@@ -117,6 +117,9 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly =
117
117
foreach ($ legacyFileInfo ->getAllFuncInfos () as $ funcInfo ) {
118
118
$ funcInfo ->discardInfoForOldPhpVersions ();
119
119
}
120
+ foreach ($ legacyFileInfo ->getAllConstInfos () as $ constInfo ) {
121
+ $ constInfo ->discardInfoForOldPhpVersions ();
122
+ }
120
123
foreach ($ legacyFileInfo ->getAllPropertyInfos () as $ propertyInfo ) {
121
124
$ propertyInfo ->discardInfoForOldPhpVersions ();
122
125
}
@@ -1766,6 +1769,8 @@ abstract protected function getFieldSynopsisName(): string;
1766
1769
*/
1767
1770
abstract protected function getFieldSynopsisValueString (iterable $ allConstInfos ): ?string ;
1768
1771
1772
+ abstract public function discardInfoForOldPhpVersions (): void ;
1773
+
1769
1774
/**
1770
1775
* @return array<int, string[]>
1771
1776
*/
@@ -1949,6 +1954,11 @@ protected function getFieldSynopsisValueString(iterable $allConstInfos): ?string
1949
1954
return $ this ->valueString ;
1950
1955
}
1951
1956
1957
+ public function discardInfoForOldPhpVersions (): void {
1958
+ $ this ->flags &= ~Class_::MODIFIER_FINAL ;
1959
+ $ this ->isDeprecated = false ;
1960
+ }
1961
+
1952
1962
/**
1953
1963
* @param iterable<ConstInfo> $allConstInfos
1954
1964
*/
@@ -2182,6 +2192,7 @@ protected function getFieldSynopsisValueString(iterable $allConstInfos): ?string
2182
2192
2183
2193
public function discardInfoForOldPhpVersions (): void {
2184
2194
$ this ->type = null ;
2195
+ $ this ->flags &= ~Class_::MODIFIER_READONLY ;
2185
2196
}
2186
2197
2187
2198
/**
@@ -2478,8 +2489,6 @@ public function getRegistration(iterable $allConstInfos): string
2478
2489
2479
2490
$ code = '' ;
2480
2491
2481
- $ php70MinimumCompatibility = $ this ->phpVersionIdMinimumCompatibility === null || $ this ->phpVersionIdMinimumCompatibility >= PHP_70_VERSION_ID ;
2482
- $ php80MinimumCompatibility = $ this ->phpVersionIdMinimumCompatibility === null || $ this ->phpVersionIdMinimumCompatibility >= PHP_80_VERSION_ID ;
2483
2492
$ php81MinimumCompatibility = $ this ->phpVersionIdMinimumCompatibility === null || $ this ->phpVersionIdMinimumCompatibility >= PHP_81_VERSION_ID ;
2484
2493
$ php82MinimumCompatibility = $ this ->phpVersionIdMinimumCompatibility === null || $ this ->phpVersionIdMinimumCompatibility >= PHP_82_VERSION_ID ;
2485
2494
0 commit comments