diff --git a/.changes/nextrelease/8-deprecation.json b/.changes/nextrelease/8-deprecation.json new file mode 100644 index 0000000000..c09f89631d --- /dev/null +++ b/.changes/nextrelease/8-deprecation.json @@ -0,0 +1,7 @@ +[ + { + "type": "feature", + "category": "", + "description": "Drops support for PHP runtimes 8.0.x and below. Adds support for PHP 8.4." + } +] diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 4aba5c5f7c..c1e390612d 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -5,7 +5,7 @@ on: - master jobs: build_docs: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: php-versions: ['8.1'] diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0da2fbeab2..933f1edcc9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ permissions: jobs: verify-no-models-changes: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 name: Check for model changes if: github.event_name == 'pull_request' steps: @@ -30,11 +30,11 @@ jobs: exit 1 fi run: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: #for each of the following versions of PHP, with and without --prefer-lowest matrix: - php-versions: ['7.2.5', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.1', '8.2', '8.3', '8.4'] composer-options: ['', '--prefer-lowest'] #set the name for each job name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-options }} @@ -65,37 +65,32 @@ jobs: - name: Install dependencies run: composer update ${{ matrix.composer-options }} --no-interaction --prefer-source - #php 8.x requirements - - if: ${{ matrix.php-versions >= '8.0' && matrix.composer-options != '' }} - name: PHP 8.x - run: composer require --dev phpunit/phpunit "^9.5" --no-interaction --prefer-source --with-all-dependencies - #php 8.1+ requirements - - if: ${{ matrix.php-versions >= '8.1' && matrix.composer-options != '' }} - name: PHP 8.1+ - run: composer require --dev guzzlehttp/guzzle "^7.4.5" --no-interaction --prefer-source --with-all-dependencies + - name: PHP 8.1+ requirements + run: composer require --dev phpunit/phpunit "^9.5" guzzlehttp/guzzle "^7.4.5" --no-interaction --prefer-source --with-all-dependencies #run tests - name: Run test suite run: make test #static analysis - - if: ${{ matrix.php-versions < '8.0' && matrix.composer-options == '' }} - name: Static analysis + - name: Static analysis + with: + fetch-depth: 0 run: | - composer require --dev nette/neon "^3.0" - composer require --dev phpstan/phpstan "0.12.45" + composer require --dev nette/neon "^3.4.4" + composer require --dev phpstan/phpstan "2.1.1" vendor/bin/phpstan analyse src #generate package - if: ${{ matrix.composer-options == '' }} name: Package generation run: | - composer config platform.php 7.2.5 + composer config platform.php 8.1 composer update make package #generate code coverage - - if: ${{ (matrix.php-versions == '7.2.5' || matrix.php-versions == '8.0') && matrix.composer-options == '' }} - name: Code coverage + - if: ${{ matrix.composer-options == '' }} + name: Code Coverage run: bash <(curl -s https://codecov.io/bash) diff --git a/composer.json b/composer.json index bc03915aea..3e0e525a03 100644 --- a/composer.json +++ b/composer.json @@ -12,23 +12,23 @@ } ], "support": { - "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", + "forum": "https://github.com/aws/aws-sdk-php/discussions", "issues": "https://github.com/aws/aws-sdk-php/issues" }, "require": { - "php": ">=7.2.5", - "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", - "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", - "guzzlehttp/promises": "^1.4.0 || ^2.0", + "php": ">=8.1", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.4.5", + "guzzlehttp/promises": "^2.0", "mtdowling/jmespath.php": "^2.6", "ext-pcre": "*", "ext-json": "*", "ext-simplexml": "*", "aws/aws-crt-php": "^1.2.3", - "psr/http-message": "^1.0 || ^2.0" + "psr/http-message": "^2.0" }, "require-dev": { - "composer/composer" : "^1.10.22", + "composer/composer" : "^2.2", "ext-openssl": "*", "ext-dom": "*", "ext-pcntl": "*", @@ -37,13 +37,12 @@ "behat/behat": "~3.0", "doctrine/cache": "~1.4", "aws/aws-php-sns-message-validator": "~1.0", - "nette/neon": "^2.3", "andrewsville/php-token-reflection": "^1.4", - "psr/cache": "^1.0 || ^2.0 || ^3.0", - "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", + "psr/cache": "^2.0 || ^3.0", + "psr/simple-cache": "^2.0 || ^3.0", "paragonie/random_compat": ">= 2", - "sebastian/comparator": "^1.2.3 || ^4.0", - "yoast/phpunit-polyfills": "^1.0", + "sebastian/comparator": "^1.2.3 || ^4.0 || ^5.0", + "yoast/phpunit-polyfills": "^2.0", "dms/phpunit-arraysubset-asserts": "^0.4.0" }, "suggest": { diff --git a/phpstan.neon b/phpstan.neon index 555c8e953e..0597cedc8b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,17 +5,18 @@ parameters: parallel: processTimeout: 300.0 - excludes_analyse: - # Guzzle V5 classes & interfaces changed in V6 - - %rootDir%/../../../src/Handler/GuzzleV5/* - - %rootDir%/../../../src/Crypto/Polyfill/* - - src/data/* + excludePaths: + # Guzzle V5 classes & interfaces changed in V6 + - %rootDir%/../../../src/Handler/GuzzleV5/* + - %rootDir%/../../../src/Crypto/Polyfill/* + - src/data/* ignoreErrors: # Intentional - '#Aws\\Api\\Parser\\Crc32ValidatingParser::__construct\(\) does not call parent constructor from Aws\\Api\\Parser\\AbstractParser\.#' - '#Aws\\S3\\(RetryableMalformedResponse|GetBucketLocation|AmbiguousSuccess)Parser::__construct\(\) does not call parent constructor from Aws\\Api\\Parser\\AbstractParser\.#' - '#Unsafe usage of new static\(\)\.#' + - '#should return .* but return statement is missing#' # HashContext definition sometimes not found by static analysis - '#Property Aws\\PhpHash::\$context has unknown class HashContext as its type\.#' diff --git a/src/functions.php b/src/functions.php index 5f4d98ad5a..c8f5077486 100644 --- a/src/functions.php +++ b/src/functions.php @@ -300,11 +300,6 @@ function default_user_agent() return \GuzzleHttp\default_user_agent(); } - // If Guzzle 5 installed - if ($version === 5) { - return \GuzzleHttp\Client::getDefaultUserAgent(); - } - throw new \RuntimeException('Unknown Guzzle version: ' . $version); }