From 86bc5eff4ec3d28e2e1faa29f0c1cc5a4fed2a61 Mon Sep 17 00:00:00 2001 From: Zombaya Date: Mon, 13 Jun 2022 23:59:47 +0200 Subject: [PATCH 1/2] Add php-cs-fixer as tool to project Squashed commits ---------------- * fb76eba4c 2022-06-13 Zombaya Add php-cs-fixer as tool to project. Installed according to best practice in README of php-cs-fixer. * 549ceaed3 2022-06-14 Zombaya Add pipeline-check for valid codestyle using php-cs-fixer * 11812f260 2022-09-13 Zombaya Update CONTRIBUTING.md and set version of php-cs-fixer fixed to current latest version * 01cb48071 2022-09-13 Zombaya Autoformat src and tests to PSR-12 using php-cs-fixer * e5e6e9599 2022-09-13 Zombaya Add release-file * Modified codestyle from PSR-12 to PER * Added composer-scripts to more easily run php-cs-fixer --- .changes/nextrelease/php-cs-fixer | 7 + .gitattributes | 2 + .github/workflows/tests.yml | 33 + .gitignore | 3 +- .php-cs-fixer.dist.php | 29 + CONTRIBUTING.md | 11 +- composer.json | 4 + tools/php-cs-fixer/.gitignore | 1 + tools/php-cs-fixer/composer.json | 5 + tools/php-cs-fixer/composer.lock | 2060 +++++++++++++++++++++++++++++ 10 files changed, 2151 insertions(+), 4 deletions(-) create mode 100644 .changes/nextrelease/php-cs-fixer create mode 100644 .php-cs-fixer.dist.php create mode 100644 tools/php-cs-fixer/.gitignore create mode 100644 tools/php-cs-fixer/composer.json create mode 100644 tools/php-cs-fixer/composer.lock diff --git a/.changes/nextrelease/php-cs-fixer b/.changes/nextrelease/php-cs-fixer new file mode 100644 index 0000000000..648bf3bf31 --- /dev/null +++ b/.changes/nextrelease/php-cs-fixer @@ -0,0 +1,7 @@ +[ + { + "type": "enhancement", + "category": "", + "description": "Add php-cs-fixer as tool to format code and lint code according to PSR-12 during github actions" + } +] \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 63a6192c71..87f696db13 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,7 @@ build/ export-ignore docs/ export-ignore tests/ export-ignore +tools/ export-ignore features/ export-ignore vendor/ export-ignore .gitattributes export-ignore @@ -13,6 +14,7 @@ composer.lock export-ignore CONTRIBUTING.md export-ignore Makefile export-ignore phpunit.xml.dist export-ignore +.php-cs-fixer.dist.php export-ignore README.md export-ignore UPGRADING.md export-ignore src/data/*.json export-ignore diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 77440b1ee8..ca7262de49 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -87,3 +87,36 @@ jobs: - if: ${{ (matrix.php-versions == '7.1' || matrix.php-versions == '8.0') && matrix.composer-options == '' }} name: Code coverage run: bash <(curl -s https://codecov.io/bash) + + lint: + runs-on: ubuntu-20.04 + name: Lint + steps: + #sets up the correct version of PHP with necessary config options + - name: Setup PHP with Xdebug + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false + + #checkout the codebase from github + - name: Checkout codebase + uses: actions/checkout@v2 + + #get dependencies + - name: Install dependencies + run: composer update --working-dir=tools/php-cs-fixer --no-interaction + + #run tests + - name: Lint codestyle using php-cs-fixer + run: > + tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --verbose --dry-run || \ + ( echo -e "\n\n" \ + && echo "Problems with the formatting of the code have been detected." \ + && echo "You can manually fix these problems or run following commands to automatically fix these problems:" \ + && echo -e "\n" \ + && echo "composer install-cs-fix" \ + && echo "composer cs-fix" \ + && echo -e "\n\n" \ + && $(exit 1) # fail test \ + ) diff --git a/.gitignore b/.gitignore index 3dd71323a3..cfd58207be 100644 --- a/.gitignore +++ b/.gitignore @@ -9,12 +9,13 @@ test_services.json .idea .php_cs.cache .phpunit.result.cache +.php-cs-fixer.cache atlassian-ide-plugin.xml aws-sdk-php.iml .DS_Store .swp .build -composer.lock +/composer.lock vendor docs/_build docs/venv diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000000..eb2bc00605 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,29 @@ +in([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]) + ->exclude([ + 'data' + ]) +; + +return (new PhpCsFixer\Config()) + ->setRules([ + '@PER' => true, + + // By default, visibility is required by PSR-12 for property, method and const. + // PHP >= 7.1 is required for const. + // Since we support PHP >= 5.5, the required visibility for const's is disabled. + // See https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/rules/class_notation/visibility_required.rst + 'visibility_required' => [ + 'elements' => [ + 'property', + 'method', + ], + ] + ]) + ->setFinder($finder) +; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fa93ad6c09..ad41ad0d8a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,8 +85,12 @@ we ask the same of all community contributions as well: will be released under that license. For substantial contributions, we may ask you to sign a [Contributor License Agreement (CLA)][cla]. 2. We follow all of the relevant PSR recommendations from the [PHP Framework - Interop Group][php-fig]. Please submit code that follows these standards. - The [PHP CS Fixer][cs-fixer] tool can be helpful for formatting your code. + Interop Group][php-fig]. Please submit code that follows the + [PER coding style](php-fig-per). + The [PHP CS Fixer][cs-fixer] tool can be helpful for formatting your code. + You can install the currently used version of PHP CS Fixer using + `composer install-cs-fix` and automatically format + your code by running `composer cs-fix`. 3. We maintain a high percentage of code coverage in our unit tests. If you make changes to the code, please add, update, and/or remove tests as appropriate. Tests are run via `make test` command. @@ -152,7 +156,8 @@ category field should exist with the value set to an empty string `""`. [pull-requests]: https://github.com/aws/aws-sdk-php/pulls [license]: http://aws.amazon.com/apache2.0/ [cla]: https://github.com/aws/aws-cla/blob/master/amazon-single-contribution-license.txt -[php-fig]: http://php-fig.org +[php-fig]: https://www.php-fig.org/ +[php-fig-per]: https://www.php-fig.org/per/coding-style/ [cs-fixer]: http://cs.sensiolabs.org/ [phpstan]: https://github.com/phpstan/phpstan [sphinx]: http://sphinx-doc.org/ diff --git a/composer.json b/composer.json index e62d2ef36e..c3fed24c0f 100644 --- a/composer.json +++ b/composer.json @@ -45,6 +45,10 @@ "yoast/phpunit-polyfills": "^1.0", "dms/phpunit-arraysubset-asserts": "^0.4.0" }, + "scripts": { + "install-cs-fix": "@composer install --working-dir=tools/php-cs-fixer", + "cs-fix": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix -v" + }, "suggest": { "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages", "ext-curl": "To send requests using cURL", diff --git a/tools/php-cs-fixer/.gitignore b/tools/php-cs-fixer/.gitignore new file mode 100644 index 0000000000..59ba6f12b4 --- /dev/null +++ b/tools/php-cs-fixer/.gitignore @@ -0,0 +1 @@ +.php-cs-fixer.cache \ No newline at end of file diff --git a/tools/php-cs-fixer/composer.json b/tools/php-cs-fixer/composer.json new file mode 100644 index 0000000000..b89802d6a2 --- /dev/null +++ b/tools/php-cs-fixer/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "friendsofphp/php-cs-fixer": "^3.11.0" + } +} diff --git a/tools/php-cs-fixer/composer.lock b/tools/php-cs-fixer/composer.lock new file mode 100644 index 0000000000..02249a96c8 --- /dev/null +++ b/tools/php-cs-fixer/composer.lock @@ -0,0 +1,2060 @@ +{ + "_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#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "a1100e4c6bbbc4e74784032ae987eefb", + "packages": [ + { + "name": "composer/pcre", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-11-17T09:50:14+00:00" + }, + { + "name": "composer/semver", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-04-01T19:23:25+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" + }, + { + "name": "doctrine/annotations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^2 || ^3", + "ext-tokenizer": "*", + "php": "^7.2 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^2.0", + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^5.4 || ^6", + "vimeo/psalm": "^4.10" + }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/2.0.1" + }, + "time": "2023-02-02T22:02:53+00:00" + }, + { + "name": "doctrine/lexer", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "84a527db05647743d50373e0ec53a152f2cde568" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", + "reference": "84a527db05647743d50373e0ec53a152f2cde568", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.9", + "phpunit/phpunit": "^9.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/3.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2022-12-15T16:57:16+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.15.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "d48755372a113bddb99f749e34805d83f3acfe04" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d48755372a113bddb99f749e34805d83f3acfe04", + "reference": "d48755372a113bddb99f749e34805d83f3acfe04", + "shasum": "" + }, + "require": { + "composer/semver": "^3.3", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^2", + "doctrine/lexer": "^2 || ^3", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/polyfill-mbstring": "^1.27", + "symfony/polyfill-php80": "^1.27", + "symfony/polyfill-php81": "^1.27", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.0", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.5.3", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.16", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "phpunitgoodpractices/polyfill": "^1.6", + "phpunitgoodpractices/traits": "^1.9.2", + "symfony/phpunit-bridge": "^6.2.3", + "symfony/yaml": "^5.4 || ^6.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.15.1" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2023-03-13T23:26:30+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "sebastian/diff", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02", + "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-03-23T05:12:41+00:00" + }, + { + "name": "symfony/console", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "cbad09eb8925b6ad4fb721c7a179344dc4a19d45" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/cbad09eb8925b6ad4fb721c7a179344dc4a19d45", + "reference": "cbad09eb8925b6ad4fb721c7a179344dc4a19d45", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.4|^6.0" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "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": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v6.2.7" + }, + "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": "2023-02-25T17:00:03+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.3-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.2.1" + }, + "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": "2023-03-01T10:25:55+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "404b307de426c1c488e5afad64403e5f145e82a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/404b307de426c1c488e5afad64403e5f145e82a5", + "reference": "404b307de426c1c488e5afad64403e5f145e82a5", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2|^3" + }, + "conflict": { + "symfony/dependency-injection": "<5.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/http-foundation": "^5.4|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^5.4|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "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 that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.7" + }, + "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": "2023-02-14T08:44:56+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", + "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.3-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "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 dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" + }, + "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": "2023-03-01T10:32:47+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "82b6c62b959f642d000456f08c6d219d749215b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/82b6c62b959f642d000456f08c6d219d749215b3", + "reference": "82b6c62b959f642d000456f08c6d219d749215b3", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "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 basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v6.2.7" + }, + "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": "2023-02-14T08:44:56+00:00" + }, + { + "name": "symfony/finder", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb", + "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "symfony/filesystem": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "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": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v6.2.7" + }, + "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": "2023-02-16T09:57:23+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "aa0e85b53bbb2b4951960efd61d295907eacd629" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/aa0e85b53bbb2b4951960efd61d295907eacd629", + "reference": "aa0e85b53bbb2b4951960efd61d295907eacd629", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "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 an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v6.2.7" + }, + "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": "2023-02-14T08:44:56+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "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.27.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-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "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 grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.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-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-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.27.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-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-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.27.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-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-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.27.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-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-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.27.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-11-03T14:55:06+00:00" + }, + { + "name": "symfony/process", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "680e8a2ea6b3f87aecc07a6a65a203ae573d1902" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/680e8a2ea6b3f87aecc07a6a65a203ae573d1902", + "reference": "680e8a2ea6b3f87aecc07a6a65a203ae573d1902", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "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": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v6.2.7" + }, + "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": "2023-02-24T10:42:00+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "a8c9cedf55f314f3a186041d19537303766df09a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", + "reference": "a8c9cedf55f314f3a186041d19537303766df09a", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.3-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "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 writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.2.1" + }, + "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": "2023-03-01T10:32:47+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", + "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/service-contracts": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "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 a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v6.2.7" + }, + "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": "2023-02-14T08:44:56+00:00" + }, + { + "name": "symfony/string", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "67b8c1eec78296b85dc1c7d9743830160218993d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/67b8c1eec78296b85dc1c7d9743830160218993d", + "reference": "67b8c1eec78296b85dc1c7d9743830160218993d", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "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": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.2.7" + }, + "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": "2023-02-24T10:42:00+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.3.0" +} From 51261cd061c6a166bae1e329750b8b0201ce249c Mon Sep 17 00:00:00 2001 From: Zombaya Date: Mon, 27 Mar 2023 21:24:35 +0200 Subject: [PATCH 2/2] Autoformat src and tests to PER using php-cs-fixer --- src/ACMPCA/ACMPCAClient.php | 5 +- src/ACMPCA/Exception/ACMPCAException.php | 5 +- src/ARCZonalShift/ARCZonalShiftClient.php | 5 +- .../Exception/ARCZonalShiftException.php | 5 +- src/AbstractConfigurationProvider.php | 1 + src/AccessAnalyzer/AccessAnalyzerClient.php | 5 +- .../Exception/AccessAnalyzerException.php | 5 +- src/Account/AccountClient.php | 5 +- src/Account/Exception/AccountException.php | 5 +- src/Acm/AcmClient.php | 5 +- src/Acm/Exception/AcmException.php | 5 +- .../AlexaForBusinessClient.php | 5 +- .../Exception/AlexaForBusinessException.php | 5 +- src/Amplify/AmplifyClient.php | 5 +- src/Amplify/Exception/AmplifyException.php | 5 +- src/AmplifyBackend/AmplifyBackendClient.php | 5 +- .../Exception/AmplifyBackendException.php | 5 +- .../AmplifyUIBuilderClient.php | 5 +- .../Exception/AmplifyUIBuilderException.php | 5 +- src/Api/AbstractModel.php | 1 + src/Api/ApiProvider.php | 1 + src/Api/DateTimeResult.php | 4 +- src/Api/DocModel.php | 1 + src/Api/ErrorParser/AbstractErrorParser.php | 6 +- src/Api/ErrorParser/JsonParserTrait.php | 1 + src/Api/ErrorParser/JsonRpcErrorParser.php | 1 + src/Api/ErrorParser/RestJsonErrorParser.php | 1 + src/Api/ErrorParser/XmlErrorParser.php | 5 +- src/Api/ListShape.php | 1 + src/Api/MapShape.php | 1 + src/Api/Operation.php | 3 +- src/Api/Parser/AbstractParser.php | 1 + src/Api/Parser/AbstractRestParser.php | 3 +- src/Api/Parser/Crc32ValidatingParser.php | 1 + .../Parser/DecodingEventStreamIterator.php | 2 +- src/Api/Parser/EventParsingIterator.php | 4 +- src/Api/Parser/Exception/ParserException.php | 1 + src/Api/Parser/JsonParser.php | 2 +- src/Api/Parser/JsonRpcParser.php | 1 + src/Api/Parser/MetadataParserTrait.php | 1 + src/Api/Parser/PayloadParserTrait.php | 1 + src/Api/Parser/QueryParser.php | 1 + src/Api/Parser/RestJsonParser.php | 1 + src/Api/Parser/RestXmlParser.php | 1 + src/Api/Parser/XmlParser.php | 1 + src/Api/Serializer/Ec2ParamBuilder.php | 1 + src/Api/Serializer/JsonBody.php | 5 +- src/Api/Serializer/JsonRpcSerializer.php | 4 +- src/Api/Serializer/QueryParamBuilder.php | 1 + src/Api/Serializer/QuerySerializer.php | 4 +- src/Api/Serializer/RestJsonSerializer.php | 1 + src/Api/Serializer/RestSerializer.php | 8 +- src/Api/Serializer/RestXmlSerializer.php | 1 + src/Api/Serializer/XmlBody.php | 1 + src/Api/Service.php | 5 +- src/Api/Shape.php | 1 + src/Api/ShapeMap.php | 1 + src/Api/StructureShape.php | 1 + src/Api/TimestampShape.php | 1 + src/Api/Validator.php | 11 +- src/ApiGateway/ApiGatewayClient.php | 1 + .../Exception/ApiGatewayException.php | 5 +- .../ApiGatewayManagementApiClient.php | 5 +- .../ApiGatewayManagementApiException.php | 5 +- src/ApiGatewayV2/ApiGatewayV2Client.php | 5 +- .../Exception/ApiGatewayV2Exception.php | 5 +- src/AppConfig/AppConfigClient.php | 5 +- .../Exception/AppConfigException.php | 5 +- src/AppConfigData/AppConfigDataClient.php | 5 +- .../Exception/AppConfigDataException.php | 5 +- .../AppIntegrationsServiceClient.php | 5 +- .../AppIntegrationsServiceException.php | 5 +- src/AppMesh/AppMeshClient.php | 5 +- src/AppMesh/Exception/AppMeshException.php | 5 +- src/AppRegistry/AppRegistryClient.php | 5 +- .../Exception/AppRegistryException.php | 5 +- src/AppRunner/AppRunnerClient.php | 5 +- .../Exception/AppRunnerException.php | 5 +- src/AppSync/AppSyncClient.php | 5 +- src/AppSync/Exception/AppSyncException.php | 5 +- src/Appflow/AppflowClient.php | 5 +- src/Appflow/Exception/AppflowException.php | 5 +- .../ApplicationAutoScalingClient.php | 5 +- .../ApplicationAutoScalingException.php | 5 +- .../ApplicationCostProfilerClient.php | 5 +- .../ApplicationCostProfilerException.php | 5 +- .../ApplicationDiscoveryServiceClient.php | 5 +- .../ApplicationDiscoveryServiceException.php | 5 +- .../ApplicationInsightsClient.php | 5 +- .../ApplicationInsightsException.php | 5 +- src/Appstream/AppstreamClient.php | 5 +- .../Exception/AppstreamException.php | 5 +- src/Arn/AccessPointArn.php | 1 + src/Arn/AccessPointArnInterface.php | 1 + src/Arn/Arn.php | 4 +- src/Arn/ArnInterface.php | 3 +- src/Arn/ArnParser.php | 1 + src/Arn/Exception/InvalidArnException.php | 5 +- src/Arn/ObjectLambdaAccessPointArn.php | 1 + src/Arn/ResourceTypeAndIdTrait.php | 3 +- src/Arn/S3/AccessPointArn.php | 3 +- src/Arn/S3/BucketArnInterface.php | 1 + src/Arn/S3/MultiRegionAccessPointArn.php | 2 +- src/Arn/S3/OutpostsAccessPointArn.php | 1 + src/Arn/S3/OutpostsArnInterface.php | 1 + src/Arn/S3/OutpostsBucketArn.php | 1 + src/Athena/AthenaClient.php | 5 +- src/Athena/Exception/AthenaException.php | 5 +- src/AuditManager/AuditManagerClient.php | 5 +- .../Exception/AuditManagerException.php | 5 +- .../AugmentedAIRuntimeClient.php | 5 +- .../Exception/AugmentedAIRuntimeException.php | 5 +- src/AutoScaling/AutoScalingClient.php | 5 +- .../Exception/AutoScalingException.php | 5 +- .../AutoScalingPlansClient.php | 5 +- .../Exception/AutoScalingPlansException.php | 5 +- src/AwsClient.php | 19 ++- src/AwsClientInterface.php | 1 + src/AwsClientTrait.php | 4 +- src/Backup/BackupClient.php | 5 +- src/Backup/Exception/BackupException.php | 5 +- src/BackupGateway/BackupGatewayClient.php | 5 +- .../Exception/BackupGatewayException.php | 5 +- src/BackupStorage/BackupStorageClient.php | 5 +- .../Exception/BackupStorageException.php | 5 +- src/Batch/BatchClient.php | 5 +- src/Batch/Exception/BatchException.php | 5 +- .../BillingConductorClient.php | 5 +- .../Exception/BillingConductorException.php | 5 +- src/Braket/BraketClient.php | 5 +- src/Braket/Exception/BraketException.php | 5 +- src/Budgets/BudgetsClient.php | 5 +- src/Budgets/Exception/BudgetsException.php | 5 +- src/CacheInterface.php | 1 + src/Chime/ChimeClient.php | 5 +- src/Chime/Exception/ChimeException.php | 5 +- .../ChimeSDKIdentityClient.php | 5 +- .../Exception/ChimeSDKIdentityException.php | 5 +- .../ChimeSDKMediaPipelinesClient.php | 5 +- .../ChimeSDKMediaPipelinesException.php | 5 +- .../ChimeSDKMeetingsClient.php | 5 +- .../Exception/ChimeSDKMeetingsException.php | 5 +- .../ChimeSDKMessagingClient.php | 5 +- .../Exception/ChimeSDKMessagingException.php | 5 +- src/ChimeSDKVoice/ChimeSDKVoiceClient.php | 5 +- .../Exception/ChimeSDKVoiceException.php | 5 +- src/CleanRooms/CleanRoomsClient.php | 5 +- .../Exception/CleanRoomsException.php | 5 +- src/ClientResolver.php | 40 +++-- .../AbstractMonitoringMiddleware.php | 5 +- .../ApiCallAttemptMonitoringMiddleware.php | 28 ++-- .../ApiCallMonitoringMiddleware.php | 8 +- src/ClientSideMonitoring/Configuration.php | 6 +- .../ConfigurationInterface.php | 1 + .../ConfigurationProvider.php | 10 +- .../Exception/ConfigurationException.php | 2 +- .../MonitoringMiddlewareInterface.php | 3 +- src/Cloud9/Cloud9Client.php | 5 +- src/Cloud9/Exception/Cloud9Exception.php | 5 +- src/CloudControlApi/CloudControlApiClient.php | 5 +- .../Exception/CloudControlApiException.php | 5 +- src/CloudDirectory/CloudDirectoryClient.php | 5 +- .../Exception/CloudDirectoryException.php | 5 +- src/CloudFormation/CloudFormationClient.php | 5 +- .../Exception/CloudFormationException.php | 5 +- src/CloudFront/CloudFrontClient.php | 1 + src/CloudFront/CookieSigner.php | 1 + .../Exception/CloudFrontException.php | 5 +- src/CloudFront/Signer.php | 5 +- src/CloudFront/UrlSigner.php | 1 + src/CloudHSMV2/CloudHSMV2Client.php | 5 +- .../Exception/CloudHSMV2Exception.php | 5 +- src/CloudHsm/CloudHsmClient.php | 5 +- src/CloudHsm/Exception/CloudHsmException.php | 5 +- src/CloudSearch/CloudSearchClient.php | 5 +- .../Exception/CloudSearchException.php | 5 +- .../CloudSearchDomainClient.php | 1 + .../Exception/CloudSearchDomainException.php | 5 +- src/CloudTrail/CloudTrailClient.php | 5 +- .../Exception/CloudTrailException.php | 5 +- src/CloudTrail/LogFileIterator.php | 1 + src/CloudTrail/LogFileReader.php | 1 + src/CloudTrail/LogRecordIterator.php | 3 +- src/CloudTrailData/CloudTrailDataClient.php | 5 +- .../Exception/CloudTrailDataException.php | 5 +- src/CloudWatch/CloudWatchClient.php | 5 +- .../Exception/CloudWatchException.php | 5 +- .../CloudWatchEventsClient.php | 5 +- .../Exception/CloudWatchEventsException.php | 5 +- .../CloudWatchEvidentlyClient.php | 5 +- .../CloudWatchEvidentlyException.php | 5 +- src/CloudWatchLogs/CloudWatchLogsClient.php | 5 +- .../Exception/CloudWatchLogsException.php | 5 +- src/CloudWatchRUM/CloudWatchRUMClient.php | 5 +- .../Exception/CloudWatchRUMException.php | 5 +- src/CodeArtifact/CodeArtifactClient.php | 5 +- .../Exception/CodeArtifactException.php | 5 +- src/CodeBuild/CodeBuildClient.php | 5 +- .../Exception/CodeBuildException.php | 5 +- src/CodeCatalyst/CodeCatalystClient.php | 5 +- .../Exception/CodeCatalystException.php | 5 +- src/CodeCommit/CodeCommitClient.php | 5 +- .../Exception/CodeCommitException.php | 5 +- src/CodeDeploy/CodeDeployClient.php | 5 +- .../Exception/CodeDeployException.php | 5 +- .../CodeGuruProfilerClient.php | 5 +- .../Exception/CodeGuruProfilerException.php | 5 +- .../CodeGuruReviewerClient.php | 5 +- .../Exception/CodeGuruReviewerException.php | 5 +- src/CodePipeline/CodePipelineClient.php | 5 +- .../Exception/CodePipelineException.php | 5 +- src/CodeStar/CodeStarClient.php | 5 +- src/CodeStar/Exception/CodeStarException.php | 5 +- .../CodeStarNotificationsClient.php | 5 +- .../CodeStarNotificationsException.php | 5 +- .../CodeStarconnectionsClient.php | 5 +- .../CodeStarconnectionsException.php | 5 +- src/CognitoIdentity/CognitoIdentityClient.php | 5 +- .../CognitoIdentityProvider.php | 1 + .../Exception/CognitoIdentityException.php | 5 +- .../CognitoIdentityProviderClient.php | 7 +- .../CognitoIdentityProviderException.php | 5 +- src/CognitoSync/CognitoSyncClient.php | 5 +- .../Exception/CognitoSyncException.php | 5 +- src/Command.php | 1 + src/CommandInterface.php | 1 + src/CommandPool.php | 1 + src/Comprehend/ComprehendClient.php | 5 +- .../Exception/ComprehendException.php | 5 +- .../ComprehendMedicalClient.php | 5 +- .../Exception/ComprehendMedicalException.php | 5 +- .../ComputeOptimizerClient.php | 5 +- .../Exception/ComputeOptimizerException.php | 5 +- src/ConfigService/ConfigServiceClient.php | 5 +- .../Exception/ConfigServiceException.php | 5 +- src/ConfigurationProviderInterface.php | 1 + src/Connect/ConnectClient.php | 5 +- src/Connect/Exception/ConnectException.php | 5 +- .../ConnectCampaignServiceClient.php | 5 +- .../ConnectCampaignServiceException.php | 5 +- src/ConnectCases/ConnectCasesClient.php | 5 +- .../Exception/ConnectCasesException.php | 5 +- .../ConnectContactLensClient.php | 5 +- .../Exception/ConnectContactLensException.php | 5 +- .../ConnectParticipantClient.php | 5 +- .../Exception/ConnectParticipantException.php | 5 +- .../ConnectWisdomServiceClient.php | 5 +- .../ConnectWisdomServiceException.php | 5 +- src/ControlTower/ControlTowerClient.php | 5 +- .../Exception/ControlTowerException.php | 5 +- src/CostExplorer/CostExplorerClient.php | 5 +- .../Exception/CostExplorerException.php | 5 +- .../CostandUsageReportServiceClient.php | 5 +- .../CostandUsageReportServiceException.php | 5 +- .../AssumeRoleCredentialProvider.php | 1 + ...eRoleWithWebIdentityCredentialProvider.php | 1 + src/Credentials/CredentialProvider.php | 35 ++-- src/Credentials/Credentials.php | 4 +- src/Credentials/CredentialsInterface.php | 1 + src/Credentials/EcsCredentialProvider.php | 20 ++- src/Credentials/InstanceProfileProvider.php | 7 +- src/Crypto/AbstractCryptoClient.php | 1 + src/Crypto/AbstractCryptoClientV2.php | 1 + src/Crypto/AesDecryptingStream.php | 8 +- src/Crypto/AesEncryptingStream.php | 6 +- src/Crypto/AesGcmDecryptingStream.php | 1 + src/Crypto/AesGcmEncryptingStream.php | 4 +- src/Crypto/AesStreamInterface.php | 1 + src/Crypto/AesStreamInterfaceV2.php | 1 + src/Crypto/Cipher/Cbc.php | 5 +- src/Crypto/Cipher/CipherBuilderTrait.php | 3 +- src/Crypto/Cipher/CipherMethod.php | 1 + src/Crypto/DecryptionTrait.php | 7 +- src/Crypto/DecryptionTraitV2.php | 10 +- src/Crypto/EncryptionTrait.php | 1 + src/Crypto/EncryptionTraitV2.php | 1 + src/Crypto/KmsMaterialsProvider.php | 1 + src/Crypto/KmsMaterialsProviderV2.php | 1 + src/Crypto/MaterialsProvider.php | 1 + src/Crypto/MaterialsProviderInterface.php | 1 + src/Crypto/MaterialsProviderInterfaceV2.php | 1 + src/Crypto/MaterialsProviderV2.php | 1 + src/Crypto/MetadataEnvelope.php | 9 +- src/Crypto/MetadataStrategyInterface.php | 1 + src/Crypto/Polyfill/AesGcm.php | 1 + src/Crypto/Polyfill/ByteArray.php | 4 +- src/Crypto/Polyfill/Gmac.php | 1 + src/Crypto/Polyfill/Key.php | 3 +- src/Crypto/Polyfill/NeedsTrait.php | 1 + .../CustomerProfilesClient.php | 5 +- .../Exception/CustomerProfilesException.php | 5 +- src/DAX/DAXClient.php | 5 +- src/DAX/Exception/DAXException.php | 5 +- src/DLM/DLMClient.php | 5 +- src/DLM/Exception/DLMException.php | 5 +- src/DataExchange/DataExchangeClient.php | 5 +- .../Exception/DataExchangeException.php | 5 +- src/DataPipeline/DataPipelineClient.php | 5 +- .../Exception/DataPipelineException.php | 5 +- src/DataSync/DataSyncClient.php | 5 +- src/DataSync/Exception/DataSyncException.php | 5 +- .../DatabaseMigrationServiceClient.php | 5 +- .../DatabaseMigrationServiceException.php | 5 +- src/DefaultsMode/Configuration.php | 6 +- src/DefaultsMode/ConfigurationInterface.php | 1 + src/DefaultsMode/ConfigurationProvider.php | 6 +- .../Exception/ConfigurationException.php | 1 + src/Detective/DetectiveClient.php | 5 +- .../Exception/DetectiveException.php | 5 +- src/DevOpsGuru/DevOpsGuruClient.php | 5 +- .../Exception/DevOpsGuruException.php | 5 +- src/DeviceFarm/DeviceFarmClient.php | 5 +- .../Exception/DeviceFarmException.php | 5 +- src/DirectConnect/DirectConnectClient.php | 5 +- .../Exception/DirectConnectException.php | 5 +- .../DirectoryServiceClient.php | 5 +- .../Exception/DirectoryServiceException.php | 5 +- src/DocDB/DocDBClient.php | 4 +- src/DocDB/Exception/DocDBException.php | 5 +- src/DocDBElastic/DocDBElasticClient.php | 5 +- .../Exception/DocDBElasticException.php | 5 +- src/DoctrineCacheAdapter.php | 1 + src/DynamoDb/BinaryValue.php | 1 + src/DynamoDb/DynamoDbClient.php | 1 + src/DynamoDb/Exception/DynamoDbException.php | 5 +- src/DynamoDb/LockingSessionConnection.php | 1 + src/DynamoDb/Marshaler.php | 4 +- src/DynamoDb/NumberValue.php | 1 + src/DynamoDb/SessionConnectionConfigTrait.php | 19 +-- src/DynamoDb/SessionConnectionInterface.php | 1 + src/DynamoDb/SessionHandler.php | 3 +- src/DynamoDb/SetValue.php | 1 + src/DynamoDb/StandardSessionConnection.php | 6 +- src/DynamoDb/WriteRequestBatch.php | 1 + src/DynamoDbStreams/DynamoDbStreamsClient.php | 3 +- .../Exception/DynamoDbStreamsException.php | 5 +- src/EBS/EBSClient.php | 5 +- src/EBS/Exception/EBSException.php | 5 +- .../EC2InstanceConnectClient.php | 5 +- .../Exception/EC2InstanceConnectException.php | 5 +- src/ECRPublic/ECRPublicClient.php | 5 +- .../Exception/ECRPublicException.php | 5 +- src/EKS/EKSClient.php | 5 +- src/EKS/Exception/EKSException.php | 5 +- src/EMRContainers/EMRContainersClient.php | 5 +- .../Exception/EMRContainersException.php | 5 +- src/EMRServerless/EMRServerlessClient.php | 5 +- .../Exception/EMRServerlessException.php | 5 +- src/Ec2/Ec2Client.php | 1 + src/Ec2/Exception/Ec2Exception.php | 5 +- src/Ecr/EcrClient.php | 5 +- src/Ecr/Exception/EcrException.php | 5 +- src/Ecs/EcsClient.php | 5 +- src/Ecs/Exception/EcsException.php | 5 +- src/Efs/EfsClient.php | 5 +- src/Efs/Exception/EfsException.php | 5 +- src/ElastiCache/ElastiCacheClient.php | 5 +- .../Exception/ElastiCacheException.php | 5 +- .../ElasticBeanstalkClient.php | 5 +- .../Exception/ElasticBeanstalkException.php | 5 +- .../ElasticInferenceClient.php | 5 +- .../Exception/ElasticInferenceException.php | 5 +- .../ElasticLoadBalancingClient.php | 5 +- .../ElasticLoadBalancingException.php | 5 +- .../ElasticLoadBalancingV2Client.php | 5 +- .../ElasticLoadBalancingV2Exception.php | 5 +- .../ElasticTranscoderClient.php | 5 +- .../Exception/ElasticTranscoderException.php | 5 +- .../ElasticsearchServiceClient.php | 5 +- .../ElasticsearchServiceException.php | 5 +- src/Emr/EmrClient.php | 5 +- src/Emr/Exception/EmrException.php | 5 +- src/Endpoint/EndpointProvider.php | 4 +- src/Endpoint/Partition.php | 17 +- src/Endpoint/PartitionEndpointProvider.php | 1 + src/Endpoint/PartitionInterface.php | 5 +- src/Endpoint/PatternEndpointProvider.php | 1 + .../UseDualstackEndpoint/Configuration.php | 4 +- .../ConfigurationInterface.php | 1 + .../ConfigurationProvider.php | 4 +- .../Exception/ConfigurationException.php | 1 + .../UseFipsEndpoint/Configuration.php | 1 + .../ConfigurationInterface.php | 1 + .../UseFipsEndpoint/ConfigurationProvider.php | 6 +- .../Exception/ConfigurationException.php | 1 + src/EndpointDiscovery/Configuration.php | 1 + .../ConfigurationInterface.php | 1 + .../ConfigurationProvider.php | 4 +- .../EndpointDiscoveryMiddleware.php | 8 +- src/EndpointDiscovery/EndpointList.php | 1 + .../Exception/ConfigurationException.php | 1 + src/EndpointParameterMiddleware.php | 2 +- src/EndpointV2/EndpointDefinitionProvider.php | 4 +- src/EndpointV2/EndpointV2SerializerTrait.php | 50 +++--- src/EndpointV2/Rule/AbstractRule.php | 7 +- src/EndpointV2/Rule/EndpointRule.php | 25 ++- src/EndpointV2/Rule/ErrorRule.php | 3 +- src/EndpointV2/Rule/RuleCreator.php | 1 - src/EndpointV2/Rule/TreeRule.php | 7 +- src/EndpointV2/Ruleset/Ruleset.php | 11 +- src/EndpointV2/Ruleset/RulesetParameter.php | 10 +- .../Ruleset/RulesetStandardLibrary.php | 18 +-- src/EventBridge/EventBridgeClient.php | 4 +- .../EventBridgeEndpointMiddleware.php | 4 +- .../Exception/EventBridgeException.php | 5 +- src/Exception/AwsException.php | 1 + src/Exception/CommonRuntimeException.php | 2 +- .../CouldNotCreateChecksumException.php | 1 + src/Exception/CredentialsException.php | 1 + src/Exception/CryptoException.php | 2 +- src/Exception/CryptoPolyfillException.php | 2 +- src/Exception/EventStreamDataException.php | 1 + .../IncalculablePayloadException.php | 1 + src/Exception/InvalidJsonException.php | 1 + src/Exception/InvalidRegionException.php | 1 + src/Exception/MultipartUploadException.php | 4 +- src/Exception/TokenException.php | 1 + src/Exception/UnresolvedApiException.php | 1 + src/Exception/UnresolvedEndpointException.php | 1 + .../UnresolvedSignatureException.php | 1 + src/FIS/Exception/FISException.php | 5 +- src/FIS/FISClient.php | 5 +- src/FMS/Exception/FMSException.php | 5 +- src/FMS/FMSClient.php | 5 +- src/FSx/Exception/FSxException.php | 5 +- src/FSx/FSxClient.php | 5 +- .../Exception/FinSpaceDataException.php | 5 +- src/FinSpaceData/FinSpaceDataClient.php | 5 +- src/Firehose/Exception/FirehoseException.php | 5 +- src/Firehose/FirehoseClient.php | 5 +- .../ForecastQueryServiceException.php | 5 +- .../ForecastQueryServiceClient.php | 5 +- .../Exception/ForecastServiceException.php | 5 +- src/ForecastService/ForecastServiceClient.php | 5 +- .../Exception/FraudDetectorException.php | 5 +- src/FraudDetector/FraudDetectorClient.php | 5 +- src/GameLift/Exception/GameLiftException.php | 5 +- src/GameLift/GameLiftClient.php | 5 +- .../Exception/GameSparksException.php | 5 +- src/GameSparks/GameSparksClient.php | 5 +- src/Glacier/Exception/GlacierException.php | 5 +- src/Glacier/GlacierClient.php | 7 +- src/Glacier/MultipartUploader.php | 13 +- src/Glacier/TreeHash.php | 1 + .../Exception/GlobalAcceleratorException.php | 5 +- .../GlobalAcceleratorClient.php | 5 +- src/Glue/Exception/GlueException.php | 5 +- src/Glue/GlueClient.php | 5 +- .../Exception/GlueDataBrewException.php | 5 +- src/GlueDataBrew/GlueDataBrewClient.php | 5 +- .../Exception/GreengrassException.php | 5 +- src/Greengrass/GreengrassClient.php | 5 +- .../Exception/GreengrassV2Exception.php | 5 +- src/GreengrassV2/GreengrassV2Client.php | 5 +- .../Exception/GroundStationException.php | 5 +- src/GroundStation/GroundStationClient.php | 5 +- .../Exception/GuardDutyException.php | 5 +- src/GuardDuty/GuardDutyClient.php | 5 +- src/Handler/GuzzleV5/GuzzleHandler.php | 1 + src/Handler/GuzzleV5/GuzzleStream.php | 1 + src/Handler/GuzzleV5/PsrStream.php | 1 + src/Handler/GuzzleV6/GuzzleHandler.php | 1 + src/HandlerList.php | 1 + src/HasDataTrait.php | 1 + src/HasMonitoringEventsTrait.php | 2 +- src/HashInterface.php | 1 + src/HashingStream.php | 1 + src/Health/Exception/HealthException.php | 5 +- src/Health/HealthClient.php | 5 +- .../Exception/HealthLakeException.php | 5 +- src/HealthLake/HealthLakeClient.php | 5 +- src/History.php | 1 + .../Exception/HoneycodeException.php | 5 +- src/Honeycode/HoneycodeClient.php | 5 +- src/IVS/Exception/IVSException.php | 5 +- src/IVS/IVSClient.php | 5 +- .../Exception/IVSRealTimeException.php | 5 +- src/IVSRealTime/IVSRealTimeClient.php | 5 +- src/Iam/Exception/IamException.php | 5 +- src/Iam/IamClient.php | 5 +- src/IdempotencyTokenMiddleware.php | 3 +- .../Exception/IdentityStoreException.php | 5 +- src/IdentityStore/IdentityStoreClient.php | 5 +- .../Exception/ImportExportException.php | 5 +- src/ImportExport/ImportExportClient.php | 5 +- src/InputValidationMiddleware.php | 11 +- .../Exception/InspectorException.php | 5 +- src/Inspector/InspectorClient.php | 5 +- .../Exception/Inspector2Exception.php | 5 +- src/Inspector2/Inspector2Client.php | 5 +- .../Exception/InternetMonitorException.php | 5 +- src/InternetMonitor/InternetMonitorClient.php | 5 +- .../IoT1ClickDevicesServiceException.php | 5 +- .../IoT1ClickDevicesServiceClient.php | 5 +- .../Exception/IoT1ClickProjectsException.php | 5 +- .../IoT1ClickProjectsClient.php | 5 +- .../Exception/IoTAnalyticsException.php | 5 +- src/IoTAnalytics/IoTAnalyticsClient.php | 5 +- .../Exception/IoTDeviceAdvisorException.php | 5 +- .../IoTDeviceAdvisorClient.php | 5 +- .../Exception/IoTEventsException.php | 5 +- src/IoTEvents/IoTEventsClient.php | 5 +- .../Exception/IoTEventsDataException.php | 5 +- src/IoTEventsData/IoTEventsDataClient.php | 5 +- .../Exception/IoTFleetHubException.php | 5 +- src/IoTFleetHub/IoTFleetHubClient.php | 5 +- .../Exception/IoTFleetWiseException.php | 5 +- src/IoTFleetWise/IoTFleetWiseClient.php | 5 +- .../Exception/IoTJobsDataPlaneException.php | 5 +- .../IoTJobsDataPlaneClient.php | 5 +- .../Exception/IoTRoboRunnerException.php | 5 +- src/IoTRoboRunner/IoTRoboRunnerClient.php | 5 +- .../Exception/IoTSecureTunnelingException.php | 5 +- .../IoTSecureTunnelingClient.php | 5 +- .../Exception/IoTSiteWiseException.php | 5 +- src/IoTSiteWise/IoTSiteWiseClient.php | 5 +- .../Exception/IoTThingsGraphException.php | 5 +- src/IoTThingsGraph/IoTThingsGraphClient.php | 5 +- .../Exception/IoTTwinMakerException.php | 5 +- src/IoTTwinMaker/IoTTwinMakerClient.php | 5 +- .../Exception/IoTWirelessException.php | 5 +- src/IoTWireless/IoTWirelessClient.php | 5 +- src/Iot/Exception/IotException.php | 5 +- src/Iot/IotClient.php | 5 +- .../Exception/IotDataPlaneException.php | 5 +- src/IotDataPlane/IotDataPlaneClient.php | 5 +- src/JsonCompiler.php | 1 + src/Kafka/Exception/KafkaException.php | 5 +- src/Kafka/KafkaClient.php | 5 +- .../Exception/KafkaConnectException.php | 5 +- src/KafkaConnect/KafkaConnectClient.php | 5 +- .../Exception/KendraRankingException.php | 5 +- src/KendraRanking/KendraRankingClient.php | 5 +- .../Exception/KeyspacesException.php | 5 +- src/Keyspaces/KeyspacesClient.php | 5 +- src/Kinesis/Exception/KinesisException.php | 5 +- src/Kinesis/KinesisClient.php | 5 +- .../Exception/KinesisAnalyticsException.php | 5 +- .../KinesisAnalyticsClient.php | 5 +- .../Exception/KinesisAnalyticsV2Exception.php | 5 +- .../KinesisAnalyticsV2Client.php | 5 +- .../Exception/KinesisVideoException.php | 5 +- src/KinesisVideo/KinesisVideoClient.php | 5 +- .../KinesisVideoArchivedMediaException.php | 5 +- .../KinesisVideoArchivedMediaClient.php | 5 +- .../Exception/KinesisVideoMediaException.php | 5 +- .../KinesisVideoMediaClient.php | 5 +- ...KinesisVideoSignalingChannelsException.php | 5 +- .../KinesisVideoSignalingChannelsClient.php | 5 +- .../KinesisVideoWebRTCStorageException.php | 5 +- .../KinesisVideoWebRTCStorageClient.php | 5 +- src/Kms/Exception/KmsException.php | 5 +- src/Kms/KmsClient.php | 5 +- .../Exception/LakeFormationException.php | 5 +- src/LakeFormation/LakeFormationClient.php | 5 +- src/Lambda/Exception/LambdaException.php | 5 +- src/Lambda/LambdaClient.php | 1 + .../LexModelBuildingServiceException.php | 5 +- .../LexModelBuildingServiceClient.php | 5 +- .../Exception/LexModelsV2Exception.php | 5 +- src/LexModelsV2/LexModelsV2Client.php | 5 +- .../Exception/LexRuntimeServiceException.php | 5 +- .../LexRuntimeServiceClient.php | 5 +- .../Exception/LexRuntimeV2Exception.php | 5 +- src/LexRuntimeV2/LexRuntimeV2Client.php | 5 +- .../Exception/LicenseManagerException.php | 5 +- src/LicenseManager/LicenseManagerClient.php | 5 +- ...enseManagerLinuxSubscriptionsException.php | 5 +- ...LicenseManagerLinuxSubscriptionsClient.php | 5 +- ...censeManagerUserSubscriptionsException.php | 5 +- .../LicenseManagerUserSubscriptionsClient.php | 5 +- .../Exception/LightsailException.php | 5 +- src/Lightsail/LightsailClient.php | 5 +- .../Exception/LocationServiceException.php | 5 +- src/LocationService/LocationServiceClient.php | 5 +- .../Exception/LookoutEquipmentException.php | 5 +- .../LookoutEquipmentClient.php | 5 +- .../Exception/LookoutMetricsException.php | 5 +- src/LookoutMetrics/LookoutMetricsClient.php | 5 +- .../Exception/LookoutforVisionException.php | 5 +- .../LookoutforVisionClient.php | 5 +- src/LruArrayCache.php | 1 + src/MQ/Exception/MQException.php | 5 +- src/MQ/MQClient.php | 5 +- src/MTurk/Exception/MTurkException.php | 5 +- src/MTurk/MTurkClient.php | 5 +- src/MWAA/Exception/MWAAException.php | 5 +- src/MWAA/MWAAClient.php | 5 +- .../Exception/MachineLearningException.php | 5 +- src/MachineLearning/MachineLearningClient.php | 1 + src/Macie/Exception/MacieException.php | 5 +- src/Macie/MacieClient.php | 5 +- src/Macie2/Exception/Macie2Exception.php | 5 +- src/Macie2/Macie2Client.php | 5 +- .../MainframeModernizationException.php | 5 +- .../MainframeModernizationClient.php | 5 +- .../Exception/ManagedBlockchainException.php | 5 +- .../ManagedBlockchainClient.php | 5 +- .../Exception/ManagedGrafanaException.php | 5 +- src/ManagedGrafana/ManagedGrafanaClient.php | 5 +- .../Exception/MarketplaceCatalogException.php | 5 +- .../MarketplaceCatalogClient.php | 5 +- .../MarketplaceCommerceAnalyticsException.php | 5 +- .../MarketplaceCommerceAnalyticsClient.php | 5 +- ...MarketplaceEntitlementServiceException.php | 5 +- .../MarketplaceEntitlementServiceClient.php | 5 +- .../MarketplaceMeteringException.php | 5 +- .../MarketplaceMeteringClient.php | 5 +- .../Exception/MediaConnectException.php | 5 +- src/MediaConnect/MediaConnectClient.php | 5 +- .../Exception/MediaConvertException.php | 5 +- src/MediaConvert/MediaConvertClient.php | 5 +- .../Exception/MediaLiveException.php | 5 +- src/MediaLive/MediaLiveClient.php | 5 +- .../Exception/MediaPackageException.php | 5 +- src/MediaPackage/MediaPackageClient.php | 5 +- .../Exception/MediaPackageVodException.php | 5 +- src/MediaPackageVod/MediaPackageVodClient.php | 5 +- .../Exception/MediaStoreException.php | 5 +- src/MediaStore/MediaStoreClient.php | 5 +- .../Exception/MediaStoreDataException.php | 5 +- src/MediaStoreData/MediaStoreDataClient.php | 5 +- .../Exception/MediaTailorException.php | 5 +- src/MediaTailor/MediaTailorClient.php | 5 +- src/MemoryDB/Exception/MemoryDBException.php | 5 +- src/MemoryDB/MemoryDBClient.php | 5 +- src/Middleware.php | 22 ++- .../Exception/MigrationHubException.php | 5 +- src/MigrationHub/MigrationHubClient.php | 5 +- .../Exception/MigrationHubConfigException.php | 5 +- .../MigrationHubConfigClient.php | 5 +- .../MigrationHubOrchestratorException.php | 5 +- .../MigrationHubOrchestratorClient.php | 5 +- .../MigrationHubRefactorSpacesException.php | 5 +- .../MigrationHubRefactorSpacesClient.php | 5 +- ...ionHubStrategyRecommendationsException.php | 5 +- ...rationHubStrategyRecommendationsClient.php | 5 +- src/Mobile/Exception/MobileException.php | 5 +- src/Mobile/MobileClient.php | 5 +- src/MockHandler.php | 1 + src/MonitoringEventsInterface.php | 3 +- src/MultiRegionClient.php | 4 +- src/Multipart/AbstractUploadManager.php | 4 +- src/Multipart/AbstractUploader.php | 1 + src/Multipart/UploadState.php | 1 + src/Neptune/Exception/NeptuneException.php | 5 +- src/Neptune/NeptuneClient.php | 4 +- .../Exception/NetworkFirewallException.php | 5 +- src/NetworkFirewall/NetworkFirewallClient.php | 5 +- .../Exception/NetworkManagerException.php | 5 +- src/NetworkManager/NetworkManagerClient.php | 5 +- .../Exception/NimbleStudioException.php | 5 +- src/NimbleStudio/NimbleStudioClient.php | 5 +- src/OAM/Exception/OAMException.php | 5 +- src/OAM/OAMClient.php | 5 +- src/Omics/Exception/OmicsException.php | 5 +- src/Omics/OmicsClient.php | 5 +- .../OpenSearchServerlessException.php | 5 +- .../OpenSearchServerlessClient.php | 5 +- .../Exception/OpenSearchServiceException.php | 5 +- .../OpenSearchServiceClient.php | 5 +- src/OpsWorks/Exception/OpsWorksException.php | 5 +- src/OpsWorks/OpsWorksClient.php | 5 +- .../Exception/OpsWorksCMException.php | 5 +- src/OpsWorksCM/OpsWorksCMClient.php | 5 +- .../Exception/OrganizationsException.php | 5 +- src/Organizations/OrganizationsClient.php | 5 +- src/Outposts/Exception/OutpostsException.php | 5 +- src/Outposts/OutpostsClient.php | 5 +- src/PI/Exception/PIException.php | 5 +- src/PI/PIClient.php | 5 +- src/Panorama/Exception/PanoramaException.php | 5 +- src/Panorama/PanoramaClient.php | 5 +- .../Exception/PersonalizeException.php | 5 +- src/Personalize/PersonalizeClient.php | 5 +- .../Exception/PersonalizeEventsException.php | 5 +- .../PersonalizeEventsClient.php | 5 +- .../Exception/PersonalizeRuntimeException.php | 5 +- .../PersonalizeRuntimeClient.php | 5 +- src/PhpHash.php | 3 +- src/Pinpoint/Exception/PinpointException.php | 5 +- src/Pinpoint/PinpointClient.php | 5 +- .../Exception/PinpointEmailException.php | 5 +- src/PinpointEmail/PinpointEmailClient.php | 5 +- .../Exception/PinpointSMSVoiceException.php | 5 +- .../PinpointSMSVoiceClient.php | 5 +- .../Exception/PinpointSMSVoiceV2Exception.php | 5 +- .../PinpointSMSVoiceV2Client.php | 5 +- src/Pipes/Exception/PipesException.php | 5 +- src/Pipes/PipesClient.php | 5 +- src/Polly/Exception/PollyException.php | 5 +- src/Polly/PollyClient.php | 1 + src/PresignUrlMiddleware.php | 1 + src/Pricing/Exception/PricingException.php | 5 +- src/Pricing/PricingClient.php | 5 +- .../Exception/PrivateNetworksException.php | 5 +- src/PrivateNetworks/PrivateNetworksClient.php | 5 +- .../Exception/PrometheusServiceException.php | 5 +- .../PrometheusServiceClient.php | 5 +- src/Proton/Exception/ProtonException.php | 5 +- src/Proton/ProtonClient.php | 5 +- src/Psr16CacheAdapter.php | 1 + src/PsrCacheAdapter.php | 1 + src/QLDB/Exception/QLDBException.php | 5 +- src/QLDB/QLDBClient.php | 5 +- .../Exception/QLDBSessionException.php | 5 +- src/QLDBSession/QLDBSessionClient.php | 5 +- .../Exception/QuickSightException.php | 5 +- src/QuickSight/QuickSightClient.php | 5 +- src/RAM/Exception/RAMException.php | 5 +- src/RAM/RAMClient.php | 5 +- .../Exception/RDSDataServiceException.php | 5 +- src/RDSDataService/RDSDataServiceClient.php | 5 +- src/Rds/AuthTokenGenerator.php | 2 +- src/Rds/Exception/RdsException.php | 5 +- src/Rds/RdsClient.php | 1 + .../Exception/RecycleBinException.php | 5 +- src/RecycleBin/RecycleBinClient.php | 5 +- src/Redshift/Exception/RedshiftException.php | 5 +- src/Redshift/RedshiftClient.php | 5 +- .../RedshiftDataAPIServiceException.php | 5 +- .../RedshiftDataAPIServiceClient.php | 5 +- .../Exception/RedshiftServerlessException.php | 5 +- .../RedshiftServerlessClient.php | 5 +- .../Exception/RekognitionException.php | 5 +- src/Rekognition/RekognitionClient.php | 5 +- .../Exception/ResilienceHubException.php | 5 +- src/ResilienceHub/ResilienceHubClient.php | 5 +- .../Exception/ResourceExplorer2Exception.php | 5 +- .../ResourceExplorer2Client.php | 5 +- .../Exception/ResourceGroupsException.php | 5 +- src/ResourceGroups/ResourceGroupsClient.php | 5 +- .../ResourceGroupsTaggingAPIException.php | 5 +- .../ResourceGroupsTaggingAPIClient.php | 5 +- src/ResponseContainerInterface.php | 2 +- src/Result.php | 1 + src/ResultInterface.php | 1 + src/ResultPaginator.php | 1 + src/Retry/Configuration.php | 1 + src/Retry/ConfigurationInterface.php | 1 + src/Retry/ConfigurationProvider.php | 4 +- .../Exception/ConfigurationException.php | 1 + src/Retry/QuotaManager.php | 1 + src/Retry/RateLimiter.php | 2 +- src/Retry/RetryHelperTrait.php | 1 + src/RetryMiddleware.php | 7 +- src/RetryMiddlewareV2.php | 17 +- .../Exception/RoboMakerException.php | 5 +- src/RoboMaker/RoboMakerClient.php | 5 +- .../Exception/RolesAnywhereException.php | 5 +- src/RolesAnywhere/RolesAnywhereClient.php | 5 +- src/Route53/Exception/Route53Exception.php | 5 +- src/Route53/Route53Client.php | 1 + .../Exception/Route53DomainsException.php | 5 +- src/Route53Domains/Route53DomainsClient.php | 5 +- .../Route53RecoveryClusterException.php | 5 +- .../Route53RecoveryClusterClient.php | 5 +- .../Route53RecoveryControlConfigException.php | 5 +- .../Route53RecoveryControlConfigClient.php | 5 +- .../Route53RecoveryReadinessException.php | 5 +- .../Route53RecoveryReadinessClient.php | 5 +- .../Exception/Route53ResolverException.php | 5 +- src/Route53Resolver/Route53ResolverClient.php | 5 +- src/S3/AmbiguousSuccessParser.php | 1 + src/S3/ApplyChecksumMiddleware.php | 11 +- src/S3/BatchDelete.php | 5 +- src/S3/BucketEndpointArnMiddleware.php | 24 +-- src/S3/BucketEndpointMiddleware.php | 3 +- src/S3/CalculatesChecksumTrait.php | 18 ++- src/S3/Crypto/CryptoParamsTrait.php | 1 + src/S3/Crypto/CryptoParamsTraitV2.php | 1 + src/S3/Crypto/HeadersMetadataStrategy.php | 5 +- .../InstructionFileMetadataStrategy.php | 7 +- src/S3/Crypto/S3EncryptionClient.php | 1 + src/S3/Crypto/S3EncryptionClientV2.php | 1 + .../Crypto/S3EncryptionMultipartUploader.php | 5 +- .../S3EncryptionMultipartUploaderV2.php | 5 +- src/S3/Crypto/UserAgentTrait.php | 3 +- src/S3/EndpointRegionHelperTrait.php | 16 +- .../DeleteMultipleObjectsException.php | 1 + .../Exception/PermanentRedirectException.php | 5 +- src/S3/Exception/S3Exception.php | 5 +- .../Exception/S3MultipartUploadException.php | 4 +- src/S3/GetBucketLocationParser.php | 1 + src/S3/MultipartCopy.php | 1 - src/S3/MultipartUploader.php | 1 + src/S3/MultipartUploadingTrait.php | 1 + src/S3/ObjectCopier.php | 1 + src/S3/ObjectUploader.php | 1 + src/S3/PermanentRedirectMiddleware.php | 1 + src/S3/PostObject.php | 1 + src/S3/PostObjectV4.php | 3 +- src/S3/PutObjectUrlMiddleware.php | 1 + src/S3/RegionalEndpoint/Configuration.php | 1 + .../ConfigurationInterface.php | 1 + .../ConfigurationProvider.php | 4 +- .../Exception/ConfigurationException.php | 1 + src/S3/RetryableMalformedResponseParser.php | 1 + src/S3/S3Client.php | 32 ++-- src/S3/S3ClientInterface.php | 1 + src/S3/S3ClientTrait.php | 9 +- src/S3/S3EndpointMiddleware.php | 11 +- src/S3/S3MultiRegionClient.php | 5 +- src/S3/S3UriParser.php | 1 + src/S3/SSECMiddleware.php | 1 + src/S3/StreamWrapper.php | 11 +- src/S3/Transfer.php | 13 +- src/S3/UseArnRegion/Configuration.php | 1 + .../UseArnRegion/ConfigurationInterface.php | 1 + src/S3/UseArnRegion/ConfigurationProvider.php | 4 +- .../Exception/ConfigurationException.php | 1 + src/S3/ValidateResponseChecksumParser.php | 3 +- src/S3Control/EndpointArnMiddleware.php | 22 ++- .../Exception/S3ControlException.php | 5 +- src/S3Control/S3ControlClient.php | 7 +- .../Exception/S3OutpostsException.php | 5 +- src/S3Outposts/S3OutpostsClient.php | 5 +- .../Exception/SSMContactsException.php | 5 +- src/SSMContacts/SSMContactsClient.php | 5 +- .../Exception/SSMIncidentsException.php | 5 +- src/SSMIncidents/SSMIncidentsClient.php | 5 +- src/SSO/Exception/SSOException.php | 5 +- src/SSO/SSOClient.php | 5 +- src/SSOAdmin/Exception/SSOAdminException.php | 5 +- src/SSOAdmin/SSOAdminClient.php | 5 +- src/SSOOIDC/Exception/SSOOIDCException.php | 5 +- src/SSOOIDC/SSOOIDCClient.php | 5 +- .../Exception/SageMakerException.php | 5 +- src/SageMaker/SageMakerClient.php | 5 +- .../SageMakerFeatureStoreRuntimeException.php | 5 +- .../SageMakerFeatureStoreRuntimeClient.php | 5 +- .../SageMakerGeospatialException.php | 5 +- .../SageMakerGeospatialClient.php | 5 +- .../Exception/SageMakerMetricsException.php | 5 +- .../SageMakerMetricsClient.php | 5 +- .../Exception/SageMakerRuntimeException.php | 5 +- .../SageMakerRuntimeClient.php | 5 +- .../SagemakerEdgeManagerException.php | 5 +- .../SagemakerEdgeManagerClient.php | 5 +- .../Exception/SavingsPlansException.php | 5 +- src/SavingsPlans/SavingsPlansClient.php | 5 +- .../Exception/SchedulerException.php | 5 +- src/Scheduler/SchedulerClient.php | 5 +- src/Schemas/Exception/SchemasException.php | 5 +- src/Schemas/SchemasClient.php | 5 +- src/Script/Composer/Composer.php | 9 +- src/Sdk.php | 1 + .../Exception/SecretsManagerException.php | 5 +- src/SecretsManager/SecretsManagerClient.php | 5 +- .../Exception/SecurityHubException.php | 5 +- src/SecurityHub/SecurityHubClient.php | 5 +- .../Exception/SecurityLakeException.php | 5 +- src/SecurityLake/SecurityLakeClient.php | 5 +- ...rverlessApplicationRepositoryException.php | 5 +- .../ServerlessApplicationRepositoryClient.php | 5 +- .../Exception/ServiceCatalogException.php | 5 +- src/ServiceCatalog/ServiceCatalogClient.php | 5 +- .../Exception/ServiceDiscoveryException.php | 5 +- .../ServiceDiscoveryClient.php | 5 +- .../Exception/ServiceQuotasException.php | 5 +- src/ServiceQuotas/ServiceQuotasClient.php | 5 +- src/Ses/Exception/SesException.php | 5 +- src/Ses/SesClient.php | 4 +- src/SesV2/Exception/SesV2Exception.php | 5 +- src/SesV2/SesV2Client.php | 5 +- src/Sfn/Exception/SfnException.php | 5 +- src/Sfn/SfnClient.php | 5 +- src/Shield/Exception/ShieldException.php | 5 +- src/Shield/ShieldClient.php | 5 +- src/Signature/AnonymousSignature.php | 1 + src/Signature/S3SignatureV4.php | 1 + src/Signature/SignatureInterface.php | 1 + src/Signature/SignatureProvider.php | 1 + src/Signature/SignatureTrait.php | 3 +- src/Signature/SignatureV4.php | 29 ++-- .../Exception/SimSpaceWeaverException.php | 5 +- src/SimSpaceWeaver/SimSpaceWeaverClient.php | 5 +- src/Sms/Exception/SmsException.php | 5 +- src/Sms/SmsClient.php | 5 +- src/SnowBall/Exception/SnowBallException.php | 5 +- src/SnowBall/SnowBallClient.php | 5 +- .../SnowDeviceManagementException.php | 5 +- .../SnowDeviceManagementClient.php | 5 +- src/Sns/Exception/SnsException.php | 5 +- src/Sns/SnsClient.php | 5 +- src/Sqs/Exception/SqsException.php | 5 +- src/Sqs/SqsClient.php | 3 +- src/Ssm/Exception/SsmException.php | 5 +- src/Ssm/SsmClient.php | 5 +- src/SsmSap/Exception/SsmSapException.php | 5 +- src/SsmSap/SsmSapClient.php | 5 +- .../Exception/StorageGatewayException.php | 5 +- src/StorageGateway/StorageGatewayClient.php | 5 +- src/StreamRequestPayloadMiddleware.php | 2 +- src/Sts/Exception/StsException.php | 5 +- src/Sts/RegionalEndpoints/Configuration.php | 1 + .../ConfigurationInterface.php | 1 + .../ConfigurationProvider.php | 4 +- .../Exception/ConfigurationException.php | 1 + src/Sts/StsClient.php | 4 +- src/Support/Exception/SupportException.php | 5 +- src/Support/SupportClient.php | 5 +- .../Exception/SupportAppException.php | 5 +- src/SupportApp/SupportAppClient.php | 5 +- src/Swf/Exception/SwfException.php | 5 +- src/Swf/SwfClient.php | 5 +- .../Exception/SyntheticsException.php | 5 +- src/Synthetics/SyntheticsClient.php | 5 +- src/Textract/Exception/TextractException.php | 5 +- src/Textract/TextractClient.php | 5 +- .../Exception/TimestreamQueryException.php | 5 +- src/TimestreamQuery/TimestreamQueryClient.php | 5 +- .../Exception/TimestreamWriteException.php | 5 +- src/TimestreamWrite/TimestreamWriteClient.php | 5 +- src/Tnb/Exception/TnbException.php | 5 +- src/Tnb/TnbClient.php | 5 +- src/Token/BearerTokenAuthorization.php | 1 + src/Token/ParsesIniTrait.php | 1 + .../RefreshableTokenProviderInterface.php | 1 + src/Token/SsoToken.php | 1 + src/Token/SsoTokenProvider.php | 14 +- src/Token/Token.php | 1 + src/Token/TokenAuthorization.php | 1 + src/Token/TokenInterface.php | 1 + src/Token/TokenProvider.php | 8 +- src/TraceMiddleware.php | 38 +++-- .../Exception/TranscribeServiceException.php | 5 +- .../TranscribeServiceClient.php | 5 +- src/Transfer/Exception/TransferException.php | 5 +- src/Transfer/TransferClient.php | 5 +- .../Exception/TranslateException.php | 5 +- src/Translate/TranslateClient.php | 5 +- src/VoiceID/Exception/VoiceIDException.php | 5 +- src/VoiceID/VoiceIDClient.php | 5 +- src/WAFV2/Exception/WAFV2Exception.php | 5 +- src/WAFV2/WAFV2Client.php | 5 +- src/Waf/Exception/WafException.php | 5 +- src/Waf/WafClient.php | 5 +- .../Exception/WafRegionalException.php | 5 +- src/WafRegional/WafRegionalClient.php | 5 +- src/Waiter.php | 1 + .../Exception/WellArchitectedException.php | 5 +- src/WellArchitected/WellArchitectedClient.php | 5 +- src/WorkDocs/Exception/WorkDocsException.php | 5 +- src/WorkDocs/WorkDocsClient.php | 5 +- src/WorkLink/Exception/WorkLinkException.php | 5 +- src/WorkLink/WorkLinkClient.php | 5 +- src/WorkMail/Exception/WorkMailException.php | 5 +- src/WorkMail/WorkMailClient.php | 5 +- .../WorkMailMessageFlowException.php | 5 +- .../WorkMailMessageFlowClient.php | 5 +- .../Exception/WorkSpacesException.php | 5 +- src/WorkSpaces/WorkSpacesClient.php | 5 +- .../Exception/WorkSpacesWebException.php | 5 +- src/WorkSpacesWeb/WorkSpacesWebClient.php | 5 +- src/WrappedHttpHandler.php | 1 + src/XRay/Exception/XRayException.php | 5 +- src/XRay/XRayClient.php | 5 +- src/drs/Exception/drsException.php | 5 +- src/drs/drsClient.php | 5 +- src/finspace/Exception/finspaceException.php | 5 +- src/finspace/finspaceClient.php | 5 +- src/functions.php | 10 +- .../Exception/imagebuilderException.php | 5 +- src/imagebuilder/imagebuilderClient.php | 5 +- src/ivschat/Exception/ivschatException.php | 5 +- src/ivschat/ivschatClient.php | 5 +- src/kendra/Exception/kendraException.php | 5 +- src/kendra/kendraClient.php | 5 +- src/mgn/Exception/mgnException.php | 5 +- src/mgn/mgnClient.php | 5 +- src/signer/Exception/signerException.php | 5 +- src/signer/signerClient.php | 5 +- tests/Api/ApiProviderTest.php | 9 +- tests/Api/DateTimeResultTest.php | 1 + .../ErrorParser/JsonRpcErrorParserTest.php | 3 +- .../ErrorParser/RestJsonErrorParserTest.php | 3 +- tests/Api/ErrorParser/XmlErrorParserTest.php | 1 + tests/Api/ListShapeTest.php | 1 + tests/Api/MapShapeTest.php | 1 + tests/Api/OperationTest.php | 5 +- tests/Api/Parser/ComplianceTest.php | 5 +- .../Api/Parser/Crc32ValidatingParserTest.php | 1 + tests/Api/Parser/EventParsingIteratorTest.php | 12 +- .../Parser/Exception/ParserExceptionTest.php | 1 + tests/Api/Parser/JsonParserTest.php | 8 +- tests/Api/Parser/JsonRpcParserTest.php | 3 +- tests/Api/Parser/ParserTestServiceTrait.php | 2 +- tests/Api/Parser/XmlParserTest.php | 4 +- tests/Api/Serializer/ComplianceTest.php | 5 +- tests/Api/Serializer/JsonBodyTest.php | 27 +++- .../Api/Serializer/JsonRpcSerializerTest.php | 7 +- tests/Api/Serializer/QuerySerializerTest.php | 7 +- .../Api/Serializer/RestJsonSerializerTest.php | 17 +- .../Api/Serializer/RestXmlSerializerTest.php | 4 +- tests/Api/ServiceTest.php | 43 +++-- tests/Api/ShapeMapTest.php | 1 + tests/Api/ShapeTest.php | 1 + tests/Api/Stringable.php | 2 +- tests/Api/StructureShapeTest.php | 1 + tests/Api/TimestampShapeTest.php | 1 + tests/Api/ValidatorTest.php | 1 + tests/Arn/AccessPointArnTest.php | 1 + tests/Arn/ArnParserTest.php | 2 +- tests/Arn/ArnTest.php | 2 +- tests/Arn/S3/AccessPointArnTest.php | 1 + tests/Arn/S3/OutpostsAccessPointArnTest.php | 1 + tests/Arn/S3/OutpostsBucketArnTest.php | 1 + tests/AwsClientTest.php | 41 +++-- .../Build/Changelog/ChangelogBuilderTest.php | 1 + tests/Build/Docs/CodeSnippetGeneratorTest.php | 2 +- tests/ClientResolverTest.php | 38 ++--- ...ApiCallAttemptMonitoringMiddlewareTest.php | 12 +- .../ApiCallMonitoringMiddlewareTest.php | 12 +- .../ConfigurationProviderTest.php | 14 +- .../ConfigurationTest.php | 1 - .../MonitoringMiddlewareTestingTrait.php | 4 +- tests/CloudFront/CloudFrontClientTest.php | 2 +- tests/CloudFront/CookieSignerTest.php | 3 +- tests/CloudFront/SignerTest.php | 7 +- tests/CloudFront/UrlSignerTest.php | 3 +- .../CloudSearchDomainTest.php | 1 + tests/CloudTrail/LogFileIteratorTest.php | 1 + tests/CloudTrail/LogFileReaderTest.php | 1 + tests/CloudTrail/LogRecordIteratorTest.php | 3 +- .../CognitoIdentityProviderTest.php | 1 + tests/CognitoSync/CognitoSyncClientTest.php | 3 +- tests/CommandPoolTest.php | 27 ++-- tests/CommandTest.php | 1 + .../AssumeRoleCredentialProviderTest.php | 4 +- ...eWithWebIdentityCredentialProviderTest.php | 4 +- tests/Credentials/CredentialProviderTest.php | 61 ++++--- tests/Credentials/CredentialsTest.php | 1 + .../Credentials/EcsCredentialProviderTest.php | 14 +- .../InstanceProfileProviderTest.php | 38 +++-- tests/Crypto/AesDecryptingStreamTest.php | 4 +- tests/Crypto/AesEncryptingStreamTest.php | 4 +- tests/Crypto/AesEncryptionStreamTestTrait.php | 1 + tests/Crypto/AesGcmDecryptingStreamTest.php | 1 + tests/Crypto/AesGcmEncryptingStreamTest.php | 1 + tests/Crypto/Cipher/CbcTest.php | 1 + tests/Crypto/KmsMaterialsProviderTest.php | 1 + tests/Crypto/KmsMaterialsProviderV2Test.php | 7 +- tests/Crypto/MetadataEnvelopeTest.php | 1 + tests/Crypto/Polyfill/AesGcmTest.php | 1 + tests/Crypto/Polyfill/ByteArrayTest.php | 1 + tests/Crypto/Polyfill/GmacTest.php | 1 + tests/Crypto/Polyfill/KeyTest.php | 1 + tests/Crypto/RandomByteStream.php | 1 + tests/Crypto/UsesCryptoParamsTrait.php | 4 +- tests/Crypto/UsesCryptoParamsTraitV2.php | 2 +- tests/Crypto/UsesMetadataEnvelopeTrait.php | 1 + .../ConfigurationProviderTest.php | 1 + tests/DocDb/DocDbClientTest.php | 7 +- tests/DoctrineCacheAdapterTest.php | 1 + tests/DynamoDb/DynamoDbClientTest.php | 5 +- .../DynamoDb/LockingSessionConnectionTest.php | 1 + tests/DynamoDb/MarshalerTest.php | 17 +- .../SessionConnectionConfigTraitTest.php | 1 + tests/DynamoDb/SessionHandlerTest.php | 7 +- .../StandardSessionConnectionTest.php | 15 +- tests/DynamoDb/WriteRequestBatchTest.php | 3 +- tests/Ec2/Ec2ClientTest.php | 1 + .../ElasticLoadBalancingV2ClientTest.php | 1 + tests/Endpoint/EndpointProviderTest.php | 8 +- .../PartitionEndpointProviderTest.php | 4 +- tests/Endpoint/PartitionTest.php | 16 +- .../Endpoint/PatternEndpointProviderTest.php | 1 + .../ConfigurationProviderTest.php | 3 +- .../ConfigurationTest.php | 1 + .../ConfigurationProviderTest.php | 2 +- .../UseFipsEndpoint/ConfigurationTest.php | 1 + .../EndpointDiscoveryMiddlewareTest.php | 4 +- tests/EndpointParameterMiddlewareTest.php | 5 +- .../EndpointDefinitionProviderTest.php | 8 +- tests/EndpointV2/EndpointProviderV2Test.php | 34 ++-- .../EndpointV2SerializerTraitTest.php | 9 +- tests/EndpointV2/RuleCreatorTest.php | 4 +- tests/EndpointV2/RulesetParameterTest.php | 6 +- .../EndpointV2/RulesetStandardLibraryTest.php | 11 +- tests/EventBridge/EventBridgeClientTest.php | 14 +- tests/Exception/AwsExceptionTest.php | 1 + .../CouldNotCreateChecksumExceptionTest.php | 1 + .../MultipartUploadExceptionTest.php | 1 + tests/FunctionsTest.php | 39 +++-- tests/Glacier/GlacierClientTest.php | 1 + tests/Glacier/MultipartUploaderTest.php | 8 +- tests/Glacier/TreeHashTest.php | 1 + tests/Handler/GuzzleV5/HandlerTest.php | 1 + tests/Handler/GuzzleV5/StreamTest.php | 1 + tests/Handler/GuzzleV6/HandlerTest.php | 5 +- tests/HandlerListTest.php | 82 +++++++--- tests/HasMonitoringEventsTraitTest.php | 9 +- tests/HashingStreamTest.php | 1 + tests/HistoryTest.php | 1 + tests/IdempotencyTokenMiddlewareTest.php | 1 + tests/InputValidationMiddlewareTest.php | 5 +- tests/Integ/ConcurrencyContext.php | 2 +- tests/Integ/CrtContext.php | 3 +- tests/Integ/GuzzleV5HandlerTest.php | 1 + tests/Integ/GuzzleV6StreamHandlerTest.php | 1 + tests/Integ/IntegUtils.php | 7 +- tests/Integ/MultipartContext.php | 5 +- tests/Integ/S3Context.php | 5 +- tests/Integ/S3EncryptionContext.php | 2 +- tests/Integ/S3EncryptionContextV2.php | 1 + tests/Integ/SmokeContext.php | 3 +- tests/JsonCompilerTest.php | 1 + tests/Lambda/LambdaClientTest.php | 5 +- tests/LexModelsV2/LexModelsV2ClientTest.php | 1 + tests/LruArrayCacheTest.php | 1 + .../MachineLearningClientTest.php | 4 +- tests/MiddlewareTest.php | 12 +- tests/MockHandlerTest.php | 4 +- tests/MultiRegionClientTest.php | 3 +- tests/Multipart/AbstractUploaderTest.php | 7 +- tests/Multipart/TestUploader.php | 1 + tests/Multipart/UploadStateTest.php | 1 + tests/Neptune/NeptuneClientTest.php | 7 +- tests/PerformanceContext.php | 2 +- tests/PhpHashTest.php | 1 + tests/Polly/PollyClientTest.php | 1 + tests/PresignUrlMiddlewareTest.php | 8 +- tests/Psr16CacheAdapterTest.php | 1 + tests/PsrCacheAdapterTest.php | 2 +- tests/Rds/AuthTokenGeneratorTest.php | 1 + tests/Rds/RdsClientTest.php | 12 +- tests/ResultPaginatorTest.php | 5 +- tests/ResultTest.php | 1 + tests/Retry/ConfigurationProviderTest.php | 1 + tests/Retry/RateLimiterTest.php | 7 +- tests/RetryMiddlewareTest.php | 40 +++-- tests/RetryMiddlewareV2Test.php | 49 ++++-- tests/Route53/RouteClient53Test.php | 1 + tests/S3/AmbiguousSuccessParserTest.php | 15 +- tests/S3/ApplyChecksumMiddlewareTest.php | 1 + tests/S3/BatchDeleteTest.php | 3 +- tests/S3/BucketEndpointArnMiddlewareTest.php | 8 +- tests/S3/BucketEndpointMiddlewareTest.php | 1 + .../S3/Crypto/HeadersMetadataStrategyTest.php | 1 + .../InstructionFileMetadataStrategyTest.php | 4 +- tests/S3/Crypto/S3EncryptionClientTest.php | 3 +- .../Crypto/S3EncryptionClientTestingTrait.php | 1 + tests/S3/Crypto/S3EncryptionClientV2Test.php | 11 +- .../S3EncryptionMultipartUploaderTest.php | 9 +- .../S3EncryptionMultipartUploaderV2Test.php | 12 +- .../DeleteMultipleObjectsExceptionTest.php | 1 + .../S3MultipartUploadExceptionTest.php | 1 + tests/S3/GetBucketLocationParserTest.php | 5 +- tests/S3/MultipartCopyTest.php | 7 +- tests/S3/MultipartUploaderTest.php | 16 +- tests/S3/ObjectCopierTest.php | 30 ++-- tests/S3/ObjectUploaderTest.php | 37 +++-- tests/S3/PermanentRedirectMiddlewareTest.php | 1 + tests/S3/PostObjectTest.php | 1 + tests/S3/PostObjectV4Test.php | 3 +- tests/S3/PutObjectUrlMiddlewareTest.php | 1 + .../RetryableMalformedResponseParserTest.php | 6 +- tests/S3/S3ClientTest.php | 80 +++++----- tests/S3/S3EndpointMiddlewareTest.php | 22 ++- tests/S3/S3MultiRegionClientTest.php | 19 +-- tests/S3/S3UriParserTest.php | 1 + tests/S3/SSECMiddlewareTest.php | 1 + tests/S3/StreamWrapperPathStyleTest.php | 79 ++++++--- tests/S3/StreamWrapperTest.php | 79 ++++++--- tests/S3/StreamWrapperV2ExistenceTest.php | 150 +++++++++++------- tests/S3/TransferTest.php | 14 +- .../ConfigurationProviderTest.php | 2 +- tests/S3/UseArnRegion/ConfigurationTest.php | 1 + .../S3/ValidateResponseChecksumParserTest.php | 65 +++++--- tests/S3/sig_hack.php | 1 + tests/S3Control/EndpointArnMiddlewareTest.php | 5 +- tests/S3Control/S3ControlClientTest.php | 4 +- tests/S3Control/S3ControlTestingTrait.php | 1 + tests/Script/ComposerTest.php | 9 +- tests/SdkTest.php | 10 +- tests/Ses/SesClientTest.php | 1 + tests/Signature/AnonymousSignatureTest.php | 1 + tests/Signature/S3SignatureV4Test.php | 1 + tests/Signature/SignatureProviderTest.php | 1 + tests/Signature/SignatureV4Test.php | 12 +- tests/Signature/sig_hack.php | 1 + tests/Sqs/SqsClientTest.php | 1 + tests/Ssm/SsmClientTest.php | 1 + tests/StreamRequestPayloadMiddlewareTest.php | 9 +- .../ConfigurationProviderTest.php | 6 +- tests/Sts/StsClientTest.php | 1 + tests/TestServiceTrait.php | 6 +- tests/Token/BearerTokenAuthorizationTest.php | 16 +- tests/Token/SsoTokenProviderTest.php | 11 +- tests/Token/TokenProviderTest.php | 32 ++-- tests/Token/token_hack.php | 1 + tests/TraceMiddlewareTest.php | 59 ++++--- tests/UsesServiceTrait.php | 8 +- tests/WaiterTest.php | 23 ++- tests/WrappedHttpHandlerTest.php | 24 ++- tests/bootstrap.php | 1 + ...nit_Framework_MockObject_Generator_7.4.php | 19 ++- 1198 files changed, 4733 insertions(+), 1865 deletions(-) diff --git a/src/ACMPCA/ACMPCAClient.php b/src/ACMPCA/ACMPCAClient.php index af6b4087df..318db3d8d8 100644 --- a/src/ACMPCA/ACMPCAClient.php +++ b/src/ACMPCA/ACMPCAClient.php @@ -1,4 +1,5 @@ api)) { - // If modeled error code is indicated, check for known error shape if (!empty($data['code'])) { - $errors = $this->api->getOperation($command->getName())->getErrors(); foreach ($errors as $key => $error) { - // If error code matches a known error shape, populate the body if ($data['code'] == $error['name'] && $error instanceof StructureShape @@ -92,4 +90,4 @@ protected function populateShape( return $data; } -} \ No newline at end of file +} diff --git a/src/Api/ErrorParser/JsonParserTrait.php b/src/Api/ErrorParser/JsonParserTrait.php index 92b447c291..e7b1805813 100644 --- a/src/Api/ErrorParser/JsonParserTrait.php +++ b/src/Api/ErrorParser/JsonParserTrait.php @@ -1,4 +1,5 @@ getDocNamespaces(); if (!isset($namespaces[''])) { return ''; - } - + } + // Account for the default namespace being defined and PHP not // being able to handle it :(. $element->registerXPathNamespace('ns', $namespaces['']); diff --git a/src/Api/ListShape.php b/src/Api/ListShape.php index a425efa72f..be84c8834f 100644 --- a/src/Api/ListShape.php +++ b/src/Api/ListShape.php @@ -1,4 +1,5 @@ getInput()->getMembers(); $contextParams = []; - foreach($members as $name => $shape) { + foreach ($members as $name => $shape) { if (!empty($contextParam = $shape->getContextParam())) { $contextParams[$contextParam['name']] = [ 'shape' => $name, diff --git a/src/Api/Parser/AbstractParser.php b/src/Api/Parser/AbstractParser.php index 2d515d2a5a..a89e1f9e4f 100644 --- a/src/Api/Parser/AbstractParser.php +++ b/src/Api/Parser/AbstractParser.php @@ -1,4 +1,5 @@ payload($response, $member, $result[$payload]); diff --git a/src/Api/Parser/Crc32ValidatingParser.php b/src/Api/Parser/Crc32ValidatingParser.php index 8e5d4f08e4..ae19993ed5 100644 --- a/src/Api/Parser/Crc32ValidatingParser.php +++ b/src/Api/Parser/Crc32ValidatingParser.php @@ -1,4 +1,5 @@ getValue(); foreach ($value as $k => $v) { diff --git a/src/Api/Serializer/JsonRpcSerializer.php b/src/Api/Serializer/JsonRpcSerializer.php index 508766e3d1..b3cac1cbd4 100644 --- a/src/Api/Serializer/JsonRpcSerializer.php +++ b/src/Api/Serializer/JsonRpcSerializer.php @@ -1,4 +1,5 @@ getName(); $operation = $this->api->getOperation($operationName); $commandArgs = $command->toArray(); diff --git a/src/Api/Serializer/QueryParamBuilder.php b/src/Api/Serializer/QueryParamBuilder.php index 3d96334eaf..a32002e9c4 100644 --- a/src/Api/Serializer/QueryParamBuilder.php +++ b/src/Api/Serializer/QueryParamBuilder.php @@ -1,4 +1,5 @@ api->getOperation($command->getName()); $body = [ 'Action' => $command->getName(), diff --git a/src/Api/Serializer/RestJsonSerializer.php b/src/Api/Serializer/RestJsonSerializer.php index 8a2aa993b1..bc0fba8daf 100644 --- a/src/Api/Serializer/RestJsonSerializer.php +++ b/src/Api/Serializer/RestJsonSerializer.php @@ -1,4 +1,5 @@ api->getOperation($command->getName()); $commandArgs = $command->toArray(); $opts = $this->serialize($operation, $commandArgs); @@ -120,7 +120,7 @@ private function serialize(Operation $operation, array $args) if (isset($bodyMembers)) { $this->payload($operation->getInput(), $bodyMembers, $opts); - } else if (!isset($opts['body']) && $this->hasPayloadParam($input, $payload)) { + } elseif (!isset($opts['body']) && $this->hasPayloadParam($input, $payload)) { $this->payload($operation->getInput(), [], $opts); } @@ -228,7 +228,7 @@ function (array $matches) use ($varDefinitions) { // Add the query string variables or appending to one if needed. if (!empty($opts['query'])) { - $relative = $this->appendQuery($opts['query'], $relative); + $relative = $this->appendQuery($opts['query'], $relative); } $path = $this->endpoint->getPath(); diff --git a/src/Api/Serializer/RestXmlSerializer.php b/src/Api/Serializer/RestXmlSerializer.php index 200b89aaa8..97477df345 100644 --- a/src/Api/Serializer/RestXmlSerializer.php +++ b/src/Api/Serializer/RestXmlSerializer.php @@ -1,4 +1,5 @@ apiVersion = $this->getApiVersion(); if (isset($definition['clientContextParams'])) { - $this->clientContextParams = $definition['clientContextParams']; + $this->clientContextParams = $definition['clientContextParams']; } } @@ -288,7 +289,7 @@ public function getOperation($name) $this->definition['operations'][$name], $this->shapeMap ); - } else if ($this->modifiedModel) { + } elseif ($this->modifiedModel) { $this->operations[$name] = new Operation( $this->definition['operations'][$name], $this->shapeMap diff --git a/src/Api/Shape.php b/src/Api/Shape.php index b1b8071d6c..788f46105d 100644 --- a/src/Api/Shape.php +++ b/src/Api/Shape.php @@ -1,4 +1,5 @@ $val) { - if (!$this->checkDocumentType($val) || gettype($key) != $typeOfFirstKey) { - return false; - } + if (!$this->checkDocumentType($val) || gettype($key) != $typeOfFirstKey) { + return false; + } } return $this->checkArray($value); } @@ -334,7 +335,9 @@ private function checkUnion($value) private function addError($message) { $this->errors[] = - implode('', array_map(function ($s) { return "[{$s}]"; }, $this->path)) + implode('', array_map(function ($s) { + return "[{$s}]"; + }, $this->path)) . ' ' . $message; } diff --git a/src/ApiGateway/ApiGatewayClient.php b/src/ApiGateway/ApiGatewayClient.php index 6162b6b6e5..58327e11fb 100644 --- a/src/ApiGateway/ApiGatewayClient.php +++ b/src/ApiGateway/ApiGatewayClient.php @@ -1,4 +1,5 @@ getOperation($c->getName())['authtype']; - switch ($authType){ + switch ($authType) { case 'none': $version = 'anonymous'; break; @@ -486,7 +487,8 @@ private function addRecursionDetection() // Add recursion detection header to requests // originating in supported Lambda runtimes $this->handlerList->appendBuild( - Middleware::recursionDetection(), 'recursion-detection' + Middleware::recursionDetection(), + 'recursion-detection' ); } @@ -523,10 +525,10 @@ private function setClientContextParams($args) $api = $this->getApi(); $resolvedParams = []; if (!empty($paramDefinitions = $api->getClientContextParams())) { - foreach($paramDefinitions as $paramName => $paramValue) { + foreach ($paramDefinitions as $paramName => $paramValue) { if (isset($args[$paramName])) { - $result[$paramName] = $args[$paramName]; - } + $result[$paramName] = $args[$paramName]; + } } } return $resolvedParams; @@ -545,7 +547,7 @@ private function setClientBuiltIns($args) $builtIns['AWS::Region'] = $this->getRegion(); $builtIns['AWS::UseFIPS'] = $config['use_fips_endpoint']->isUseFipsEndpoint(); $builtIns['AWS::UseDualStack'] = $config['use_dual_stack_endpoint']->isUseDualstackEndpoint(); - if ($service === 's3' || $service === 's3control'){ + if ($service === 's3' || $service === 's3control') { $builtIns['AWS::S3::UseArnRegion'] = $config['use_arn_region']->isUseArnRegion(); } if ($service === 's3') { @@ -578,7 +580,7 @@ private function normalizeEndpointProviderArgs() { $normalizedBuiltIns = []; - foreach($this->clientBuiltIns as $name => $value) { + foreach ($this->clientBuiltIns as $name => $value) { $normalizedName = explode('::', $name); $normalizedName = $normalizedName[count($normalizedName) - 1]; $normalizedBuiltIns[$normalizedName] = $value; @@ -592,7 +594,8 @@ protected function isUseEndpointV2() return $this->endpointProvider instanceof EndpointProviderV2; } - public static function emitDeprecationWarning() { + public static function emitDeprecationWarning() + { $phpVersion = PHP_VERSION_ID; if ($phpVersion < 70205) { $phpVersionString = phpversion(); diff --git a/src/AwsClientInterface.php b/src/AwsClientInterface.php index 12a570181e..852e207659 100644 --- a/src/AwsClientInterface.php +++ b/src/AwsClientInterface.php @@ -1,4 +1,5 @@ getApi()['serviceFullName'] + $name, + $this->getApi()['serviceFullName'] )); } diff --git a/src/Backup/BackupClient.php b/src/Backup/BackupClient.php index cc0b700c3e..faff058d07 100644 --- a/src/Backup/BackupClient.php +++ b/src/Backup/BackupClient.php @@ -1,4 +1,5 @@ interpose( new TraceMiddleware( $value === true ? [] : $value, - $args['api']) + $args['api'] + ) ); } } @@ -877,7 +885,7 @@ public static function _apply_user_agent($inputUserAgent, array &$args, HandlerL } //Add the input to the end - if ($inputUserAgent){ + if ($inputUserAgent) { if (!is_array($inputUserAgent)) { $inputUserAgent = [$inputUserAgent]; } @@ -941,7 +949,8 @@ public static function _apply_idempotency_auto_fill( } } - public static function _apply_suppress_php_deprecation_warning($suppressWarning, array &$args) { + public static function _apply_suppress_php_deprecation_warning($suppressWarning, array &$args) + { if ($suppressWarning) { $args['suppress_php_deprecation_warning'] = true; } elseif (!empty($_ENV["AWS_SUPPRESS_PHP_DEPRECATION_WARNING"])) { @@ -1134,10 +1143,9 @@ private static function isValidRegion($region) private function _apply_client_context_params(array $args) { if (isset($args['api']) - && !empty($args['api']->getClientContextParams())) - { + && !empty($args['api']->getClientContextParams())) { $clientContextParams = $args['api']->getClientContextParams(); - foreach($clientContextParams as $paramName => $paramDefinition) { + foreach ($clientContextParams as $paramName => $paramDefinition) { $definition = [ 'type' => 'value', 'valid' => [$paramDefinition['type']], @@ -1156,7 +1164,8 @@ private function _apply_client_context_params(array $args) } } - private static function isValidService($service) { + private static function isValidService($service) + { if (is_null($service)) { return false; } @@ -1164,12 +1173,13 @@ private static function isValidService($service) { return isset($services[$service]); } - private static function isValidApiVersion($service, $apiVersion) { + private static function isValidApiVersion($service, $apiVersion) + { if (is_null($apiVersion)) { return false; } return is_dir( - __DIR__ . "/data/{$service}/$apiVersion" + __DIR__ . "/data/{$service}/$apiVersion" ); } } diff --git a/src/ClientSideMonitoring/AbstractMonitoringMiddleware.php b/src/ClientSideMonitoring/AbstractMonitoringMiddleware.php index 130de6b525..ddcec9185c 100644 --- a/src/ClientSideMonitoring/AbstractMonitoringMiddleware.php +++ b/src/ClientSideMonitoring/AbstractMonitoringMiddleware.php @@ -14,8 +14,7 @@ /** * @internal */ -abstract class AbstractMonitoringMiddleware - implements MonitoringMiddlewareInterface +abstract class AbstractMonitoringMiddleware implements MonitoringMiddlewareInterface { private static $socket; @@ -286,4 +285,4 @@ private function unwrappedOptions() } return $this->options; } -} \ No newline at end of file +} diff --git a/src/ClientSideMonitoring/ApiCallAttemptMonitoringMiddleware.php b/src/ClientSideMonitoring/ApiCallAttemptMonitoringMiddleware.php index 91810bb9cf..24fbb4ebb0 100644 --- a/src/ClientSideMonitoring/ApiCallAttemptMonitoringMiddleware.php +++ b/src/ClientSideMonitoring/ApiCallAttemptMonitoringMiddleware.php @@ -15,7 +15,6 @@ */ class ApiCallAttemptMonitoringMiddleware extends AbstractMonitoringMiddleware { - /** * Standard middleware wrapper function with CSM options passed in. * @@ -160,7 +159,8 @@ private static function getResultHttpStatusCode(ResultInterface $result) return $result['@metadata']['statusCode']; } - private static function getAwsExceptionAttemptLatency(AwsException $e) { + private static function getAwsExceptionAttemptLatency(AwsException $e) + { $attempt = $e->getTransferInfo(); if (isset($attempt['total_time'])) { return (int) floor($attempt['total_time'] * 1000); @@ -168,15 +168,18 @@ private static function getAwsExceptionAttemptLatency(AwsException $e) { return null; } - private static function getAwsExceptionErrorCode(AwsException $e) { + private static function getAwsExceptionErrorCode(AwsException $e) + { return $e->getAwsErrorCode(); } - private static function getAwsExceptionMessage(AwsException $e) { + private static function getAwsExceptionMessage(AwsException $e) + { return $e->getAwsErrorMessage(); } - private static function getAwsExceptionDestinationIp(AwsException $e) { + private static function getAwsExceptionDestinationIp(AwsException $e) + { $attempt = $e->getTransferInfo(); if (isset($attempt['primary_ip'])) { return $attempt['primary_ip']; @@ -184,7 +187,8 @@ private static function getAwsExceptionDestinationIp(AwsException $e) { return null; } - private static function getAwsExceptionDnsLatency(AwsException $e) { + private static function getAwsExceptionDnsLatency(AwsException $e) + { $attempt = $e->getTransferInfo(); if (isset($attempt['namelookup_time'])) { return (int) floor($attempt['namelookup_time'] * 1000); @@ -192,7 +196,8 @@ private static function getAwsExceptionDnsLatency(AwsException $e) { return null; } - private static function getAwsExceptionHttpStatusCode(AwsException $e) { + private static function getAwsExceptionHttpStatusCode(AwsException $e) + { $response = $e->getResponse(); if ($response !== null) { return $response->getStatusCode(); @@ -200,7 +205,8 @@ private static function getAwsExceptionHttpStatusCode(AwsException $e) { return null; } - private static function getExceptionHttpStatusCode(\Exception $e) { + private static function getExceptionHttpStatusCode(\Exception $e) + { if ($e instanceof ResponseContainerInterface) { $response = $e->getResponse(); if ($response instanceof ResponseInterface) { @@ -210,14 +216,16 @@ private static function getExceptionHttpStatusCode(\Exception $e) { return null; } - private static function getExceptionCode(\Exception $e) { + private static function getExceptionCode(\Exception $e) + { if (!($e instanceof AwsException)) { return get_class($e); } return null; } - private static function getExceptionMessage(\Exception $e) { + private static function getExceptionMessage(\Exception $e) + { if (!($e instanceof AwsException)) { return $e->getMessage(); } diff --git a/src/ClientSideMonitoring/ApiCallMonitoringMiddleware.php b/src/ClientSideMonitoring/ApiCallMonitoringMiddleware.php index 0a5abdac3a..f77581ab23 100644 --- a/src/ClientSideMonitoring/ApiCallMonitoringMiddleware.php +++ b/src/ClientSideMonitoring/ApiCallMonitoringMiddleware.php @@ -13,7 +13,6 @@ */ class ApiCallMonitoringMiddleware extends AbstractMonitoringMiddleware { - /** * Api Call Attempt event keys for each Api Call event key * @@ -88,14 +87,16 @@ public static function getResponseData($klass) return $data + self::getFinalAttemptData($klass); } - private static function getResultAttemptCount(ResultInterface $result) { + private static function getResultAttemptCount(ResultInterface $result) + { if (isset($result['@metadata']['transferStats']['http'])) { return count($result['@metadata']['transferStats']['http']); } return 1; } - private static function getExceptionAttemptCount(\Exception $e) { + private static function getExceptionAttemptCount(\Exception $e) + { $attemptCount = 0; if ($e instanceof MonitoringEventsInterface) { foreach ($e->getMonitoringEvents() as $event) { @@ -104,7 +105,6 @@ private static function getExceptionAttemptCount(\Exception $e) { $attemptCount++; } } - } return $attemptCount; } diff --git a/src/ClientSideMonitoring/Configuration.php b/src/ClientSideMonitoring/Configuration.php index b875274b8b..b7e2c890a8 100644 --- a/src/ClientSideMonitoring/Configuration.php +++ b/src/ClientSideMonitoring/Configuration.php @@ -1,4 +1,5 @@ port = filter_var($port, FILTER_VALIDATE_INT); if ($this->port === false) { throw new \InvalidArgumentException( - "CSM 'port' value must be an integer!"); + "CSM 'port' value must be an integer!" + ); } // Unparsable $enabled flag errors on the side of disabling CSM @@ -74,4 +76,4 @@ public function toArray() 'port' => $this->getPort() ]; } -} \ No newline at end of file +} diff --git a/src/ClientSideMonitoring/ConfigurationInterface.php b/src/ClientSideMonitoring/ConfigurationInterface.php index 9a548279cb..751f365615 100644 --- a/src/ClientSideMonitoring/ConfigurationInterface.php +++ b/src/ClientSideMonitoring/ConfigurationInterface.php @@ -1,4 +1,5 @@ wait(); * */ -class ConfigurationProvider extends AbstractConfigurationProvider - implements ConfigurationProviderInterface +class ConfigurationProvider extends AbstractConfigurationProvider implements ConfigurationProviderInterface { const DEFAULT_CLIENT_ID = ''; const DEFAULT_ENABLED = false; @@ -113,8 +113,8 @@ public static function env() $enabled, getenv(self::ENV_HOST) ?: self::DEFAULT_HOST, getenv(self::ENV_PORT) ?: self::DEFAULT_PORT, - getenv(self:: ENV_CLIENT_ID) ?: self::DEFAULT_CLIENT_ID - ) + getenv(self::ENV_CLIENT_ID) ?: self::DEFAULT_CLIENT_ID + ) ); } @@ -131,7 +131,7 @@ public static function env() */ public static function fallback() { - return function() { + return function () { return Promise\Create::promiseFor( new Configuration( self::DEFAULT_ENABLED, diff --git a/src/ClientSideMonitoring/Exception/ConfigurationException.php b/src/ClientSideMonitoring/Exception/ConfigurationException.php index 827743e268..9d88b50b41 100644 --- a/src/ClientSideMonitoring/Exception/ConfigurationException.php +++ b/src/ClientSideMonitoring/Exception/ConfigurationException.php @@ -1,10 +1,10 @@ pkHandle = openssl_pkey_get_private("file://$privateKey", $passphrase); if (!$this->pkHandle) { $errorMessages = []; - while(($newMessage = openssl_error_string()) !== false){ + while (($newMessage = openssl_error_string()) !== false) { $errorMessages[] = $newMessage; } - throw new \InvalidArgumentException(implode("\n",$errorMessages)); + throw new \InvalidArgumentException(implode("\n", $errorMessages)); } } } diff --git a/src/CloudFront/UrlSigner.php b/src/CloudFront/UrlSigner.php index 3929c2f46b..c65f96068f 100644 --- a/src/CloudFront/UrlSigner.php +++ b/src/CloudFront/UrlSigner.php @@ -1,4 +1,5 @@ otherwise( - function () use ($next, $previousCreds) {return $next($previousCreds);} + function () use ($next, $previousCreds) { + return $next($previousCreds); + } ); } else { $promise = $promise->otherwise($next); @@ -230,7 +234,7 @@ public static function memoize(callable $provider) // Refresh the result and forward the promise. return $result = $provider($creds); }) - ->otherwise(function($reason) use (&$result) { + ->otherwise(function ($reason) use (&$result) { // Cleanup rejected promise. $result = null; return new Promise\RejectedPromise($reason); @@ -293,7 +297,7 @@ public static function env() $secret = getenv(self::ENV_SECRET); if ($key && $secret) { return Promise\Create::promiseFor( - new Credentials($key, $secret, getenv(self::ENV_SESSION) ?: NULL) + new Credentials($key, $secret, getenv(self::ENV_SESSION) ?: null) ); } @@ -321,9 +325,10 @@ public static function instanceProfile(array $config = []) * * @return callable */ - public static function sso($ssoProfileName = 'default', - $filename = null, - $config = [] + public static function sso( + $ssoProfileName = 'default', + $filename = null, + $config = [] ) { $filename = $filename ?: (self::getHomeDir() . '/.aws/config'); @@ -372,7 +377,6 @@ public static function sso($ssoProfileName = 'default', $config ); $expiration = $ssoCredentials['expiration']; - } else { if (empty($ssoProfile['sso_start_url']) || empty($ssoProfile['sso_region']) @@ -586,7 +590,8 @@ public static function ini($profile = null, $filename = null, array $config = [] if ($disableAssumeRole) { return self::reject( "Role assumption profiles are disabled. " - . "Failed to load profile " . $profile); + . "Failed to load profile " . $profile + ); } return self::loadRoleProfile( $data, @@ -666,8 +671,7 @@ public static function process($profile = null, $filename = null) } if (!isset($processData['AccessKeyId']) - || !isset($processData['SecretAccessKey'])) - { + || !isset($processData['SecretAccessKey'])) { return self::reject("credential_process does not return valid credentials"); } @@ -723,7 +727,8 @@ private static function loadRoleProfile( empty($roleProfile['source_profile']) == empty($roleProfile['credential_source']) ) { - return self::reject("Either source_profile or credential_source must be set " . + return self::reject( + "Either source_profile or credential_source must be set " . "using profile " . $profileName . ", but not both." ); } @@ -732,7 +737,8 @@ private static function loadRoleProfile( if (!empty($roleProfile['source_profile'])) { $sourceProfileName = $roleProfile['source_profile']; if (!isset($profiles[$sourceProfileName])) { - return self::reject("source_profile " . $sourceProfileName + return self::reject( + "source_profile " . $sourceProfileName . " using profile " . $profileName . " does not exist" ); } @@ -757,7 +763,7 @@ private static function loadRoleProfile( : 'us-east-1'; $config['preferStaticCredentials'] = true; $sourceCredentials = null; - if (!empty($roleProfile['source_profile'])){ + if (!empty($roleProfile['source_profile'])) { $sourceCredentials = call_user_func( CredentialProvider::ini($sourceProfileName, $filename, $config) )->wait(); @@ -830,7 +836,8 @@ private static function loadProfiles($filename) /** * Gets profiles from ~/.aws/credentials and ~/.aws/config ini files */ - private static function loadDefaultProfiles() { + private static function loadDefaultProfiles() + { $profiles = []; $credFile = self::getHomeDir() . '/.aws/credentials'; $configFile = self::getHomeDir() . '/.aws/config'; diff --git a/src/Credentials/Credentials.php b/src/Credentials/Credentials.php index 49af46310f..fcc501236f 100644 --- a/src/Credentials/Credentials.php +++ b/src/Credentials/Credentials.php @@ -1,4 +1,5 @@ expires = time() + $extension * 60; diff --git a/src/Credentials/CredentialsInterface.php b/src/Credentials/CredentialsInterface.php index 86fac9d324..c3ac6d94c6 100644 --- a/src/Credentials/CredentialsInterface.php +++ b/src/Credentials/CredentialsInterface.php @@ -1,4 +1,5 @@ client; $request = new Request('GET', self::getEcsUri()); - + $headers = $this->setHeaderForAuthToken(); return $client( $request, @@ -81,17 +82,19 @@ public function __invoke() ); }); } - + private function getEcsAuthToken() { return getenv(self::ENV_AUTH_TOKEN); } - public function setHeaderForAuthToken(){ + public function setHeaderForAuthToken() + { $authToken = self::getEcsAuthToken(); $headers = []; - if(!empty($authToken)) + if (!empty($authToken)) { $headers = ['Authorization' => $authToken]; + } return $headers; } @@ -109,16 +112,17 @@ private function getEcsUri() $credsUri = isset($_SERVER[self::ENV_URI]) ? $_SERVER[self::ENV_URI] : ''; } - if(empty($credsUri)){ + if (empty($credsUri)) { $credFullUri = getenv(self::ENV_FULL_URI); - if($credFullUri === false){ + if ($credFullUri === false) { $credFullUri = isset($_SERVER[self::ENV_FULL_URI]) ? $_SERVER[self::ENV_FULL_URI] : ''; } - if(!empty($credFullUri)) + if (!empty($credFullUri)) { return $credFullUri; + } } - + return self::SERVER_URI . $credsUri; } diff --git a/src/Credentials/InstanceProfileProvider.php b/src/Credentials/InstanceProfileProvider.php index 0f1fcb126d..e9cf2d7709 100644 --- a/src/Credentials/InstanceProfileProvider.php +++ b/src/Credentials/InstanceProfileProvider.php @@ -1,4 +1,5 @@ attempts = 0; return Promise\Coroutine::of(function () use ($previousCredentials) { - // Retrieve token or switch out of secure mode $token = null; while ($this->secureMode && is_null($token)) { @@ -87,8 +87,7 @@ public function __invoke($previousCredentials = null) && $previousCredentials instanceof Credentials ) { goto generateCredentials; - } - else if (!method_exists($e, 'getResponse') + } elseif (!method_exists($e, 'getResponse') || empty($e->getResponse()) || !in_array( $e->getResponse()->getStatusCode(), @@ -169,7 +168,7 @@ public function __invoke($previousCredentials = null) && $previousCredentials instanceof Credentials ) { goto generateCredentials; - } else if (!empty($this->getExceptionStatusCode($e)) + } elseif (!empty($this->getExceptionStatusCode($e)) && $this->getExceptionStatusCode($e) === 401 ) { $this->secureMode = true; diff --git a/src/Crypto/AbstractCryptoClient.php b/src/Crypto/AbstractCryptoClient.php index 823467b781..caf0c911be 100644 --- a/src/Crypto/AbstractCryptoClient.php +++ b/src/Crypto/AbstractCryptoClient.php @@ -1,4 +1,5 @@ strlen($this->buffer)) { $this->buffer .= $this->decryptBlock( (int) ( - self::BLOCK_SIZE * ceil(($length - strlen($this->buffer)) / self::BLOCK_SIZE) + self::BLOCK_SIZE * ceil(($length - strlen($this->buffer)) / self::BLOCK_SIZE) ) ); } diff --git a/src/Crypto/AesEncryptingStream.php b/src/Crypto/AesEncryptingStream.php index 3b7c446754..89fcbe7d13 100644 --- a/src/Crypto/AesEncryptingStream.php +++ b/src/Crypto/AesEncryptingStream.php @@ -1,8 +1,9 @@ plaintext = $plaintext; $this->key = $key; $this->initializationVector = $initializationVector; diff --git a/src/Crypto/AesStreamInterface.php b/src/Crypto/AesStreamInterface.php index ce7b85d7e0..f2733a0bed 100644 --- a/src/Crypto/AesStreamInterface.php +++ b/src/Crypto/AesStreamInterface.php @@ -1,4 +1,5 @@ getTagFromCiphertextStream( - $cipherTextStream, - $cipherOptions['TagLength'] - ); + $cipherTextStream, + $cipherOptions['TagLength'] + ); return new AesGcmDecryptingStream( $this->getStrippedCiphertextStream( diff --git a/src/Crypto/DecryptionTraitV2.php b/src/Crypto/DecryptionTraitV2.php index ed63e0befa..f4f7216453 100644 --- a/src/Crypto/DecryptionTraitV2.php +++ b/src/Crypto/DecryptionTraitV2.php @@ -1,4 +1,5 @@ getTagFromCiphertextStream( - $cipherTextStream, - $cipherOptions['TagLength'] - ); + $cipherTextStream, + $cipherOptions['TagLength'] + ); return new AesGcmDecryptingStream( $this->getStrippedCiphertextStream( diff --git a/src/Crypto/EncryptionTrait.php b/src/Crypto/EncryptionTrait.php index 37ae59ccbb..104ad30843 100644 --- a/src/Crypto/EncryptionTrait.php +++ b/src/Crypto/EncryptionTrait.php @@ -1,4 +1,5 @@ count(); } - $i = 0; $j = $offset; + $i = 0; + $j = $offset; while ($i < $length && $j < $this->count()) { $this[$j] = $input[$i]; ++$i; diff --git a/src/Crypto/Polyfill/Gmac.php b/src/Crypto/Polyfill/Gmac.php index 535cfcaa09..48e89f7972 100644 --- a/src/Crypto/Polyfill/Gmac.php +++ b/src/Crypto/Polyfill/Gmac.php @@ -1,4 +1,5 @@ $settingName)) { if (isset($settingValue['override'])) { $this->$settingName = $settingValue['override']; - } else if (isset($settingValue['multiply'])) { + } elseif (isset($settingValue['multiply'])) { $this->$settingName *= $settingValue['multiply']; - } else if (isset($settingValue['add'])) { + } elseif (isset($settingValue['add'])) { $this->$settingName += $settingValue['add']; } } else { @@ -127,5 +128,4 @@ public function toArray() 'http_request_timeout_in_milliseconds' => $this->getHttpRequestTimeoutInMillis(), ]; } - } diff --git a/src/DefaultsMode/ConfigurationInterface.php b/src/DefaultsMode/ConfigurationInterface.php index 34c5a63f9d..dba5704bdf 100644 --- a/src/DefaultsMode/ConfigurationInterface.php +++ b/src/DefaultsMode/ConfigurationInterface.php @@ -1,4 +1,5 @@ wait(); * */ -class ConfigurationProvider extends AbstractConfigurationProvider - implements ConfigurationProviderInterface +class ConfigurationProvider extends AbstractConfigurationProvider implements ConfigurationProviderInterface { const DEFAULT_MODE = 'legacy'; const ENV_MODE = 'AWS_DEFAULTS_MODE'; @@ -124,7 +124,7 @@ public static function fallback() { return function () { return Promise\Create::promiseFor( - new Configuration( self::DEFAULT_MODE) + new Configuration(self::DEFAULT_MODE) ); }; } diff --git a/src/DefaultsMode/Exception/ConfigurationException.php b/src/DefaultsMode/Exception/ConfigurationException.php index b7186a5b8f..763766b8e2 100644 --- a/src/DefaultsMode/Exception/ConfigurationException.php +++ b/src/DefaultsMode/Exception/ConfigurationException.php @@ -1,4 +1,5 @@ $v) { $data->$k = $this->unmarshalValue($v, $mapAsObject); } return $data; } // NOBREAK: Unmarshal M the same way as L, for arrays. + // no break case 'L': foreach ($value as $k => $v) { $value[$k] = $this->unmarshalValue($v, $mapAsObject); diff --git a/src/DynamoDb/NumberValue.php b/src/DynamoDb/NumberValue.php index 4189d0d947..12457fe33f 100644 --- a/src/DynamoDb/NumberValue.php +++ b/src/DynamoDb/NumberValue.php @@ -1,4 +1,5 @@ ThisIsATest * and it uses it in order to set the values. - * + * * @param array $config */ - public function initConfig( array $config = [] ) + public function initConfig(array $config = []) { - if (!empty($config)) - { - foreach ($config as $key => $value) - { + if (!empty($config)) { + foreach ($config as $key => $value) { $method = 'set' . str_replace('_', '', ucwords($key, '_')); - if(method_exists($this,$method)) - { + if (method_exists($this, $method)) { call_user_func_array(array($this, $method), array($value)); } } } // It applies the default PHP session lifetime, if no session lifetime config is provided - if(!isset($config['session_lifetime'])) - { + if (!isset($config['session_lifetime'])) { $this->setSessionLifetime((int) ini_get('session.gc_maxlifetime')); } } diff --git a/src/DynamoDb/SessionConnectionInterface.php b/src/DynamoDb/SessionConnectionInterface.php index 0c46a7d1af..80e9618a81 100644 --- a/src/DynamoDb/SessionConnectionInterface.php +++ b/src/DynamoDb/SessionConnectionInterface.php @@ -1,4 +1,5 @@ getDataAttribute()] = ['Value' => ['S' => $data]]; } - } else { $attributes[$this->getDataAttribute()] = ['Action' => 'DELETE']; } diff --git a/src/DynamoDb/WriteRequestBatch.php b/src/DynamoDb/WriteRequestBatch.php index c5e5eaf324..fffab0ea1f 100644 --- a/src/DynamoDb/WriteRequestBatch.php +++ b/src/DynamoDb/WriteRequestBatch.php @@ -1,4 +1,5 @@ data['dnsSuffix']; return [ 'endpoint' => "{$scheme}://" . $this->formatEndpoint( - $template, - $service, - $region, - $dnsSuffix - ), + $template, + $service, + $region, + $dnsSuffix + ), 'signatureVersion' => $this->getSignatureVersion($data), 'signingRegion' => isset($data['credentialScope']['region']) ? $data['credentialScope']['region'] @@ -228,7 +229,8 @@ private function isStsLegacyEndpointUsed($service, $region, $options) { return $service === 'sts' && in_array($region, $this->stsLegacyGlobalRegions) - && (empty($options['sts_regional_endpoints']) + && ( + empty($options['sts_regional_endpoints']) || ConfigurationProvider::unwrap( $options['sts_regional_endpoints'] )->getEndpointsType() !== 'regional' @@ -248,7 +250,8 @@ private function isS3LegacyEndpointUsed($service, $region, $options) { return $service === 's3' && $region === 'us-east-1' - && (empty($options['s3_us_east_1_regional_endpoint']) + && ( + empty($options['s3_us_east_1_regional_endpoint']) || S3ConfigurationProvider::unwrap( $options['s3_us_east_1_regional_endpoint'] )->getEndpointsType() !== 'regional' diff --git a/src/Endpoint/PartitionEndpointProvider.php b/src/Endpoint/PartitionEndpointProvider.php index 21ca2c8381..4ad2048fa7 100644 --- a/src/Endpoint/PartitionEndpointProvider.php +++ b/src/Endpoint/PartitionEndpointProvider.php @@ -1,4 +1,5 @@ useDualstackEndpoint == true && (strpos($region, "iso-") !== false || strpos($region, "-iso") !== false) ) { - throw new ConfigurationException("Dual-stack is not supported in ISO regions"); } + throw new ConfigurationException("Dual-stack is not supported in ISO regions"); + } } /** diff --git a/src/Endpoint/UseDualstackEndpoint/ConfigurationInterface.php b/src/Endpoint/UseDualstackEndpoint/ConfigurationInterface.php index e1c7d5e86f..736dd9df19 100644 --- a/src/Endpoint/UseDualstackEndpoint/ConfigurationInterface.php +++ b/src/Endpoint/UseDualstackEndpoint/ConfigurationInterface.php @@ -1,4 +1,5 @@ wait(); * */ -class ConfigurationProvider extends AbstractConfigurationProvider - implements ConfigurationProviderInterface +class ConfigurationProvider extends AbstractConfigurationProvider implements ConfigurationProviderInterface { const ENV_USE_DUAL_STACK_ENDPOINT = 'AWS_USE_DUALSTACK_ENDPOINT'; const INI_USE_DUAL_STACK_ENDPOINT = 'use_dualstack_endpoint'; diff --git a/src/Endpoint/UseDualstackEndpoint/Exception/ConfigurationException.php b/src/Endpoint/UseDualstackEndpoint/Exception/ConfigurationException.php index 796adc9459..c1fd1ddf09 100644 --- a/src/Endpoint/UseDualstackEndpoint/Exception/ConfigurationException.php +++ b/src/Endpoint/UseDualstackEndpoint/Exception/ConfigurationException.php @@ -1,4 +1,5 @@ wait(); * */ -class ConfigurationProvider extends AbstractConfigurationProvider - implements ConfigurationProviderInterface +class ConfigurationProvider extends AbstractConfigurationProvider implements ConfigurationProviderInterface { const ENV_USE_FIPS_ENDPOINT = 'AWS_USE_FIPS_ENDPOINT'; const INI_USE_FIPS_ENDPOINT = 'use_fips_endpoint'; @@ -168,7 +168,7 @@ public static function fallback($region) return function () use ($region) { $isFipsPseudoRegion = strpos($region, 'fips-') !== false || strpos($region, '-fips') !== false; - if ($isFipsPseudoRegion){ + if ($isFipsPseudoRegion) { $configuration = new Configuration(true); } else { $configuration = new Configuration(false); diff --git a/src/Endpoint/UseFipsEndpoint/Exception/ConfigurationException.php b/src/Endpoint/UseFipsEndpoint/Exception/ConfigurationException.php index 468aa650a5..c8d09d87d8 100644 --- a/src/Endpoint/UseFipsEndpoint/Exception/ConfigurationException.php +++ b/src/Endpoint/UseFipsEndpoint/Exception/ConfigurationException.php @@ -1,4 +1,5 @@ wait(); * */ -class ConfigurationProvider extends AbstractConfigurationProvider - implements ConfigurationProviderInterface +class ConfigurationProvider extends AbstractConfigurationProvider implements ConfigurationProviderInterface { const DEFAULT_ENABLED = false; const DEFAULT_CACHE_LIMIT = 1000; diff --git a/src/EndpointDiscovery/EndpointDiscoveryMiddleware.php b/src/EndpointDiscovery/EndpointDiscoveryMiddleware.php index 30f18200e1..05ec92377f 100644 --- a/src/EndpointDiscovery/EndpointDiscoveryMiddleware.php +++ b/src/EndpointDiscovery/EndpointDiscoveryMiddleware.php @@ -1,4 +1,5 @@ nextHandler; $endpointList = self::$cache->get($cacheKey); if ($endpointList instanceof EndpointList) { - // Remove invalid endpoint from cached list $endpointList->remove($endpoint); @@ -319,13 +319,11 @@ private function handleInvalidEndpoint( $newEndpoint = $endpointList->getEndpoint(); } if (empty($newEndpoint)) { - // If no more cached endpoints, make discovery call // if none made within cooldown for given key if (time() - $this->discoveryTimes[$cacheKey] < self::$discoveryCooldown ) { - // If no more cached endpoints and it's required, // fail with original exception if ($isRequired) { @@ -393,7 +391,7 @@ private function parseEndpoint($endpoint) $split = explode('/', $parsed['path'], 2); $parsed['host'] = $split[0]; if (isset($split[1])) { - if (substr($split[1], 0 , 1) !== '/') { + if (substr($split[1], 0, 1) !== '/') { $split[1] = '/' . $split[1]; } $parsed['path'] = $split[1]; diff --git a/src/EndpointDiscovery/EndpointList.php b/src/EndpointDiscovery/EndpointList.php index 80ccc4729d..a7c6240ffe 100644 --- a/src/EndpointDiscovery/EndpointList.php +++ b/src/EndpointDiscovery/EndpointList.php @@ -1,4 +1,5 @@ $parameter) { diff --git a/src/EndpointV2/EndpointDefinitionProvider.php b/src/EndpointV2/EndpointDefinitionProvider.php index aee14b5eee..8154ad88a0 100644 --- a/src/EndpointV2/EndpointDefinitionProvider.php +++ b/src/EndpointV2/EndpointDefinitionProvider.php @@ -24,7 +24,7 @@ public static function getPartitions() $file = '/partitions.json'; if (file_exists($basePath . $file . '.php')) { - return require($basePath . $file . '.php'); + return require($basePath . $file . '.php'); } else { return json_decode(file_get_contents($basePath . $file)); } @@ -64,4 +64,4 @@ private static function getLatest($service) $manifest = \Aws\manifest(); return $manifest[$service]['versions']['latest']; } -} \ No newline at end of file +} diff --git a/src/EndpointV2/EndpointV2SerializerTrait.php b/src/EndpointV2/EndpointV2SerializerTrait.php index 922ec189ec..4eaf57fb5d 100644 --- a/src/EndpointV2/EndpointV2SerializerTrait.php +++ b/src/EndpointV2/EndpointV2SerializerTrait.php @@ -30,8 +30,7 @@ private function setRequestOptions( $commandArgs, $clientArgs, &$headers - ) - { + ) { $providerArgs = $this->resolveProviderArgs( $endpointProvider, $operation, @@ -52,8 +51,7 @@ private function resolveProviderArgs( $operation, $commandArgs, $clientArgs - ) - { + ) { $rulesetParams = $endpointProvider->getRuleset()->getParameters(); $endpointCommandArgs = $this->filterEndpointCommandArgs( $rulesetParams, @@ -63,7 +61,8 @@ private function resolveProviderArgs( $operation->getStaticContextParams() ); $contextParams = $this->bindContextParams( - $commandArgs, $operation->getContextParams() + $commandArgs, + $operation->getContextParams() ); $providerArgs = $this->normalizeEndpointProviderArgs( $endpointCommandArgs, @@ -88,8 +87,7 @@ private function normalizeEndpointProviderArgs( $clientArgs, $contextParams, $staticContextParams - ) - { + ) { $commandContextParams = array_merge($contextParams, $staticContextParams); $combinedEndpointArgs = array_merge($clientArgs, $commandContextParams); @@ -100,7 +98,7 @@ private function bindContextParams($commandArgs, $contextParams) { $scopedParams = []; - foreach($contextParams as $name => $spec) { + foreach ($contextParams as $name => $spec) { if (isset($commandArgs[$spec['shape']])) { $scopedParams[$name] = $commandArgs[$spec['shape']]; } @@ -112,7 +110,7 @@ private function bindStaticContextParams($staticContextParams) { $scopedParams = []; - forEach($staticContextParams as $paramName => $paramValue) { + foreach ($staticContextParams as $paramName => $paramValue) { $scopedParams[$paramName] = $paramValue['value']; } return $scopedParams; @@ -121,8 +119,7 @@ private function bindStaticContextParams($staticContextParams) private function filterEndpointCommandArgs( $rulesetParams, $commandArgs - ) - { + ) { $endpointMiddlewareOpts = [ '@use_dual_stack_endpoint' => 'UseDualStack', '@use_accelerate_endpoint' => 'Accelerate', @@ -131,7 +128,7 @@ private function filterEndpointCommandArgs( $filteredArgs = []; - foreach($rulesetParams as $name => $value) { + foreach ($rulesetParams as $name => $value) { if (isset($commandArgs[$name])) { if (!empty($value->getBuiltIn())) { continue; @@ -141,7 +138,7 @@ private function filterEndpointCommandArgs( } if ($this->api->getServiceName() === 's3') { - foreach($endpointMiddlewareOpts as $optionName => $newValue) { + foreach ($endpointMiddlewareOpts as $optionName => $newValue) { if (isset($commandArgs[$optionName])) { $filteredArgs[$newValue] = $commandArgs[$optionName]; } @@ -154,10 +151,10 @@ private function filterEndpointCommandArgs( private function applyHeaders($endpoint, &$headers) { if (!is_null($endpoint->getHeaders())) { - $headers = array_merge( - $headers, - $endpoint->getHeaders() - ); + $headers = array_merge( + $headers, + $endpoint->getHeaders() + ); } } @@ -176,7 +173,7 @@ private function selectAuthScheme($authSchemes) $validAuthSchemes = ['sigv4', 'sigv4a', 'none', 'bearer']; $invalidAuthSchemes = []; - foreach($authSchemes as $authScheme) { + foreach ($authSchemes as $authScheme) { if (in_array($authScheme['name'], $validAuthSchemes)) { return $this->normalizeAuthScheme($authScheme); } else { @@ -194,11 +191,11 @@ private function selectAuthScheme($authSchemes) private function normalizeAuthScheme($authScheme) { - /* - sigv4a will contain a regionSet property. which is guaranteed to be `*` - for now. The SigV4 class handles this automatically for now. It seems - complexity will be added here in the future. - */ + /* + sigv4a will contain a regionSet property. which is guaranteed to be `*` + for now. The SigV4 class handles this automatically for now. It seems + complexity will be added here in the future. + */ $normalizedAuthScheme = []; if (isset($authScheme['disableDoubleEncoding']) @@ -208,10 +205,11 @@ private function normalizeAuthScheme($authScheme) $normalizedAuthScheme['version'] = 's3v4'; } elseif ($authScheme['name'] === 'none') { $normalizedAuthScheme['version'] = 'anonymous'; - } - else { + } else { $normalizedAuthScheme['version'] = str_replace( - 'sig', '', $authScheme['name'] + 'sig', + '', + $authScheme['name'] ); } diff --git a/src/EndpointV2/Rule/AbstractRule.php b/src/EndpointV2/Rule/AbstractRule.php index 94da12d01b..d446fd53d8 100644 --- a/src/EndpointV2/Rule/AbstractRule.php +++ b/src/EndpointV2/Rule/AbstractRule.php @@ -8,7 +8,7 @@ * A rule within a rule set. All rules contain a conditions property, * which can be empty, and documentation about the rule. */ -abstract Class AbstractRule +abstract class AbstractRule { private $conditions; private $documentation; @@ -44,9 +44,8 @@ public function getDocumentation() protected function evaluateConditions( array &$inputParameters, RulesetStandardLibrary $standardLibrary - ) - { - foreach($this->getConditions() as $condition) { + ) { + foreach ($this->getConditions() as $condition) { $result = $standardLibrary->callFunction($condition, $inputParameters); if (is_null($result) || $result === false) { return false; diff --git a/src/EndpointV2/Rule/EndpointRule.php b/src/EndpointV2/Rule/EndpointRule.php index b6b276d70c..ab3977111a 100644 --- a/src/EndpointV2/Rule/EndpointRule.php +++ b/src/EndpointV2/Rule/EndpointRule.php @@ -5,7 +5,7 @@ use Aws\EndpointV2\Ruleset\RulesetStandardLibrary; use Aws\EndpointV2\Ruleset\RulesetEndpoint; -Class EndpointRule extends AbstractRule +class EndpointRule extends AbstractRule { /** @var array */ private $endpoint; @@ -46,8 +46,7 @@ public function evaluate(array $inputParameters, RulesetStandardLibrary $standar private function resolve( array $inputParameters, RulesetStandardLibrary $standardLibrary - ) - { + ) { $uri = $standardLibrary->resolveValue($this->endpoint['url'], $inputParameters); $properties = isset($this->endpoint['properties']) ? $this->resolveProperties($this->endpoint['properties'], $inputParameters, $standardLibrary) @@ -67,14 +66,13 @@ private function resolveProperties( $properties, array $inputParameters, RulesetStandardLibrary $standardLibrary - ) - { + ) { if (is_array($properties)) { - $propertiesArr = []; - foreach($properties as $key => $val) { - $propertiesArr[$key] = $this->resolveProperties($val, $inputParameters, $standardLibrary); - } - return $propertiesArr; + $propertiesArr = []; + foreach ($properties as $key => $val) { + $propertiesArr[$key] = $this->resolveProperties($val, $inputParameters, $standardLibrary); + } + return $propertiesArr; } elseif ($standardLibrary->isTemplate($properties)) { return $standardLibrary->resolveTemplateString($properties, $inputParameters); } @@ -90,17 +88,16 @@ private function resolveProperties( private function resolveHeaders( array $inputParameters, RulesetStandardLibrary $standardLibrary - ) - { + ) { $headers = isset($this->endpoint['headers']) ? $this->endpoint['headers'] : null; if (is_null($headers)) { return null; } $resolvedHeaders = []; - foreach($headers as $headerName => $headerValues) { + foreach ($headers as $headerName => $headerValues) { $resolvedValues = []; - foreach($headerValues as $value) { + foreach ($headerValues as $value) { $resolvedValue = $standardLibrary->resolveValue($value, $inputParameters, $standardLibrary); $resolvedValues[] = $resolvedValue; } diff --git a/src/EndpointV2/Rule/ErrorRule.php b/src/EndpointV2/Rule/ErrorRule.php index 941624a124..503e2fc551 100644 --- a/src/EndpointV2/Rule/ErrorRule.php +++ b/src/EndpointV2/Rule/ErrorRule.php @@ -34,8 +34,7 @@ public function getError() public function evaluate( array $inputParameters, RulesetStandardLibrary $standardLibrary - ) - { + ) { if ($this->evaluateConditions($inputParameters, $standardLibrary)) { $message = $standardLibrary->resolveValue($this->error, $inputParameters); throw new UnresolvedEndpointException($message); diff --git a/src/EndpointV2/Rule/RuleCreator.php b/src/EndpointV2/Rule/RuleCreator.php index 279477e814..4fc96ca159 100644 --- a/src/EndpointV2/Rule/RuleCreator.php +++ b/src/EndpointV2/Rule/RuleCreator.php @@ -23,4 +23,3 @@ public static function create($type, $definition) } } } - diff --git a/src/EndpointV2/Rule/TreeRule.php b/src/EndpointV2/Rule/TreeRule.php index aa98180394..aaeec08028 100644 --- a/src/EndpointV2/Rule/TreeRule.php +++ b/src/EndpointV2/Rule/TreeRule.php @@ -34,10 +34,9 @@ public function getRules() public function evaluate( array $inputParameters, RulesetStandardLibrary $standardLibrary - ) - { + ) { if ($this->evaluateConditions($inputParameters, $standardLibrary)) { - foreach($this->rules as $rule) { + foreach ($this->rules as $rule) { $inputParametersCopy = $inputParameters; $evaluation = $rule->evaluate($inputParametersCopy, $standardLibrary); if ($evaluation !== false) { @@ -52,7 +51,7 @@ private function createRules(array $rules) { $rulesList = []; - forEach($rules as $rule) { + foreach ($rules as $rule) { $ruleType = RuleCreator::create($rule['type'], $rule); $rulesList[] = $ruleType; } diff --git a/src/EndpointV2/Ruleset/Ruleset.php b/src/EndpointV2/Ruleset/Ruleset.php index aa4d26e07f..a4ea1255b4 100644 --- a/src/EndpointV2/Ruleset/Ruleset.php +++ b/src/EndpointV2/Ruleset/Ruleset.php @@ -8,7 +8,7 @@ * A collection of rules, parameter definitions and a class of helper functions * used to resolve either an endpoint or an error. */ -Class Ruleset +class Ruleset { /** @var string */ private $version; @@ -64,7 +64,7 @@ public function evaluate(array $inputParameters) { $this->validateInputParameters($inputParameters); - foreach($this->rules as $rule) { + foreach ($this->rules as $rule) { $evaluation = $rule->evaluate($inputParameters, $this->standardLibrary); if ($evaluation !== false) { return $evaluation; @@ -81,7 +81,7 @@ public function evaluate(array $inputParameters) */ private function validateInputParameters(array &$inputParameters) { - foreach($this->parameters as $paramName => $param) { + foreach ($this->parameters as $paramName => $param) { $inputParam = isset($inputParameters[$paramName]) ? $inputParameters[$paramName] : null; if (is_null($inputParam) && !is_null($param->getDefault())) { @@ -96,7 +96,7 @@ private function createParameters(array $parameters) { $parameterList = []; - foreach($parameters as $name => $definition) { + foreach ($parameters as $name => $definition) { $parameterList[$name] = new RulesetParameter($name, $definition); } @@ -107,11 +107,10 @@ private function createRules(array $rules) { $rulesList = []; - forEach($rules as $rule) { + foreach ($rules as $rule) { $ruleObj = RuleCreator::create($rule['type'], $rule); $rulesList[] = $ruleObj; } return $rulesList; } } - diff --git a/src/EndpointV2/Ruleset/RulesetParameter.php b/src/EndpointV2/Ruleset/RulesetParameter.php index b7cd107616..4549b71839 100644 --- a/src/EndpointV2/Ruleset/RulesetParameter.php +++ b/src/EndpointV2/Ruleset/RulesetParameter.php @@ -133,9 +133,13 @@ public function validateInputParam($inputParam) $msg = isset($deprecated['message']) ? $deprecated['message'] : null; $since = isset($deprecated['since']) ? $deprecated['since'] : null; - if (!is_null($since)) $deprecationString = $deprecationString - . 'since '. $since . '. '; - if (!is_null($msg)) $deprecationString = $deprecationString . $msg; + if (!is_null($since)) { + $deprecationString = $deprecationString + . 'since '. $since . '. '; + } + if (!is_null($msg)) { + $deprecationString = $deprecationString . $msg; + } trigger_error($deprecationString, E_USER_WARNING); } diff --git a/src/EndpointV2/Ruleset/RulesetStandardLibrary.php b/src/EndpointV2/Ruleset/RulesetStandardLibrary.php index 495a1368ed..248ae0ba5b 100644 --- a/src/EndpointV2/Ruleset/RulesetStandardLibrary.php +++ b/src/EndpointV2/Ruleset/RulesetStandardLibrary.php @@ -69,8 +69,8 @@ public function getAttr($from, $path) return null; } $slice = intval(substr($part, $sliceIdx + 1, strlen($part) - 1)); - $from = isset($from[substr($part,0, $sliceIdx)][$slice]) - ? $from[substr($part,0, $sliceIdx)][$slice] + $from = isset($from[substr($part, 0, $sliceIdx)][$slice]) + ? $from[substr($part, 0, $sliceIdx)][$slice] : null; } else { $from = $from[$part]; @@ -220,7 +220,7 @@ public function isValidHostLabel($hostLabel, $allowSubDomains) public function parseArn($arnString) { if (is_null($arnString) - || substr( $arnString, 0, 3 ) !== "arn" + || substr($arnString, 0, 3) !== "arn" ) { return null; } @@ -293,7 +293,7 @@ public function isVirtualHostableS3Bucket($bucketName, $allowSubdomains) if ($allowSubdomains) { $labels = explode('.', $bucketName); $results = []; - forEach($labels as $label) { + foreach ($labels as $label) { $results[] = $this->isVirtualHostableS3Bucket($label, false); } return !in_array(false, $results); @@ -305,7 +305,7 @@ public function callFunction($funcCondition, &$inputParameters) { $funcArgs = []; - forEach($funcCondition['argv'] as $arg) { + foreach ($funcCondition['argv'] as $arg) { $funcArgs[] = $this->resolveValue($arg, $inputParameters); } @@ -321,7 +321,7 @@ public function callFunction($funcCondition, &$inputParameters) if (isset($funcCondition['assign'])) { $assign = $funcCondition['assign']; - if (isset($inputParameters[$assign])){ + if (isset($inputParameters[$assign])) { throw new UnresolvedEndpointException( "Assignment `{$assign}` already exists in input parameters" . " or has already been assigned by an endpoint rule and cannot be overwritten." @@ -376,7 +376,7 @@ function ($match) use ($inputParameters) { $parts = explode("#", $match[1]); if (count($parts) > 1) { $resolvedValue = $inputParameters; - foreach($parts as $part) { + foreach ($parts as $part) { if (!isset($resolvedValue[$part])) { throw new UnresolvedEndpointException($notFoundMessage); } @@ -394,7 +394,7 @@ function ($match) use ($inputParameters) { ); } - private function validateHostLabel ($hostLabel) + private function validateHostLabel($hostLabel) { if (empty($hostLabel) || strlen($hostLabel) > 63) { return false; @@ -411,7 +411,7 @@ private function isValidIp($hostName) && strrpos($hostName, ']') === strlen($hostName) - 1; return preg_match( - self::IPV4_RE, + self::IPV4_RE, $hostName ) //IPV6 enclosed in brackets diff --git a/src/EventBridge/EventBridgeClient.php b/src/EventBridge/EventBridgeClient.php index 0090814894..38800d01e8 100644 --- a/src/EventBridge/EventBridgeClient.php +++ b/src/EventBridge/EventBridgeClient.php @@ -1,4 +1,5 @@ isCustomEndpoint = $isCustomEndpoint; } - public function __invoke(CommandInterface $cmd, RequestInterface $req) { + public function __invoke(CommandInterface $cmd, RequestInterface $req) + { $sigV4aCommands = ['PutEvents']; if (in_array($cmd->getName(), $sigV4aCommands)) { if (isset($cmd['EndpointId'])) { diff --git a/src/EventBridge/Exception/EventBridgeException.php b/src/EventBridge/Exception/EventBridgeException.php index 0ddebafe90..d07c3713b1 100644 --- a/src/EventBridge/Exception/EventBridgeException.php +++ b/src/EventBridge/Exception/EventBridgeException.php @@ -1,4 +1,5 @@ withHeader( 'x-amz-sha256-tree-hash', @@ -158,7 +160,8 @@ function ($result) use (&$request) { // Add a linear content hash if not provided. if (!$command['ContentSHA256']) { $body = new HashingStream( - $body, new PhpHash('sha256'), + $body, + new PhpHash('sha256'), function ($result) use ($command) { $command['ContentSHA256'] = bin2hex($result); } diff --git a/src/Glacier/MultipartUploader.php b/src/Glacier/MultipartUploader.php index b282fc311f..57604268af 100644 --- a/src/Glacier/MultipartUploader.php +++ b/src/Glacier/MultipartUploader.php @@ -1,4 +1,5 @@ decorateWithHashes($body, $data); - while (!$decoratedBody->eof()) $decoratedBody->read(1048576); + while (!$decoratedBody->eof()) { + $decoratedBody->read(1048576); + } // Seek the original source forward to the end of the range. $this->source->seek($this->source->tell() + $body->getSize()); } else { @@ -241,14 +244,18 @@ protected function getCompleteParams() private function decorateWithHashes(Stream $stream, array &$data) { // Make sure that a tree hash is calculated. - $stream = new HashingStream($stream, new TreeHash(), + $stream = new HashingStream( + $stream, + new TreeHash(), function ($result) use (&$data) { $data['checksum'] = bin2hex($result); } ); // Make sure that a linear SHA256 hash is calculated. - $stream = new HashingStream($stream, new PhpHash('sha256'), + $stream = new HashingStream( + $stream, + new PhpHash('sha256'), function ($result) use (&$data) { $data['ContentSHA256'] = bin2hex($result); } diff --git a/src/Glacier/TreeHash.php b/src/Glacier/TreeHash.php index 9289725e7f..9879af92d1 100644 --- a/src/Glacier/TreeHash.php +++ b/src/Glacier/TreeHash.php @@ -1,4 +1,5 @@ mandatoryAttributeList = $mandatoryAttributeList; } - public function __invoke(CommandInterface $cmd) { + public function __invoke(CommandInterface $cmd) + { $nextHandler = $this->nextHandler; $op = $this->service->getOperation($cmd->getName())->toArray(); if (!empty($op['input']['shape'])) { @@ -58,7 +60,7 @@ public function __invoke(CommandInterface $cmd) { if (!empty($input['required'])) { foreach ($input['required'] as $key => $member) { if (in_array($member, $this->mandatoryAttributeList)) { - $argument = is_string($cmd[$member]) ? trim($cmd[$member]) : $cmd[$member]; + $argument = is_string($cmd[$member]) ? trim($cmd[$member]) : $cmd[$member]; if ($argument === '' || $argument === null) { $commandName = $cmd->getName(); throw new \InvalidArgumentException( @@ -72,5 +74,4 @@ public function __invoke(CommandInterface $cmd) { } return $nextHandler($cmd); } - } diff --git a/src/Inspector/Exception/InspectorException.php b/src/Inspector/Exception/InspectorException.php index 4a17feb7d4..b613ad0a10 100644 --- a/src/Inspector/Exception/InspectorException.php +++ b/src/Inspector/Exception/InspectorException.php @@ -1,4 +1,5 @@ then( - function (TokenInterface $token) - use ($handler, $command, $signer, $request) { + function (TokenInterface $token) use ($handler, $command, $signer, $request) { return $handler( $command, $signer->authorizeRequest($request, $token) @@ -145,8 +144,7 @@ function (TokenInterface $token) ); } else { return $credProvider()->then( - function (CredentialsInterface $creds) - use ($handler, $command, $signer, $request) { + function (CredentialsInterface $creds) use ($handler, $command, $signer, $request) { return $handler( $command, $signer->signRequest($request, $creds) @@ -227,7 +225,7 @@ public static function invocationId() return function ( CommandInterface $command, RequestInterface $request - ) use ($handler){ + ) use ($handler) { return $handler($command, $request->withHeader( 'aws-sdk-invocation-id', md5(uniqid(gethostname(), true)) @@ -281,7 +279,7 @@ public static function recursionDetection() return function ( CommandInterface $command, RequestInterface $request - ) use ($handler){ + ) use ($handler) { $isLambda = getenv('AWS_LAMBDA_FUNCTION_NAME'); $traceId = str_replace('\e', '\x1b', getenv('_X_AMZN_TRACE_ID')); @@ -290,9 +288,9 @@ public static function recursionDetection() $ignoreChars = ['=', ';', ':', '+', '&', '[', ']', '{', '}', '"', '\'', ',']; $traceIdEncoded = rawurlencode(stripcslashes($traceId)); - foreach($ignoreChars as $char) { + foreach ($ignoreChars as $char) { $encodedChar = rawurlencode($char); - $traceIdEncoded = str_replace($encodedChar, $char, $traceIdEncoded); + $traceIdEncoded = str_replace($encodedChar, $char, $traceIdEncoded); } return $handler($command, $request->withHeader( diff --git a/src/MigrationHub/Exception/MigrationHubException.php b/src/MigrationHub/Exception/MigrationHubException.php index 4fc3c5d1db..d47d5d8b58 100644 --- a/src/MigrationHub/Exception/MigrationHubException.php +++ b/src/MigrationHub/Exception/MigrationHubException.php @@ -1,4 +1,5 @@ promise = Promise\Coroutine::of(function () { // Initiate the upload. if ($this->state->isCompleted()) { - throw new \LogicException('This multipart upload has already ' + throw new \LogicException( + 'This multipart upload has already ' . 'been completed or aborted.' ); } diff --git a/src/Multipart/AbstractUploader.php b/src/Multipart/AbstractUploader.php index 75e6794660..81c7a67617 100644 --- a/src/Multipart/AbstractUploader.php +++ b/src/Multipart/AbstractUploader.php @@ -1,4 +1,5 @@ wait(); * */ -class ConfigurationProvider extends AbstractConfigurationProvider - implements ConfigurationProviderInterface +class ConfigurationProvider extends AbstractConfigurationProvider implements ConfigurationProviderInterface { const DEFAULT_MAX_ATTEMPTS = 3; const DEFAULT_MODE = 'legacy'; diff --git a/src/Retry/Exception/ConfigurationException.php b/src/Retry/Exception/ConfigurationException.php index 0705c2ee9f..fd4a934565 100644 --- a/src/Retry/Exception/ConfigurationException.php +++ b/src/Retry/Exception/ConfigurationException.php @@ -1,4 +1,5 @@ releaseToQuota($result); @@ -106,7 +106,6 @@ public static function createDefaultDecider( ); if ($isRetryable) { - // Retrieve retry tokens and check if quota has been exceeded if (!$quotaManager->hasRetryQuota($result)) { return false; @@ -246,7 +245,7 @@ public function __invoke(CommandInterface $cmd, RequestInterface $req) public function exponentialDelayWithJitter($attempts) { $rand = mt_rand() / mt_getrandmax(); - return min(1000 * $rand * pow(2, $attempts) , $this->maxBackoff); + return min(1000 * $rand * pow(2, $attempts), $this->maxBackoff); } private static function isRetryable( @@ -258,14 +257,14 @@ private static function isRetryable( if (!empty($options['transient_error_codes']) && is_array($options['transient_error_codes']) ) { - foreach($options['transient_error_codes'] as $code) { + foreach ($options['transient_error_codes'] as $code) { $errorCodes[$code] = true; } } if (!empty($options['throttling_error_codes']) && is_array($options['throttling_error_codes']) ) { - foreach($options['throttling_error_codes'] as $code) { + foreach ($options['throttling_error_codes'] as $code) { $errorCodes[$code] = true; } } @@ -274,7 +273,7 @@ private static function isRetryable( if (!empty($options['status_codes']) && is_array($options['status_codes']) ) { - foreach($options['status_codes'] as $code) { + foreach ($options['status_codes'] as $code) { $statusCodes[$code] = true; } } @@ -282,7 +281,7 @@ private static function isRetryable( if (!empty($options['curl_errors']) && is_array($options['curl_errors']) ) { - foreach($options['curl_errors'] as $code) { + foreach ($options['curl_errors'] as $code) { $retryCurlErrors[$code] = true; } } @@ -353,7 +352,7 @@ private function isThrottlingError($result) if (!empty($this->options['throttling_error_codes']) && is_array($this->options['throttling_error_codes']) ) { - foreach($this->options['throttling_error_codes'] as $code) { + foreach ($this->options['throttling_error_codes'] as $code) { $throttlingErrors[$code] = true; } } diff --git a/src/RoboMaker/Exception/RoboMakerException.php b/src/RoboMaker/Exception/RoboMakerException.php index 4cff3a82f2..0e6e9cb1a0 100644 --- a/src/RoboMaker/Exception/RoboMakerException.php +++ b/src/RoboMaker/Exception/RoboMakerException.php @@ -1,4 +1,5 @@ api->getOperation($command->getName()); @@ -95,10 +96,10 @@ public function __invoke( } if (!empty($checksumInfo)) { - //if the checksum member is absent, check if it's required - $checksumRequired = isset($checksumInfo['requestChecksumRequired']) - ? $checksumInfo['requestChecksumRequired'] - : null; + //if the checksum member is absent, check if it's required + $checksumRequired = isset($checksumInfo['requestChecksumRequired']) + ? $checksumInfo['requestChecksumRequired'] + : null; if ((!empty($checksumRequired) && !$request->hasHeader('Content-MD5')) || (in_array($name, self::$sha256AndMd5) && $addContentMD5) ) { diff --git a/src/S3/BatchDelete.php b/src/S3/BatchDelete.php index 92439115cd..1c17a649bf 100644 --- a/src/S3/BatchDelete.php +++ b/src/S3/BatchDelete.php @@ -1,4 +1,5 @@ then( - function () use ($cleanup) { + function () use ($cleanup) { return Promise\Create::promiseFor($this->flushQueue()) ->then($cleanup); }, - function ($reason) use ($cleanup) { + function ($reason) use ($cleanup) { $cleanup(); return Promise\Create::rejectionFor($reason); } diff --git a/src/S3/BucketEndpointArnMiddleware.php b/src/S3/BucketEndpointArnMiddleware.php index becfded6f1..94adda9216 100644 --- a/src/S3/BucketEndpointArnMiddleware.php +++ b/src/S3/BucketEndpointArnMiddleware.php @@ -1,4 +1,5 @@ getName(), $this->nonArnableCommands)) { @@ -121,7 +121,6 @@ public function __invoke(CommandInterface $cmd, RequestInterface $req) if ($this->isUseEndpointV2) { $req = $req->withUri( $req->getUri()->withPath($path) - ); goto next; } @@ -194,7 +193,7 @@ private function generateAccessPointHost( if ($arn instanceof OutpostsAccessPointArn) { $host .= '.' . $arn->getOutpostId() . '.s3-outposts'; - } else if ($arn instanceof ObjectLambdaAccessPointArn) { + } elseif ($arn instanceof ObjectLambdaAccessPointArn) { if (!empty($this->config['endpoint'])) { return $host . '.' . $this->config['endpoint']; } else { @@ -227,7 +226,6 @@ private function generateAccessPointHost( private function validateArn($arn) { if ($arn instanceof AccessPointArnInterface) { - // Dualstack is not supported with Outposts access points if ($arn instanceof OutpostsAccessPointArn && !empty($this->config['dual_stack']) @@ -235,7 +233,8 @@ private function validateArn($arn) throw new UnresolvedEndpointException( 'Dualstack is currently not supported with S3 Outposts access' . ' points. Please disable dualstack or do not supply an' - . ' access point ARN.'); + . ' access point ARN.' + ); } if ($arn instanceof MultiRegionAccessPointArn) { if (!empty($this->config['disable_multiregion_access_points'])) { @@ -256,7 +255,8 @@ private function validateArn($arn) throw new UnresolvedEndpointException( 'Accelerate is currently not supported with access points.' . ' Please disable accelerate or do not supply an access' - . ' point ARN.'); + . ' point ARN.' + ); } // Path-style is not supported with access points @@ -264,7 +264,8 @@ private function validateArn($arn) throw new UnresolvedEndpointException( 'Path-style addressing is currently not supported with' . ' access points. Please disable path-style or do not' - . ' supply an access point ARN.'); + . ' supply an access point ARN.' + ); } // Custom endpoint is not supported with access points @@ -274,7 +275,8 @@ private function validateArn($arn) throw new UnresolvedEndpointException( 'A custom endpoint has been supplied along with an access' . ' point ARN, and these are not compatible with each other.' - . ' Please only use one or the other.'); + . ' Please only use one or the other.' + ); } // Dualstack is not supported with object lambda access points @@ -284,7 +286,8 @@ private function validateArn($arn) throw new UnresolvedEndpointException( 'Dualstack is currently not supported with Object Lambda access' . ' points. Please disable dualstack or do not supply an' - . ' access point ARN.'); + . ' access point ARN.' + ); } // Global endpoints do not support cross-region requests if ($this->isGlobal($this->region) @@ -295,7 +298,8 @@ private function validateArn($arn) throw new UnresolvedEndpointException( 'Global endpoints do not support cross region requests.' . ' Please enable use_arn_region or do not supply a global region' - . ' with a different region in the ARN.'); + . ' with a different region in the ARN.' + ); } // Get partitions for ARN and client region diff --git a/src/S3/BucketEndpointMiddleware.php b/src/S3/BucketEndpointMiddleware.php index 1a915ca582..f8dd428ad0 100644 --- a/src/S3/BucketEndpointMiddleware.php +++ b/src/S3/BucketEndpointMiddleware.php @@ -1,4 +1,5 @@ config['params'] = $params; }; } -} \ No newline at end of file +} diff --git a/src/S3/Crypto/S3EncryptionMultipartUploaderV2.php b/src/S3/Crypto/S3EncryptionMultipartUploaderV2.php index 1bdbccf374..c460ffbcf8 100644 --- a/src/S3/Crypto/S3EncryptionMultipartUploaderV2.php +++ b/src/S3/Crypto/S3EncryptionMultipartUploaderV2.php @@ -1,4 +1,5 @@ getHandlerList(); $list->appendBuild(Middleware::mapRequest( - function(RequestInterface $req) use ($agentString) { + function (RequestInterface $req) use ($agentString) { if (!empty($req->getHeader('User-Agent')) && !empty($req->getHeader('User-Agent')[0]) ) { diff --git a/src/S3/EndpointRegionHelperTrait.php b/src/S3/EndpointRegionHelperTrait.php index 3c35c4b973..84a9c73891 100644 --- a/src/S3/EndpointRegionHelperTrait.php +++ b/src/S3/EndpointRegionHelperTrait.php @@ -1,4 +1,5 @@ isMatchingSigningRegion( - $arn->getRegion(), - $this->region, - $this->service->getEndpointPrefix(), - $this->partitionProvider) + if (!( + $this->isMatchingSigningRegion( + $arn->getRegion(), + $this->region, + $this->service->getEndpointPrefix(), + $this->partitionProvider + ) )) { if (empty($this->config['use_arn_region']) || !($this->config['use_arn_region']->isUseArnRegion()) diff --git a/src/S3/Exception/DeleteMultipleObjectsException.php b/src/S3/Exception/DeleteMultipleObjectsException.php index 5b4c28903a..540aa21f95 100644 --- a/src/S3/Exception/DeleteMultipleObjectsException.php +++ b/src/S3/Exception/DeleteMultipleObjectsException.php @@ -1,4 +1,5 @@ collectPathInfo($error->getCommand()); } elseif ($prev instanceof AwsException) { diff --git a/src/S3/GetBucketLocationParser.php b/src/S3/GetBucketLocationParser.php index 94aee6967b..524ec6aa95 100644 --- a/src/S3/GetBucketLocationParser.php +++ b/src/S3/GetBucketLocationParser.php @@ -1,4 +1,5 @@ $ldt]; diff --git a/src/S3/PutObjectUrlMiddleware.php b/src/S3/PutObjectUrlMiddleware.php index 8faba4159e..25e2c939f4 100644 --- a/src/S3/PutObjectUrlMiddleware.php +++ b/src/S3/PutObjectUrlMiddleware.php @@ -1,4 +1,5 @@ wait(); * */ -class ConfigurationProvider extends AbstractConfigurationProvider - implements ConfigurationProviderInterface +class ConfigurationProvider extends AbstractConfigurationProvider implements ConfigurationProviderInterface { const ENV_ENDPOINTS_TYPE = 'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT'; const INI_ENDPOINTS_TYPE = 's3_us_east_1_regional_endpoint'; diff --git a/src/S3/RegionalEndpoint/Exception/ConfigurationException.php b/src/S3/RegionalEndpoint/Exception/ConfigurationException.php index 29e211f557..a281ba0317 100644 --- a/src/S3/RegionalEndpoint/Exception/ConfigurationException.php +++ b/src/S3/RegionalEndpoint/Exception/ConfigurationException.php @@ -1,4 +1,5 @@ appendInit($this->getHeadObjectMiddleware(), 's3.head_object'); if ($this->isUseEndpointV2()) { $this->processEndpointV2Model(); - $stack->after('builderV2', + $stack->after( + 'builderV2', 's3.check_empty_path_with_query', - $this->getEmptyPathWithQuery()); + $this->getEmptyPathWithQuery() + ); } } @@ -648,7 +651,6 @@ private function getEncodingTypeMiddleware() } } } - } return $result; @@ -687,7 +689,7 @@ private function getEmptyPathWithQuery() */ private function getSigningName($host) { - if (strpos( $host, 's3-object-lambda')) { + if (strpos($host, 's3-object-lambda')) { return 's3-object-lambda'; } @@ -706,7 +708,7 @@ private function processEndpointV2Model() { $definition = $this->getApi()->getDefinition(); - foreach($definition['operations'] as &$operation) { + foreach ($definition['operations'] as &$operation) { if (isset($operation['http']['requestUri'])) { $requestUri = $operation['http']['requestUri']; if ($requestUri === "/{Bucket}") { @@ -737,7 +739,7 @@ private function addBuiltIns($args) if (is_string($result)) { if ($result === 'regional') { $value = false; - } else if ($result === 'legacy') { + } elseif ($result === 'legacy') { $value = true; } else { return; @@ -779,9 +781,9 @@ public static function _applyRetryConfig($value, $args, HandlerList $list) && $error->getResponse()->getStatusCode() >= 400 ) { return strpos( - $error->getResponse()->getBody(), - 'Your socket connection to the server' - ) !== false; + $error->getResponse()->getBody(), + 'Your socket connection to the server' + ) !== false; } if ($error->getPrevious() instanceof RequestException) { @@ -808,7 +810,7 @@ public static function _applyRetryConfig($value, $args, HandlerList $list) $config, [ 'collect_stats' => $args['stats']['retries'], - 'decider' => function( + 'decider' => function ( $attempts, CommandInterface $cmd, $result @@ -871,11 +873,11 @@ public static function applyDocFilters(array $api, array $docs) $opt = '
This value will be computed for you it is not supplied.
'; // Add a note on the CopyObject docs - $s3ExceptionRetryMessage = "

Additional info on response behavior: if there is" - . " an internal error in S3 after the request was successfully recieved," - . " a 200 response will be returned with an S3Exception embedded" - . " in it; this will still be caught and retried by" - . " RetryMiddleware.

"; + $s3ExceptionRetryMessage = "

Additional info on response behavior: if there is" + . " an internal error in S3 after the request was successfully recieved," + . " a 200 response will be returned with an S3Exception embedded" + . " in it; this will still be caught and retried by" + . " RetryMiddleware.

"; $docs['operations']['CopyObject'] .= $s3ExceptionRetryMessage; $docs['operations']['CompleteMultipartUpload'] .= $s3ExceptionRetryMessage; diff --git a/src/S3/S3ClientInterface.php b/src/S3/S3ClientInterface.php index 261d7dd3c0..2a761322cb 100644 --- a/src/S3/S3ClientInterface.php +++ b/src/S3/S3ClientInterface.php @@ -1,4 +1,5 @@ getStatusCode() === 404) { + if ($e->getStatusCode() === 404) { return false; } throw $e; @@ -319,8 +320,10 @@ public function doesObjectExistV2( $key, $includeDeleteMarkers = false, array $options = [] - ){ - $command = $this->getCommand('HeadObject', [ + ) { + $command = $this->getCommand( + 'HeadObject', + [ 'Bucket' => $bucket, 'Key' => $key ] + $options diff --git a/src/S3/S3EndpointMiddleware.php b/src/S3/S3EndpointMiddleware.php index c8dd007030..f1c4e6c6aa 100644 --- a/src/S3/S3EndpointMiddleware.php +++ b/src/S3/S3EndpointMiddleware.php @@ -1,4 +1,5 @@ getUri(); $request = $request->withUri( $uri->withHost($this->getBucketStyleHost( - $command, - $uri->getHost() - )) + $command, + $uri->getHost() + )) ->withPath($this->getBucketlessPath( $uri->getPath(), $command @@ -286,7 +287,7 @@ private function getBucketlessPath($path, CommandInterface $command) { $pattern = '/^\\/' . preg_quote($command['Bucket'], '/') . '/'; $path = preg_replace($pattern, '', $path) ?: '/'; - if (substr($path, 0 , 1) !== '/') { + if (substr($path, 0, 1) !== '/') { $path = '/' . $path; } return $path; @@ -330,7 +331,7 @@ private function applyEndpoint( ); $uri = $request->getUri(); $scheme = $uri->getScheme(); - if(empty($scheme)){ + if (empty($scheme)) { $request = $request->withUri( $uri->withHost($host) ); diff --git a/src/S3/S3MultiRegionClient.php b/src/S3/S3MultiRegionClient.php index f643d9a8e3..4df241b15a 100644 --- a/src/S3/S3MultiRegionClient.php +++ b/src/S3/S3MultiRegionClient.php @@ -1,4 +1,5 @@ 'config', 'valid' => [CacheInterface::class], 'doc' => 'Cache of regions in which given buckets are located.', - 'default' => function () { return new LruArrayCache; }, + 'default' => function () { + return new LruArrayCache(); + }, ], 'region' => $regionDef, ]; diff --git a/src/S3/S3UriParser.php b/src/S3/S3UriParser.php index 508bff14c5..621009622c 100644 --- a/src/S3/S3UriParser.php +++ b/src/S3/S3UriParser.php @@ -1,4 +1,5 @@ triggerError($errors); } - return $this->boolCall(function() { + return $this->boolCall(function () { switch ($this->mode) { case 'r': return $this->openReadStream(); case 'a': return $this->openAppendStream(); @@ -173,7 +174,7 @@ public function stream_flush() { // Check if stream body size has been // calculated via a flush or close - if($this->body->getSize() === null && $this->mode !== 'r') { + if ($this->body->getSize() === null && $this->mode !== 'r') { return $this->triggerError( "Unable to determine stream size. Did you forget to close or flush the stream?" ); @@ -221,7 +222,9 @@ public function stream_seek($offset, $whence = SEEK_SET) public function stream_tell() { - return $this->boolCall(function() { return $this->body->tell(); }); + return $this->boolCall(function () { + return $this->body->tell(); + }); } public function stream_write($data) @@ -472,7 +475,7 @@ public function dir_closedir() */ public function dir_rewinddir() { - return $this->boolCall(function() { + return $this->boolCall(function () { $this->objectIterator = null; $this->dir_opendir($this->openedPath, null); return true; diff --git a/src/S3/Transfer.php b/src/S3/Transfer.php index 9228c807fc..d250510805 100644 --- a/src/S3/Transfer.php +++ b/src/S3/Transfer.php @@ -1,4 +1,5 @@ sourceMetadata['scheme'] === $this->destination['scheme']) { - throw new \InvalidArgumentException("You cannot copy from" + throw new \InvalidArgumentException( + "You cannot copy from" . " {$this->sourceMetadata['scheme']} to" . " {$this->destination['scheme']}." ); @@ -268,7 +270,9 @@ private function createDownloadPromise() throw new AwsException( 'Cannot download key ' . $objectKey . ', its relative path resolves outside the' - . ' parent directory', $command); + . ' parent directory', + $command + ); } // Create the directory if needed. @@ -311,7 +315,9 @@ private function getUploadsIterator() if (is_string($this->source)) { return Aws\filter( Aws\recursive_dir_iterator($this->sourceMetadata['path']), - function ($file) { return !is_dir($file); } + function ($file) { + return !is_dir($file); + } ); } @@ -410,6 +416,7 @@ private function addDebugToBefore($debug) break; case 'UploadPart': $part = $command['PartNumber']; + // no break case 'CreateMultipartUpload': case 'CompleteMultipartUpload': $sourceKey = $command['Key']; diff --git a/src/S3/UseArnRegion/Configuration.php b/src/S3/UseArnRegion/Configuration.php index 91277d61e7..07cb8d7e6a 100644 --- a/src/S3/UseArnRegion/Configuration.php +++ b/src/S3/UseArnRegion/Configuration.php @@ -1,4 +1,5 @@ wait(); * */ -class ConfigurationProvider extends AbstractConfigurationProvider - implements ConfigurationProviderInterface +class ConfigurationProvider extends AbstractConfigurationProvider implements ConfigurationProviderInterface { const ENV_USE_ARN_REGION = 'AWS_S3_USE_ARN_REGION'; const INI_USE_ARN_REGION = 's3_use_arn_region'; diff --git a/src/S3/UseArnRegion/Exception/ConfigurationException.php b/src/S3/UseArnRegion/Exception/ConfigurationException.php index 15d06a9c2b..dcade8e086 100644 --- a/src/S3/UseArnRegion/Exception/ConfigurationException.php +++ b/src/S3/UseArnRegion/Exception/ConfigurationException.php @@ -1,4 +1,5 @@ getName() == "GetObject" && !empty($checksumValidationInfo['checksumHeaderValue']) diff --git a/src/S3Control/EndpointArnMiddleware.php b/src/S3Control/EndpointArnMiddleware.php index 580c174834..7378d81bfc 100644 --- a/src/S3Control/EndpointArnMiddleware.php +++ b/src/S3Control/EndpointArnMiddleware.php @@ -1,4 +1,5 @@ partitionProvider = PartitionEndpointProvider::defaultProvider(); $this->region = $region; $this->service = $service; @@ -108,7 +107,6 @@ public function __invoke(CommandInterface $cmd, RequestInterface $req) ) { $service = $this->service->toArray(); if (!empty($input = $service['shapes'][$op['input']['shape']])) { - // Stores member name that targets 'BucketName' shape $bucketNameMember = null; @@ -172,7 +170,6 @@ public function __invoke(CommandInterface $cmd, RequestInterface $req) // Replace ARN in the command $cmd[$accesspointNameMember] = $arn->getAccesspointName(); } elseif ($arn instanceof BucketArnInterface) { - // Replace ARN in the path $path = str_replace( urlencode($cmd[$bucketNameMember]), @@ -233,8 +230,6 @@ public function __invoke(CommandInterface $cmd, RequestInterface $req) if ($arn instanceof OutpostsArnInterface) { $cmd['@context']['signing_service'] = $arn->getService(); } - - } } } @@ -318,7 +313,8 @@ private function validateArn(ArnInterface $arn) ) { throw new UnresolvedEndpointException( 'Dualstack is currently not supported with S3 Outposts ARNs.' - . ' Please disable dualstack or do not supply an Outposts ARN.'); + . ' Please disable dualstack or do not supply an Outposts ARN.' + ); } // Get partitions for ARN and client region @@ -358,4 +354,4 @@ private function validateArn(ArnInterface $arn) return $arnPart; } -} \ No newline at end of file +} diff --git a/src/S3Control/Exception/S3ControlException.php b/src/S3Control/Exception/S3ControlException.php index eb005bf943..4a57ec792d 100644 --- a/src/S3Control/Exception/S3ControlException.php +++ b/src/S3Control/Exception/S3ControlException.php @@ -1,4 +1,5 @@ getComposer(); $extra = $composer->getPackage()->getExtra(); $listedServices = isset($extra['aws/aws-sdk-php']) @@ -83,7 +83,8 @@ private static function removeServiceDirs( $modelDir = $modelPath . $modelName; if ($filesystem->exists([$clientDir, $modelDir])) { - $filesystem->remove([$clientDir, $modelDir]);; + $filesystem->remove([$clientDir, $modelDir]); + ; $deleteCount++; } } @@ -92,4 +93,4 @@ private static function removeServiceDirs( "Removed $deleteCount AWS service" . ($deleteCount === 1 ? '' : 's') ); } -} \ No newline at end of file +} diff --git a/src/Sdk.php b/src/Sdk.php index ad6d9f735b..1ba5697293 100644 --- a/src/Sdk.php +++ b/src/Sdk.php @@ -1,4 +1,5 @@ getTimestamp(); } elseif (!is_numeric($dateValue)) { - $timestamp = strtotime($dateValue, + $timestamp = strtotime( + $dateValue, $relativeTimeBase === null ? time() : $relativeTimeBase ); } else { @@ -477,7 +479,7 @@ private function removeIllegalV4aHeaders(&$request) $storedHeaders = []; foreach ($illegalV4aHeaders as $header) { - if ($request->hasHeader($header)){ + if ($request->hasHeader($header)) { $storedHeaders[$header] = $request->getHeader($header); $request = $request->withoutHeader($header); } @@ -492,7 +494,9 @@ private function CRTRequestFromGuzzleRequest($request) $request->getMethod(), (string) $request->getUri(), [], //leave empty as the query is parsed from the uri object - array_map(function ($header) {return $header[0];}, $request->getHeaders()) + array_map(function ($header) { + return $header[0]; + }, $request->getHeaders()) ); } @@ -521,9 +525,11 @@ protected function signWithV4a(CredentialsInterface $credentials, RequestInterfa Signing::signRequestAws( Signable::fromHttpRequest($http_request), - $signingConfig, function ($signing_result, $error_code) use (&$http_request) { - $signing_result->applyToHttpRequest($http_request); - }); + $signingConfig, + function ($signing_result, $error_code) use (&$http_request) { + $signing_result->applyToHttpRequest($http_request); + } + ); foreach ($removedIllegalHeaders as $header => $value) { $request = $request->withHeader($header, $value); } @@ -540,8 +546,7 @@ protected function presignWithV4a( RequestInterface $request, CredentialsInterface $credentials, $expires - ) - { + ) { $this->verifyCRTLoaded(); $credentials_provider = $this->createCRTStaticCredentialsProvider($credentials); $signingConfig = new SigningConfigAWS([ @@ -565,9 +570,11 @@ protected function presignWithV4a( $http_request = $this->CRTRequestFromGuzzleRequest($request); Signing::signRequestAws( Signable::fromHttpRequest($http_request), - $signingConfig, function ($signing_result, $error_code) use (&$http_request) { - $signing_result->applyToHttpRequest($http_request); - }); + $signingConfig, + function ($signing_result, $error_code) use (&$http_request) { + $signing_result->applyToHttpRequest($http_request); + } + ); return $request->withUri( new Psr7\Uri($http_request->pathAndQuery()) diff --git a/src/SimSpaceWeaver/Exception/SimSpaceWeaverException.php b/src/SimSpaceWeaver/Exception/SimSpaceWeaverException.php index a278cb7dc9..413a5ad694 100644 --- a/src/SimSpaceWeaver/Exception/SimSpaceWeaverException.php +++ b/src/SimSpaceWeaver/Exception/SimSpaceWeaverException.php @@ -1,4 +1,5 @@ wait(); * */ -class ConfigurationProvider extends AbstractConfigurationProvider - implements ConfigurationProviderInterface +class ConfigurationProvider extends AbstractConfigurationProvider implements ConfigurationProviderInterface { const DEFAULT_ENDPOINTS_TYPE = 'legacy'; const ENV_ENDPOINTS_TYPE = 'AWS_STS_REGIONAL_ENDPOINTS'; diff --git a/src/Sts/RegionalEndpoints/Exception/ConfigurationException.php b/src/Sts/RegionalEndpoints/Exception/ConfigurationException.php index 668426672e..97c4685fd6 100644 --- a/src/Sts/RegionalEndpoints/Exception/ConfigurationException.php +++ b/src/Sts/RegionalEndpoints/Exception/ConfigurationException.php @@ -1,4 +1,5 @@ ssoProfileName = !empty($ssoProfileName) ? $ssoProfileName : $profileName; $this->filename = !empty($filename) @@ -93,7 +95,8 @@ public function __invoke() * Refreshes the token * @return mixed|null */ - public function refresh() { + public function refresh() + { try { //try to reload from disk $token = $this(); @@ -124,7 +127,7 @@ public function refresh() { ]); if ($response['@metadata']['statusCode'] == 200) { $tokenData['accessToken'] = $response['accessToken']; - $tokenData['expiresAt'] = time () + $response['expiresIn']; + $tokenData['expiresAt'] = time() + $response['expiresIn']; $tokenData['refreshToken'] = $response['refreshToken']; $token = new SsoToken( $tokenData['accessToken'], @@ -134,7 +137,8 @@ public function refresh() { isset($tokenData['clientSecret']) ? $tokenData['clientSecret'] : null, isset($tokenData['registrationExpiresAt']) ? $tokenData['registrationExpiresAt'] : null, isset($tokenData['region']) ? $tokenData['region'] : null, - isset($tokenData['startUrl']) ? $tokenData['startUrl'] : null ); + isset($tokenData['startUrl']) ? $tokenData['startUrl'] : null + ); $this->writeNewTokenDataToDisk($tokenData, $tokenLocation); @@ -166,7 +170,7 @@ public static function getTokenLocation($sso_session) * @param $tokenLocation * @return array */ - function getTokenData($tokenLocation) + public function getTokenData($tokenLocation) { return json_decode(file_get_contents($tokenLocation), true); } diff --git a/src/Token/Token.php b/src/Token/Token.php index 6d2c566982..f59fd515ed 100644 --- a/src/Token/Token.php +++ b/src/Token/Token.php @@ -1,4 +1,5 @@ otherwise(function($reason) use (&$result) { + ->otherwise(function ($reason) use (&$result) { // Cleanup rejected promise. $result = null; return Promise\Create::promiseFor(null); @@ -227,7 +227,8 @@ public static function cache( /** * Gets profiles from the ~/.aws/config ini file */ - private static function loadDefaultProfiles() { + private static function loadDefaultProfiles() + { $profiles = []; $configFile = self::getHomeDir() . '/.aws/config'; @@ -265,4 +266,3 @@ public static function sso($profileName, $filename, $config = []) return new SsoTokenProvider($profileName, $filename, $config); } } - diff --git a/src/TraceMiddleware.php b/src/TraceMiddleware.php index 6e40521afa..36e52a4a99 100644 --- a/src/TraceMiddleware.php +++ b/src/TraceMiddleware.php @@ -1,4 +1,5 @@ config = $config + [ - 'logfn' => function ($value) { echo $value; }, + 'logfn' => function ($value) { + echo $value; + }, 'stream_size' => 524288, 'scrub_auth' => true, 'http' => true, @@ -337,22 +340,23 @@ private function getRedactedArray(CommandInterface $cmd) RecursiveIteratorIterator::SELF_FIRST ); foreach ($iterator as $parameter => $value) { - if (isset($shapes[$parameter]['sensitive']) && - $shapes[$parameter]['sensitive'] === true - ) { - $redactedValue = is_string($value) ? "[{$parameter}]" : ["[{$parameter}]"]; - $currentDepth = $iterator->getDepth(); - for ($subDepth = $currentDepth; $subDepth >= 0; $subDepth--) { - $subIterator = $iterator->getSubIterator($subDepth); - $subIterator->offsetSet( - $subIterator->key(), - ($subDepth === $currentDepth - ? $redactedValue - : $iterator->getSubIterator(($subDepth+1))->getArrayCopy() - ) - ); - } - } + if (isset($shapes[$parameter]['sensitive']) && + $shapes[$parameter]['sensitive'] === true + ) { + $redactedValue = is_string($value) ? "[{$parameter}]" : ["[{$parameter}]"]; + $currentDepth = $iterator->getDepth(); + for ($subDepth = $currentDepth; $subDepth >= 0; $subDepth--) { + $subIterator = $iterator->getSubIterator($subDepth); + $subIterator->offsetSet( + $subIterator->key(), + ( + $subDepth === $currentDepth + ? $redactedValue + : $iterator->getSubIterator(($subDepth+1))->getArrayCopy() + ) + ); + } + } } return $iterator->getArrayCopy(); } diff --git a/src/TranscribeService/Exception/TranscribeServiceException.php b/src/TranscribeService/Exception/TranscribeServiceException.php index 7c9c48fa36..cf89b0f760 100644 --- a/src/TranscribeService/Exception/TranscribeServiceException.php +++ b/src/TranscribeService/Exception/TranscribeServiceException.php @@ -1,4 +1,5 @@ ['serviceIdentifier' => 's']]; $this->assertEquals($result, ApiProvider::resolve($p, 't', 's', 'v')); - $p = function ($a, $b, $c) {return null;}; + $p = function ($a, $b, $c) { + return null; + }; $this->expectException(UnresolvedApiException::class); ApiProvider::resolve($p, 't', 's', 'v'); } diff --git a/tests/Api/DateTimeResultTest.php b/tests/Api/DateTimeResultTest.php index 7afc019d02..deba16c729 100644 --- a/tests/Api/DateTimeResultTest.php +++ b/tests/Api/DateTimeResultTest.php @@ -1,4 +1,5 @@ $value) { + foreach ($parsed as $key => $value) { if ($key === 'error_shape') { $this->assertEquals( $expected['error_shape']->toArray(), diff --git a/tests/Api/ErrorParser/RestJsonErrorParserTest.php b/tests/Api/ErrorParser/RestJsonErrorParserTest.php index 04d4a05ded..669ac5b7e6 100644 --- a/tests/Api/ErrorParser/RestJsonErrorParserTest.php +++ b/tests/Api/ErrorParser/RestJsonErrorParserTest.php @@ -1,4 +1,5 @@ $value) { + foreach ($parsed as $key => $value) { if ($key === 'error_shape') { $this->assertEquals( $expected['error_shape']->toArray(), diff --git a/tests/Api/ErrorParser/XmlErrorParserTest.php b/tests/Api/ErrorParser/XmlErrorParserTest.php index 3bc73e5f19..9888920548 100644 --- a/tests/Api/ErrorParser/XmlErrorParserTest.php +++ b/tests/Api/ErrorParser/XmlErrorParserTest.php @@ -1,4 +1,5 @@ getContextParams(); $this->assertEquals( - $expected, - $contextParams + $expected, + $contextParams ); } } diff --git a/tests/Api/Parser/ComplianceTest.php b/tests/Api/Parser/ComplianceTest.php index c3a66467c8..fc8313af24 100644 --- a/tests/Api/Parser/ComplianceTest.php +++ b/tests/Api/Parser/ComplianceTest.php @@ -1,4 +1,5 @@ $case['given'] ] ]; - $description = new Service($serviceData, function () { return []; }); + $description = new Service($serviceData, function () { + return []; + }); if (!empty($case['error'])) { if (empty($case['errorCode'])) { throw new \InvalidArgumentException('Protocol test error cases must have associated "errorType" value.'); diff --git a/tests/Api/Parser/Crc32ValidatingParserTest.php b/tests/Api/Parser/Crc32ValidatingParserTest.php index 128c536abe..442e7882df 100644 --- a/tests/Api/Parser/Crc32ValidatingParserTest.php +++ b/tests/Api/Parser/Crc32ValidatingParserTest.php @@ -1,4 +1,5 @@ eventstreamShape, new RestXmlParser( - new Service([], function () { return []; }) + new Service([], function () { + return []; + }) ) ); @@ -115,7 +117,9 @@ public function testThrowsOnErrorEvent() $stream, $this->eventstreamShape, new RestXmlParser( - new Service([], function () { return []; }) + new Service([], function () { + return []; + }) ) ); @@ -144,7 +148,9 @@ public function testThrowsOnUnknownMessageType() $stream, $this->eventstreamShape, new RestXmlParser( - new Service([], function () { return []; }) + new Service([], function () { + return []; + }) ) ); diff --git a/tests/Api/Parser/Exception/ParserExceptionTest.php b/tests/Api/Parser/Exception/ParserExceptionTest.php index 5c588d8042..5c113dcb9b 100644 --- a/tests/Api/Parser/Exception/ParserExceptionTest.php +++ b/tests/Api/Parser/Exception/ParserExceptionTest.php @@ -1,4 +1,5 @@ generateTestService('json'); $client = $this->generateTestClient( $service, @@ -109,8 +109,7 @@ public function testTimeStampExceptions( $commandName, $expectedException, $expectedMessage - ) - { + ) { $service = $this->generateTestService('json'); $client = $this->generateTestClient( $service, @@ -123,4 +122,3 @@ public function testTimeStampExceptions( $handler($command)->wait(); } } - diff --git a/tests/Api/Parser/JsonRpcParserTest.php b/tests/Api/Parser/JsonRpcParserTest.php index 38df19c5e8..47529c1034 100644 --- a/tests/Api/Parser/JsonRpcParserTest.php +++ b/tests/Api/Parser/JsonRpcParserTest.php @@ -1,4 +1,5 @@ getMockBuilder(Operation::class) diff --git a/tests/Api/Parser/ParserTestServiceTrait.php b/tests/Api/Parser/ParserTestServiceTrait.php index 3bbb2a9012..6767a2db0c 100644 --- a/tests/Api/Parser/ParserTestServiceTrait.php +++ b/tests/Api/Parser/ParserTestServiceTrait.php @@ -1,4 +1,5 @@ generateTestService('rest-xml'); $client = $this->generateTestClient( $service, diff --git a/tests/Api/Serializer/ComplianceTest.php b/tests/Api/Serializer/ComplianceTest.php index fc11d15021..fb1b0d8063 100644 --- a/tests/Api/Serializer/ComplianceTest.php +++ b/tests/Api/Serializer/ComplianceTest.php @@ -1,4 +1,5 @@ assertSame( '{}', $j->build(new Shape([], new ShapeMap([])), []) @@ -96,8 +99,11 @@ public function formatProvider() 'bar' => ['a' => 'b'] ] ], - sprintf('{"foo":{"baz":{"a":"%s"},"bar":{"a":"%s"}}}', - base64_encode('a'), base64_encode('b')) + sprintf( + '{"foo":{"baz":{"a":"%s"},"bar":{"a":"%s"}}}', + base64_encode('a'), + base64_encode('b') + ) ], // Formats lists [ @@ -169,7 +175,9 @@ public function formatProvider() */ public function testFormatsJson($def, $args, $result) { - $j = new JsonBody(new Service([], function() { return []; })); + $j = new JsonBody(new Service([], function () { + return []; + })); $shape = Shape::create($def, new ShapeMap([])); $this->assertEquals($result, $j->build($shape, $args)); } @@ -197,8 +205,11 @@ public function formatNoReferencesProvider() 'bar' => ['a' => 'b'] ] ], - sprintf('{"foo":{"baz":{"a":"%s"},"bar":{"a":"%s"}}}', - base64_encode('a'), base64_encode('b')) + sprintf( + '{"foo":{"baz":{"a":"%s"},"bar":{"a":"%s"}}}', + base64_encode('a'), + base64_encode('b') + ) ], // Formats lists [ @@ -217,7 +228,9 @@ public function formatNoReferencesProvider() */ public function testFormatsJsonDoesNotCreateReferences($def, $args, $result) { - $j = new JsonBody(new Service([], function() { return []; })); + $j = new JsonBody(new Service([], function () { + return []; + })); $shape = Shape::create($def, new ShapeMap([])); $builtShape = $j->build($shape, $args); $this->assertEquals($result, $builtShape); diff --git a/tests/Api/Serializer/JsonRpcSerializerTest.php b/tests/Api/Serializer/JsonRpcSerializerTest.php index 81db7560b5..20a2515ef6 100644 --- a/tests/Api/Serializer/JsonRpcSerializerTest.php +++ b/tests/Api/Serializer/JsonRpcSerializerTest.php @@ -1,4 +1,5 @@ ['type' => 'boolean'], ] ], - function () {} + function () { + } ); } @@ -263,7 +265,8 @@ public function testHandlesDoctype($input, $expectedOutput) } - public function doctypeTestProvider() { + public function doctypeTestProvider() + { return [ [ ['DocumentValue' => @@ -302,7 +305,8 @@ public function doctypeTestProvider() { * @param string $operation * @param string $input */ - public function testRestJsonContentTypeNoPayload($operation, $input) { + public function testRestJsonContentTypeNoPayload($operation, $input) + { $request = $this->getRequest($operation, $input); $this->assertSame('http://foo.com/', (string) $request->getUri()); $this->assertSame("", $request->getBody()->getContents()); @@ -314,7 +318,8 @@ public function testRestJsonContentTypeNoPayload($operation, $input) { } - public function restJsonContentTypeProvider() { + public function restJsonContentTypeProvider() + { return [ [ "noPayload", ['baz' => 'bar'], @@ -336,7 +341,8 @@ public function testSerializesHeaderValueToBoolString($arg, $expected) $this->assertSame($expected, $request->getHeaderLine('Is-Bool')); } - public function boolProvider() { + public function boolProvider() + { return [ [true, 'true'], [false, 'false'] @@ -358,4 +364,3 @@ public function testDoesNotOverrideScheme() $this->assertSame('http://us-east-1.amazonaws.com/', (string) $request->getUri()); } } - diff --git a/tests/Api/Serializer/RestXmlSerializerTest.php b/tests/Api/Serializer/RestXmlSerializerTest.php index 7ed0bf4ed3..f53c042c17 100644 --- a/tests/Api/Serializer/RestXmlSerializerTest.php +++ b/tests/Api/Serializer/RestXmlSerializerTest.php @@ -1,4 +1,5 @@ assertSame([], $s['operations']); $this->assertSame([], $s['shapes']); } public function testImplementsArrayAccess() { - $s = new Service(['metadata' => ['foo' => 'bar']], function () { return []; }); + $s = new Service(['metadata' => ['foo' => 'bar']], function () { + return []; + }); $this->assertSame('bar', $s['metadata']['foo']); $this->assertNull($s['missing']); $s['abc'] = '123'; @@ -48,7 +53,9 @@ public function testReturnsApiData() 'uid' => 'foo-2016-12-09' ] ], - function () { return []; } + function () { + return []; + } ); $this->assertSame('Foo Service', $s->getServiceFullName()); $this->assertSame('foo', $s->getServiceName()); @@ -62,7 +69,9 @@ function () { return []; } public function testReturnsMetadata() { - $s = new Service([], function () { return []; }); + $s = new Service([], function () { + return []; + }); $this->assertIsArray($s->getMetadata()); $s['metadata'] = [ 'serviceFullName' => 'foo', @@ -87,7 +96,9 @@ public function testReturnsIfOperationExists() { $s = new Service( ['operations' => ['foo' => ['input' => []]]], - function () { return []; } + function () { + return []; + } ); $this->assertTrue($s->hasOperation('foo')); $this->assertInstanceOf('Aws\Api\Operation', $s->getOperation('foo')); @@ -97,7 +108,9 @@ function () { return []; } public function testEnsuresOperationExists() { $this->expectException(\InvalidArgumentException::class); - $s = new Service([], function () { return []; }); + $s = new Service([], function () { + return []; + }); $s->getOperation('foo'); } @@ -185,7 +198,9 @@ public function testCreatesSerializer($type, $cl) } $service = new Service( $data, - function () { return []; } + function () { + return []; + } ); $serializer = Service::createSerializer($service, $type); $this->assertInstanceOf($cl, $serializer); @@ -209,7 +224,9 @@ public function testCreatesParsers($type, $cl) { $service = new Service( ['metadata' => ['protocol' => $type]], - function () { return []; } + function () { + return []; + } ); $parser = Service::createParser($service); $this->assertInstanceOf($cl, $parser); @@ -244,7 +261,9 @@ public function testGetClientContextParams() ], 'clientContextParams' => $params ], - function () { return []; } + function () { + return []; + } ); $clientContextParams = $s->getClientContextParams(); @@ -266,12 +285,14 @@ public function testModifyModel() 'uid' => 'foo-2016-12-09' ] ], - function () { return []; } + function () { + return []; + } ); $definition = $s->getDefinition(); $definition['metadata']['serviceId'] = 'bar'; $s->setDefinition($definition); $this->assertTrue($s->isModifiedModel()); - $this->assertEquals( 'bar', $s->getMetadata('serviceId')); + $this->assertEquals('bar', $s->getMetadata('serviceId')); } } diff --git a/tests/Api/ShapeMapTest.php b/tests/Api/ShapeMapTest.php index 2a22f425df..8e3378ec51 100644 --- a/tests/Api/ShapeMapTest.php +++ b/tests/Api/ShapeMapTest.php @@ -1,4 +1,5 @@ function () {}, + 'handler' => function () { + }, 'credentials' => new Credentials('foo', 'bar'), 'region' => 'foo', 'endpoint' => 'http://us-east-1.foo.amazonaws.com', - 'serializer' => function () {}, + 'serializer' => function () { + }, 'api_provider' => $this->getApiProvider(), 'service' => 'foo', - 'error_parser' => function () {}, + 'error_parser' => function () { + }, 'version' => 'latest' ]; @@ -92,7 +96,8 @@ public function testWrapsExceptions() { $this->expectExceptionMessage("Error executing \"foo\" on \"http://us-east-1.foo.amazonaws.com\"; AWS HTTP error: Baz Bar!"); $this->expectException(\Aws\S3\Exception\S3Exception::class); - $parser = function () {}; + $parser = function () { + }; $errorParser = new JsonRpcErrorParser(); $h = new WrappedHttpHandler( function () { @@ -329,7 +334,7 @@ public function testDoesNotSignOperationsWithAnAuthTypeOfNone() } } - return new Result; + return new Result(); } ] ); @@ -361,7 +366,7 @@ public function testSignOperationsWithAnAuthType() $this->assertTrue($request->hasHeader($signatureHeader)); } $this->assertSame('UNSIGNED-PAYLOAD', $request->getHeader('X-Amz-Content-Sha256')[0]); - return new Result; + return new Result(); } ] ); @@ -391,15 +396,13 @@ public function testUsesCommandContextSigningRegionAndService() 'ap-southeast-1/custom-service', $request->getHeader('Authorization')[0] ); - return new Result; + return new Result(); } ] ); $list = $client->getHandlerList(); $list->appendBuild(function ($handler) { - return function (CommandInterface $cmd, RequestInterface $req) - use ($handler) - { + return function (CommandInterface $cmd, RequestInterface $req) use ($handler) { $cmd['@context']['signing_region'] = 'ap-southeast-1'; $cmd['@context']['signing_service'] = 'custom-service'; return $handler($cmd, $req); @@ -525,7 +528,8 @@ public function testGetEndpointProviderArgs() ); } - public function testIsUseGlobalEndpoint() { + public function testIsUseGlobalEndpoint() + { $client = new StsClient([ 'region' => 'us-west-2', 'version' => 'latest', @@ -562,7 +566,8 @@ private function createHttpsEndpointClient(array $service = [], array $config = 'region' => 'foo', 'service' => 'foo', 'api_provider' => $apiProvider, - 'error_parser' => function () {}, + 'error_parser' => function () { + }, 'version' => 'latest' ]); } @@ -595,12 +600,14 @@ private function createClient(array $service = [], array $config = []) 'region' => 'foo', 'service' => 'foo', 'api_provider' => $apiProvider, - 'error_parser' => function () {}, + 'error_parser' => function () { + }, 'version' => 'latest' ]); } - public function testThrowsDeprecationWarning() { + public function testThrowsDeprecationWarning() + { $storeEnvVariable = getenv('AWS_SUPPRESS_PHP_DEPRECATION_WARNING'); $storeEnvArrayVariable = isset($_ENV['AWS_SUPPRESS_PHP_DEPRECATION_WARNING']) ? $_ENV['AWS_SUPPRESS_PHP_DEPRECATION_WARNING'] : ''; $storeServerArrayVariable = isset($_SERVER['AWS_SUPPRESS_PHP_DEPRECATION_WARNING']) ? $_SERVER['AWS_SUPPRESS_PHP_DEPRECATION_WARNING'] : ''; @@ -641,7 +648,8 @@ public function testThrowsDeprecationWarning() { } } - public function testCanDisableWarningWithClientConfig() { + public function testCanDisableWarningWithClientConfig() + { $storeEnvVariable = getenv('AWS_SUPPRESS_PHP_DEPRECATION_WARNING'); putenv('AWS_SUPPRESS_PHP_DEPRECATION_WARNING'); $expectsDeprecation = PHP_VERSION_ID < 70205; @@ -667,7 +675,8 @@ public function testCanDisableWarningWithClientConfig() { putenv("AWS_SUPPRESS_PHP_DEPRECATION_WARNING={$storeEnvVariable}"); } - public function testCanDisableWarningWithEnvVar() { + public function testCanDisableWarningWithEnvVar() + { $storeEnvVariable = getenv('AWS_SUPPRESS_PHP_DEPRECATION_WARNING'); putenv('AWS_SUPPRESS_PHP_DEPRECATION_WARNING=true'); $expectsDeprecation = PHP_VERSION_ID < 70205; diff --git a/tests/Build/Changelog/ChangelogBuilderTest.php b/tests/Build/Changelog/ChangelogBuilderTest.php index a6ffcdb5b4..6afe14eb94 100644 --- a/tests/Build/Changelog/ChangelogBuilderTest.php +++ b/tests/Build/Changelog/ChangelogBuilderTest.php @@ -1,4 +1,5 @@ set('aws_cached_instance_credentials', $c); $r = new ClientResolver(ClientResolver::getDefaultArguments()); $conf = $r->resolve([ @@ -574,8 +575,7 @@ public function testDualstackEndpoints( $useFipsEndpoint, $region, $expectedEndpoint - ) - { + ) { $resolver = new ClientResolver(ClientResolver::getDefaultArguments()); $conf = $resolver->resolve([ 'service' => $service, @@ -887,7 +887,7 @@ public function testUserAgentAlwaysStartsWithSdkAgentString() */ public function testAcceptsBooleansAndArraysForSelectiveStatCollection($userValue, array $resolvedValue) { - $list = new HandlerList; + $list = new HandlerList(); $args = []; ClientResolver::_apply_stats($userValue, $args, $list); foreach ($resolvedValue as $collector => $enabled) { @@ -932,21 +932,20 @@ public function statValueProvider() */ public function testResolvesValuesReturnedByEndpointProvider( array $args, - $argName, - $expected, - $override - ) - { + $argName, + $expected, + $override + ) { $resolverArgs = array_intersect_key( ClientResolver::getDefaultArguments(), array_flip(['endpoint_provider', 'service', 'region', 'scheme', $argName]) ); $resolver = new ClientResolver($resolverArgs); - $resolved = $resolver->resolve($args, new HandlerList); + $resolved = $resolver->resolve($args, new HandlerList()); $this->assertSame($expected, $resolved[$argName]); - $resolved = $resolver->resolve([$argName => $override] + $args, new HandlerList); + $resolved = $resolver->resolve([$argName => $override] + $args, new HandlerList()); $this->assertSame($override, $resolved[$argName]); } @@ -996,17 +995,16 @@ public function endpointProviderReturnProvider() */ public function testSigningValuesAreFetchedFromPartition( array $args, - $argName, - $expected - ) - { + $argName, + $expected + ) { $resolverArgs = array_intersect_key( ClientResolver::getDefaultArguments(), array_flip(['endpoint_provider', 'endpoint', 'service', 'region', $argName]) ); $resolver = new ClientResolver($resolverArgs); - $resolved = $resolver->resolve($args, new HandlerList); + $resolved = $resolver->resolve($args, new HandlerList()); $this->assertSame($expected, $resolved[$argName]); } @@ -1045,14 +1043,13 @@ public function partitionReturnProvider() public function testIdempotencyTokenMiddlewareAddedAsAppropriate( $value, $shouldAddIdempotencyMiddleware - ) - { + ) { $args = [ 'api' => new Service([], function () { return []; }), ]; - $list = new HandlerList; + $list = new HandlerList(); $this->assertCount(0, $list); ClientResolver::_apply_idempotency_auto_fill($value, $args, $list); @@ -1095,7 +1092,6 @@ public function testValidatesRegion($region, $expected) $this->fail('Expected an exception with: ' . $expected->getMessage()); } $this->assertEquals($expected, $result['region']); - } catch (InvalidRegionException $e) { $this->assertEquals($expected->getMessage(), $e->getMessage()); } @@ -1122,4 +1118,4 @@ public function validateRegionProvider() ], ]; } -} \ No newline at end of file +} diff --git a/tests/ClientSideMonitoring/ApiCallAttemptMonitoringMiddlewareTest.php b/tests/ClientSideMonitoring/ApiCallAttemptMonitoringMiddlewareTest.php index 8e12a7700d..a1c3370e9b 100644 --- a/tests/ClientSideMonitoring/ApiCallAttemptMonitoringMiddlewareTest.php +++ b/tests/ClientSideMonitoring/ApiCallAttemptMonitoringMiddlewareTest.php @@ -52,11 +52,14 @@ protected function getMethod($name) protected function resetMiddlewareSocket() { $prepareSocket = $this->getMethod('prepareSocket'); - $middleware = new ApiCallAttemptMonitoringMiddleware(function(){}, + $middleware = new ApiCallAttemptMonitoringMiddleware( + function () { + }, $this->getCredentialProvider(), $this->getConfiguration(), 'test', - 'test'); + 'test' + ); $prepareSocket->invokeArgs($middleware, array(true)); } @@ -243,9 +246,10 @@ public function getMonitoringDataTests() public function testDisablesMiddlewareForUnwrapErrors() { $middleware = new ApiCallAttemptMonitoringMiddleware( - function() {}, + function () { + }, $this->getCredentialProvider(), - function() { + function () { throw new \Exception('Test exception'); }, 'us-east-1', diff --git a/tests/ClientSideMonitoring/ApiCallMonitoringMiddlewareTest.php b/tests/ClientSideMonitoring/ApiCallMonitoringMiddlewareTest.php index f1bb4df026..efb84fce91 100644 --- a/tests/ClientSideMonitoring/ApiCallMonitoringMiddlewareTest.php +++ b/tests/ClientSideMonitoring/ApiCallMonitoringMiddlewareTest.php @@ -49,11 +49,14 @@ protected function getMethod($name) protected function resetMiddlewareSocket() { $prepareSocket = $this->getMethod('prepareSocket'); - $middleware = new ApiCallMonitoringMiddleware(function(){}, + $middleware = new ApiCallMonitoringMiddleware( + function () { + }, $this->getCredentialProvider(), $this->getConfiguration(), 'test', - 'test'); + 'test' + ); $prepareSocket->invokeArgs($middleware, array(true)); } @@ -194,9 +197,10 @@ public function getMonitoringDataTests() public function testDisablesMiddlewareForUnwrapErrors() { $middleware = new ApiCallMonitoringMiddleware( - function() {}, + function () { + }, $this->getCredentialProvider(), - function() { + function () { throw new \Exception('Test exception'); }, 'us-east-1', diff --git a/tests/ClientSideMonitoring/ConfigurationProviderTest.php b/tests/ClientSideMonitoring/ConfigurationProviderTest.php index bc50ca0b0f..fb4d9362fb 100644 --- a/tests/ClientSideMonitoring/ConfigurationProviderTest.php +++ b/tests/ClientSideMonitoring/ConfigurationProviderTest.php @@ -10,13 +10,11 @@ use GuzzleHttp\Promise; use Yoast\PHPUnitPolyfills\TestCases\TestCase; - /** * @covers \Aws\ClientSideMonitoring\ConfigurationProvider */ class ConfigurationProviderTest extends TestCase { - private static $originalEnv; private $iniFile = <<then( - function() { + function () { $this->fail('Should have received a rejection.'); }, - function(ConfigurationException $e) { + function (ConfigurationException $e) { $this->assertStringStartsWith( 'Could not find environment variable CSM config', $e->getMessage() @@ -294,7 +292,7 @@ public function testEnsuresIniFileIsValid() throw $e; } } - + public function testUsesClassDefaultOptions() { $this->clearEnv(); @@ -344,7 +342,9 @@ public function testChainsConfiguration() putenv('HOME=' . dirname($dir)); $a = ConfigurationProvider::ini('custom'); $b = ConfigurationProvider::ini(); - $c = function () { $this->fail('Should not have called'); }; + $c = function () { + $this->fail('Should not have called'); + }; $provider = ConfigurationProvider::chain($a, $b, $c); /** @var ConfigurationInterface $result */ $result = $provider()->wait(); @@ -438,7 +438,7 @@ public function getSuccessfulUnwrapData() $expected = new Configuration(true, '123.4.5.6', 555, 'FooApp'); return [ [ - function() use ($expected) { + function () use ($expected) { return $expected; }, $expected diff --git a/tests/ClientSideMonitoring/ConfigurationTest.php b/tests/ClientSideMonitoring/ConfigurationTest.php index 6add824ee4..18dc3d7031 100644 --- a/tests/ClientSideMonitoring/ConfigurationTest.php +++ b/tests/ClientSideMonitoring/ConfigurationTest.php @@ -6,7 +6,6 @@ use Yoast\PHPUnitPolyfills\TestCases\TestCase; use Psr\Log\InvalidArgumentException; - /** * @covers \Aws\ClientSideMonitoring\Configuration */ diff --git a/tests/ClientSideMonitoring/MonitoringMiddlewareTestingTrait.php b/tests/ClientSideMonitoring/MonitoringMiddlewareTestingTrait.php index bcfe9ed206..3c8f904f22 100644 --- a/tests/ClientSideMonitoring/MonitoringMiddlewareTestingTrait.php +++ b/tests/ClientSideMonitoring/MonitoringMiddlewareTestingTrait.php @@ -63,7 +63,7 @@ public function testPopulatesMonitoringData( } catch (\Exception $e) { if (!$isResultException) { $this->fail('Should not have received a rejection.'); - } else if (!($e instanceof MonitoringEventsInterface)) { + } elseif (!($e instanceof MonitoringEventsInterface)) { $this->fail('Unable to validate the specified behavior'); } $monitoringEvents = $e->getMonitoringEvents(); @@ -74,4 +74,4 @@ public function testPopulatesMonitoringData( $this->assertArraySubset($expected, $eventData); $this->assertIsInt($eventData['Timestamp']); } -} \ No newline at end of file +} diff --git a/tests/CloudFront/CloudFrontClientTest.php b/tests/CloudFront/CloudFrontClientTest.php index 04d2cd12c7..6017ae470a 100644 --- a/tests/CloudFront/CloudFrontClientTest.php +++ b/tests/CloudFront/CloudFrontClientTest.php @@ -15,7 +15,7 @@ class CloudFrontClientTest extends TestCase public function set_up() { - openssl_pkey_export(openssl_pkey_new(),$this->key); + openssl_pkey_export(openssl_pkey_new(), $this->key); $this->kp = 'test'; } diff --git a/tests/CloudFront/CookieSignerTest.php b/tests/CloudFront/CookieSignerTest.php index 54856629db..be8e354308 100644 --- a/tests/CloudFront/CookieSignerTest.php +++ b/tests/CloudFront/CookieSignerTest.php @@ -1,4 +1,5 @@ key); + openssl_pkey_export(openssl_pkey_new(), $this->key); $this->kp = 'test'; } diff --git a/tests/CloudFront/SignerTest.php b/tests/CloudFront/SignerTest.php index a8d03f4398..b5513cd060 100644 --- a/tests/CloudFront/SignerTest.php +++ b/tests/CloudFront/SignerTest.php @@ -1,4 +1,5 @@ expectExceptionMessageMatches("/PK .*Not a real private key/"); $this->expectException(\InvalidArgumentException::class); $privateKey = "Not a real private key"; @@ -38,7 +40,8 @@ public function testBadPrivateKeyContents() { /** * Assert that the key file is parsed during construction */ - public function testBadPrivateKeyPath() { + public function testBadPrivateKeyPath() + { $this->expectExceptionMessageMatches("/PEM .*no start line/"); $this->expectException(\InvalidArgumentException::class); $filename = tempnam(sys_get_temp_dir(), 'cloudfront-fake-key'); diff --git a/tests/CloudFront/UrlSignerTest.php b/tests/CloudFront/UrlSignerTest.php index 585a356d04..bd9b5e80ec 100644 --- a/tests/CloudFront/UrlSignerTest.php +++ b/tests/CloudFront/UrlSignerTest.php @@ -12,13 +12,12 @@ */ class UrlSignerTest extends TestCase { - protected $key; protected $kp; public function set_up() { - openssl_pkey_export(openssl_pkey_new(),$this->key); + openssl_pkey_export(openssl_pkey_new(), $this->key); $this->kp = 'test'; } diff --git a/tests/CloudSearchDomain/CloudSearchDomainTest.php b/tests/CloudSearchDomain/CloudSearchDomainTest.php index 6ba8816612..1f2e5a1419 100644 --- a/tests/CloudSearchDomain/CloudSearchDomainTest.php +++ b/tests/CloudSearchDomain/CloudSearchDomainTest.php @@ -1,4 +1,5 @@ getMockBuilder('Aws\CloudTrail\LogFileReader') ->disableOriginalConstructor() ->getMock(); - $logFileIterator = new \ArrayIterator; + $logFileIterator = new \ArrayIterator(); $records = new LogRecordIterator($logFileReader, $logFileIterator); $this->assertNull($records->key()); $this->assertFalse($records->current()); diff --git a/tests/CognitoIdentity/CognitoIdentityProviderTest.php b/tests/CognitoIdentity/CognitoIdentityProviderTest.php index 6098430316..38d86dafc2 100644 --- a/tests/CognitoIdentity/CognitoIdentityProviderTest.php +++ b/tests/CognitoIdentity/CognitoIdentityProviderTest.php @@ -1,4 +1,5 @@ new Result(), 'B' => new Result()]; - $client = $this->getTestClient('s3'); - $this->addMockResults($client, $results); - $iter = [ - 'A' => $client->getCommand('HeadBucket', ['Bucket' => 'Foo']), - 'B' => $client->getCommand('HeadBucket', ['Bucket' => 'Foo']) - ]; - $pool = new CommandPool($client, $iter, [ - 'fulfilled' => function ($result, $key) use (&$called) { - $called[$key] = $result; - }, - 'preserve_iterator_keys' => true, + { + $results = ['A' => new Result(), 'B' => new Result()]; + $client = $this->getTestClient('s3'); + $this->addMockResults($client, $results); + $iter = [ + 'A' => $client->getCommand('HeadBucket', ['Bucket' => 'Foo']), + 'B' => $client->getCommand('HeadBucket', ['Bucket' => 'Foo']) + ]; + $pool = new CommandPool($client, $iter, [ + 'fulfilled' => function ($result, $key) use (&$called) { + $called[$key] = $result; + }, + 'preserve_iterator_keys' => true, ]); $pool->promise()->wait(); $this->assertSame($results, $called); diff --git a/tests/CommandTest.php b/tests/CommandTest.php index 9b1f8acfe5..7ab683d4cf 100644 --- a/tests/CommandTest.php +++ b/tests/CommandTest.php @@ -1,4 +1,5 @@ set($key, $saved, $saved->getExpiration() - time()); @@ -108,7 +112,7 @@ public function testCreatesFromCache() public function testRefreshesCacheWhenCredsExpired() { - $cache = new LruArrayCache; + $cache = new LruArrayCache(); $key = __CLASS__ . 'credentialsCache'; $saved = new Credentials('foo', 'bar', 'baz', time() - 1); $cache->set($key, $saved); @@ -129,7 +133,7 @@ public function testRefreshesCacheWhenCredsExpired() public function testPersistsToCache() { - $cache = new LruArrayCache; + $cache = new LruArrayCache(); $key = __CLASS__ . 'credentialsCache'; $creds = new Credentials('foo', 'bar', 'baz', PHP_INT_MAX); @@ -787,7 +791,7 @@ public function testAssumeRoleInConfigFromCredentialSourceNoRoleArn() $dir . '/credentials', [] ))->wait(); - } finally { + } finally { unlink($dir . '/credentials'); } } @@ -1036,7 +1040,8 @@ public function testLegacySsoProfileProvider() } $tokenFileName = $tokenFileDirectory . sha1("url.co.uk") . '.json'; file_put_contents( - $tokenFileName, $tokenFile + $tokenFileName, + $tokenFile ); $configFilename = $dir . '/config'; @@ -1116,7 +1121,8 @@ public function testSsoProfileProviderWithNewFileFormat() mkdir(dirname($tokenLocation), 0777, true); } file_put_contents( - $tokenLocation, $tokenFile + $tokenLocation, + $tokenFile ); $configFilename = $dir . '/config'; @@ -1183,7 +1189,8 @@ public function testSsoProfileProviderAddedToDefaultChain() } $tokenFileName = $tokenFileDirectory . sha1("url.co.uk") . '.json'; file_put_contents( - $tokenFileName, $tokenFile + $tokenFileName, + $tokenFile ); $configFilename = $dir . '/config'; @@ -1247,7 +1254,8 @@ public function testSsoProfileProviderMissingTokenData() } $tokenFileName = $tokenFileDirectory . sha1("url.co.uk") . '.json'; file_put_contents( - $tokenFileName, $tokenFile + $tokenFileName, + $tokenFile ); $configFilename = $dir . '/config'; @@ -1306,7 +1314,8 @@ public function testSsoProfileProviderMissingProfile() } $tokenFileName = $tokenFileDirectory . sha1("url.co.uk") . '.json'; file_put_contents( - $tokenFileName, $tokenFile + $tokenFileName, + $tokenFile ); putenv('HOME=' . dirname($dir)); $configFilename = $dir . '/config'; @@ -1350,7 +1359,6 @@ public function testSsoProfileProviderBadFile() putenv('HOME=' . dirname($dir)); call_user_func(CredentialProvider::sso('default', $filename))->wait(); - } public function testSsoProfileProviderFailsWithBadSsoSessionName() @@ -1872,8 +1880,10 @@ public function testCachesCacheableInDefaultChain() foreach ($cacheable as $provider) { $this->clearEnv(); - if ($provider == 'ecs') putenv('AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/latest'); - $cache = new LruArrayCache; + if ($provider == 'ecs') { + putenv('AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/latest'); + } + $cache = new LruArrayCache(); $cache->set('aws_cached_' . $provider . '_credentials', $credsForCache); $credentials = call_user_func(CredentialProvider::defaultProvider([ 'credentials' => $cache, @@ -1890,7 +1900,7 @@ public function testCachesAsPartOfDefaultChain() $instanceCredential = new Credentials('instance_foo', 'instance_bar', 'instance_baz', PHP_INT_MAX); $ecsCredential = new Credentials('ecs_foo', 'ecs_bar', 'ecs_baz', PHP_INT_MAX); - $cache = new LruArrayCache; + $cache = new LruArrayCache(); $cache->set('aws_cached_instance_credentials', $instanceCredential); $cache->set('aws_cached_ecs_credentials', $ecsCredential); @@ -1908,7 +1918,7 @@ public function testCachesAsPartOfDefaultChain() 'credentials' => $cache, ])) ->wait(); - + $this->assertSame($ecsCredential->getAccessKeyId(), $credentials->getAccessKeyId()); $this->assertSame($ecsCredential->getSecretKey(), $credentials->getSecretKey()); @@ -1919,7 +1929,7 @@ public function testCachesAsPartOfDefaultChain() 'credentials' => $cache, ])) ->wait(); - + $this->assertSame($ecsCredential->getAccessKeyId(), $credentials->getAccessKeyId()); $this->assertSame($ecsCredential->getSecretKey(), $credentials->getSecretKey()); } @@ -1933,7 +1943,9 @@ public function testChainsCredentials() putenv('HOME=' . dirname($dir)); $a = CredentialProvider::ini('foo'); $b = CredentialProvider::ini(); - $c = function () { $this->fail('Should not have called'); }; + $c = function () { + $this->fail('Should not have called'); + }; $provider = CredentialProvider::chain($a, $b, $c); $creds = $provider()->wait(); $this->assertSame('foo', $creds->getAccessKeyId()); @@ -1981,9 +1993,12 @@ public function testProcessCredentialConfigDefaultChain() * @param bool $expected */ public function testShouldUseEcs( - $relative, $serverRelative, $full, $serverFull, $expected - ) - { + $relative, + $serverRelative, + $full, + $serverFull, + $expected + ) { $this->clearEnv(); putenv('AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' . $relative); $_SERVER['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI'] = $serverRelative; diff --git a/tests/Credentials/CredentialsTest.php b/tests/Credentials/CredentialsTest.php index 3637448ceb..f31ff14b50 100644 --- a/tests/Credentials/CredentialsTest.php +++ b/tests/Credentials/CredentialsTest.php @@ -1,4 +1,5 @@ clearEnv(); $provider = new EcsCredentialProvider(); @@ -100,8 +102,12 @@ public function testRequestHeaderWithAuthorisationKey(){ } private function getCredentialArray( - $key, $secret, $token = null, $time = null, $success = true - ){ + $key, + $secret, + $token = null, + $time = null, + $success = true + ) { return [ 'Code' => $success ? 'Success' : 'Failed', 'AccessKeyId' => $key, @@ -195,7 +201,7 @@ public function testNoProxying() $args['client'] = $guzzle; $provider = new EcsCredentialProvider($args); - $provider()->otherwise(function(\Exception $e) { + $provider()->otherwise(function (\Exception $e) { $this->fail('Did not override ECS request proxy settings.'); })->wait(); diff --git a/tests/Credentials/InstanceProfileProviderTest.php b/tests/Credentials/InstanceProfileProviderTest.php index fc94558956..b635dd79f5 100644 --- a/tests/Credentials/InstanceProfileProviderTest.php +++ b/tests/Credentials/InstanceProfileProviderTest.php @@ -1,4 +1,5 @@ new RequestException('404 Not Found', + 'exception' => new RequestException( + '404 Not Found', $putRequest, new $responseClass(404) ) @@ -1015,7 +1021,7 @@ public function testExtendsExpirationAndSendsRequestIfImdsYieldsExpiredCreds($cl $result = $s3Client->listBuckets(); $this->assertEquals('Request sent', $result['message']); - $this->assertLessThanOrEqual(3,$this->getPropertyValue($provider,'attempts')); + $this->assertLessThanOrEqual(3, $this->getPropertyValue($provider, 'attempts')); } public function returnsExpiredCredsProvider() @@ -1024,11 +1030,15 @@ public function returnsExpiredCredsProvider() $expiredCreds = ['foo', 'baz', null, "@{$expiredTime}"]; $promiseCreds = Promise\Create::promiseFor( - new Response(200, [], Psr7\Utils::streamFor( - json_encode(call_user_func_array( - [$this, 'getCredentialArray'], - $expiredCreds - ))) + new Response( + 200, + [], + Psr7\Utils::streamFor( + json_encode(call_user_func_array( + [$this, 'getCredentialArray'], + $expiredCreds + )) + ) ) ); @@ -1100,7 +1110,7 @@ public function testExtendsExpirationAndSendsRequestIfImdsUnavailable($client) $result = $s3Client->listBuckets(); $this->assertEquals('Request sent', $result['message']); - $this->assertLessThanOrEqual(3,$this->getPropertyValue($provider,'attempts')); + $this->assertLessThanOrEqual(3, $this->getPropertyValue($provider, 'attempts')); } public function imdsUnavailableProvider() diff --git a/tests/Crypto/AesDecryptingStreamTest.php b/tests/Crypto/AesDecryptingStreamTest.php index da2d03cf22..50b7f4bc29 100644 --- a/tests/Crypto/AesDecryptingStreamTest.php +++ b/tests/Crypto/AesDecryptingStreamTest.php @@ -1,4 +1,5 @@ getTestClient('Kms', []); $list = $client->getHandlerList(); - $list->appendSign(Middleware::tap(function($cmd, $req) use ($keyId) { + $list->appendSign(Middleware::tap(function ($cmd, $req) use ($keyId) { // Test that command is populated correctly $this->assertEquals( [ @@ -144,7 +145,7 @@ public function testDecryptCek() /** @var KmsClient $client */ $client = $this->getTestClient('Kms', []); $list = $client->getHandlerList(); - $list->appendSign(Middleware::tap(function($cmd, $req) { + $list->appendSign(Middleware::tap(function ($cmd, $req) { // Test that command is populated correctly $this->assertEquals( [ @@ -197,7 +198,7 @@ public function testDecryptWithAnyCmk() /** @var KmsClient $client */ $client = $this->getTestClient('Kms', []); $list = $client->getHandlerList(); - $list->appendSign(Middleware::tap(function($cmd, $req) { + $list->appendSign(Middleware::tap(function ($cmd, $req) { // Test that command is populated correctly $this->assertEquals( [ diff --git a/tests/Crypto/MetadataEnvelopeTest.php b/tests/Crypto/MetadataEnvelopeTest.php index 11fd1121cc..aa09f3156c 100644 --- a/tests/Crypto/MetadataEnvelopeTest.php +++ b/tests/Crypto/MetadataEnvelopeTest.php @@ -1,4 +1,5 @@ assertStringContainsString("X-Amz-Signature={$expectedSignature}", $url); } else { self::assertNull($url); } - return new Result; + return new Result(); } ]); @@ -85,4 +87,3 @@ public function testCorrectPresignDocDbUrls( call_user_func([$docDb, $functionName], $functionArgs); } } - diff --git a/tests/DoctrineCacheAdapterTest.php b/tests/DoctrineCacheAdapterTest.php index 7ce21f324c..174ab7c460 100644 --- a/tests/DoctrineCacheAdapterTest.php +++ b/tests/DoctrineCacheAdapterTest.php @@ -1,4 +1,5 @@ []] ], [ // Traversable @@ -228,7 +229,7 @@ public function testMarshalingJsonAndItems() ]], ]; - $m = new Marshaler; + $m = new Marshaler(); $this->assertEquals($expected, $m->marshalJson($json)); $this->assertEquals($expected, $m->marshalItem($array)); } @@ -236,7 +237,7 @@ public function testMarshalingJsonAndItems() public function testErrorIfMarshalingBadJsonDoc() { $this->expectException(\InvalidArgumentException::class); - (new Marshaler)->marshalJson('foo'); + (new Marshaler())->marshalJson('foo'); } @@ -279,14 +280,14 @@ public function testUnmarshalingHandlesAllDynamoDbTypes() JSON; $json = str_replace([" ", "\n"], '', $json); // remove whitespace - $m = new Marshaler; + $m = new Marshaler(); $this->assertSame($json, $m->unmarshalJson($item)); $this->assertSame($json, json_encode($m->unmarshalItem($item))); } public function testCanUnmarshalToObjectFormat() { - $result = (new Marshaler)->unmarshalValue( + $result = (new Marshaler())->unmarshalValue( ['M' => ['a' => ['S' => 'b']]], true ); @@ -298,13 +299,13 @@ public function testCanUnmarshalToObjectFormat() public function testErrorIfUnmarshalingUnknownType() { $this->expectException(\UnexpectedValueException::class); - $m = new Marshaler; + $m = new Marshaler(); $m->unmarshalValue(['BOMB' => 'BOOM']); } public function testThatBinaryAndSetValuesGetRoundtrippedWithoutChanges() { - $m = new Marshaler; + $m = new Marshaler(); $item = [ 'foo' => $m->binary('foo'), 'bar' => $m->set(['foo', 'bar']), diff --git a/tests/DynamoDb/SessionConnectionConfigTraitTest.php b/tests/DynamoDb/SessionConnectionConfigTraitTest.php index 4ffcee2e29..ad9b112181 100644 --- a/tests/DynamoDb/SessionConnectionConfigTraitTest.php +++ b/tests/DynamoDb/SessionConnectionConfigTraitTest.php @@ -1,4 +1,5 @@ expects($this->any()) ->method('write') - ->willReturn( true); + ->willReturn(true); $connection->expects($this->once()) ->method('read') ->withAnyParameters('test') @@ -114,10 +115,10 @@ public function testSessionDataCanBeWrittenToNewIdWithNoChanges() ->willReturn('expires'); $connection->expects($this->any()) ->method('write') - ->willReturn( true); + ->willReturn(true); $connection->expects($this->any()) ->method('read') - ->willReturn( ['expires' => time() + 1000, 'data' => 'serializedData']); + ->willReturn(['expires' => time() + 1000, 'data' => 'serializedData']); $sh = new SessionHandler($connection); $sh->write(session_id(), $data); diff --git a/tests/DynamoDb/StandardSessionConnectionTest.php b/tests/DynamoDb/StandardSessionConnectionTest.php index 27260fda5e..40b01c0e90 100644 --- a/tests/DynamoDb/StandardSessionConnectionTest.php +++ b/tests/DynamoDb/StandardSessionConnectionTest.php @@ -1,4 +1,5 @@ ['B' => 'bar'] ]]), ]); - + $client->getHandlerList()->appendBuild(Middleware::tap(function ($command) { $this->assertEquals( ['sessionid' => ['S' => 'session1']], $command['Key'] ); })); - + $connection = new StandardSessionConnection($client, [ 'hash_key' => 'sessionid', ]); @@ -219,10 +220,12 @@ public function testDeleteExpiredReturnsBoolBasedOnSuccess() ]); $commands = []; - $client->getHandlerList()->appendBuild(Middleware::tap( - function (CommandInterface $command) use (&$commands) { - $commands[] = $command->getName(); - }) + $client->getHandlerList()->appendBuild( + Middleware::tap( + function (CommandInterface $command) use (&$commands) { + $commands[] = $command->getName(); + } + ) ); (new StandardSessionConnection($client))->deleteExpired(); diff --git a/tests/DynamoDb/WriteRequestBatchTest.php b/tests/DynamoDb/WriteRequestBatchTest.php index 2be84a22e3..381b94b7c1 100644 --- a/tests/DynamoDb/WriteRequestBatchTest.php +++ b/tests/DynamoDb/WriteRequestBatchTest.php @@ -1,4 +1,5 @@ 'foo', - 'error' => function($e) use (&$unhandledErrors) { + 'error' => function ($e) use (&$unhandledErrors) { $unhandledErrors++; } ]); diff --git a/tests/Ec2/Ec2ClientTest.php b/tests/Ec2/Ec2ClientTest.php index 30393edbad..84a0624053 100644 --- a/tests/Ec2/Ec2ClientTest.php +++ b/tests/Ec2/Ec2ClientTest.php @@ -1,4 +1,5 @@ expectException(\Aws\Exception\UnresolvedEndpointException::class); - EndpointProvider::resolve(function() {}, []); + EndpointProvider::resolve(function () { + }, []); } public function testThrowsWhenNotArray() { $this->expectException(\Aws\Exception\UnresolvedEndpointException::class); - EndpointProvider::resolve(function() { return 'foo'; }, []); + EndpointProvider::resolve(function () { + return 'foo'; + }, []); } public function testCreatesDefaultProvider() diff --git a/tests/Endpoint/PartitionEndpointProviderTest.php b/tests/Endpoint/PartitionEndpointProviderTest.php index fec050d0dc..e4afae98eb 100644 --- a/tests/Endpoint/PartitionEndpointProviderTest.php +++ b/tests/Endpoint/PartitionEndpointProviderTest.php @@ -1,4 +1,5 @@ $old) { foreach ($old as $prefix) { $this->assertArrayHasKey( - $prefix, $partition["services"] + $prefix, + $partition["services"] ); $this->assertSame( $partition["services"][$current], diff --git a/tests/Endpoint/PartitionTest.php b/tests/Endpoint/PartitionTest.php index 9642602781..211d75f583 100644 --- a/tests/Endpoint/PartitionTest.php +++ b/tests/Endpoint/PartitionTest.php @@ -1,4 +1,5 @@ assertEquals($expectedEndpoint, $data['endpoint']); - } public function stsEndpointTestCases() @@ -611,7 +611,6 @@ public function testResolvesS3RegionalEndpoint( $data = $partition($params); $this->assertEquals($expectedEndpoint, $data['endpoint']); - } public function s3EndpointTestCases() @@ -676,8 +675,7 @@ public function testGetVariantIgnoresVariantTagOrder( array $definition, $fipsConfig, $dualstackConfig - ) - { + ) { $partition = new Partition($definition); $resolved = $partition([ 'region' => 'us-east-1', @@ -826,8 +824,7 @@ public function testGetVariantNoVariantSelectedIfTagsAreEmpty( array $definition, $fipsConfig, $dualstackConfig - ) - { + ) { $partition = new Partition($definition); $resolved = $partition([ 'region' => 'us-east-1', @@ -974,10 +971,9 @@ public function variantTagEmptyProvider() */ public function testGetVariantWithBooleanConfigValues( array $tags, - $fipsConfig, - $dualstackConfig - ) - { + $fipsConfig, + $dualstackConfig + ) { $definition = [ 'partition' => 'aws_test', 'dnsSuffix' => 'amazonaws.com', diff --git a/tests/Endpoint/PatternEndpointProviderTest.php b/tests/Endpoint/PatternEndpointProviderTest.php index d9d7af07cc..d001803668 100644 --- a/tests/Endpoint/PatternEndpointProviderTest.php +++ b/tests/Endpoint/PatternEndpointProviderTest.php @@ -1,4 +1,5 @@ assertSame($expected->toArray(), $result->toArray()); } } - diff --git a/tests/Endpoint/UseDualstackEndpoint/ConfigurationTest.php b/tests/Endpoint/UseDualstackEndpoint/ConfigurationTest.php index 621146e6d6..9c2c418603 100644 --- a/tests/Endpoint/UseDualstackEndpoint/ConfigurationTest.php +++ b/tests/Endpoint/UseDualstackEndpoint/ConfigurationTest.php @@ -1,4 +1,5 @@ assertSame($expected->toArray(), $result->toArray()); } } - diff --git a/tests/Endpoint/UseFipsEndpoint/ConfigurationTest.php b/tests/Endpoint/UseFipsEndpoint/ConfigurationTest.php index b77a7a030c..c1fbb4ae25 100644 --- a/tests/Endpoint/UseFipsEndpoint/ConfigurationTest.php +++ b/tests/Endpoint/UseFipsEndpoint/ConfigurationTest.php @@ -1,4 +1,5 @@ assertIsArray($rulesetDefinition); $this->assertArrayHasKey('parameters', $rulesetDefinition); @@ -19,7 +20,8 @@ public function testProvidesRuleset() public function testProvidesRulesetTests() { $testsDefinition = EndpointDefinitionProvider::getEndpointTests( - 's3', 'latest' + 's3', + 'latest' ); $this->assertIsArray($testsDefinition); $this->assertArrayHasKey('testCases', $testsDefinition); @@ -45,4 +47,4 @@ public function testThrowsExceptionOnInvalidApiVersion() $this->expectExceptionMessage('Invalid api version.'); EndpointDefinitionProvider::getEndpointRuleset('s3', '10-22-2022'); } -} \ No newline at end of file +} diff --git a/tests/EndpointV2/EndpointProviderV2Test.php b/tests/EndpointV2/EndpointProviderV2Test.php index 078aaea5ef..0769b33d83 100644 --- a/tests/EndpointV2/EndpointProviderV2Test.php +++ b/tests/EndpointV2/EndpointProviderV2Test.php @@ -1,4 +1,5 @@ resolveEndpoint($inputParams); $expectedEndpoint = $expected['endpoint']; $this->assertEquals($expectedEndpoint['url'], $endpoint->getUrl()); - if (isset($expectedEndpoint['headers'])){ + if (isset($expectedEndpoint['headers'])) { $this->assertEquals($expectedEndpoint['headers'], $endpoint->getHeaders()); } if (isset($expectedEndpoint['properties'])) { @@ -107,19 +107,20 @@ public function serviceTestCaseProvider() $serviceTestCases = []; $services = \Aws\Manifest(); - foreach($services as $service => $data) { + foreach ($services as $service => $data) { $serviceTests = EndpointDefinitionProvider::getEndpointTests( - $service, 'latest' + $service, + 'latest' ); - foreach($serviceTests['testCases'] as $case) { + foreach ($serviceTests['testCases'] as $case) { $testCase = [$service]; $inputParams = isset($case['params']) ? $case['params'] : []; $expected = $case['expect']; if (isset($expected['endpoint'])) { $testCase[] = 'true'; - } else if (isset($expected['error'])) { + } elseif (isset($expected['error'])) { $testCase[] = 'false'; } array_push($testCase, $inputParams, $expected); @@ -137,8 +138,7 @@ public function testServiceEndpointAndErrorCases( $isSuccessCase, $inputParams, $expected - ) - { + ) { $provider = new EndpointProviderV2( EndpointDefinitionProvider::getEndpointRuleset($service, 'latest'), EndpointDefinitionProvider::getPartitions() @@ -152,7 +152,7 @@ public function testServiceEndpointAndErrorCases( $endpoint = $provider->resolveEndpoint($inputParams); $expectedEndpoint = $expected['endpoint']; $this->assertEquals($expectedEndpoint['url'], $endpoint->getUrl()); - if (isset($expectedEndpoint['headers'])){ + if (isset($expectedEndpoint['headers'])) { $this->assertEquals($expectedEndpoint['headers'], $endpoint->getHeaders()); } if (isset($expectedEndpoint['properties'])) { @@ -166,15 +166,15 @@ public function rulesetProtocolEndpointAndErrorCaseProvider() $protocolTestCases = []; $serviceList = \Aws\manifest(); - forEach($serviceList as $service => $serviceValue) { + foreach ($serviceList as $service => $serviceValue) { $testFile = EndpointDefinitionProvider::getEndpointTests($service, 'latest'); - foreach($testFile['testCases'] as $case) { + foreach ($testFile['testCases'] as $case) { if (!isset($case['operationInputs'])) { continue; } - foreach($case['operationInputs'] as $operationInput) { + foreach ($case['operationInputs'] as $operationInput) { $caseArgs = [$service]; $builtInParams = $operationInput['builtInParams']; @@ -201,7 +201,6 @@ public function rulesetProtocolEndpointAndErrorCaseProvider() array_push($caseArgs, $clientArgs, $operationInput, $case['expect'], isset($case['expect']['error'])); $protocolTestCases[] = $caseArgs; } - } } return $protocolTestCases; @@ -243,7 +242,7 @@ public function testRulesetProtocolEndpointAndErrorCases($service, $clientArgs, goto resolveHandler; } - $list->appendSign(Middleware::tap(function($cmd, $req) use ($service, $expected) { + $list->appendSign(Middleware::tap(function ($cmd, $req) use ($service, $expected) { $expectedEndpoint = $expected['endpoint']; $expectedUri = new Uri($expected['endpoint']['url']); $this->assertStringContainsString( @@ -285,14 +284,13 @@ public function testRulesetProtocolEndpointAndErrorCases($service, $clientArgs, $expectedHeaders = $expectedEndpoint['headers']; $returnedHeaders = $req->getHeaders(); - foreach($expectedHeaders as $headerKey => $headerValue) { + foreach ($expectedHeaders as $headerKey => $headerValue) { $this->assertArrayHasKey($headerKey, $returnedHeaders); $this->assertEquals( $returnedHeaders[$headerKey][0], $headerValue[0] ); } - } })); resolveHandler: diff --git a/tests/EndpointV2/EndpointV2SerializerTraitTest.php b/tests/EndpointV2/EndpointV2SerializerTraitTest.php index 37e5f3747c..7cb46d70d7 100644 --- a/tests/EndpointV2/EndpointV2SerializerTraitTest.php +++ b/tests/EndpointV2/EndpointV2SerializerTraitTest.php @@ -1,4 +1,5 @@ getHandlerList(); - $list->appendSign(Middleware::tap(function($cmd, $req) { + $list->appendSign(Middleware::tap(function ($cmd, $req) { $this->assertStringContainsString( 'foo.com', $req->getUri()->getHost() @@ -54,8 +55,8 @@ public function testThrowsExceptionForInvalidAuthScheme() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage( - 'This operation requests `sigvfoo`, `sigvbar`, `sigvbaz` auth schemes,' - . ' but the client only supports `sigv4`, `sigv4a`, `none`, `bearer`.' + 'This operation requests `sigvfoo`, `sigvbar`, `sigvbaz` auth schemes,' + . ' but the client only supports `sigv4`, `sigv4a`, `none`, `bearer`.' ); $rulesetPath = __DIR__ . '/invalid-rules/invalid-scheme.json'; @@ -79,4 +80,4 @@ public function testThrowsExceptionForInvalidAuthScheme() $handler = $list->resolve(); $handler($command)->wait(); } -} \ No newline at end of file +} diff --git a/tests/EndpointV2/RuleCreatorTest.php b/tests/EndpointV2/RuleCreatorTest.php index 99d4d3fe0a..1eb1ec0a8c 100644 --- a/tests/EndpointV2/RuleCreatorTest.php +++ b/tests/EndpointV2/RuleCreatorTest.php @@ -1,4 +1,5 @@ assertInstanceOf('Aws\EndpointV2\Rule\\' . $expected, $result); } diff --git a/tests/EndpointV2/RulesetParameterTest.php b/tests/EndpointV2/RulesetParameterTest.php index 2300c8d430..90279732d6 100644 --- a/tests/EndpointV2/RulesetParameterTest.php +++ b/tests/EndpointV2/RulesetParameterTest.php @@ -1,4 +1,5 @@ 'There is a new parameter.' ] ]; - $this->rulesetParameter = new RulesetParameter('Region' ,$spec); + $this->rulesetParameter = new RulesetParameter('Region', $spec); } public function wrongParameterTypeProvider() @@ -58,7 +59,8 @@ public function testDeprecatedParameterLogsError() $this->rulesetParameter->validateInputParam('us-east-1'); } - public function testUnknownTypeThrowsException() { + public function testUnknownTypeThrowsException() + { $parameterSpec = [ 'type' => 'tuple' ]; diff --git a/tests/EndpointV2/RulesetStandardLibraryTest.php b/tests/EndpointV2/RulesetStandardLibraryTest.php index 35c156a533..84cb8a3bba 100644 --- a/tests/EndpointV2/RulesetStandardLibraryTest.php +++ b/tests/EndpointV2/RulesetStandardLibraryTest.php @@ -1,4 +1,5 @@ standardLibrary->resolveTemplateString($string, $inputParams); } - public function testParseArnReturnsNullIfInvalid() { + public function testParseArnReturnsNullIfInvalid() + { $result = $this->standardLibrary->parseArn('arn:aws:this-is-not-an-arn:foo'); $this->assertEquals(null, $result); } @@ -300,13 +302,15 @@ public function testPartitionThrowsExceptionIfNotString() $this->standardLibrary->partition(null); } - public function testSubstringThrowsExceptionIfInputNotString() { + public function testSubstringThrowsExceptionIfInputNotString() + { $this->expectException(UnresolvedEndpointException::class); $this->expectExceptionMessage('Input passed to `substring` must be `string`.'); $this->standardLibrary->substring(null, null, null, null); } - public function testCallFunctionThrowsErrorIfAlreadyAssigned() { + public function testCallFunctionThrowsErrorIfAlreadyAssigned() + { $condition = [ 'fn' => 'aws.parseArn', 'argv' => ['{Bucket}'], @@ -325,4 +329,3 @@ public function testCallFunctionThrowsErrorIfAlreadyAssigned() { $this->standardLibrary->callFunction($condition, $inputParameters); } } - diff --git a/tests/EventBridge/EventBridgeClientTest.php b/tests/EventBridge/EventBridgeClientTest.php index 6c0b85cdf2..60d8ee11b7 100644 --- a/tests/EventBridge/EventBridgeClientTest.php +++ b/tests/EventBridge/EventBridgeClientTest.php @@ -1,4 +1,5 @@ $clientRegion, 'version' => 'latest', - 'handler' => function (CommandInterface $cmd, RequestInterface $req) - use ($expectedEndpoint, $additionalHeaders) { + 'handler' => function (CommandInterface $cmd, RequestInterface $req) use ($expectedEndpoint, $additionalHeaders) { $this->assertSame( $expectedEndpoint, (string) $req->getUri() @@ -140,7 +138,6 @@ public function testPutEventsEndpointSuccessCases( public function putEventsEndpointFailureProvider() { - return [ ["us-east-1", [], 'badactor.com?foo=bar', 'EndpointId must be a valid host label.'], ["us-east-1", ['use_fips_endpoint' => true], 'abc123.456def', 'Invalid Configuration: FIPS is not supported with EventBridge multi-region endpoints.'], @@ -161,8 +158,7 @@ public function testPutEventsEndpointFailureCases( $additionalConfig, $endpointId, $expectedException - ) - { + ) { $clientConfig = [ 'region' => $clientRegion, 'version' => 'latest', @@ -198,4 +194,4 @@ public function testPutEventsEndpointFailureCases( self::assertStringContainsString($expectedException, $exception->getMessage()); } } -} \ No newline at end of file +} diff --git a/tests/Exception/AwsExceptionTest.php b/tests/Exception/AwsExceptionTest.php index 7007e682af..dbe3a8d73e 100644 --- a/tests/Exception/AwsExceptionTest.php +++ b/tests/Exception/AwsExceptionTest.php @@ -1,4 +1,5 @@ assertSame('+-', $comp('+', '-')); } @@ -49,9 +56,15 @@ public function testComposesOrFunctions() public function testReturnsNullWhenNonResolve() { $called = []; - $a = function () use (&$called) { $called[] = 'a'; }; - $b = function () use (&$called) { $called[] = 'b'; }; - $c = function () use (&$called) { $called[] = 'c'; }; + $a = function () use (&$called) { + $called[] = 'a'; + }; + $b = function () use (&$called) { + $called[] = 'b'; + }; + $c = function () use (&$called) { + $called[] = 'c'; + }; $comp = Aws\or_chain($a, $b, $c); $this->assertNull($comp()); $this->assertEquals(['a', 'b', 'c'], $called); @@ -136,7 +149,9 @@ public function testOnlyLoadsCompiledJsonOnce() public function testFilter() { $data = [0, 1, 2, 3, 4]; - $func = function ($v) { return $v % 2; }; + $func = function ($v) { + return $v % 2; + }; $result = \Aws\filter($data, $func); $this->assertEquals([1, 3], iterator_to_array($result)); } @@ -147,7 +162,9 @@ public function testFilter() public function testMap() { $data = [0, 1, 2, 3, 4]; - $result = \Aws\map($data, function ($v) { return $v + 1; }); + $result = \Aws\map($data, function ($v) { + return $v + 1; + }); $this->assertEquals([1, 2, 3, 4, 5], iterator_to_array($result)); } @@ -157,7 +174,9 @@ public function testMap() public function testFlatMap() { $data = ['Hello', 'World']; - $xf = function ($value) { return str_split($value); }; + $xf = function ($value) { + return str_split($value); + }; $result = \Aws\flatmap($data, $xf); $this->assertEquals( ['H', 'e', 'l', 'l', 'o', 'W', 'o', 'r', 'l', 'd'], @@ -198,7 +217,7 @@ public function testDescribeArray() */ public function testDescribeDoubleToFloat() { - $double = (double)1.3; + $double = (float)1.3; $this->assertSame('float(1.3)', Aws\describe_type($double)); } diff --git a/tests/Glacier/GlacierClientTest.php b/tests/Glacier/GlacierClientTest.php index 080b359d8e..a247be250f 100644 --- a/tests/Glacier/GlacierClientTest.php +++ b/tests/Glacier/GlacierClientTest.php @@ -1,4 +1,5 @@ 1] + $defaults, Psr7\FnStream::decorate( - Psr7\Utils::streamFor($data), [ - 'getSize' => function () {return null;} + Psr7\Utils::streamFor($data), + [ + 'getSize' => function () { + return null; + } ] ), 'InvalidArgumentException' diff --git a/tests/Glacier/TreeHashTest.php b/tests/Glacier/TreeHashTest.php index 907faac89e..9dd970b809 100644 --- a/tests/Glacier/TreeHashTest.php +++ b/tests/Glacier/TreeHashTest.php @@ -1,4 +1,5 @@ function () {}, + 'http_stats_receiver' => function () { + }, 'on_stats' => function (TransferStats $stats) use (&$wasCalled) { $wasCalled = true; }, @@ -145,5 +147,4 @@ public function testHandlerWorksWithErroredRequest() $this->assertTrue($wasRejected, 'Reject callback was not triggered.'); } - } diff --git a/tests/HandlerListTest.php b/tests/HandlerListTest.php index d9a7ac99a5..2012f6bc57 100644 --- a/tests/HandlerListTest.php +++ b/tests/HandlerListTest.php @@ -1,4 +1,5 @@ assertTrue($list->hasHandler()); $this->assertSame($handler, $list->resolve()); @@ -31,7 +33,8 @@ public function testHandlerCanBeSetInCtor() public function testHandlerCanBeSetInSetter() { - $handler = function () {}; + $handler = function () { + }; $list = new HandlerList(); $list->setHandler($handler); $this->assertTrue($list->hasHandler()); @@ -41,15 +44,20 @@ public function testHandlerCanBeSetInSetter() public function testCanPrependWithName() { $list = new HandlerList(); - $list->prependInit(function () {}, 'foo'); + $list->prependInit(function () { + }, 'foo'); $this->assertCount(1, $list); } public function testCanRemoveByInstance() { - $handler = function () {}; + $handler = function () { + }; $list = new HandlerList($handler); - $middleware = function () { return function () {}; }; + $middleware = function () { + return function () { + }; + }; $list->appendInit($middleware); $this->assertCount(1, $list); $this->assertNotSame($handler, $list->resolve()); @@ -67,9 +75,13 @@ public function testIgnoreWhenNameNotFound() public function testCanRemoveByName() { - $handler = function () {}; + $handler = function () { + }; $list = new HandlerList($handler); - $middleware = function () { return function () {}; }; + $middleware = function () { + return function () { + }; + }; $list->appendInit($middleware, 'foo'); $this->assertCount(1, $list); $this->assertNotSame($handler, $list->resolve()); @@ -127,11 +139,13 @@ public function testWrapsInStepOrderWithPrepend() public function testCanPrintStack() { $list = new HandlerList(); - $list->appendInit(function () {}, 'foo'); + $list->appendInit(function () { + }, 'foo'); $list->appendInit([$this, 'bar'], 'bar'); $list->appendValidate(__CLASS__ . '::foo'); $list->appendSign([Middleware::class, 'tap'], 'baz'); - $list->setHandler(function () {}); + $list->setHandler(function () { + }); $lines = explode("\n", (string) $list); $this->assertCount(6, $lines); $this->assertStringContainsString('0) Step: init, Name: foo, Function: callable(', $lines[0]); @@ -141,15 +155,22 @@ public function testCanPrintStack() $this->assertStringContainsString('4) Handler: callable(', $lines[4]); } - public static function foo() {} - public function bar() {} + public static function foo() + { + } + public function bar() + { + } public function testCanAddBefore() { $list = new HandlerList(); - $list->appendInit(function () {}); - $list->appendBuild(function () {}, 'test'); - $list->before('test', 'a', function () {}); + $list->appendInit(function () { + }); + $list->appendBuild(function () { + }, 'test'); + $list->before('test', 'a', function () { + }); $lines = explode("\n", (string) $list); $this->assertStringContainsString("1) Step: build, Name: a", $lines[1]); $this->assertStringContainsString("2) Step: build, Name: test", $lines[2]); @@ -158,10 +179,14 @@ public function testCanAddBefore() public function testCanAddAfter() { $list = new HandlerList(); - $list->appendBuild(function () {}, 'test'); - $list->appendBuild(function () {}, 'after_test'); - $list->appendInit(function () {}); - $list->after('test', 'a', function () {}); + $list->appendBuild(function () { + }, 'test'); + $list->appendBuild(function () { + }, 'after_test'); + $list->appendInit(function () { + }); + $list->after('test', 'a', function () { + }); $lines = explode("\n", (string) $list); $this->assertStringContainsString("1) Step: build, Name: test", $lines[1]); $this->assertStringContainsString("2) Step: build, Name: a", $lines[2]); @@ -172,17 +197,24 @@ public function testMustExistByNameToPrependOrAppend() { $this->expectException(\InvalidArgumentException::class); $list = new HandlerList(); - $list->before('foo', '', function () {}); + $list->before('foo', '', function () { + }); } public function testCanInterposeMiddleware() { - $list = new HandlerList(function () {}); - $list->appendInit(Middleware::tap(function () {}), 'a'); - $list->appendValidate(Middleware::tap(function () {}), 'b'); - $list->appendBuild(Middleware::tap(function () {}), 'c'); - $list->appendSign(Middleware::tap(function () {}), 'd'); - $list->appendAttempt(Middleware::tap(function (){}), 'e'); + $list = new HandlerList(function () { + }); + $list->appendInit(Middleware::tap(function () { + }), 'a'); + $list->appendValidate(Middleware::tap(function () { + }), 'b'); + $list->appendBuild(Middleware::tap(function () { + }), 'c'); + $list->appendSign(Middleware::tap(function () { + }), 'd'); + $list->appendAttempt(Middleware::tap(function () { + }), 'e'); $list->interpose(function ($step, $name) use (&$res) { return function (callable $h) use ($step, $name, &$res) { diff --git a/tests/HasMonitoringEventsTraitTest.php b/tests/HasMonitoringEventsTraitTest.php index d3e7df6b27..7b2652f11d 100644 --- a/tests/HasMonitoringEventsTraitTest.php +++ b/tests/HasMonitoringEventsTraitTest.php @@ -1,15 +1,14 @@ getMockForTrait('Aws\HasMonitoringEventsTrait'); - foreach($events as $event) { + foreach ($events as $event) { $mock->appendMonitoringEvent($event); } $this->assertSame( - $events, $mock->getMonitoringEvents() + $events, + $mock->getMonitoringEvents() ); } - } diff --git a/tests/HashingStreamTest.php b/tests/HashingStreamTest.php index ddb4a86844..aa080c581e 100644 --- a/tests/HashingStreamTest.php +++ b/tests/HashingStreamTest.php @@ -1,4 +1,5 @@ assertCount((int) $count, array_unique( - JmesPath\search($path, $this->result) + JmesPath\search($path, $this->result) )); } } diff --git a/tests/Integ/CrtContext.php b/tests/Integ/CrtContext.php index e7a4268366..64bb4790e2 100644 --- a/tests/Integ/CrtContext.php +++ b/tests/Integ/CrtContext.php @@ -1,4 +1,5 @@ $filename, 'Body' => 'foo' ]); - $ex = $this->s3Client->getObject( [ + $ex = $this->s3Client->getObject([ 'Bucket' => self::getResourceName(), 'Key' => $filename])['Body']; } @@ -166,7 +166,8 @@ public function theNewFileShouldBeInTheBucket($filename) 'Bucket' => self::getResourceName(), 'Key' => $filename . '-copy', ])['Body']->getContents() - ); } + ); + } /** * @Given I have a non-seekable read stream diff --git a/tests/Integ/S3Context.php b/tests/Integ/S3Context.php index 2628417ccb..3ec68b116c 100644 --- a/tests/Integ/S3Context.php +++ b/tests/Integ/S3Context.php @@ -1,4 +1,5 @@ send($this->presignedRequest); + (new Client())->send($this->presignedRequest); } /** @@ -269,7 +270,7 @@ public function iCreateAPostObjectSigvWithInputsAndPolicy2() public function iMakeAHttpPostRequest() { try { - (new Client)->request( + (new Client())->request( $this->attributes['method'], $this->attributes['action'], [ diff --git a/tests/Integ/S3EncryptionContext.php b/tests/Integ/S3EncryptionContext.php index efdeb231a4..32aef675f6 100644 --- a/tests/Integ/S3EncryptionContext.php +++ b/tests/Integ/S3EncryptionContext.php @@ -1,4 +1,5 @@ getFeature()->getTags() as $tag) { - try{ + try { $this->serviceName = Aws\manifest($tag)['namespace']; break; } catch (\Exception $e) { diff --git a/tests/JsonCompilerTest.php b/tests/JsonCompilerTest.php index bca34d2c4f..0f01e11b47 100644 --- a/tests/JsonCompilerTest.php +++ b/tests/JsonCompilerTest.php @@ -1,4 +1,5 @@ markTestSkipped('Test skipped on no cURL extension'); @@ -37,4 +38,4 @@ function testsAddsDefaultCurlOptions() $client->listFunctions(); } -} \ No newline at end of file +} diff --git a/tests/LexModelsV2/LexModelsV2ClientTest.php b/tests/LexModelsV2/LexModelsV2ClientTest.php index 0eeb5177db..3ca0c62f81 100644 --- a/tests/LexModelsV2/LexModelsV2ClientTest.php +++ b/tests/LexModelsV2/LexModelsV2ClientTest.php @@ -1,4 +1,5 @@ addMockResults($client, [[]]); $client->getHandlerList()->appendSign(Middleware::tap(function ($c, $r) use (&$command, &$request) { - $command = $c; $request = $r; + $command = $c; + $request = $r; })); $client->predict([ 'MLModelId' => 'foo', diff --git a/tests/MiddlewareTest.php b/tests/MiddlewareTest.php index 9eb9d6bf3f..39311b3905 100644 --- a/tests/MiddlewareTest.php +++ b/tests/MiddlewareTest.php @@ -1,4 +1,5 @@ ['type' => 'string'] ] ], - function () { return []; } + function () { + return []; + } ); $list->appendValidate(Middleware::validation($api)); $handler = $list->resolve(); @@ -196,7 +198,9 @@ public function testHandlesModifiedServiceModel() 'a' => ['type' => 'string'] ] ], - function () { return []; } + function () { + return []; + } ); $list->appendValidate(Middleware::validation($api)); $api->setDefinition( @@ -332,7 +336,7 @@ public function testCanTimeSuccessfulHandlers() $list = new HandlerList(); $list->setHandler(function () { usleep(1000); // wait for a millisecond - return Promise\Create::promiseFor(new Result); + return Promise\Create::promiseFor(new Result()); }); $list->prependInit(Middleware::timer()); $handler = $list->resolve(); diff --git a/tests/MockHandlerTest.php b/tests/MockHandlerTest.php index 7ba880a69d..0954d85023 100644 --- a/tests/MockHandlerTest.php +++ b/tests/MockHandlerTest.php @@ -1,4 +1,5 @@ expects($this->atLeastOnce()) ->method('resolve') ->willReturn(function (CommandInterface $c) { - return new FulfilledPromise(new Result); + return new FulfilledPromise(new Result()); }); $this->mockRegionalClient->expects($this->once()) ->method('getCommand') diff --git a/tests/Multipart/AbstractUploaderTest.php b/tests/Multipart/AbstractUploaderTest.php index 96d3dd9a95..302c5c2ccc 100644 --- a/tests/Multipart/AbstractUploaderTest.php +++ b/tests/Multipart/AbstractUploaderTest.php @@ -1,4 +1,5 @@ getTestUploader('non-existent-file.foobar', $config); - } catch (\Exception $exception) {} + } catch (\Exception $exception) { + } $this->assertInstanceOf('RuntimeException', $exception); // CASE 3: Source stream is not readable. $exception = null; try { $this->getTestUploader(STDERR, $config); - } catch (\Exception $exception) {} + } catch (\Exception $exception) { + } $this->assertInstanceOf('InvalidArgumentException', $exception); } diff --git a/tests/Multipart/TestUploader.php b/tests/Multipart/TestUploader.php index 6fe855ac7e..fb8f9d03d1 100644 --- a/tests/Multipart/TestUploader.php +++ b/tests/Multipart/TestUploader.php @@ -1,4 +1,5 @@ assertStringContainsString("X-Amz-Signature={$expectedSignature}", $url); } else { self::assertNull($url); } - return new Result; + return new Result(); } ]); @@ -89,4 +91,3 @@ function ( call_user_func([$neptune, $functionName], $functionArgs); } } - diff --git a/tests/PerformanceContext.php b/tests/PerformanceContext.php index bfdb5a02ce..0ed624aaf3 100644 --- a/tests/PerformanceContext.php +++ b/tests/PerformanceContext.php @@ -146,7 +146,7 @@ public function iExecuteCommandsOnEachClient($numCommands) ->findOperationWithNoRequiredParameters($service); $this->addMockResults( $this->clients[$service], - array_fill(0, $numCommands, new Result) + array_fill(0, $numCommands, new Result()) ); for ($i = 0; $i < $numCommands; $i++) { diff --git a/tests/PhpHashTest.php b/tests/PhpHashTest.php index 461a455bd2..6642392862 100644 --- a/tests/PhpHashTest.php +++ b/tests/PhpHashTest.php @@ -1,4 +1,5 @@ assertStringContainsString('X-Amz-Signature=', $url); $this->assertSame('us-east-2', $cmd['DestinationRegion']); - return new Result; + return new Result(); }, ]); $ec2->copySnapshot([ @@ -75,7 +76,7 @@ public function testAddsPresignedUrlForRequiredOperations() $this->assertStringContainsString('X-Amz-Signature=', $url); $this->assertSame('us-east-2', $cmd['DestinationRegion']); - return new Result; + return new Result(); }, ]); $rds->copyDBSnapshot([ @@ -95,7 +96,7 @@ public function testNoPreSignedUrlWhenDifferentSourceRegionRequired() $this->assertNull($cmd['PreSignedUrl']); $this->assertSame('us-east-2', $cmd['DestinationRegion']); - return new Result; + return new Result(); }, ]); $rds->createDBInstanceReadReplica([ @@ -104,4 +105,3 @@ public function testNoPreSignedUrlWhenDifferentSourceRegionRequired() ]); } } - diff --git a/tests/Psr16CacheAdapterTest.php b/tests/Psr16CacheAdapterTest.php index 337d5db31e..3cebb0e90f 100644 --- a/tests/Psr16CacheAdapterTest.php +++ b/tests/Psr16CacheAdapterTest.php @@ -1,4 +1,5 @@ function ( CommandInterface $cmd, RequestInterface $r - ) use ($expectedUrl, $expectedSignature) - { + ) use ($expectedUrl, $expectedSignature) { $url = $cmd['PreSignedUrl']; if (!empty($expectedUrl)) { self::assertSame($expectedUrl, $url); - } else if (!empty($expectedSignature)) { + } elseif (!empty($expectedSignature)) { $this->assertStringContainsString("X-Amz-Signature={$expectedSignature}", $url); } else { self::assertNull($url); } - return new Result; + return new Result(); } ]); @@ -119,4 +120,3 @@ public function testCorrectPresignRdsUrls( call_user_func([$rds, $functionName], $functionArgs); } } - diff --git a/tests/ResultPaginatorTest.php b/tests/ResultPaginatorTest.php index 0e41e327a5..50fd56dd36 100644 --- a/tests/ResultPaginatorTest.php +++ b/tests/ResultPaginatorTest.php @@ -1,4 +1,5 @@ search('a') as $b) { - } } @@ -452,7 +452,8 @@ function () use (&$requestCount) { "logStreamName" => 'bar', ]); // Iterate over the paginator - foreach ($paginator as $key => $result) {} + foreach ($paginator as $key => $result) { + } // Make sure the paginator yields the expected results $this->assertInstanceOf('Aws\\Result', $result); $this->assertEquals(3, $requestCount); diff --git a/tests/ResultTest.php b/tests/ResultTest.php index 633009e40d..61c577be0e 100644 --- a/tests/ResultTest.php +++ b/tests/ResultTest.php @@ -1,4 +1,5 @@ function() { + 'time_provider' => function () { static $i; $times = [5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8]; if (is_null($i)) { @@ -165,7 +165,7 @@ public function testCorrectlySleepsForThrottling() } $rateLimiter = new RateLimiter([ - 'time_provider' => function() use ($times) { + 'time_provider' => function () use ($times) { static $i; if (is_null($i)) { $i = 0; @@ -199,7 +199,7 @@ public function testUpdatesClientSendingRatesCorrectly() } $rateLimiter = new RateLimiter([ - 'time_provider' => function() use ($times) { + 'time_provider' => function () use ($times) { static $i; if (is_null($i)) { $i = 0; @@ -257,5 +257,4 @@ public function testUpdatesClientSendingRatesCorrectly() ); } } - } diff --git a/tests/RetryMiddlewareTest.php b/tests/RetryMiddlewareTest.php index 07a76ada34..df4905a8e9 100644 --- a/tests/RetryMiddlewareTest.php +++ b/tests/RetryMiddlewareTest.php @@ -1,4 +1,5 @@ wait(); $this->fail(); - } catch (AwsException $e) { } + } catch (AwsException $e) { + } } public function testDeciderRetriesWhenStatusCodeMatches() @@ -304,7 +306,9 @@ function ($command, $request) use ($res2) { return $res2; }, ], - function () use (&$called) { $called[] = func_get_args(); } + function () use (&$called) { + $called[] = func_get_args(); + } ); $wrapped = new RetryMiddleware( @@ -337,8 +341,12 @@ function ($command, $request) { return new Result(); }, ], - function () use (&$called) { $called[] = func_get_args(); }, - function () use (&$called) { $called[] = func_get_args(); } + function () use (&$called) { + $called[] = func_get_args(); + }, + function () use (&$called) { + $called[] = func_get_args(); + } ); $wrapped = new RetryMiddleware( @@ -365,8 +373,12 @@ function ($command, $request) { return new AwsException('foo', $command); } ], - function () use (&$called) { $called[] = func_get_args(); }, - function () use (&$called) { $called[] = func_get_args(); } + function () use (&$called) { + $called[] = func_get_args(); + }, + function () use (&$called) { + $called[] = func_get_args(); + } ); $wrapped = new RetryMiddleware( @@ -391,8 +403,12 @@ public function testForwardValueWhenResultDoesNotMatch() $res1 = new Result(); $mock = new MockHandler( [$res1], - function () use (&$called) { $called[] = func_get_args(); }, - function () use (&$called) { $called[] = func_get_args(); } + function () use (&$called) { + $called[] = func_get_args(); + }, + function () use (&$called) { + $called[] = func_get_args(); + } ); $wrapped = new RetryMiddleware( @@ -466,7 +482,9 @@ public function testResultReportsTotalRetryDelay() ]); $retryMW = new RetryMiddleware( RetryMiddleware::createDefaultDecider($retries = 3), - function () { return 100; }, + function () { + return 100; + }, $handler, true ); @@ -486,7 +504,9 @@ public function testExceptionReportsTotalRetryDelay() }; $retryMW = new RetryMiddleware( RetryMiddleware::createDefaultDecider($retries = 3), - function () { return 100; }, + function () { + return 100; + }, $nextHandler, true ); diff --git a/tests/RetryMiddlewareV2Test.php b/tests/RetryMiddlewareV2Test.php index 6d66a57090..c63c7fbd56 100644 --- a/tests/RetryMiddlewareV2Test.php +++ b/tests/RetryMiddlewareV2Test.php @@ -1,4 +1,5 @@ assertEquals( $expected[$attempt]['quota'], @@ -62,14 +63,13 @@ function() use ($expected, &$attempt, $quotaManager, &$errors, $command) { $command['@http']['delay'] ); } - } catch (\Exception $e) { // Catch errors manually for throwing later $errors[] = $e; } $attempt++; }, - function() use ($expected, &$attempt, $quotaManager, &$errors, $command) { + function () use ($expected, &$attempt, $quotaManager, &$errors, $command) { try { $this->assertEquals( $expected[$attempt]['quota'], @@ -129,7 +129,7 @@ function() use ($expected, &$attempt, $quotaManager, &$errors, $command) { $this->assertCount($attempt, $queue); } - function standardModeTestCases() + public function standardModeTestCases() { $command = new Command('foo'); $result200 = new Result([ @@ -391,7 +391,7 @@ public function testRetriesForAdapativeMode() // Errors within MockHandler closure get caught silently $errors = []; - $assertFunction = function() use (&$time, &$attempt, &$errors, $expectedTimes) { + $assertFunction = function () use (&$time, &$attempt, &$errors, $expectedTimes) { try { $this->assertLessThanOrEqual( 0.5, @@ -430,7 +430,7 @@ public function testRetriesForAdapativeMode() $mock, [ 'rate_limiter' => new RateLimiter([ - 'time_provider' => function() use ($times) { + 'time_provider' => function () use ($times) { static $i; if (is_null($i)) { $i = 0; @@ -473,7 +473,8 @@ public function testAddRetryHeader() try { $retryMW(new Command('SomeCommand'), new Request('GET', ''))->wait(); $this->fail(); - } catch (AwsException $e) { } + } catch (AwsException $e) { + } } public function testDeciderRetriesWhenStatusCodeMatches() @@ -770,7 +771,8 @@ public function testUsesCustomDelayer() public function testDelaysExponentiallyWithJitter() { - $retryMiddleware = new RetryMiddlewareV2(new Configuration('standard', 3), function () {}); + $retryMiddleware = new RetryMiddlewareV2(new Configuration('standard', 3), function () { + }); $this->assertLessThanOrEqual(2000, $retryMiddleware->exponentialDelayWithJitter(1)); $this->assertLessThanOrEqual(4000, $retryMiddleware->exponentialDelayWithJitter(2)); $this->assertLessThanOrEqual(8000, $retryMiddleware->exponentialDelayWithJitter(3)); @@ -779,7 +781,8 @@ public function testDelaysExponentiallyWithJitter() public function testDelaysWithSomeRandomness() { - $retryMiddleware = new RetryMiddlewareV2(new Configuration('standard', 3), function () {}); + $retryMiddleware = new RetryMiddlewareV2(new Configuration('standard', 3), function () { + }); $maxDelay = 1000 * pow(2, 4); $values = array_map(function () use ($retryMiddleware) { return $retryMiddleware->exponentialDelayWithJitter(4); @@ -809,7 +812,9 @@ function ($command, $request) use ($res2) { return $res2; }, ], - function () use (&$called) { $called[] = func_get_args(); } + function () use (&$called) { + $called[] = func_get_args(); + } ); $wrapped = new RetryMiddlewareV2( @@ -842,8 +847,12 @@ function ($command, $request) { return new Result(); }, ], - function () use (&$called) { $called[] = func_get_args(); }, - function () use (&$called) { $called[] = func_get_args(); } + function () use (&$called) { + $called[] = func_get_args(); + }, + function () use (&$called) { + $called[] = func_get_args(); + } ); $wrapped = new RetryMiddlewareV2( @@ -870,8 +879,12 @@ function ($command, $request) { return new AwsException('foo', $command); } ], - function () use (&$called) { $called[] = func_get_args(); }, - function () use (&$called) { $called[] = func_get_args(); } + function () use (&$called) { + $called[] = func_get_args(); + }, + function () use (&$called) { + $called[] = func_get_args(); + } ); $wrapped = new RetryMiddlewareV2( @@ -896,8 +909,12 @@ public function testForwardValueWhenResultDoesNotMatch() $res1 = new Result(); $mock = new MockHandler( [$res1], - function () use (&$called) { $called[] = func_get_args(); }, - function () use (&$called) { $called[] = func_get_args(); } + function () use (&$called) { + $called[] = func_get_args(); + }, + function () use (&$called) { + $called[] = func_get_args(); + } ); $wrapped = new RetryMiddlewareV2( diff --git a/tests/Route53/RouteClient53Test.php b/tests/Route53/RouteClient53Test.php index 88dde9306c..f4395394d9 100644 --- a/tests/Route53/RouteClient53Test.php +++ b/tests/Route53/RouteClient53Test.php @@ -1,4 +1,5 @@ 'InternalError', 'message' => 'Sorry!']; }; @@ -78,7 +80,8 @@ public function testThrowsConnectionErrorForEmptyBody($operation) { $this->expectExceptionMessage("An error connecting to the service occurred while performing the"); $this->expectException(\Aws\S3\Exception\S3Exception::class); - $parser = function() {}; + $parser = function () { + }; $errorParser = new XmlErrorParser(); $instance = new AmbiguousSuccessParser( $parser, @@ -105,11 +108,15 @@ public function opsWithoutAmbiguousSuccessesProvider() { $provider = ApiProvider::defaultProvider(); return array_map( - function ($op) { return [$op]; }, + function ($op) { + return [$op]; + }, array_diff( array_keys($provider('api', 's3', 'latest')['operations']), array_map( - function (array $args) { return $args[0]; }, + function (array $args) { + return $args[0]; + }, $this->opsWithAmbiguousSuccessesProvider() ) ) diff --git a/tests/S3/ApplyChecksumMiddlewareTest.php b/tests/S3/ApplyChecksumMiddlewareTest.php index c91a68ffee..8855902548 100644 --- a/tests/S3/ApplyChecksumMiddlewareTest.php +++ b/tests/S3/ApplyChecksumMiddlewareTest.php @@ -1,4 +1,5 @@ assertEquals(range(0, 9), $keys); } - + public function testWithNoMatchingObjects() { $client = $this->getTestClient('s3'); diff --git a/tests/S3/BucketEndpointArnMiddlewareTest.php b/tests/S3/BucketEndpointArnMiddlewareTest.php index d7609e16cf..6fc56931e3 100644 --- a/tests/S3/BucketEndpointArnMiddlewareTest.php +++ b/tests/S3/BucketEndpointArnMiddlewareTest.php @@ -1,4 +1,5 @@ true, ], new UnresolvedEndpointException( - 'Access Points do not support S3 Accelerate' + 'Access Points do not support S3 Accelerate' ) ], // Path-style with access point ARN @@ -498,7 +499,8 @@ public function incorrectUsageProvider() 'use_accelerate_endpoint' => true, ], new UnresolvedEndpointException( - 'S3 Outposts does not support S3 Accelerate' ) + 'S3 Outposts does not support S3 Accelerate' + ) ], // s3-external, use_arn_region false [ @@ -557,7 +559,7 @@ public function testCorrectlyHandlesCopyObject() 'version' => 'latest', 'region' => 'us-west-2', 's3_use_arn_region' => true, - 'handler' => function(CommandInterface $cmd, RequestInterface $req) { + 'handler' => function (CommandInterface $cmd, RequestInterface $req) { $this->assertSame( 'myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com', $req->getUri()->getHost() diff --git a/tests/S3/BucketEndpointMiddlewareTest.php b/tests/S3/BucketEndpointMiddlewareTest.php index c842f7f0a4..02baabde38 100644 --- a/tests/S3/BucketEndpointMiddlewareTest.php +++ b/tests/S3/BucketEndpointMiddlewareTest.php @@ -1,4 +1,5 @@ getKmsClient(); $list = $kms->getHandlerList(); - $list->setHandler(function($cmd, $req) { + $list->setHandler(function ($cmd, $req) { // Verify decryption command has correct parameters $this->assertSame('cek', $cmd['CiphertextBlob']); $this->assertEquals( diff --git a/tests/S3/Crypto/S3EncryptionClientTestingTrait.php b/tests/S3/Crypto/S3EncryptionClientTestingTrait.php index 779fdc0a45..abbede0bba 100644 --- a/tests/S3/Crypto/S3EncryptionClientTestingTrait.php +++ b/tests/S3/Crypto/S3EncryptionClientTestingTrait.php @@ -1,4 +1,5 @@ getKmsClient(); $list = $kms->getHandlerList(); - $list->setHandler(function($cmd, $req) { + $list->setHandler(function ($cmd, $req) { // Verify decryption command has correct parameters $this->assertSame('cek', $cmd['CiphertextBlob']); $this->assertEquals( @@ -690,7 +691,7 @@ public function testGetObjectWithLegacyGcmMetadata() { $kms = $this->getKmsClient(); $list = $kms->getHandlerList(); - $list->setHandler(function($cmd, $req) { + $list->setHandler(function ($cmd, $req) { // Verify decryption command has correct parameters $this->assertSame('cek', $cmd['CiphertextBlob']); $this->assertEquals( @@ -734,7 +735,7 @@ public function testGetObjectWithV2GcmMetadata() { $kms = $this->getKmsClient(); $list = $kms->getHandlerList(); - $list->setHandler(function($cmd, $req) { + $list->setHandler(function ($cmd, $req) { // Verify decryption command has correct parameters $this->assertSame('cek', $cmd['CiphertextBlob']); $this->assertEquals( @@ -908,7 +909,7 @@ public function testEmitsWarningForLegacySecurityProfile() $this->expectWarning(); $kms = $this->getKmsClient(); $list = $kms->getHandlerList(); - $list->setHandler(function($cmd, $req) { + $list->setHandler(function ($cmd, $req) { // Verify decryption command has correct parameters $this->assertSame('cek', $cmd['CiphertextBlob']); $this->assertEquals( @@ -953,7 +954,7 @@ public function testThrowsForV2ProfileAndLegacyObject() $this->expectException(\Aws\Exception\CryptoException::class); $kms = $this->getKmsClient(); $list = $kms->getHandlerList(); - $list->setHandler(function($cmd, $req) { + $list->setHandler(function ($cmd, $req) { // Verify decryption command has correct parameters $this->assertSame('cek', $cmd['CiphertextBlob']); $this->assertEquals( diff --git a/tests/S3/Crypto/S3EncryptionMultipartUploaderTest.php b/tests/S3/Crypto/S3EncryptionMultipartUploaderTest.php index 328cf8b46c..2d2347874e 100644 --- a/tests/S3/Crypto/S3EncryptionMultipartUploaderTest.php +++ b/tests/S3/Crypto/S3EncryptionMultipartUploaderTest.php @@ -1,4 +1,5 @@ [ 'Cipher' => 'cbc', ], - 'before_initiate' => function($command) { + 'before_initiate' => function ($command) { $this->assertSame('foo', $command['Bucket']); $this->assertSame('bar', $command['Key']); $this->assertSame( @@ -450,7 +453,7 @@ public function testAddsCryptoUserAgent() new Result(['Location' => self::TEST_URL]), ]); $list = $s3->getHandlerList(); - $list->appendSign(Middleware::tap(function($cmd, $req) { + $list->appendSign(Middleware::tap(function ($cmd, $req) { $this->assertStringContainsString( 'feat/s3-encrypt/' . S3EncryptionMultipartUploader::CRYPTO_VERSION, $req->getHeaderLine('User-Agent') diff --git a/tests/S3/Crypto/S3EncryptionMultipartUploaderV2Test.php b/tests/S3/Crypto/S3EncryptionMultipartUploaderV2Test.php index a38ea4621b..e2bda9161a 100644 --- a/tests/S3/Crypto/S3EncryptionMultipartUploaderV2Test.php +++ b/tests/S3/Crypto/S3EncryptionMultipartUploaderV2Test.php @@ -1,4 +1,5 @@ 'gcm', ], '@KmsEncryptionContext' => [], - 'before_initiate' => function($command) { + 'before_initiate' => function ($command) { $this->assertSame('foo', $command['Bucket']); $this->assertSame('bar', $command['Key']); $this->assertSame( @@ -501,7 +504,7 @@ public function testAddsCryptoUserAgent() new Result(['Location' => self::TEST_URL]), ]); $list = $s3->getHandlerList(); - $list->appendSign(Middleware::tap(function($cmd, $req) { + $list->appendSign(Middleware::tap(function ($cmd, $req) { $this->assertStringContainsString( 'feat/s3-encrypt/' . S3EncryptionMultipartUploaderV2::CRYPTO_VERSION, $req->getHeaderLine('User-Agent') @@ -547,7 +550,8 @@ public function testAddsUpdatedEncryptionContext() new Result(['Location' => self::TEST_URL]), ]); $list = $s3->getHandlerList(); - $list->appendSign(Middleware::tap(function( + $list->appendSign(Middleware::tap( + function ( CommandInterface $cmd, RequestInterface $req ) { diff --git a/tests/S3/Exception/DeleteMultipleObjectsExceptionTest.php b/tests/S3/Exception/DeleteMultipleObjectsExceptionTest.php index 97acc0c053..5c97e205af 100644 --- a/tests/S3/Exception/DeleteMultipleObjectsExceptionTest.php +++ b/tests/S3/Exception/DeleteMultipleObjectsExceptionTest.php @@ -1,4 +1,5 @@ 'bar', 'source_metadata' => new Result(['ContentLength' => 11 * self::MB]), 'params' => ['RequestPayer' => 'test'], - 'before_initiate' => function($command) { + 'before_initiate' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, - 'before_upload' => function($command) { + 'before_upload' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, - 'before_complete' => function($command) { + 'before_complete' => function ($command) { $this->assertSame('test', $command['RequestPayer']); } ]; diff --git a/tests/S3/MultipartUploaderTest.php b/tests/S3/MultipartUploaderTest.php index c5beefae92..c69dfc386b 100644 --- a/tests/S3/MultipartUploaderTest.php +++ b/tests/S3/MultipartUploaderTest.php @@ -1,4 +1,5 @@ 1] + $defaults, Psr7\FnStream::decorate( - Psr7\Utils::streamFor($data), [ - 'getSize' => function () {return null;} + Psr7\Utils::streamFor($data), + [ + 'getSize' => function () { + return null; + } ] ), 'InvalidArgumentException' @@ -181,14 +185,14 @@ public function testS3MultipartUploadParams($stream, $size) 'RequestPayer' => 'test', 'ContentLength' => $size ], - 'before_initiate' => function($command) { + 'before_initiate' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, - 'before_upload' => function($command) use ($size) { + 'before_upload' => function ($command) use ($size) { $this->assertLessThan($size, $command['ContentLength']); $this->assertSame('test', $command['RequestPayer']); }, - 'before_complete' => function($command) { + 'before_complete' => function ($command) { $this->assertSame('test', $command['RequestPayer']); } ]; @@ -254,7 +258,7 @@ public function testS3MultipartContentTypeSetting( 'bucket' => 'foo', 'key' => 'bar', 'params' => $params, - 'before_initiate' => function($command) use ($expectedContentType) { + 'before_initiate' => function ($command) use ($expectedContentType) { $this->assertEquals( $expectedContentType, $command['ContentType'] diff --git a/tests/S3/ObjectCopierTest.php b/tests/S3/ObjectCopierTest.php index 3273931fe1..c7353d82a7 100644 --- a/tests/S3/ObjectCopierTest.php +++ b/tests/S3/ObjectCopierTest.php @@ -1,4 +1,5 @@ getHandlerList()->appendSign(Middleware::tap( function (CommandInterface $cmd, RequestInterface $req) { - switch($cmd->getName()) { case 'UploadPartCopy': case 'CopyObject': @@ -94,8 +94,8 @@ function (CommandInterface $cmd, RequestInterface $req) { $cmd['CopySource'] ); $this->assertEquals( - 'arn:aws:s3:us-west-2:123456789012:accesspoint:mysource/object/sourceKey', - $req->getHeader('x-amz-copy-source')[0] + 'arn:aws:s3:us-west-2:123456789012:accesspoint:mysource/object/sourceKey', + $req->getHeader('x-amz-copy-source')[0] ); break; @@ -122,7 +122,6 @@ function (CommandInterface $cmd, RequestInterface $req) { default: $this->fail('Unexpected command encountered.'); - } return Promise\Create::promiseFor(new Result([])); @@ -289,7 +288,7 @@ public function testCanCopyVersions() $headObjectCommand, Promise\Create::promiseFor(new Result(['ContentLength' => 1024 * 1024 * 6])) ], - [$copyObjectCommand, Promise\Create::promiseFor(new Result)], + [$copyObjectCommand, Promise\Create::promiseFor(new Result())], ])); (new ObjectCopier( @@ -306,10 +305,10 @@ public function testS3ObjectCopierCopyObjectParams() $client = $this->getTestClient('s3'); $copyOptions = [ 'params' => ['RequestPayer' => 'test'], - 'before_lookup' => function($command) { + 'before_lookup' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, - 'before_upload' => function($command) { + 'before_upload' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, ]; @@ -325,7 +324,8 @@ public function testS3ObjectCopierCopyObjectParams() ['Bucket' => 'sourceBucket', 'Key' => 'sourceKey'], ['Bucket' => 'bucket', 'Key' => 'key'], 'private', - $copyOptions); + $copyOptions + ); $this->assertFalse($this->mockQueueEmpty()); $result = $uploader->copy(); @@ -340,16 +340,16 @@ public function testS3ObjectCopierMultipartParams() $copyOptions = [ 'mup_threshold' => MultipartUploader::PART_MIN_SIZE, 'params' => ['RequestPayer' => 'test'], - 'before_lookup' => function($command) { + 'before_lookup' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, - 'before_initiate' => function($command) { + 'before_initiate' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, - 'before_upload' => function($command) { + 'before_upload' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, - 'before_complete' => function($command) { + 'before_complete' => function ($command) { $this->assertSame('test', $command['RequestPayer']); } ]; @@ -365,7 +365,8 @@ public function testS3ObjectCopierMultipartParams() ['Bucket' => 'sourceBucket', 'Key' => 'sourceKey'], ['Bucket' => 'bucket', 'Key' => 'key'], 'private', - $copyOptions); + $copyOptions + ); $this->assertFalse($this->mockQueueEmpty()); $result = $uploader->copy(); @@ -398,7 +399,8 @@ public function testS3ObjectCopierDoesTransformUnicodeKeyToEncodedURL() $this->assertSame($url, $result['ObjectURL']); } - public function MultipartCopierProvider(){ + public function MultipartCopierProvider() + { return [ ["äž­æ–‡", "%E4%B8%AD%E6%96%87"], ["文件ć€č/文件", "%E6%96%87%E4%BB%B6%E5%A4%B9/%E6%96%87%E4%BB%B6"], diff --git a/tests/S3/ObjectUploaderTest.php b/tests/S3/ObjectUploaderTest.php index b02b111faf..f4d5b236e6 100644 --- a/tests/S3/ObjectUploaderTest.php +++ b/tests/S3/ObjectUploaderTest.php @@ -1,4 +1,5 @@ 'us-west-2' ]); $client->getHandlerList()->appendSign(Middleware::tap( - function(CommandInterface $cmd, RequestInterface $req) { + function (CommandInterface $cmd, RequestInterface $req) { $this->assertSame( 'mydest-123456789012.s3-accesspoint.us-west-2.amazonaws.com', $req->getUri()->getHost() @@ -80,13 +81,13 @@ function(CommandInterface $cmd, RequestInterface $req) { )); $this->addMockResults($client, $mockedResults); $result = (new ObjectUploader( - $client, - 'arn:aws:s3:us-west-2:123456789012:accesspoint:mydest', - 'key', - $body, - 'private', - $options - ))->upload(); + $client, + 'arn:aws:s3:us-west-2:123456789012:accesspoint:mydest', + 'key', + $body, + 'private', + $options + ))->upload(); $this->assertTrue($this->mockQueueEmpty()); } @@ -140,7 +141,8 @@ public function getUploadTestCases() // 3 MB, known-size stream (put) $this->generateStream(1024 * 1024 * 3), [$putObject], - ['before_upload' => function () {}] + ['before_upload' => function () { + }] ], [ // 3 MB, unknown-size stream (put) @@ -187,7 +189,8 @@ public function getUploadTestCasesWithPathStyle() // 3 MB, known-size stream (put) $this->generateStream(1024 * 1024 * 3), [$putObject], - ['before_upload' => function () {}] + ['before_upload' => function () { + }] ], [ // 3 MB, unknown-size stream (put) @@ -251,7 +254,7 @@ public function testS3ObjectUploaderPutObjectParams() $uploadOptions = [ 'params' => ['RequestPayer' => 'test'], 'add_content_md5' => true, - 'before_upload' => function($command) { + 'before_upload' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, ]; @@ -273,7 +276,8 @@ public function testS3ObjectUploaderPutObjectParams() 'bar', $source, 'private', - $uploadOptions); + $uploadOptions + ); $result = $uploader->upload(); $this->assertSame($url, $result['ObjectURL']); @@ -297,13 +301,13 @@ public function testS3ObjectUploaderMultipartParams() 'mup_threshold' => self::MB * 4, 'params' => ['RequestPayer' => 'test'], 'add_content_md5' => true, - 'before_initiate' => function($command) { + 'before_initiate' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, - 'before_upload' => function($command) { + 'before_upload' => function ($command) { $this->assertSame('test', $command['RequestPayer']); }, - 'before_complete' => function($command) { + 'before_complete' => function ($command) { $this->assertSame('test', $command['RequestPayer']); } ]; @@ -325,7 +329,8 @@ public function testS3ObjectUploaderMultipartParams() 'bar', $source, 'private', - $uploadOptions); + $uploadOptions + ); $result = $uploader->upload(); $this->assertSame($url, $result['ObjectURL']); diff --git a/tests/S3/PermanentRedirectMiddlewareTest.php b/tests/S3/PermanentRedirectMiddlewareTest.php index eda7f92424..d236f6cba3 100644 --- a/tests/S3/PermanentRedirectMiddlewareTest.php +++ b/tests/S3/PermanentRedirectMiddlewareTest.php @@ -1,4 +1,5 @@ [ 'key' => 'AKIAIOSFODNN7EXAMPLE', 'secret' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - 'token' => NULL + 'token' => null ], ]); $p = new PostObjectV4( diff --git a/tests/S3/PutObjectUrlMiddlewareTest.php b/tests/S3/PutObjectUrlMiddlewareTest.php index 198b3ae540..7639afb39e 100644 --- a/tests/S3/PutObjectUrlMiddlewareTest.php +++ b/tests/S3/PutObjectUrlMiddlewareTest.php @@ -1,4 +1,5 @@ expectExceptionMessage("Sorry!"); $this->expectException(\Aws\S3\Exception\S3Exception::class); - $parser = function () { throw new ParserException('Sorry!'); }; + $parser = function () { + throw new ParserException('Sorry!'); + }; $instance = new RetryableMalformedResponseParser( $parser, diff --git a/tests/S3/S3ClientTest.php b/tests/S3/S3ClientTest.php index 54992b2687..81339ff7bc 100644 --- a/tests/S3/S3ClientTest.php +++ b/tests/S3/S3ClientTest.php @@ -1,4 +1,5 @@ assertTrue($request->hasHeader($signatureHeader)); } - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); }, ]); $command = $client->getCommand('GetObject', ['Bucket' => 'foo', 'Key' => 'bar']); @@ -294,8 +295,7 @@ private function getS3ErrorMock( $errCode, $statusCode, $deleteMarker = false - ) - { + ) { $response = new Response($statusCode); $deleteMarker && $response = $response->withHeader( 'x-amz-delete-marker', @@ -320,8 +320,7 @@ public function testsIfExists( $V2 = false, $accept403 = false, $acceptDeleteMarkers = false - ) - { + ) { /** @var S3Client $s3 */ $s3 = $this->getTestClient('S3', ['region' => 'us-east-1']); $this->addMockResults($s3, [$result]); @@ -427,7 +426,8 @@ public function testEnsuresMandatoryInputVariables() $this->expectException(\InvalidArgumentException::class); /** @var S3Client $client */ $client = $this->getTestClient('S3'); - $client->deleteObject([ + $client->deleteObject( + [ 'Bucket' => "", 'Key' => "key"] ); @@ -567,7 +567,7 @@ public function testRequestSucceedsWithColon() (string) $request->getUri() ); - return Promise\Create::promiseFor(new Psr7\Response); + return Promise\Create::promiseFor(new Psr7\Response()); } ]); @@ -591,7 +591,7 @@ public function testRetriesConnectionErrors($retrySettings) 'retries' => $retrySettings, 'http_handler' => function () use (&$retries) { if (0 === --$retries) { - return new FulfilledPromise(new Response); + return new FulfilledPromise(new Response()); } return new RejectedPromise([ @@ -934,7 +934,7 @@ public function testNetworkingErrorsAreRetriedOnIdempotentCommands($retrySetting 'retries' => $retrySettings, 'http_handler' => function () use (&$retries, $networkingError) { if (0 === --$retries) { - return new FulfilledPromise(new Response); + return new FulfilledPromise(new Response()); } return new RejectedPromise([ @@ -974,7 +974,7 @@ public function testNetworkingErrorsAreNotRetriedOnNonIdempotentCommands($retryS 'retries' => $retrySettings, 'http_handler' => function () use (&$retries, $networkingError) { if (0 === --$retries) { - return new FulfilledPromise(new Response); + return new FulfilledPromise(new Response()); } return new RejectedPromise([ @@ -1013,7 +1013,7 @@ public function testErrorsWithUnparseableBodiesCanBeRetried($retrySettings) 'retries' => $retrySettings, 'http_handler' => function () use (&$retries, $networkingError) { if (0 === --$retries) { - return new FulfilledPromise(new Response); + return new FulfilledPromise(new Response()); } return new RejectedPromise([ @@ -1042,7 +1042,7 @@ public function testListObjectsAppliesUrlEncodingWhenNoneSupplied() $this->assertArrayHasKey('encoding-type', $query); $this->assertSame('url', $query['encoding-type']); - return new FulfilledPromise(new Response); + return new FulfilledPromise(new Response()); }, ]); @@ -1150,7 +1150,7 @@ public function testHeadObjectDisablesContentDecodingByDefault() $this->assertArrayHasKey('decode_content', $opts); $this->assertFalse($opts['decode_content']); - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); } ]); @@ -1167,7 +1167,7 @@ public function testContentDecodingCanBeDisabled() $this->assertArrayHasKey('decode_content', $opts); $this->assertFalse($opts['decode_content']); - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); } ]); @@ -1183,7 +1183,7 @@ public function testContentDecodingCanBeDisabledOnCommands() $this->assertArrayHasKey('decode_content', $opts); $this->assertFalse($opts['decode_content']); - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); } ]); @@ -1210,7 +1210,7 @@ public function testCanDetermineRegionOfBucket() $client = new S3Client([ 'region' => 'us-west-2', 'version' => 'latest', - 'http_handler' => function() { + 'http_handler' => function () { return new RejectedPromise([ 'connection_error' => false, 'exception' => $this->getMockBuilder(AwsException::class) @@ -1231,7 +1231,7 @@ public function testDetermineBucketRegionExposeException() $client = new S3Client([ 'region' => 'us-west-2', 'version' => 'latest', - 'http_handler' => function() { + 'http_handler' => function () { return new RejectedPromise([ 'connection_error' => false, 'exception' => $this->getMockBuilder(AwsException::class) @@ -1256,7 +1256,7 @@ public function testAppliesS3EndpointMiddlewareDualstackAccelerate() '/key', $req->getUri()->getPath() ); - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); }; $accelerateClient = new S3Client([ @@ -1292,7 +1292,7 @@ public function testAppliesS3EndpointMiddlewareAccelerate() 'bucket.s3-accelerate.amazonaws.com', $req->getUri()->getHost() ); - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); }; $accelerateClient = new S3Client([ @@ -1330,7 +1330,7 @@ public function testAppliesS3EndpointMiddlewareDualstack() '/', $req->getUri()->getPath() ); - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); }; $dualStackClient = new S3Client([ @@ -1366,7 +1366,7 @@ public function testAppliesS3EndpointMiddlewareDualstackWithPathStyle() '/bucket/', $req->getUri()->getPath() ); - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); }; $dualStackClient = new S3Client([ @@ -1642,7 +1642,6 @@ public function testRetriesAmbiguousSuccesses() public function multiRegionSuccessProvider() { - return [ ["arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap", "us-east-1", null, null, false, "mfzwi23gnjvgw.mrap.accesspoint.s3-global.amazonaws.com", "x-amz-region-set:*"], ["arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap", "us-west-2", null, null, false, "mfzwi23gnjvgw.mrap.accesspoint.s3-global.amazonaws.com", "x-amz-region-set:*"], @@ -1673,8 +1672,7 @@ public function testMrapParsing( 'use_arn_region' => $useArnRegion, 'version' => 'latest', 'disable_multiregion_access_points' => $disableMraps, - 'handler' => function (CommandInterface $cmd, RequestInterface $req) - use ($expectedEndpoint, $expectedHeaders) { + 'handler' => function (CommandInterface $cmd, RequestInterface $req) use ($expectedEndpoint, $expectedHeaders) { $this->assertSame( $expectedEndpoint, $req->getUri()->getHost() @@ -1702,7 +1700,8 @@ public function testMrapParsing( $client->execute($command); } - public function mrapExceptionTestProvider() { + public function mrapExceptionTestProvider() + { return [ [ "arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap", "us-west-2", null, null, true, @@ -1774,14 +1773,14 @@ public function testMrapExceptions( * @param $disableMraps * @param $expectedException */ - public function testAccessPointFailures ( + public function testAccessPointFailures( $bucketFieldInput, $clientRegion, $additionalFlags, $useArnRegion, $disableMraps, $expectedException - ){ + ) { $client = new S3Client([ 'region' => $clientRegion, 'use_arn_region' => $useArnRegion, @@ -1846,7 +1845,7 @@ public function AccessPointFailureProvider() ]; } - public function testPresignedMrapSuccess () + public function testPresignedMrapSuccess() { if (!extension_loaded('awscrt')) { $this->markTestSkipped(); @@ -1872,7 +1871,7 @@ public function testPresignedMrapSuccess () $this->assertStringContainsString('X-Amz-Algorithm=AWS4-ECDSA-P256-SHA256', $url); } - public function testPresignedMrapFailure () + public function testPresignedMrapFailure() { $arn = 'arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap'; $expectedException = "Invalid configuration: Multi-Region Access Point ARNs are disabled."; @@ -1957,15 +1956,14 @@ public function testObjectLambdaArnSuccess( $additionalFlags, $useArnRegion, $endpointUrl, - $expectedEndpoint) - { + $expectedEndpoint + ) { //additional flags is not used yet, will be in the future if dualstack support is added $clientConfig = [ 'region' => $clientRegion, 'use_arn_region' => $useArnRegion, 'version' => 'latest', - 'handler' => function (CommandInterface $cmd, RequestInterface $req) - use ($expectedEndpoint) { + 'handler' => function (CommandInterface $cmd, RequestInterface $req) use ($expectedEndpoint) { $this->assertSame( $expectedEndpoint, $req->getUri()->getHost() @@ -2031,14 +2029,13 @@ public function testObjectLambdaArnFailures( $additionalFlags, $useArnRegion, $endpointUrl, - $expectedException) - { + $expectedException + ) { $clientConfig = [ 'region' => $clientRegion, 'use_arn_region' => $useArnRegion, 'version' => 'latest', - 'handler' => function (CommandInterface $cmd, RequestInterface $req) - use ($expectedException) { + 'handler' => function (CommandInterface $cmd, RequestInterface $req) use ($expectedException) { $this->assertSame( $expectedException, $req->getUri()->getHost() @@ -2157,13 +2154,11 @@ public function testWriteGetObjectResponse( $route, $endpointUrl, $expectedEndpoint - ) - { + ) { $clientConfig = [ 'region' => $clientRegion, 'version' => 'latest', - 'handler' => function (CommandInterface $cmd, RequestInterface $req) - use ($expectedEndpoint) { + 'handler' => function (CommandInterface $cmd, RequestInterface $req) use ($expectedEndpoint) { $this->assertSame( $expectedEndpoint, $req->getUri()->getHost() @@ -2235,7 +2230,8 @@ public function testAddsForwardSlashIfEmptyPathAndQuery() $s3->execute($command); } - public function addMD5Provider() { + public function addMD5Provider() + { return [ [ ['Bucket' => 'foo', 'Key' => 'foo', 'Body' => 'test'], diff --git a/tests/S3/S3EndpointMiddlewareTest.php b/tests/S3/S3EndpointMiddlewareTest.php index 58b6ac7480..f34800d847 100644 --- a/tests/S3/S3EndpointMiddlewareTest.php +++ b/tests/S3/S3EndpointMiddlewareTest.php @@ -1,4 +1,5 @@ $clientRegion, 'use_arn_region' => $useArnRegion, 'version' => 'latest', - 'handler' => function (CommandInterface $cmd, RequestInterface $req) - use ($expectedEndpoint) { + 'handler' => function (CommandInterface $cmd, RequestInterface $req) use ($expectedEndpoint) { $this->assertSame( $expectedEndpoint, $req->getUri()->getHost() @@ -622,14 +622,13 @@ public function testObjectLambdaArnFailures( $additionalFlags, $useArnRegion, $endpointUrl, - $expectedException) - { + $expectedException + ) { $clientConfig = [ 'region' => $clientRegion, 'use_arn_region' => $useArnRegion, 'version' => 'latest', - 'handler' => function (CommandInterface $cmd, RequestInterface $req) - use ($expectedException) { + 'handler' => function (CommandInterface $cmd, RequestInterface $req) use ($expectedException) { $this->assertSame( $expectedException, $req->getUri()->getHost() @@ -747,13 +746,11 @@ public function testWriteGetObjectResponse( $route, $endpointUrl, $expectedEndpoint - ) - { + ) { $clientConfig = [ 'region' => $clientRegion, 'version' => 'latest', - 'handler' => function (CommandInterface $cmd, RequestInterface $req) - use ($expectedEndpoint) { + 'handler' => function (CommandInterface $cmd, RequestInterface $req) use ($expectedEndpoint) { $this->assertSame( $expectedEndpoint, $req->getUri()->getHost() @@ -777,7 +774,6 @@ public function testWriteGetObjectResponse( public function writeGetObjectResponseProvider() { - return [ ["us-west-2", "route", null, 'route.s3-object-lambda.us-west-2.amazonaws.com'], ["us-east-1", "route", null, 'route.s3-object-lambda.us-east-1.amazonaws.com'], diff --git a/tests/S3/S3MultiRegionClientTest.php b/tests/S3/S3MultiRegionClientTest.php index dde751fff4..00423129e8 100644 --- a/tests/S3/S3MultiRegionClientTest.php +++ b/tests/S3/S3MultiRegionClientTest.php @@ -1,4 +1,5 @@ 'us-west-2'])); } - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); }, 'use_path_style_endpoint' => true ]); @@ -235,7 +236,7 @@ public function testCreatesObjectUrlsForCorrectRegion() ]); } - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); }, ]); @@ -254,7 +255,7 @@ public function testCreatesObjectUrlsForCorrectRegionWithPathStyle() return Promise\Create::promiseFor(new Response(301, ['X-Amz-Bucket-Region' => 'us-west-2'])); } - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); }, 'use_path_style_endpoint' => true ]); @@ -439,7 +440,7 @@ public function testReadsBucketLocationFromCacheWithPathStyle() public function testCorrectsErroneousEntriesInCache() { - $cache = new LruArrayCache; + $cache = new LruArrayCache(); $cache->set('aws:s3:foo:location', 'us-east-1'); $client = new S3MultiRegionClient([ @@ -467,7 +468,7 @@ public function testCorrectsErroneousEntriesInCache() public function testCorrectsErroneousEntriesInCacheWithPathStyle() { - $cache = new LruArrayCache; + $cache = new LruArrayCache(); $cache->set('aws:s3:foo:location', 'us-east-1'); $client = new S3MultiRegionClient([ diff --git a/tests/S3/S3UriParserTest.php b/tests/S3/S3UriParserTest.php index 39c9b4d864..bfce038edd 100644 --- a/tests/S3/S3UriParserTest.php +++ b/tests/S3/S3UriParserTest.php @@ -1,4 +1,5 @@ expectExceptionMessage("403 Forbidden"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $req) { return new S3Exception('403 Forbidden', $cmd); } + function ($cmd, $req) { + return new S3Exception('403 Forbidden', $cmd); + } ]); $s = fopen('s3://bucket/key', 'w'); fwrite($s, 'test'); @@ -213,7 +216,9 @@ public function testCanOpenAppendStreamsWithOriginalFile() public function testCanOpenAppendStreamsWithMissingFile() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('err', $cmd); }, + function ($cmd, $r) { + return new S3Exception('err', $cmd); + }, new Result(['@metadata' => ['statusCode' => 204, 'effectiveUri' => 'http://foo.com']]) ]); @@ -242,7 +247,9 @@ public function testThrowsErrorsWhenUnlinkFails() $this->expectExceptionMessage("403 Forbidden"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, ]); $this->assertFalse(unlink('s3://bucket/key')); } @@ -274,11 +281,17 @@ public function testCreatingBucketsSetsAclBasedOnPermissions() $this->client->getHandlerList()->appendSign(Middleware::history($history)); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result(), - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result(), - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result(), ]); @@ -307,7 +320,9 @@ public function testCreatesNestedSubfolder() $this->client->getHandlerList()->appendSign(Middleware::history($history)); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result() // 204 ]); @@ -331,7 +346,9 @@ public function testRmDirWithExceptionTriggersError() $this->expectExceptionMessage("403 Forbidden"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, ]); rmdir('s3://bucket'); } @@ -414,7 +431,9 @@ public function testRenameWithExceptionThrowsError() $this->expectExceptionMessage("Forbidden"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, ]); rename('s3://foo/bar', 's3://baz/bar'); } @@ -496,7 +515,7 @@ public function testStatDataIsClearedOnWrite() $this->cache->set('s3://foo/bar', ['size' => 123, 7 => 123]); $this->assertSame(123, filesize('s3://foo/bar')); $this->addMockResults($this->client, [ - new Result, + new Result(), new Result(['ContentLength' => 124]) ]); file_put_contents('s3://foo/bar', 'baz!'); @@ -515,8 +534,12 @@ public function testFailingStatTriggersError() $this->expectWarning(); // Sends one request for HeadObject, then another for ListObjects $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); } + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + } ]); clearstatcache('s3://bucket/key'); stat('s3://bucket/key'); @@ -527,7 +550,9 @@ public function testBucketNotFoundTriggersError() $this->expectExceptionMessage("File or directory not found: s3://bucket"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, ]); clearstatcache('s3://bucket'); stat('s3://bucket'); @@ -553,7 +578,9 @@ public function testStatsRegularObjects() public function testCanStatPrefix() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result([ 'Name' => 'bucket-1', 'IsTruncated' => false, @@ -572,7 +599,9 @@ public function testCannotStatPrefixWithNoResults() $this->expectExceptionMessage("File or directory not found: s3://bucket/prefix"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result() ]); clearstatcache('s3://bucket/prefix'); @@ -581,7 +610,9 @@ function ($cmd, $r) { return new S3Exception('404', $cmd); }, public function fileTypeProvider() { - $err = function ($cmd, $r) { return new S3Exception('404', $cmd); }; + $err = function ($cmd, $r) { + return new S3Exception('404', $cmd); + }; return [ ['s3://', [], 'dir'], @@ -627,7 +658,9 @@ public function testDeterminesIfFileOrDir($uri, $queue, $result) clearstatcache(); if ($result == 'error') { $err = false; - set_error_handler(function ($e) use (&$err) { $err = true; }); + set_error_handler(function ($e) use (&$err) { + $err = true; + }); $actual = filetype($uri); restore_error_handler(); $this->assertFalse($actual); @@ -671,7 +704,9 @@ public function testEnsuresClientIsSet() public function testDoesNotErrorOnIsLink() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, ]); $this->assertFalse(is_link('s3://bucket/key')); } @@ -679,7 +714,9 @@ function ($cmd, $r) { return new S3Exception('404', $cmd); }, public function testDoesNotErrorOnFileExists() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, ]); $this->assertFileDoesNotExist('s3://bucket/key'); } @@ -827,7 +864,9 @@ public function testReturnsStreamSizeFromHeaders() { $stream = Psr7\Utils::streamFor('12345'); $stream = Psr7\FnStream::decorate($stream, [ - 'getSize' => function () { return null; } + 'getSize' => function () { + return null; + } ]); $result = [ 'Body' => $stream, diff --git a/tests/S3/StreamWrapperTest.php b/tests/S3/StreamWrapperTest.php index eb1cf7f438..d19e5d9842 100644 --- a/tests/S3/StreamWrapperTest.php +++ b/tests/S3/StreamWrapperTest.php @@ -1,4 +1,5 @@ expectExceptionMessage("403 Forbidden"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $req) { return new S3Exception('403 Forbidden', $cmd); } + function ($cmd, $req) { + return new S3Exception('403 Forbidden', $cmd); + } ]); $s = fopen('s3://bucket/key', 'w'); fwrite($s, 'test'); @@ -326,7 +329,9 @@ public function testCanOpenAppendStreamsWithOriginalFile() public function testCanOpenAppendStreamsWithMissingFile() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('err', $cmd); }, + function ($cmd, $r) { + return new S3Exception('err', $cmd); + }, new Result(['@metadata' => ['statusCode' => 204, 'effectiveUri' => 'http://foo.com']]) ]); @@ -355,7 +360,9 @@ public function testThrowsErrorsWhenUnlinkFails() $this->expectExceptionMessage("403 Forbidden"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, ]); $this->assertFalse(unlink('s3://bucket/key')); } @@ -387,11 +394,17 @@ public function testCreatingBucketsSetsAclBasedOnPermissions() $this->client->getHandlerList()->appendSign(Middleware::history($history)); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result(), - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result(), - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result(), ]); @@ -420,7 +433,9 @@ public function testCreatesNestedSubfolder() $this->client->getHandlerList()->appendSign(Middleware::history($history)); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result() // 204 ]); @@ -444,7 +459,9 @@ public function testRmDirWithExceptionTriggersError() $this->expectExceptionMessage("403 Forbidden"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, ]); rmdir('s3://bucket'); } @@ -528,7 +545,9 @@ public function testRenameWithExceptionThrowsError() $this->expectExceptionMessage("Forbidden"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, ]); rename('s3://foo/bar', 's3://baz/bar'); } @@ -611,7 +630,7 @@ public function testStatDataIsClearedOnWrite() $this->cache->set('s3://foo/bar', ['size' => 123, 7 => 123]); $this->assertSame(123, filesize('s3://foo/bar')); $this->addMockResults($this->client, [ - new Result, + new Result(), new Result(['ContentLength' => 124]) ]); file_put_contents('s3://foo/bar', 'baz!'); @@ -630,8 +649,12 @@ public function testFailingStatTriggersError() $this->expectWarning(); // Sends one request for HeadObject, then another for ListObjects $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); } + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + } ]); clearstatcache('s3://bucket/key'); stat('s3://bucket/key'); @@ -642,7 +665,9 @@ public function testBucketNotFoundTriggersError() $this->expectExceptionMessage("File or directory not found: s3://bucket"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, ]); clearstatcache('s3://bucket'); stat('s3://bucket'); @@ -668,7 +693,9 @@ public function testStatsRegularObjects() public function testCanStatPrefix() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result([ 'Name' => 'bucket-1', 'IsTruncated' => false, @@ -687,7 +714,9 @@ public function testCannotStatPrefixWithNoResults() $this->expectExceptionMessage("File or directory not found: s3://bucket/prefix"); $this->expectWarning(); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, new Result() ]); clearstatcache('s3://bucket/prefix'); @@ -696,7 +725,9 @@ function ($cmd, $r) { return new S3Exception('404', $cmd); }, public function fileTypeProvider() { - $err = function ($cmd, $r) { return new S3Exception('404', $cmd); }; + $err = function ($cmd, $r) { + return new S3Exception('404', $cmd); + }; return [ ['s3://', [], 'dir'], @@ -742,7 +773,9 @@ public function testDeterminesIfFileOrDir($uri, $queue, $result) clearstatcache(); if ($result == 'error') { $err = false; - set_error_handler(function ($e) use (&$err) { $err = true; }); + set_error_handler(function ($e) use (&$err) { + $err = true; + }); $actual = filetype($uri); restore_error_handler(); $this->assertFalse($actual); @@ -786,7 +819,9 @@ public function testEnsuresClientIsSet() public function testDoesNotErrorOnIsLink() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, ]); $this->assertFalse(is_link('s3://bucket/key')); } @@ -794,7 +829,9 @@ function ($cmd, $r) { return new S3Exception('404', $cmd); }, public function testDoesNotErrorOnFileExists() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('404', $cmd); }, + function ($cmd, $r) { + return new S3Exception('404', $cmd); + }, ]); $this->assertFileDoesNotExist('s3://bucket/key'); } @@ -942,7 +979,9 @@ public function testReturnsStreamSizeFromHeaders() { $stream = Psr7\Utils::streamFor('12345'); $stream = Psr7\FnStream::decorate($stream, [ - 'getSize' => function () { return null; } + 'getSize' => function () { + return null; + } ]); $result = [ 'Body' => $stream, diff --git a/tests/S3/StreamWrapperV2ExistenceTest.php b/tests/S3/StreamWrapperV2ExistenceTest.php index 301cd44975..5aa5f9608a 100644 --- a/tests/S3/StreamWrapperV2ExistenceTest.php +++ b/tests/S3/StreamWrapperV2ExistenceTest.php @@ -1,4 +1,5 @@ expectError(); $this->expectErrorMessage('403 Forbidden'); $this->addMockResults($this->client, [ - function ($cmd, $req) { return new S3Exception('403 Forbidden', $cmd); } + function ($cmd, $req) { + return new S3Exception('403 Forbidden', $cmd); + } ]); $s = fopen('s3://bucket/key', 'w'); fwrite($s, 'test'); @@ -282,7 +285,9 @@ public function testCanOpenAppendStreamsWithOriginalFile() public function testCanOpenAppendStreamsWithMissingFile() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('err', $cmd); }, + function ($cmd, $r) { + return new S3Exception('err', $cmd); + }, new Result(['@metadata' => ['statusCode' => 204, 'effectiveUri' => 'http://foo.com']]) ]); @@ -311,7 +316,9 @@ public function testThrowsErrorsWhenUnlinkFails() $this->expectError(); $this->expectErrorMessage('403 Forbidden'); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, ]); $this->assertFalse(unlink('s3://bucket/key')); } @@ -343,23 +350,29 @@ public function testCreatingBucketsSetsAclBasedOnPermissions() $this->client->getHandlerList()->appendSign(Middleware::history($history)); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception( - '404', - $cmd, - ['response' => new Response(404)] - );}, + function ($cmd, $r) { + return new S3Exception( + '404', + $cmd, + ['response' => new Response(404)] + ); + }, new Result(), - function ($cmd, $r) { return new S3Exception( - '404', - $cmd, - ['response' => new Response(404)] - );}, + function ($cmd, $r) { + return new S3Exception( + '404', + $cmd, + ['response' => new Response(404)] + ); + }, new Result(), - function ($cmd, $r) {return new S3Exception( - '404', - $cmd, - ['response' => new Response(404)] - );}, + function ($cmd, $r) { + return new S3Exception( + '404', + $cmd, + ['response' => new Response(404)] + ); + }, new Result(), ]); @@ -388,11 +401,12 @@ public function testCreatesNestedSubfolder() $this->client->getHandlerList()->appendSign(Middleware::history($history)); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception( - '404', - $cmd, - ['response' => new Response(404)] - ); + function ($cmd, $r) { + return new S3Exception( + '404', + $cmd, + ['response' => new Response(404)] + ); }, new Result() // 204 ]); @@ -417,7 +431,9 @@ public function testRmDirWithExceptionTriggersError() $this->expectError(); $this->expectErrorMessage('403 Forbidden'); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, ]); rmdir('s3://bucket'); } @@ -501,7 +517,9 @@ public function testRenameWithExceptionThrowsError() $this->expectError(); $this->expectErrorMessage('Forbidden'); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, ]); rename('s3://foo/bar', 's3://baz/bar'); } @@ -584,7 +602,7 @@ public function testStatDataIsClearedOnWrite() $this->cache->set('s3://foo/bar', ['size' => 123, 7 => 123]); $this->assertSame(123, filesize('s3://foo/bar')); $this->addMockResults($this->client, [ - new Result, + new Result(), new Result(['ContentLength' => 124]) ]); file_put_contents('s3://foo/bar', 'baz!'); @@ -603,8 +621,12 @@ public function testFailingStatTriggersError() $this->expectErrorMessage('Forbidden'); // Sends one request for HeadObject, then another for ListObjects $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); }, - function ($cmd, $r) { return new S3Exception('403 Forbidden', $cmd); } + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + }, + function ($cmd, $r) { + return new S3Exception('403 Forbidden', $cmd); + } ]); clearstatcache('s3://bucket/key'); stat('s3://bucket/key'); @@ -616,11 +638,12 @@ public function testBucketNotFoundTriggersError() $this->expectErrorMessage('File or directory not found: s3://bucket'); $this->addMockResults($this->client, [ function ($cmd, $r) { - return new S3Exception( - '404', - $cmd, - ['response' => new Response(404)] - );}, + return new S3Exception( + '404', + $cmd, + ['response' => new Response(404)] + ); + }, ]); clearstatcache('s3://bucket'); stat('s3://bucket'); @@ -646,11 +669,12 @@ public function testStatsRegularObjects() public function testCanStatPrefix() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception( - '404', - $cmd, - ['response' => new Response(404)] - ); + function ($cmd, $r) { + return new S3Exception( + '404', + $cmd, + ['response' => new Response(404)] + ); }, new Result([ 'Name' => 'bucket-1', @@ -670,11 +694,12 @@ public function testCannotStatPrefixWithNoResults() $this->expectError(); $this->expectErrorMessage('File or directory not found: s3://bucket/prefix'); $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception( - '404', - $cmd, - ['response' => new Response(404)] - ); + function ($cmd, $r) { + return new S3Exception( + '404', + $cmd, + ['response' => new Response(404)] + ); }, new Result() ]); @@ -684,11 +709,12 @@ function ($cmd, $r) { return new S3Exception( public function fileTypeProvider() { - $err = function ($cmd, $r) { return new S3Exception( - '404', - $cmd, - ['response' => new Response(404)] - ); + $err = function ($cmd, $r) { + return new S3Exception( + '404', + $cmd, + ['response' => new Response(404)] + ); }; return [ @@ -735,7 +761,9 @@ public function testDeterminesIfFileOrDir($uri, $queue, $result) clearstatcache(); if ($result == 'error') { $err = false; - set_error_handler(function ($e) use (&$err) { $err = true; }); + set_error_handler(function ($e) use (&$err) { + $err = true; + }); $actual = filetype($uri); restore_error_handler(); $this->assertFalse($actual); @@ -770,11 +798,13 @@ public function testStreamCastIsNotPossible() public function testDoesNotErrorOnIsLink() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception( - '404', - $cmd, - ['response' => new Response(404)] - );}, + function ($cmd, $r) { + return new S3Exception( + '404', + $cmd, + ['response' => new Response(404)] + ); + }, ]); $this->assertFalse(is_link('s3://bucket/key')); } @@ -782,11 +812,13 @@ function ($cmd, $r) { return new S3Exception( public function testDoesNotErrorOnFileExists() { $this->addMockResults($this->client, [ - function ($cmd, $r) { return new S3Exception( - '404', - $cmd, - ['response' => new Response(404)] - );}, + function ($cmd, $r) { + return new S3Exception( + '404', + $cmd, + ['response' => new Response(404)] + ); + }, ]); $this->assertFileDoesNotExist('s3://bucket/key'); } diff --git a/tests/S3/TransferTest.php b/tests/S3/TransferTest.php index 6a3571954b..d37e3060ef 100644 --- a/tests/S3/TransferTest.php +++ b/tests/S3/TransferTest.php @@ -1,4 +1,5 @@ getTestClient('s3'); $s3->getHandlerList()->appendSign( - $this->mockResult(function() { + $this->mockResult(function () { return new Result(); }), 's3.test' @@ -315,7 +316,8 @@ public function testCannotDownloadObjectsOutsideTarget($key) `rm -rf $dir`; } - public function providedPathsOutsideTarget() { + public function providedPathsOutsideTarget() + { return [ ['bar/../a/b'], //ensures if path resolves to target directory @@ -333,7 +335,9 @@ public function testCanUploadToBareBucket() $s3 = $this->getMockS3Client(); $filesInDirectory = array_filter( iterator_to_array(\Aws\recursive_dir_iterator(__DIR__)), - function ($path) { return !is_dir($path); } + function ($path) { + return !is_dir($path); + } ); $s3->expects($this->exactly(count($filesInDirectory))) @@ -357,7 +361,9 @@ public function testCanUploadFilesYieldedBySourceIterator() $s3 = $this->getMockS3Client(); $justThisFile = array_filter( iterator_to_array(\Aws\recursive_dir_iterator(__DIR__)), - function ($path) { return $path === __FILE__; } + function ($path) { + return $path === __FILE__; + } ); $s3->expects($this->once()) diff --git a/tests/S3/UseArnRegion/ConfigurationProviderTest.php b/tests/S3/UseArnRegion/ConfigurationProviderTest.php index 8abc234207..2569ec6352 100644 --- a/tests/S3/UseArnRegion/ConfigurationProviderTest.php +++ b/tests/S3/UseArnRegion/ConfigurationProviderTest.php @@ -1,4 +1,5 @@ assertSame($expected->toArray(), $result->toArray()); } } - diff --git a/tests/S3/UseArnRegion/ConfigurationTest.php b/tests/S3/UseArnRegion/ConfigurationTest.php index 9f05028cee..daa67b8ca9 100644 --- a/tests/S3/UseArnRegion/ConfigurationTest.php +++ b/tests/S3/UseArnRegion/ConfigurationTest.php @@ -1,4 +1,5 @@ getTestClient( 's3', ['api_provider' => ApiProvider::filesystem(__DIR__ . '/fixtures')] ); - $parser = new ValidateResponseChecksumParser(function () { - return new Result(); - }, - $s3->getApi()); + $parser = new ValidateResponseChecksumParser( + function () { + return new Result(); + }, + $s3->getApi() + ); $response = new Response(200, [], "response body"); foreach ($checksumHeadersReturned as $header) { @@ -56,14 +61,16 @@ public function getChosenChecksumCases() ]; } - public function testValidatesChecksumFailsOnBadValue() { + public function testValidatesChecksumFailsOnBadValue() + { $s3 = $this->getTestClient( 's3', ['api_provider' => ApiProvider::filesystem(__DIR__ . '/fixtures')] ); - $parser = new ValidateResponseChecksumParser(function () { - return new Result(); - }, + $parser = new ValidateResponseChecksumParser( + function () { + return new Result(); + }, $s3->getApi() ); @@ -78,14 +85,16 @@ public function testValidatesChecksumFailsOnBadValue() { $this->assertEquals("FAILED", $chosenChecksum['status']); } - public function testValidatesChecksumSucceeds() { + public function testValidatesChecksumSucceeds() + { $s3 = $this->getTestClient( 's3', ['api_provider' => ApiProvider::filesystem(__DIR__ . '/fixtures')] ); - $parser = new ValidateResponseChecksumParser(function () { - return new Result(); - }, + $parser = new ValidateResponseChecksumParser( + function () { + return new Result(); + }, $s3->getApi() ); $expectedValue = "E6TOUbfBBDPqSyozecOzDgB3K9CZKCI6d7PbKBAYvo0="; @@ -102,14 +111,16 @@ public function testValidatesChecksumSucceeds() { $this->assertEquals($expectedValue, $chosenChecksum['checksumHeaderValue']); } - public function testValidatesChecksumSkipsValidation() { + public function testValidatesChecksumSkipsValidation() + { $s3 = $this->getTestClient( 's3', ['api_provider' => ApiProvider::filesystem(__DIR__ . '/fixtures')] ); - $parser = new ValidateResponseChecksumParser(function () { - return new Result(); - }, + $parser = new ValidateResponseChecksumParser( + function () { + return new Result(); + }, $s3->getApi() ); $response = new Response(200, [], "response body"); @@ -121,14 +132,16 @@ public function testValidatesChecksumSkipsValidation() { $this->assertEquals("SKIPPED", $chosenChecksum['status']); } - public function testSkipsGetObjectReturnsFullMultipart() { + public function testSkipsGetObjectReturnsFullMultipart() + { $s3 = $this->getTestClient( 's3', ['api_provider' => ApiProvider::filesystem(__DIR__ . '/fixtures')] ); - $parser = new ValidateResponseChecksumParser(function () { - return new Result(); - }, + $parser = new ValidateResponseChecksumParser( + function () { + return new Result(); + }, $s3->getApi() ); $command = $s3->getCommand("GetObject", ["ChecksumMode" => "enabled"]); @@ -141,14 +154,16 @@ public function testSkipsGetObjectReturnsFullMultipart() { self::assertTrue(true); } - public function testValidatesSha256() { + public function testValidatesSha256() + { $s3 = $this->getTestClient( 's3', ['api_provider' => ApiProvider::filesystem(__DIR__ . '/fixtures')] ); - $parser = new ValidateResponseChecksumParser(function () { - return new Result(); - }, + $parser = new ValidateResponseChecksumParser( + function () { + return new Result(); + }, $s3->getApi() ); $command = $s3->getCommand("GetObject", ["ChecksumMode" => "enabled"]); diff --git a/tests/S3/sig_hack.php b/tests/S3/sig_hack.php index b69dc44317..a466f583e0 100644 --- a/tests/S3/sig_hack.php +++ b/tests/S3/sig_hack.php @@ -1,4 +1,5 @@ getTestClient($options); @@ -436,7 +437,7 @@ public function testCorrectlyThrowsForBadInputsOrConfig( $options, \Exception $expectedException ) { - $options['http_handler'] = function($req) { + $options['http_handler'] = function ($req) { return Promise\Create::promiseFor(new Response()); }; $s3control = $this->getTestClient($options); diff --git a/tests/S3Control/S3ControlClientTest.php b/tests/S3Control/S3ControlClientTest.php index 8640d1ca0e..2964596791 100644 --- a/tests/S3Control/S3ControlClientTest.php +++ b/tests/S3Control/S3ControlClientTest.php @@ -1,4 +1,5 @@ getUri()->getHost() ); - return Promise\Create::promiseFor(new Response); + return Promise\Create::promiseFor(new Response()); }; $client = $this->getTestClient([ @@ -35,5 +36,4 @@ public function testAppliesS3ControlEndpointMiddleware() 'AccountId' => '111222333444', ]); } - } diff --git a/tests/S3Control/S3ControlTestingTrait.php b/tests/S3Control/S3ControlTestingTrait.php index c1aeb332e9..43281759b8 100644 --- a/tests/S3Control/S3ControlTestingTrait.php +++ b/tests/S3Control/S3ControlTestingTrait.php @@ -1,4 +1,5 @@ mkdir($clientDir); $filesystem->mkdir($modelDir); } - $filesystem->mkdir( $clientPath . 'Api'); + $filesystem->mkdir($clientPath . 'Api'); $unsafeForDeletion = ['Kms', 'S3', 'SSO', 'SSOOIDC', 'Sts']; if (in_array('DynamoDbStreams', $servicesToKeep)) { @@ -114,8 +115,8 @@ public function testRemoveServices($servicesToKeep) private function getMockEvent( array $servicesToKeep, - $vendorDir = '', - $message = null + $vendorDir = '', + $message = null ) { $mockPackage = $this->getMockBuilder('Composer\Package\RootPackage') ->disableOriginalConstructor() @@ -162,4 +163,4 @@ private function getMockEvent( return $mockEvent; } -} \ No newline at end of file +} diff --git a/tests/SdkTest.php b/tests/SdkTest.php index 698b1539a3..f0f6ee0ea6 100644 --- a/tests/SdkTest.php +++ b/tests/SdkTest.php @@ -1,4 +1,5 @@ expectException(\BadMethodCallException::class); - (new Sdk)->foo(); + (new Sdk())->foo(); } public function testHasMagicMethods() @@ -34,7 +34,7 @@ public function testCreatesClients() { $this->assertInstanceOf( AwsClientInterface::class, - (new Sdk)->createDynamoDb([ + (new Sdk())->createDynamoDb([ 'region' => 'us-east-1', 'version' => 'latest' ]) @@ -43,7 +43,7 @@ public function testCreatesClients() public function testCreatesMultiRegionClients() { - $multiregionS3 = (new Sdk)->createMultiRegionS3([ + $multiregionS3 = (new Sdk())->createMultiRegionS3([ 'version' => 'latest', ]); @@ -56,7 +56,7 @@ public function testCreatesClientsWithAlias() { $this->assertInstanceOf( AwsClientInterface::class, - (new Sdk)->createCloudWatch([ + (new Sdk())->createCloudWatch([ 'region' => 'us-east-1', 'version' => 'latest' ]) diff --git a/tests/Ses/SesClientTest.php b/tests/Ses/SesClientTest.php index de6daa45f6..86475e3b4d 100644 --- a/tests/Ses/SesClientTest.php +++ b/tests/Ses/SesClientTest.php @@ -1,4 +1,5 @@ getUri(); - $this->assertStringContainsString('X-Amz-Expires=518400',$url); - + $this->assertStringContainsString('X-Amz-Expires=518400', $url); } public function testCreatesPresignedDatesFromUnixTimestamp() @@ -141,8 +141,8 @@ public function testCreatesPresignedDatesFromUnixTimestamp() $_SERVER['override_v4_time'] = true; list($request, $credentials, $signature) = $this->getFixtures(); $credentials = new Credentials('foo', 'bar', '123'); - $url = (string) $signature->presign($request,$credentials,1386720000)->getUri(); - $this->assertStringContainsString('X-Amz-Expires=518400',$url); + $url = (string) $signature->presign($request, $credentials, 1386720000)->getUri(); + $this->assertStringContainsString('X-Amz-Expires=518400', $url); } public function testCreatesPresignedDateFromStrtotime() @@ -155,7 +155,7 @@ public function testCreatesPresignedDateFromStrtotime() $credentials, 'December 11, 2013 00:00:00 UTC' )->getUri(); - $this->assertStringContainsString('X-Amz-Expires=518400',$url); + $this->assertStringContainsString('X-Amz-Expires=518400', $url); } public function testAddsSecurityTokenIfPresentInPresigned() @@ -405,7 +405,7 @@ public function testSignRequestUnsignedPayload($req, $sreq, $creq) $payloadFn = new \ReflectionMethod($signature, 'getPayload'); $payloadFn->setAccessible(true); $payload = $payloadFn->invoke($signature, $request); - $this->assertSame('UNSIGNED-PAYLOAD',$payload); + $this->assertSame('UNSIGNED-PAYLOAD', $payload); $ctx = $contextFn->invoke($signature, $parsed, $payload); $this->assertEquals($creq, $ctx['creq']); $this->assertSame($sreq, Psr7\Message::toString($signature->signRequest($request, $credentials))); diff --git a/tests/Signature/sig_hack.php b/tests/Signature/sig_hack.php index 25e4eac189..dccc498b10 100644 --- a/tests/Signature/sig_hack.php +++ b/tests/Signature/sig_hack.php @@ -1,4 +1,5 @@ iniFile); putenv('HOME=' . dirname($dir)); /** @var ConfigurationInterface $result */ - $result = call_user_func(ConfigurationProvider::defaultProvider( - ['use_aws_shared_config_files' => false]) + $result = call_user_func( + ConfigurationProvider::defaultProvider( + ['use_aws_shared_config_files' => false] + ) )->wait(); $this->assertSame($expected->toArray(), $result->toArray()); unlink($dir . '/config'); diff --git a/tests/Sts/StsClientTest.php b/tests/Sts/StsClientTest.php index 276ea14025..936aeabf46 100644 --- a/tests/Sts/StsClientTest.php +++ b/tests/Sts/StsClientTest.php @@ -1,4 +1,5 @@ [ @@ -36,7 +38,8 @@ public function bearerTestProvider() { /** * @dataProvider bearerTestProvider */ - public function testBearerSuccessCases($headers, $tokenString, $expectedHeaders) { + public function testBearerSuccessCases($headers, $tokenString, $expectedHeaders) + { $authorizer = new \Aws\Token\BearerTokenAuthorization(); $request = new Request('GET', 'http://foo.com'); foreach ($headers as $header => $value) { @@ -49,7 +52,8 @@ public function testBearerSuccessCases($headers, $tokenString, $expectedHeaders) } } - public function testBearerNullToken() { + public function testBearerNullToken() + { $authorizer = new \Aws\Token\BearerTokenAuthorization(); $request = new Request('GET', 'http://foo.com'); $token = new Token(null); @@ -57,4 +61,4 @@ public function testBearerNullToken() { $this->expectExceptionMessage("Cannot authorize a request with an empty token"); $authorizer->authorizeRequest($request, $token); } -} \ No newline at end of file +} diff --git a/tests/Token/SsoTokenProviderTest.php b/tests/Token/SsoTokenProviderTest.php index 4ce3e02770..b538f23391 100644 --- a/tests/Token/SsoTokenProviderTest.php +++ b/tests/Token/SsoTokenProviderTest.php @@ -1,6 +1,6 @@ assertSame('token', $token->getToken()); $this->assertSame('2500-12-25T21:30:00Z', $token->getExpiration()); $this->assertNull($token->getRegistrationExpiresAt()); - } finally { unlink($dir . '/config'); unlink($tokenLocation); @@ -209,7 +209,4 @@ public function testSsoSessionUnspecified() unlink($dir . '/config'); } } - - - -} \ No newline at end of file +} diff --git a/tests/Token/TokenProviderTest.php b/tests/Token/TokenProviderTest.php index f4f49b31f1..a0c20b0c15 100644 --- a/tests/Token/TokenProviderTest.php +++ b/tests/Token/TokenProviderTest.php @@ -1,4 +1,5 @@ $token]; @@ -124,7 +127,8 @@ public function testCreatesFromCache() $this->assertEquals($token->getExpiration(), $found->getExpiration()); } - public function tokenProviderSuccessCases() { + public function tokenProviderSuccessCases() + { return [ "Valid token with all fields" => [ @@ -163,7 +167,7 @@ public function tokenProviderSuccessCases() { public function testTokenProviderCachedSuccess($cachedToken, $expectedToken) { $_SERVER['aws_time'] = 1640466950; - $cache = new LruArrayCache; + $cache = new LruArrayCache(); $key = 'aws_cached_sso_token'; $token = new SsoToken( $cachedToken['accessToken'], @@ -187,7 +191,8 @@ public function testTokenProviderCachedSuccess($cachedToken, $expectedToken) $this->assertEquals(strtotime($expectedToken['expiration']), $found->getExpiration()); } - public function tokenProviderSuccessCasesWithRefresh() { + public function tokenProviderSuccessCasesWithRefresh() + { return [ "Expired token refresh with refresh token" => [ @@ -266,11 +271,11 @@ public function testTokenProviderCachedSuccessWithRefresh( $cachedToken, $refreshResponse, $expectedTokenWriteback, - $expectedToken) - { + $expectedToken + ) { $_SERVER['aws_time'] = \strtotime('2021-12-25T13:30:00Z'); $_SERVER['aws_str_to_time'] = \strtotime('2021-12-25T13:25:00Z'); - $cache = new LruArrayCache; + $cache = new LruArrayCache(); $key = __CLASS__ . 'tokenCache'; $ssooidc = $this->getTestClient('ssooidc', ['credentials' => false]); @@ -319,7 +324,7 @@ public function testTokenProviderCachedSuccessWithRefresh( isset($cachedToken['registrationExpiresAt']) ? strToTime($cachedToken['registrationExpiresAt']) : null, isset($cachedToken['region']) ? $cachedToken['region'] : null, isset($cachedToken['startUrl']) ? $cachedToken['startUrl'] : null - ); + ); $saved = [ 'token' => $token, 'refreshMethod' => function () use ($ssoTokenProvider) { @@ -340,7 +345,8 @@ public function testTokenProviderCachedSuccessWithRefresh( } } - public function tokenProviderFailureCases() { + public function tokenProviderFailureCases() + { return [ "Minimal expired cached token" => [ @@ -386,7 +392,7 @@ public function tokenProviderFailureCases() { */ public function testTokenProviderFailureCases($cachedToken, $expectedException) { - $cache = new LruArrayCache; + $cache = new LruArrayCache(); $key = __CLASS__ . 'tokenCache'; $token = new SsoToken( 'string', @@ -412,4 +418,4 @@ public function testTokenProviderFailureCases($cachedToken, $expectedException) $this->assertSame($token->getToken(), $found->getToken()); $this->assertEquals($token->getExpiration(), $found->getExpiration()); } -} \ No newline at end of file +} diff --git a/tests/Token/token_hack.php b/tests/Token/token_hack.php index 375b84267d..75500386db 100644 --- a/tests/Token/token_hack.php +++ b/tests/Token/token_hack.php @@ -1,4 +1,5 @@ setHandler(function ($cmd, $req) { return Promise\Create::promiseFor(new Result([ @@ -62,7 +65,9 @@ public function testEmitsDebugInfo() public function testTracksExceptions() { $str = ''; - $logfn = function ($value) use (&$str) { $str .= $value; }; + $logfn = function ($value) use (&$str) { + $str .= $value; + }; $list = new HandlerList(); $list->setHandler(function ($cmd, $req) { return Promise\Create::promiseFor(new Result()); @@ -94,7 +99,9 @@ public function testTracksExceptions() public function testTracksAwsSpecificExceptions() { $str = ''; - $logfn = function ($value) use (&$str) { $str .= $value; }; + $logfn = function ($value) use (&$str) { + $str .= $value; + }; $list = new HandlerList(); $list->setHandler(function ($cmd, $req) { return Promise\Create::promiseFor(new Result()); @@ -136,7 +143,9 @@ public function testTracksAwsSpecificExceptions() public function testScrubsAuthStrings($key, $signature, array $headers) { $str = ''; - $logfn = function ($value) use (&$str) { $str .= $value; }; + $logfn = function ($value) use (&$str) { + $str .= $value; + }; $list = new HandlerList(); $list->setHandler(function ($cmd, $req) use ($key) { @@ -156,7 +165,9 @@ public function testScrubsAuthStrings($key, $signature, array $headers) $request = new Request( 'GET', "http://foo.com?Signature=$signature&AWSAccessKeyId=$key", - array_map(function (array $h) { return $h['raw']; }, $headers) + array_map(function (array $h) { + return $h['raw']; + }, $headers) ); $handler($command, $request); @@ -174,23 +185,25 @@ public function testRedactsSensitiveTraits() $client = $this->generateTestClient($service); $command = $client->getCommand( 'SensitiveOp', - [ - "InputShape" => [ - "PublicParameter" => "PublicParameter not redacted", - "SensitiveParameter" => "SensitiveParameter was redacted", - "NestedParams" => [ - "NestedPublicParameter" => "NestedParams also not redacted", - "NestedSensitiveParameter" => "NestedSensitiveParameter was also redacted", - ], - "SensitiveArray" => [ - "PublicParameter" => "SensitiveArray contents also redacted", - ] - ] - ] + [ + "InputShape" => [ + "PublicParameter" => "PublicParameter not redacted", + "SensitiveParameter" => "SensitiveParameter was redacted", + "NestedParams" => [ + "NestedPublicParameter" => "NestedParams also not redacted", + "NestedSensitiveParameter" => "NestedSensitiveParameter was also redacted", + ], + "SensitiveArray" => [ + "PublicParameter" => "SensitiveArray contents also redacted", + ] + ] + ] ); $str = ''; - $logfn = function ($value) use (&$str) { $str .= $value; }; + $logfn = function ($value) use (&$str) { + $str .= $value; + }; $list = new HandlerList(); $list->setHandler(function () { return Promise\Create::promiseFor(new Result()); @@ -248,7 +261,9 @@ public function testCanScrubOnArbitraryPatterns() ]; $toScrub = 'OhNoIShouldBeHidden'; $str = ''; - $logfn = function ($value) use (&$str) { $str .= $value; }; + $logfn = function ($value) use (&$str) { + $str .= $value; + }; $list = new HandlerList(); $list->setHandler(function ($cmd, $req) { @@ -372,7 +387,9 @@ private function generateTestService() ], ], ], - function () { return []; } + function () { + return []; + } ); } } diff --git a/tests/UsesServiceTrait.php b/tests/UsesServiceTrait.php index 04d2f36b96..3aa7707252 100644 --- a/tests/UsesServiceTrait.php +++ b/tests/UsesServiceTrait.php @@ -1,4 +1,5 @@ 'version' ] ], - function () { return []; } - ))); + function () { + return []; + } + ) + )); return new $type( $message ?: 'Test error', diff --git a/tests/WaiterTest.php b/tests/WaiterTest.php index 05baefc709..1efdb691b3 100644 --- a/tests/WaiterTest.php +++ b/tests/WaiterTest.php @@ -1,4 +1,5 @@ resolve(new Response(200, [], + $promise->resolve(new Response( + 200, + [], Psr7\Utils::streamFor(sprintf( '{"Table":{"TableStatus":"%s"}}', $statusQueue[$iteration] @@ -157,8 +164,7 @@ public function testWaiterWorkflow($results, $expectedException) $client->waitUntil('TableExists', [ 'TableName' => 'WhoCares', '@waiter' => [ - 'before' => function (CommandInterface $cmd, $attempt) - use (&$actualAttempt) { + 'before' => function (CommandInterface $cmd, $attempt) use (&$actualAttempt) { $actualAttempt = $attempt; } ] @@ -227,7 +233,9 @@ private function getApiProvider() return ['waiters' => [ 'TableExists' => [ - 'delay' => function ($attempt) { return $attempt; }, + 'delay' => function ($attempt) { + return $attempt; + }, 'maxAttempts' => 5, 'operation' => 'DescribeTable', 'acceptors' => [ @@ -388,7 +396,8 @@ public function getMatchersTestCases() private function getMockResult($data = []) { if (is_string($data)) { - return new AwsException('ERROR', + return new AwsException( + 'ERROR', $this->getMockBuilder('Aws\CommandInterface')->getMock(), [ 'code' => $data, diff --git a/tests/WrappedHttpHandlerTest.php b/tests/WrappedHttpHandlerTest.php index 186e04e842..1a0ce8675f 100644 --- a/tests/WrappedHttpHandlerTest.php +++ b/tests/WrappedHttpHandlerTest.php @@ -1,4 +1,5 @@ expectException(\RuntimeException::class); $cmd = new Command('foo'); $req = new Request('GET', 'http://foo.com'); - $handler = function () { return new RejectedPromise([]); }; + $handler = function () { + return new RejectedPromise([]); + }; $parser = $errorParser = [$this, 'fail']; $wrapped = new WrappedHttpHandler($handler, $parser, $errorParser); $wrapped($cmd, $req)->wait(); @@ -108,8 +111,7 @@ public function testCanRejectWithAndParseResponse( $expectedCode, $expectedId, $expectedArray - ) - { + ) { $client = $this->generateTestClient($service, []); $cmd = $client->getCommand('TestOperation', []); $e = new \Exception('a'); @@ -341,7 +343,9 @@ public function testCanRejectWithException() $e = new \Exception('a'); $cmd = new Command('foo'); $req = new Request('GET', 'http://foo.com'); - $handler = function () use ($e) { throw $e; }; + $handler = function () use ($e) { + throw $e; + }; $parser = [$this, 'fail']; $errorParser = [$this, 'fail']; $wrapped = new WrappedHttpHandler($handler, $parser, $errorParser); @@ -358,9 +362,11 @@ public function testDoesNotPassOnTransferStatsCallbackToHandlerByDefault() { $handler = function ($request, array $options) { $this->assertArrayNotHasKey('http_stats_receiver', $options); - return new Response; + return new Response(); + }; + $parser = function () { + return new Result(); }; - $parser = function () { return new Result; }; $wrapped = new WrappedHttpHandler($handler, $parser, [$this, 'fail']); $wrapped(new Command('a'), new Request('GET', 'http://foo.com')) @@ -372,10 +378,12 @@ public function testPassesOnTransferStatsCallbackToHandlerWhenRequested() $handler = function ($request, array $options) { $this->assertArrayHasKey('http_stats_receiver', $options); $this->assertIsCallable($options['http_stats_receiver']); - return new Response; + return new Response(); }; - $parser = function () { return new Result; }; + $parser = function () { + return new Result(); + }; $wrapped = new WrappedHttpHandler( $handler, $parser, diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3591ad7425..baa89d6350 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,4 +1,5 @@ newInstanceArgs($arguments); } } else { try { - $instantiator = new Instantiator; + $instantiator = new Instantiator(); $object = $instantiator->instantiate($className); } catch (InstantiatorUnexpectedValueException $exception) { if ($exception->getPrevious()) { @@ -322,7 +322,7 @@ private function getObject($code, $className, $type = '', $callOriginalConstruct if ($callOriginalMethods) { if (!is_object($proxyTarget)) { if (count($arguments) == 0) { - $proxyTarget = new $type; + $proxyTarget = new $type(); } else { $class = new ReflectionClass($type); $proxyTarget = $class->newInstanceArgs($arguments); @@ -710,10 +710,11 @@ private function generateMock($type, $methods, $mockClassName, $callOriginalClon $isMultipleInterfaces = true; $additionalInterfaces[] = $_type; - $typeClass = new ReflectionClass($this->generateClassName( - $_type, - $mockClassName, - 'Mock_' + $typeClass = new ReflectionClass( + $this->generateClassName( + $_type, + $mockClassName, + 'Mock_' )['fullClassName'] ); @@ -879,7 +880,9 @@ private function generateMock($type, $methods, $mockClassName, $callOriginalClon 'mock_class_name' => $mockClassName['className'], 'mocked_methods' => $mockedMethods, 'method' => $method, - 'configurable' => '[' . implode(', ', array_map(function ($m) { return '\'' . $m . '\'';}, $configurable)) . ']' + 'configurable' => '[' . implode(', ', array_map(function ($m) { + return '\'' . $m . '\''; + }, $configurable)) . ']' ] );