Skip to content

Commit

Permalink
feat: 8.0.x deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean O'Brien committed Jan 17, 2025
1 parent 7e40cec commit 9e4820e
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 42 deletions.
7 changes: 7 additions & 0 deletions .changes/nextrelease/8-deprecation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"type": "feature",
"category": "",
"description": "Drops support for PHP runtimes 8.0.x and below. Adds support for PHP 8.4."
}
]
2 changes: 1 addition & 1 deletion .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
34 changes: 15 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down Expand Up @@ -65,37 +65,33 @@ 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
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
run: bash <(curl -s https://codecov.io/bash)
- if: ${{ matrix.composer-options == '' }}
name: Code Coverage
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: bash <(curl -s https://codecov.io/bash)
23 changes: 11 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand All @@ -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": {
Expand Down
11 changes: 6 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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\.#'
Expand Down
5 changes: 0 additions & 5 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 9e4820e

Please sign in to comment.