Skip to content

Commit 8ac17ec

Browse files
committed
fixup! Fix GH-8842 Make the ABI compatibility of generated arginfo files configurable
1 parent a49d667 commit 8ac17ec

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

build/gen_stub.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly =
117117
foreach ($legacyFileInfo->getAllFuncInfos() as $funcInfo) {
118118
$funcInfo->discardInfoForOldPhpVersions();
119119
}
120+
foreach ($legacyFileInfo->getAllConstInfos() as $constInfo) {
121+
$constInfo->discardInfoForOldPhpVersions();
122+
}
120123
foreach ($legacyFileInfo->getAllPropertyInfos() as $propertyInfo) {
121124
$propertyInfo->discardInfoForOldPhpVersions();
122125
}
@@ -1766,6 +1769,8 @@ abstract protected function getFieldSynopsisName(): string;
17661769
*/
17671770
abstract protected function getFieldSynopsisValueString(iterable $allConstInfos): ?string;
17681771

1772+
abstract public function discardInfoForOldPhpVersions(): void;
1773+
17691774
/**
17701775
* @return array<int, string[]>
17711776
*/
@@ -1949,6 +1954,11 @@ protected function getFieldSynopsisValueString(iterable $allConstInfos): ?string
19491954
return $this->valueString;
19501955
}
19511956

1957+
public function discardInfoForOldPhpVersions(): void {
1958+
$this->flags &= ~Class_::MODIFIER_FINAL;
1959+
$this->isDeprecated = false;
1960+
}
1961+
19521962
/**
19531963
* @param iterable<ConstInfo> $allConstInfos
19541964
*/
@@ -2182,6 +2192,7 @@ protected function getFieldSynopsisValueString(iterable $allConstInfos): ?string
21822192

21832193
public function discardInfoForOldPhpVersions(): void {
21842194
$this->type = null;
2195+
$this->flags &= ~Class_::MODIFIER_READONLY;
21852196
}
21862197

21872198
/**
@@ -2478,8 +2489,6 @@ public function getRegistration(iterable $allConstInfos): string
24782489

24792490
$code = '';
24802491

2481-
$php70MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersionIdMinimumCompatibility >= PHP_70_VERSION_ID;
2482-
$php80MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersionIdMinimumCompatibility >= PHP_80_VERSION_ID;
24832492
$php81MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersionIdMinimumCompatibility >= PHP_81_VERSION_ID;
24842493
$php82MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersionIdMinimumCompatibility >= PHP_82_VERSION_ID;
24852494

0 commit comments

Comments
 (0)