@@ -1594,7 +1594,7 @@ class EvaluatedValue
1594
1594
public $ type ;
1595
1595
1596
1596
/** @var string|null */
1597
- public $ cConstName ;
1597
+ public $ cConstValue ;
1598
1598
1599
1599
/** @var bool */
1600
1600
public $ isUnknownConstValue ;
@@ -1671,7 +1671,7 @@ private function __construct($value, SimpleType $type, ?string $cConstName, ?Con
1671
1671
{
1672
1672
$ this ->value = $ value ;
1673
1673
$ this ->type = $ type ;
1674
- $ this ->cConstName = $ cConstName ;
1674
+ $ this ->cConstValue = $ cConstName ;
1675
1675
$ this ->originatingConst = $ originatingConst ;
1676
1676
$ this ->isUnknownConstValue = $ isUnknownConstValue ;
1677
1677
}
@@ -1719,8 +1719,8 @@ public function initializeZval(string $zvalName, iterable $allConstInfos): strin
1719
1719
*/
1720
1720
public function getCConstValue (iterable $ allConstInfos ): ?string
1721
1721
{
1722
- if ($ this ->cConstName ) {
1723
- return $ this ->cConstName ;
1722
+ if ($ this ->cConstValue ) {
1723
+ return $ this ->cConstValue ;
1724
1724
}
1725
1725
1726
1726
if ($ this ->originatingConst ) {
@@ -1872,7 +1872,7 @@ class ConstInfo extends VariableLike
1872
1872
/** @var string|null */
1873
1873
public $ cond ;
1874
1874
/** @var string|null */
1875
- public $ cname ;
1875
+ public $ cValue ;
1876
1876
1877
1877
public function __construct (
1878
1878
ConstOrClassConstName $ name ,
@@ -1882,7 +1882,7 @@ public function __construct(
1882
1882
?Type $ phpDocType ,
1883
1883
bool $ isDeprecated ,
1884
1884
?string $ cond ,
1885
- ?string $ cname ,
1885
+ ?string $ cValue ,
1886
1886
?string $ link ,
1887
1887
?int $ phpVersionIdMinimumCompatibility
1888
1888
) {
@@ -1891,7 +1891,7 @@ public function __construct(
1891
1891
$ this ->valueString = $ valueString ;
1892
1892
$ this ->isDeprecated = $ isDeprecated ;
1893
1893
$ this ->cond = $ cond ;
1894
- $ this ->cname = $ cname ;
1894
+ $ this ->cValue = $ cValue ;
1895
1895
parent ::__construct ($ flags , $ phpDocType , $ link , $ phpVersionIdMinimumCompatibility );
1896
1896
}
1897
1897
@@ -1903,7 +1903,7 @@ public function getValue(iterable $allConstInfos): EvaluatedValue
1903
1903
return EvaluatedValue::createFromExpression (
1904
1904
$ this ->value ,
1905
1905
$ this ->phpDocType ->tryToSimpleType (),
1906
- $ this ->cname ,
1906
+ $ this ->cValue ,
1907
1907
$ allConstInfos
1908
1908
);
1909
1909
}
@@ -1948,7 +1948,7 @@ protected function addTypeToFieldSynopsis(DOMDocument $doc, DOMElement $fieldsyn
1948
1948
*/
1949
1949
protected function getFieldSynopsisValueString (iterable $ allConstInfos ): ?string
1950
1950
{
1951
- $ value = EvaluatedValue::createFromExpression ($ this ->value , null , $ this ->cname , $ allConstInfos );
1951
+ $ value = EvaluatedValue::createFromExpression ($ this ->value , null , $ this ->cValue , $ allConstInfos );
1952
1952
if ($ value ->originatingConst ) {
1953
1953
return $ value ->originatingConst ->getFieldSynopsisValueString ($ allConstInfos );
1954
1954
}
@@ -1971,9 +1971,9 @@ public function getDeclaration(iterable $allConstInfos): string
1971
1971
throw new Exception ("Constant " . $ this ->name ->__toString () . " must have a simple built-in type " );
1972
1972
}
1973
1973
1974
- $ value = EvaluatedValue::createFromExpression ($ this ->value , $ type , $ this ->cname , $ allConstInfos );
1975
- if ($ value ->isUnknownConstValue && !$ value ->cConstName ) {
1976
- throw new Exception ("Constant " . $ this ->name ->__toString () . " must have a @cname annotation " );
1974
+ $ value = EvaluatedValue::createFromExpression ($ this ->value , $ type , $ this ->cValue , $ allConstInfos );
1975
+ if ($ value ->isUnknownConstValue && !$ value ->cConstValue ) {
1976
+ throw new Exception ("Constant " . $ this ->name ->__toString () . " must have a @cvalue annotation " );
1977
1977
}
1978
1978
1979
1979
$ code = "" ;
@@ -2059,35 +2059,35 @@ private function getClassConstDeclaration(EvaluatedValue $value, iterable $allCo
2059
2059
2060
2060
private function getValueAssertion (EvaluatedValue $ value ): string
2061
2061
{
2062
- if ($ value ->isUnknownConstValue || $ value ->originatingConst || $ value ->cConstName === null ) {
2062
+ if ($ value ->isUnknownConstValue || $ value ->originatingConst || $ value ->cConstValue === null ) {
2063
2063
return "" ;
2064
2064
}
2065
2065
2066
- $ cName = $ value ->cConstName ;
2066
+ $ cConstValue = $ value ->cConstValue ;
2067
2067
$ constValue = $ value ->value ;
2068
2068
2069
2069
if ($ value ->type ->isNull ()) {
2070
- return "\tZEND_ASSERT( $ cName == NULL); \n" ;
2070
+ return "\tZEND_ASSERT( $ cConstValue == NULL); \n" ;
2071
2071
}
2072
2072
2073
2073
if ($ value ->type ->isBool ()) {
2074
2074
$ cValue = $ constValue ? "true " : "false " ;
2075
- return "\tZEND_ASSERT( $ cName == $ cValue); \n" ;
2075
+ return "\tZEND_ASSERT( $ cConstValue == $ cValue); \n" ;
2076
2076
}
2077
2077
2078
2078
if ($ value ->type ->isInt ()) {
2079
2079
$ cValue = (int ) $ constValue ;
2080
- return "\tZEND_ASSERT( $ cName == $ cValue); \n" ;
2080
+ return "\tZEND_ASSERT( $ cConstValue == $ cValue); \n" ;
2081
2081
}
2082
2082
2083
2083
if ($ value ->type ->isFloat ()) {
2084
2084
$ cValue = (float ) $ constValue ;
2085
- return "\tZEND_ASSERT( $ cName == $ cValue); \n" ;
2085
+ return "\tZEND_ASSERT( $ cConstValue == $ cValue); \n" ;
2086
2086
}
2087
2087
2088
2088
if ($ value ->type ->isString ()) {
2089
2089
$ cValue = '" ' . addslashes ($ constValue ) . '" ' ;
2090
- return "\tZEND_ASSERT(strcmp( $ cName , $ cValue) == 0); \n" ;
2090
+ return "\tZEND_ASSERT(strcmp( $ cConstValue , $ cValue) == 0); \n" ;
2091
2091
}
2092
2092
2093
2093
throw new Exception ("Unimplemented constant type " );
@@ -3376,7 +3376,7 @@ function parseConstLike(
3376
3376
): ConstInfo {
3377
3377
$ phpDocType = null ;
3378
3378
$ deprecated = false ;
3379
- $ cname = null ;
3379
+ $ cValue = null ;
3380
3380
$ link = null ;
3381
3381
if ($ docComment ) {
3382
3382
$ tags = parseDocComment ($ docComment );
@@ -3385,8 +3385,8 @@ function parseConstLike(
3385
3385
$ phpDocType = $ tag ->getType ();
3386
3386
} elseif ($ tag ->name === 'deprecated ' ) {
3387
3387
$ deprecated = true ;
3388
- } elseif ($ tag ->name === 'cname ' ) {
3389
- $ cname = $ tag ->value ;
3388
+ } elseif ($ tag ->name === 'cvalue ' ) {
3389
+ $ cValue = $ tag ->value ;
3390
3390
} elseif ($ tag ->name === 'link ' ) {
3391
3391
$ link = $ tag ->value ;
3392
3392
}
@@ -3405,7 +3405,7 @@ function parseConstLike(
3405
3405
Type::fromString ($ phpDocType ),
3406
3406
$ deprecated ,
3407
3407
$ cond ,
3408
- $ cname ,
3408
+ $ cValue ,
3409
3409
$ link ,
3410
3410
$ phpVersionIdMinimumCompatibility
3411
3411
);
0 commit comments