Skip to content

Commit e770cd5

Browse files
aarondfrancisclaude
andcommitted
Fix PHP 8.1 compatibility for deprecated constants classes
Using EnumCase->value in class constant initializers is not supported in PHP 8.1 (only available from 8.2+). Hardcode the string values instead to maintain backward compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 01a0b4b commit e770cd5

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

src/ArchitectureConstants.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
abstract class ArchitectureConstants
1111
{
1212
/** @deprecated Use Architecture::X86_64 instead */
13-
public const X86_64 = Architecture::X86_64->value;
13+
public const X86_64 = 'x86_64';
1414

1515
/** @deprecated Use Architecture::ARM_64 instead */
16-
public const ARM_64 = Architecture::ARM_64->value;
16+
public const ARM_64 = 'arm64';
1717
}

src/RuntimeConstants.php

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,98 +10,98 @@
1010
abstract class RuntimeConstants
1111
{
1212
/** @deprecated Use Runtime::NODEJS_24 instead */
13-
public const NODEJS_24 = Runtime::NODEJS_24->value;
13+
public const NODEJS_24 = 'nodejs24.x';
1414

1515
/** @deprecated Use Runtime::NODEJS_22 instead */
16-
public const NODEJS_22 = Runtime::NODEJS_22->value;
16+
public const NODEJS_22 = 'nodejs22.x';
1717

1818
/** @deprecated Use Runtime::NODEJS_20 instead */
19-
public const NODEJS_20 = Runtime::NODEJS_20->value;
19+
public const NODEJS_20 = 'nodejs20.x';
2020

2121
/** @deprecated Use Runtime::NODEJS_18 instead (also deprecated by AWS) */
22-
public const NODEJS_18 = Runtime::NODEJS_18->value;
22+
public const NODEJS_18 = 'nodejs18.x';
2323

2424
/** @deprecated Use Runtime::NODEJS_16 instead (also deprecated by AWS) */
25-
public const NODEJS_16 = Runtime::NODEJS_16->value;
25+
public const NODEJS_16 = 'nodejs16.x';
2626

2727
/** @deprecated Use Runtime::NODEJS_14 instead (also deprecated by AWS) */
28-
public const NODEJS_14 = Runtime::NODEJS_14->value;
28+
public const NODEJS_14 = 'nodejs14.x';
2929

3030
/** @deprecated Use Runtime::PYTHON_314 instead */
31-
public const PYTHON_314 = Runtime::PYTHON_314->value;
31+
public const PYTHON_314 = 'python3.14';
3232

3333
/** @deprecated Use Runtime::PYTHON_313 instead */
34-
public const PYTHON_313 = Runtime::PYTHON_313->value;
34+
public const PYTHON_313 = 'python3.13';
3535

3636
/** @deprecated Use Runtime::PYTHON_312 instead */
37-
public const PYTHON_312 = Runtime::PYTHON_312->value;
37+
public const PYTHON_312 = 'python3.12';
3838

3939
/** @deprecated Use Runtime::PYTHON_311 instead */
40-
public const PYTHON_311 = Runtime::PYTHON_311->value;
40+
public const PYTHON_311 = 'python3.11';
4141

4242
/** @deprecated Use Runtime::PYTHON_310 instead */
43-
public const PYTHON_310 = Runtime::PYTHON_310->value;
43+
public const PYTHON_310 = 'python3.10';
4444

4545
/** @deprecated Use Runtime::PYTHON_39 instead */
46-
public const PYTHON_39 = Runtime::PYTHON_39->value;
46+
public const PYTHON_39 = 'python3.9';
4747

4848
/** @deprecated Use Runtime::PYTHON_38 instead (also deprecated by AWS) */
49-
public const PYTHON_38 = Runtime::PYTHON_38->value;
49+
public const PYTHON_38 = 'python3.8';
5050

5151
/** @deprecated Use Runtime::PYTHON_37 instead (also deprecated by AWS) */
52-
public const PYTHON_37 = Runtime::PYTHON_37->value;
52+
public const PYTHON_37 = 'python3.7';
5353

5454
/** @deprecated Use Runtime::JAVA_25 instead */
55-
public const JAVA_25 = Runtime::JAVA_25->value;
55+
public const JAVA_25 = 'java25';
5656

5757
/** @deprecated Use Runtime::JAVA_21 instead */
58-
public const JAVA_21 = Runtime::JAVA_21->value;
58+
public const JAVA_21 = 'java21';
5959

6060
/** @deprecated Use Runtime::JAVA_17 instead */
61-
public const JAVA_17 = Runtime::JAVA_17->value;
61+
public const JAVA_17 = 'java17';
6262

6363
/** @deprecated Use Runtime::JAVA_11 instead */
64-
public const JAVA_11 = Runtime::JAVA_11->value;
64+
public const JAVA_11 = 'java11';
6565

6666
/** @deprecated Use Runtime::JAVA_8_LINUX2 instead */
67-
public const JAVA_8_LINUX2 = Runtime::JAVA_8_LINUX2->value;
67+
public const JAVA_8_LINUX2 = 'java8.al2';
6868

6969
/** @deprecated Use Runtime::JAVA_8 instead (also deprecated by AWS) */
70-
public const JAVA_8 = Runtime::JAVA_8->value;
70+
public const JAVA_8 = 'java8';
7171

7272
/** @deprecated Use Runtime::DOT_NET_9 instead */
73-
public const DOT_NET_9 = Runtime::DOT_NET_9->value;
73+
public const DOT_NET_9 = 'dotnet9';
7474

7575
/** @deprecated Use Runtime::DOT_NET_8 instead */
76-
public const DOT_NET_8 = Runtime::DOT_NET_8->value;
76+
public const DOT_NET_8 = 'dotnet8';
7777

7878
/** @deprecated Use Runtime::DOT_NET_7 instead (also deprecated by AWS) */
79-
public const DOT_NET_7 = Runtime::DOT_NET_7->value;
79+
public const DOT_NET_7 = 'dotnet7';
8080

8181
/** @deprecated Use Runtime::DOT_NET_6 instead (also deprecated by AWS) */
82-
public const DOT_NET_6 = Runtime::DOT_NET_6->value;
82+
public const DOT_NET_6 = 'dotnet6';
8383

8484
/** @deprecated Use Runtime::RUBY_34 instead */
85-
public const RUBY_34 = Runtime::RUBY_34->value;
85+
public const RUBY_34 = 'ruby3.4';
8686

8787
/** @deprecated Use Runtime::RUBY_33 instead */
88-
public const RUBY_33 = Runtime::RUBY_33->value;
88+
public const RUBY_33 = 'ruby3.3';
8989

9090
/** @deprecated Use Runtime::RUBY_32 instead */
91-
public const RUBY_32 = Runtime::RUBY_32->value;
91+
public const RUBY_32 = 'ruby3.2';
9292

9393
/** @deprecated Use Runtime::RUBY_27 instead (also deprecated by AWS) */
94-
public const RUBY_27 = Runtime::RUBY_27->value;
94+
public const RUBY_27 = 'ruby2.7';
9595

9696
/** @deprecated Use Runtime::GO_1X instead (also deprecated by AWS) */
97-
public const GO_1X = Runtime::GO_1X->value;
97+
public const GO_1X = 'go1.x';
9898

9999
/** @deprecated Use Runtime::PROVIDED_AL2023 instead */
100-
public const PROVIDED_AL2023 = Runtime::PROVIDED_AL2023->value;
100+
public const PROVIDED_AL2023 = 'provided.al2023';
101101

102102
/** @deprecated Use Runtime::PROVIDED_AL2 instead */
103-
public const PROVIDED_AL2 = Runtime::PROVIDED_AL2->value;
103+
public const PROVIDED_AL2 = 'provided.al2';
104104

105105
/** @deprecated Use Runtime::PROVIDED instead (also deprecated by AWS) */
106-
public const PROVIDED = Runtime::PROVIDED->value;
106+
public const PROVIDED = 'provided';
107107
}

0 commit comments

Comments
 (0)