Skip to content

Commit a9ceb4c

Browse files
authored
Drop support for PHP lower than 8.2 (#1967)
* Drop support for PHP lower than 8.2 * Remove dead code related to old PHP versions * Regenerate the Psalm baseline
1 parent f5be34b commit a9ceb4c

File tree

164 files changed

+394
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+394
-284
lines changed

.github/workflows/bin/refresh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ foreach ($services as $service => $hasChange) {
182182
$fixSectionLabel = $hasChange ? '### Added' : '### Changed';
183183
$fixSectionOrder = [
184184
'### BC-BREAK', '### Removed', // Major
185-
'### Added', '### Deprecated', // Minor
185+
'### Added', '### Deprecated', '### Dependency bumped', // Minor
186186
'### Changed', '### Fixed', '### Security', // Patch
187187
];
188188
$fixSectionIndex = array_search($fixSectionLabel, $fixSectionOrder);

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
16+
php: ['8.2', '8.3', '8.4', '8.5']
1717
strategy: ['default']
1818
include:
1919
# Minimum supported dependencies with the oldest PHP version
20-
- php: '7.2'
20+
- php: '8.2'
2121
strategy: 'lowest'
2222

2323
steps:

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
- name: Set up PHP
8787
uses: shivammathur/setup-php@v2
8888
with:
89-
php-version: 7.4
89+
php-version: 8.2
9090
coverage: none
9191

9292
- name: Checkout code

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"type": "project",
66
"require": {
7-
"php": "^7.2.5 || ^8.0",
7+
"php": "^8.2",
88
"ext-dom": "*",
99
"ext-filter": "*",
1010
"ext-hash": "*",

psalm.baseline.xml

Lines changed: 62 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.11.0@c9b192ab8400fdaf04b2b13d110575adc879aa90">
2+
<files psalm-version="5.14.1@b9d355e0829c397b9b3b47d0c0ed042a8a70284d">
33
<file src="src/Core/src/AbstractApi.php">
44
<UndefinedFunction>
55
<code><![CDATA[trigger_deprecation('async-aws/core', '1.2', 'Extending "%s"" without overriding "%s" is deprecated. This method will be abstract in version 2.0.', __CLASS__, __FUNCTION__)]]></code>
66
<code><![CDATA[trigger_deprecation('async-aws/core', '1.2', 'providing an endpoint with placeholder is deprecated and will be ignored in version 2.0. Provide full endpoint instead.')]]></code>
77
</UndefinedFunction>
88
</file>
9-
<file src="src/Core/src/Credentials/PsrCacheProvider.php">
10-
<InvalidCatch>
11-
<code><![CDATA[try {
12-
return $this->getFromCache($configuration);
13-
} catch (CacheException $e) {
14-
if (null !== $this->logger) {
15-
$this->logger->error('Failed to get AWS credentials from cache.', ['exception' => $e]);
16-
}
17-
18-
return $this->decorated->getCredentials($configuration);
19-
}]]></code>
20-
</InvalidCatch>
21-
<InvalidThrow>
22-
<code>CacheException</code>
23-
</InvalidThrow>
24-
</file>
25-
<file src="src/Core/src/Credentials/SymfonyCacheProvider.php">
26-
<InvalidCatch>
27-
<code><![CDATA[try {
28-
return $this->cache->get('AsyncAws.Credentials.' . sha1(serialize([$configuration, \get_class($this->decorated)])), $closure);
29-
} catch (CacheException $e) {
30-
if (null !== $this->logger) {
31-
$this->logger->error('Failed to get AWS credentials from cache.', ['exception' => $e]);
32-
}
33-
34-
return $provider->getCredentials($configuration);
35-
}]]></code>
36-
</InvalidCatch>
37-
</file>
38-
<file src="src/Core/src/Response.php">
39-
<LessSpecificReturnStatement>
40-
<code><![CDATA[$this->httpResponse->getHeaders(false)]]></code>
41-
</LessSpecificReturnStatement>
42-
<MoreSpecificReturnType>
43-
<code><![CDATA[array<string, list<string>>]]></code>
44-
</MoreSpecificReturnType>
45-
</file>
469
<file src="src/Core/src/Waiter.php">
4710
<PossiblyUndefinedVariable>
4811
<code>$exception</code>
@@ -71,14 +34,20 @@
7134
</UndefinedInterfaceMethod>
7235
</file>
7336
<file src="src/Integration/Monolog/CloudWatch/src/CloudWatchLogsHandler.php">
74-
<InvalidOperand>
75-
<code><![CDATA[$entry['datetime']->format('U.u')]]></code>
76-
</InvalidOperand>
37+
<DeprecatedConstant>
38+
<code>Logger::DEBUG</code>
39+
</DeprecatedConstant>
40+
<InvalidArgument>
41+
<code>$level</code>
42+
</InvalidArgument>
43+
<PossiblyInvalidArgument>
44+
<code><![CDATA[$record['formatted']]]></code>
45+
</PossiblyInvalidArgument>
46+
<PossiblyInvalidMethodCall>
47+
<code>format</code>
48+
</PossiblyInvalidMethodCall>
7749
</file>
7850
<file src="src/Integration/Symfony/Bundle/src/DependencyInjection/Configuration.php">
79-
<PossiblyNullReference>
80-
<code>scalarNode</code>
81-
</PossiblyNullReference>
8251
<UndefinedInterfaceMethod>
8352
<code>scalarNode</code>
8453
</UndefinedInterfaceMethod>
@@ -128,6 +97,22 @@
12897
<code><![CDATA[list<AutoRollbackEvent::*>]]></code>
12998
</MoreSpecificReturnType>
13099
</file>
100+
<file src="src/Service/CognitoIdentityProvider/src/Result/AdminInitiateAuthResponse.php">
101+
<LessSpecificReturnStatement>
102+
<code>$items</code>
103+
</LessSpecificReturnStatement>
104+
<MoreSpecificReturnType>
105+
<code><![CDATA[list<ChallengeNameType::*>]]></code>
106+
</MoreSpecificReturnType>
107+
</file>
108+
<file src="src/Service/CognitoIdentityProvider/src/Result/InitiateAuthResponse.php">
109+
<LessSpecificReturnStatement>
110+
<code>$items</code>
111+
</LessSpecificReturnStatement>
112+
<MoreSpecificReturnType>
113+
<code><![CDATA[list<ChallengeNameType::*>]]></code>
114+
</MoreSpecificReturnType>
115+
</file>
131116
<file src="src/Service/Kinesis/src/Result/DescribeStreamOutput.php">
132117
<LessSpecificReturnStatement>
133118
<code>$items</code>
@@ -161,9 +146,29 @@
161146
</LessSpecificReturnStatement>
162147
<MoreSpecificReturnType>
163148
<code><![CDATA[list<EncryptionAlgorithmSpec::*>]]></code>
149+
<code><![CDATA[list<KeyAgreementAlgorithmSpec::*>]]></code>
164150
<code><![CDATA[list<MacAlgorithmSpec::*>]]></code>
165151
<code><![CDATA[list<SigningAlgorithmSpec::*>]]></code>
152+
</MoreSpecificReturnType>
153+
</file>
154+
<file src="src/Service/Kms/src/Result/GetPublicKeyResponse.php">
155+
<LessSpecificReturnStatement>
156+
<code>$items</code>
157+
<code>$items</code>
158+
<code>$items</code>
159+
</LessSpecificReturnStatement>
160+
<MoreSpecificReturnType>
161+
<code><![CDATA[list<EncryptionAlgorithmSpec::*>]]></code>
166162
<code><![CDATA[list<KeyAgreementAlgorithmSpec::*>]]></code>
163+
<code><![CDATA[list<SigningAlgorithmSpec::*>]]></code>
164+
</MoreSpecificReturnType>
165+
</file>
166+
<file src="src/Service/Lambda/src/Result/FunctionConfiguration.php">
167+
<LessSpecificReturnStatement>
168+
<code>$items</code>
169+
</LessSpecificReturnStatement>
170+
<MoreSpecificReturnType>
171+
<code><![CDATA[list<Architecture::*>]]></code>
167172
</MoreSpecificReturnType>
168173
</file>
169174
<file src="src/Service/Lambda/src/Result/ListFunctionsResponse.php">
@@ -211,9 +216,9 @@
211216
</LessSpecificReturnStatement>
212217
<MoreSpecificReturnType>
213218
<code><![CDATA[list<AudioChannelTag::*>]]></code>
219+
<code><![CDATA[list<FrameMetricType::*>]]></code>
214220
<code><![CDATA[list<HlsAdMarkers::*>]]></code>
215221
<code><![CDATA[list<TeletextPageType::*>]]></code>
216-
<code><![CDATA[list<FrameMetricType::*>]]></code>
217222
</MoreSpecificReturnType>
218223
</file>
219224
<file src="src/Service/MediaConvert/src/Result/GetJobResponse.php">
@@ -225,9 +230,9 @@
225230
</LessSpecificReturnStatement>
226231
<MoreSpecificReturnType>
227232
<code><![CDATA[list<AudioChannelTag::*>]]></code>
233+
<code><![CDATA[list<FrameMetricType::*>]]></code>
228234
<code><![CDATA[list<HlsAdMarkers::*>]]></code>
229235
<code><![CDATA[list<TeletextPageType::*>]]></code>
230-
<code><![CDATA[list<FrameMetricType::*>]]></code>
231236
</MoreSpecificReturnType>
232237
</file>
233238
<file src="src/Service/MediaConvert/src/Result/ListJobsResponse.php">
@@ -239,9 +244,9 @@
239244
</LessSpecificReturnStatement>
240245
<MoreSpecificReturnType>
241246
<code><![CDATA[list<AudioChannelTag::*>]]></code>
247+
<code><![CDATA[list<FrameMetricType::*>]]></code>
242248
<code><![CDATA[list<HlsAdMarkers::*>]]></code>
243249
<code><![CDATA[list<TeletextPageType::*>]]></code>
244-
<code><![CDATA[list<FrameMetricType::*>]]></code>
245250
</MoreSpecificReturnType>
246251
</file>
247252
<file src="src/Service/Rekognition/src/Result/IndexFacesResponse.php">
@@ -252,15 +257,15 @@
252257
<code><![CDATA[list<Reason::*>]]></code>
253258
</MoreSpecificReturnType>
254259
</file>
255-
<file src="src/Service/S3/src/Result/ListObjectsV2Output.php">
260+
<file src="src/Service/S3/src/Result/ListObjectVersionsOutput.php">
256261
<LessSpecificReturnStatement>
257262
<code>$items</code>
258263
</LessSpecificReturnStatement>
259264
<MoreSpecificReturnType>
260265
<code><![CDATA[list<ChecksumAlgorithm::*>]]></code>
261266
</MoreSpecificReturnType>
262267
</file>
263-
<file src="src/Service/S3/src/Result/ListObjectVersionsOutput.php">
268+
<file src="src/Service/S3/src/Result/ListObjectsV2Output.php">
264269
<LessSpecificReturnStatement>
265270
<code>$items</code>
266271
</LessSpecificReturnStatement>
@@ -279,16 +284,6 @@
279284
<code>empty($s3SignerOptions)</code>
280285
</TypeDoesNotContainType>
281286
</file>
282-
<file src="src/Service/StepFunctions/src/Result/StartExecutionOutput.php">
283-
<PossiblyFalsePropertyAssignmentValue>
284-
<code><![CDATA[$d = \DateTimeImmutable::createFromFormat('U.u', \sprintf('%.6F', $data['startDate']))]]></code>
285-
</PossiblyFalsePropertyAssignmentValue>
286-
</file>
287-
<file src="src/Service/StepFunctions/src/Result/StopExecutionOutput.php">
288-
<PossiblyFalsePropertyAssignmentValue>
289-
<code><![CDATA[$d = \DateTimeImmutable::createFromFormat('U.u', \sprintf('%.6F', $data['stopDate']))]]></code>
290-
</PossiblyFalsePropertyAssignmentValue>
291-
</file>
292287
<file src="src/Service/Sqs/src/Result/GetQueueAttributesResult.php">
293288
<LessSpecificReturnStatement>
294289
<code>$items</code>
@@ -305,40 +300,14 @@
305300
<code><![CDATA[array<MessageSystemAttributeName::*, string>]]></code>
306301
</MoreSpecificReturnType>
307302
</file>
308-
<file src="src/Service/Lambda/src/Result/FunctionConfiguration.php">
309-
<LessSpecificReturnStatement>
310-
<code><![CDATA[$items]]></code>
311-
</LessSpecificReturnStatement>
312-
<MoreSpecificReturnType>
313-
<code><![CDATA[list<Architecture::*>]]></code>
314-
</MoreSpecificReturnType>
315-
</file>
316-
<file src="src/Service/CognitoIdentityProvider/src/Result/InitiateAuthResponse.php">
317-
<LessSpecificReturnStatement>
318-
<code><![CDATA[$items]]></code>
319-
</LessSpecificReturnStatement>
320-
<MoreSpecificReturnType>
321-
<code><![CDATA[list<ChallengeNameType::*>]]></code>
322-
</MoreSpecificReturnType>
323-
</file>
324-
<file src="src/Service/CognitoIdentityProvider/src/Result/AdminInitiateAuthResponse.php">
325-
<LessSpecificReturnStatement>
326-
<code><![CDATA[$items]]></code>
327-
</LessSpecificReturnStatement>
328-
<MoreSpecificReturnType>
329-
<code><![CDATA[list<ChallengeNameType::*>]]></code>
330-
</MoreSpecificReturnType>
303+
<file src="src/Service/StepFunctions/src/Result/StartExecutionOutput.php">
304+
<PossiblyFalsePropertyAssignmentValue>
305+
<code><![CDATA[$d = \DateTimeImmutable::createFromFormat('U.u', \sprintf('%.6F', $data['startDate']))]]></code>
306+
</PossiblyFalsePropertyAssignmentValue>
331307
</file>
332-
<file src="src/Service/Kms/src/Result/GetPublicKeyResponse.php">
333-
<LessSpecificReturnStatement>
334-
<code><![CDATA[$items]]></code>
335-
<code><![CDATA[$items]]></code>
336-
<code><![CDATA[$items]]></code>
337-
</LessSpecificReturnStatement>
338-
<MoreSpecificReturnType>
339-
<code><![CDATA[list<EncryptionAlgorithmSpec::*>]]></code>
340-
<code><![CDATA[list<KeyAgreementAlgorithmSpec::*>]]></code>
341-
<code><![CDATA[list<SigningAlgorithmSpec::*>]]></code>
342-
</MoreSpecificReturnType>
308+
<file src="src/Service/StepFunctions/src/Result/StopExecutionOutput.php">
309+
<PossiblyFalsePropertyAssignmentValue>
310+
<code><![CDATA[$d = \DateTimeImmutable::createFromFormat('U.u', \sprintf('%.6F', $data['stopDate']))]]></code>
311+
</PossiblyFalsePropertyAssignmentValue>
343312
</file>
344313
</files>

release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function getNextVersion(string $changelogPath): ?string
7676

7777
continue;
7878
}
79-
if ('### Added' === $line || '### Deprecated' === $line) {
79+
if ('### Added' === $line || '### Deprecated' === $line || '### Dependency bumped' === $line) {
8080
$level = min($level, 1);
8181

8282
continue;

src/CodeGenerator/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
max-parallel: 10
1515
matrix:
16-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
16+
php: ['8.2', '8.3', '8.4', '8.5']
1717

1818
steps:
1919
- name: Set up PHP

src/Core/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
max-parallel: 10
1515
matrix:
16-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
16+
php: ['8.2', '8.3', '8.4', '8.5']
1717

1818
steps:
1919
- name: Set up PHP

src/Core/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- AWS api-change: Added `us-isob-west-1` region
88

9+
### Dependency bumped
10+
11+
- Drop support for PHP versions lower than 8.2
12+
913
### Changed
1014

1115
- Apply new CodingStandard from latest php-cs-fixer.

src/Core/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"sts"
1212
],
1313
"require": {
14-
"php": "^7.2.5 || ^8.0",
14+
"php": "^8.2",
1515
"ext-hash": "*",
1616
"ext-json": "*",
1717
"ext-simplexml": "*",

0 commit comments

Comments
 (0)