Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 8.0.x deprecation #3061

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
46 changes: 27 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 All @@ -57,6 +57,18 @@ jobs:
- name: Checkout codebase
uses: actions/checkout@v4

#install openssl 1.1
- name: Install OpenSSL 1.1.1
run: sudo apt-get install -y libssl1.1

#configure openssl 1.1
- name: Configure OpenSSL 1.1.1
run: export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/

#confirm openssl 1.1 installation
- name: Confirm OpenSSL installation
run: openssl version

#validate composer files
- name: Validate composer.json and composer.lock
run: composer validate
Expand All @@ -65,37 +77,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)
25 changes: 12 additions & 13 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",
"mtdowling/jmespath.php": "^2.6",
"php": ">=8.1",
"guzzlehttp/guzzle": "^7.4.5",
"guzzlehttp/psr7": "^2.4.5",
"guzzlehttp/promises": "^2.0",
"mtdowling/jmespath.php": "^2.8.0",
"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
Loading