Lines Matching refs:this

206         $this->keyType = $keyType;
207 $this->valueType = $valueType;
213 $this->keyType->toOptimizerTypeMaskForArrayKey(),
214 $this->valueType->toOptimizerTypeMaskForArrayValue(),
227 return Type::equals($this->keyType, $other->keyType) &&
228 Type::equals($this->valueType, $other->valueType);
374 $this->name = $name;
375 $this->isBuiltin = $isBuiltin;
379 …return $this->isBuiltin && in_array($this->name, ["null", "false", "true", "bool", "int", "float"]…
383 return $this->isBuiltin && $this->name === 'null';
387 return $this->isBuiltin && $this->name === 'bool';
391 return $this->isBuiltin && $this->name === 'int';
395 return $this->isBuiltin && $this->name === 'float';
399 return $this->isBuiltin && $this->name === 'string';
403 return $this->isBuiltin && $this->name === 'array';
407 return $this->isBuiltin && $this->name === 'mixed';
411 assert($this->isBuiltin);
412 switch ($this->name) {
442 throw new Exception("Not implemented: $this->name");
447 assert($this->isBuiltin);
449 switch ($this->name) {
479 throw new Exception("Not implemented: $this->name");
484 assert($this->isBuiltin);
486 switch ($this->name) {
492 throw new Exception("Type $this->name cannot be an array key");
497 if (!$this->isBuiltin) {
501 switch ($this->name) {
527 throw new Exception("Type $this->name cannot be an array value");
532 if (!$this->isBuiltin) {
536 switch ($this->name) {
547 return $this->toTypeMask();
555 $this->name
560 return str_replace('\\', '_', $this->name);
564 return $this->name === $other->name && $this->isBuiltin === $other->isBuiltin;
648 $this->types = $types;
649 $this->isIntersection = $isIntersection;
653 foreach ($this->types as $type) {
663 foreach ($this->types as $type) {
676 $this->types,
687 $withoutNull = $this->getWithoutNull();
690 return $this->types[0];
701 foreach ($this->types as $type) {
714 foreach ($this->types as $type) {
725 foreach ($this->types as $type) {
735 foreach ($this->types as $type) {
743 if (count($this->types) > 1) {
744 $typeSort = $this->isIntersection ? "intersection" : "union";
748 foreach ($this->types as $type) {
753 $type = $this->types[0];
781 if ($this->types === null) {
785 $char = $this->isIntersection ? '&' : '|';
788 $this->types)
804 $this->classTypes = $classTypes;
805 $this->builtinTypes = $builtinTypes;
809 return !empty($this->classTypes);
815 }, $this->classTypes));
819 if (empty($this->builtinTypes)) {
824 }, $this->builtinTypes));
854 $this->name = $name;
855 $this->sendBy = $sendBy;
856 $this->isVariadic = $isVariadic;
857 $this->setTypes($type, $phpDocType);
858 $this->defaultValue = $defaultValue;
859 $this->attributes = $attributes;
863 return $this->name === $other->name
864 && $this->sendBy === $other->sendBy
865 && $this->isVariadic === $other->isVariadic
866 && Type::equals($this->type, $other->type)
867 && $this->defaultValue === $other->defaultValue;
871 switch ($this->sendBy) {
883 if ($this->type) {
884 return $this->type;
887 if ($this->phpDocType) {
888 return $this->phpDocType;
895 return $this->defaultValue !== null && $this->defaultValue !== "UNKNOWN";
899 if ($this->hasProperDefaultValue()) {
900 return '"' . addslashes($this->defaultValue) . '"';
907 if ($this->defaultValue === null) {
911 switch ($this->defaultValue) {
917 return "&{$this->defaultValue};";
920 return $this->defaultValue;
925 $this->type = $type;
926 $this->phpDocType = $phpDocType;
945 return $this->__toString() === $const->__toString();
950 return strtolower($this->__toString()) === "unknown";
962 $this->const = $const;
972 $name = $this->__toString();
981 return $this->const;
986 return $this->name->toString();
996 $this->class = $class;
997 $this->const = $const;
1007 return $this->class->toString() . "::" . $this->const;
1012 return $this->const;
1022 $this->class = $class;
1023 $this->property = $property;
1028 return $this->class->toString() . "::$" . $this->property;
1033 return $this->property;
1052 $this->name = $name;
1056 if ($this->name->isQualified()) {
1057 return $this->name->slice(0, -1)->toString();
1063 if ($this->name->isQualified()) {
1066 return $this->name->toString();
1070 return implode('_', $this->name->getParts());
1074 return $this->name->getLast();
1078 return "ZEND_FUNCTION({$this->getDeclarationName()});\n";
1082 $underscoreName = implode('_', $this->name->getParts());
1087 $underscoreName = implode('_', $this->name->getParts());
1092 return 'functions/' . implode('/', str_replace('_', '-', $this->name->getParts()));
1096 return strtolower($this->name->toString());
1100 return $this->name->toString();
1121 $this->className = $className;
1122 $this->methodName = $methodName;
1126 return implode('_', $this->className->getParts());
1130 return "ZEND_METHOD({$this->getDeclarationClassName()}, $this->methodName);\n";
1134 return "arginfo_class_{$this->getDeclarationClassName()}_{$this->methodName}";
1139 $parts = [...$this->className->getParts(), ltrim($this->methodName, '_')];
1145 return strtolower($this->methodName);
1149 return "$this->className::$this->methodName";
1157 return $this->methodName === "__construct";
1161 return $this->methodName === "__destruct";
1183 $this->byRef = $byRef;
1184 $this->setTypes($type, $phpDocType, $tentativeReturnType);
1185 $this->setRefcount($refcount);
1189 return $this->byRef === $other->byRef
1190 && Type::equals($this->type, $other->type)
1191 && $this->tentativeReturnType === $other->tentativeReturnType;
1195 return $this->type ?? $this->phpDocType;
1200 $this->type = $type;
1201 $this->phpDocType = $phpDocType;
1202 $this->tentativeReturnType = $tentativeReturnType;
1207 $type = $this->phpDocType ?? $this->type;
1211 $this->refcount = $isScalarType ? self::REFCOUNT_0 : self::REFCOUNT_N;
1227 $this->refcount = $refcount;
1277 $this->name = $name;
1278 $this->classFlags = $classFlags;
1279 $this->flags = $flags;
1280 $this->aliasType = $aliasType;
1281 $this->alias = $alias;
1282 $this->isDeprecated = $isDeprecated;
1283 $this->supportsCompileTimeEval = $supportsCompileTimeEval;
1284 $this->verify = $verify;
1285 $this->args = $args;
1286 $this->return = $return;
1287 $this->numRequiredArgs = $numRequiredArgs;
1288 $this->cond = $cond;
1289 $this->isUndocumentable = $isUndocumentable;
1290 $this->minimumPhpVersionIdCompatibility = $minimumPhpVersionIdCompatibility;
1291 $this->attributes = $attributes;
1292 $this->framelessFunctionInfos = $framelessFunctionInfos;
1293 $this->exposedDocComment = $exposedDocComment;
1298 return $this->name->isMethod();
1303 return ($this->flags & Modifiers::FINAL) || ($this->classFlags & Modifiers::FINAL);
1308 … return !($this->flags & Modifiers::STATIC) && $this->isMethod() && !$this->name->isConstructor();
1314 if (!$this->isMethod()) {
1320 if ($this->flags & Modifiers::FINAL) {
1322 } elseif ($this->flags & Modifiers::ABSTRACT && $this->classFlags & ~Modifiers::ABSTRACT) {
1326 if ($this->flags & Modifiers::PROTECTED) {
1328 } elseif ($this->flags & Modifiers::PRIVATE) {
1334 if ($this->flags & Modifiers::STATIC) {
1343 foreach ($this->args as $arg) {
1353 if (count($this->args) !== count($other->args)) {
1357 for ($i = 0; $i < count($this->args); $i++) {
1358 if (!$this->args[$i]->equals($other->args[$i])) {
1363 return $this->return->equalsApartFromPhpDocAndRefcount($other->return)
1364 && $this->numRequiredArgs === $other->numRequiredArgs
1365 && $this->cond === $other->cond;
1369 return $this->name->getArgInfoName();
1374 $name = $this->alias ?? $this->name;
1376 return "$name|$this->cond";
1381 if ($this->flags & Modifiers::ABSTRACT) {
1385 $name = $this->alias ?? $this->name;
1391 if (empty($this->framelessFunctionInfos)) {
1395 …$php84MinimumCompatibility = $this->minimumPhpVersionIdCompatibility === null || $this->minimumPhp…
1403 foreach ($this->framelessFunctionInfos as $framelessFunctionInfo) {
1404 …$code .= "ZEND_FRAMELESS_FUNCTION({$this->name->getFunctionName()}, {$framelessFunctionInfo->arity…
1407 …$code .= 'static const zend_frameless_function_info ' . $this->getFramelessFunctionInfosName() . "…
1408 foreach ($this->framelessFunctionInfos as $framelessFunctionInfo) {
1409 …$code .= "\t{ ZEND_FRAMELESS_FUNCTION_NAME({$this->name->getFunctionName()}, {$framelessFunctionIn…
1422 return $this->name->getFramelessFunctionInfosName();
1428 …$php84MinimumCompatibility = $this->minimumPhpVersionIdCompatibility === null || $this->minimumPhp…
1429 …$isVanillaEntry = $this->alias === null && !$this->supportsCompileTimeEval && $this->exposedDocCom…
1430 $argInfoName = $this->getArgInfoName();
1431 $flagsByPhpVersions = $this->getArginfoFlagsByPhpVersions();
1434 if (!empty($this->framelessFunctionInfos)) {
1435 if ($this->isMethod()) {
1438 if ($this->name->getNamespace()) {
1441 if ($this->alias) {
1446 if ($this->isMethod()) {
1447 $zendName = '"' . $this->name->methodName . '"';
1448 if ($this->alias) {
1449 if ($this->alias instanceof MethodName) {
1450 … $name = "zim_" . $this->alias->getDeclarationClassName() . "_" . $this->alias->methodName;
1451 } else if ($this->alias instanceof FunctionName) {
1452 $name = "zif_" . $this->alias->getNonNamespacedName();
1457 if ($this->flags & Modifiers::ABSTRACT) {
1460 … $name = "zim_" . $this->name->getDeclarationClassName() . "_" . $this->name->methodName;
1463 …$functionEntryCode = "\tZEND_ME(" . $this->name->getDeclarationClassName() . ", " . $this->name->m…
1467 } else if ($this->name instanceof FunctionName) {
1468 $functionName = $this->name->getFunctionName();
1469 …$declarationName = $this->alias ? $this->alias->getNonNamespacedName() : $this->name->getDeclarati…
1471 if ($this->name->getNamespace()) {
1472 $namespace = addslashes($this->name->getNamespace());
1495 … $docComment = $this->exposedDocComment ? '"' . $this->exposedDocComment->escape() . '"' : "NULL";
1496 …$framelessFuncInfosName = !empty($this->framelessFunctionInfos) ? $this->getFramelessFunctionInfos…
1516 $this->minimumPhpVersionIdCompatibility
1530 if ($this->isMethod()) {
1534 if ($this->alias !== null) {
1538 … if ($this->return->refcount !== ReturnInfo::REFCOUNT_1 && $this->return->phpDocType === null) {
1542 $type = $this->return->phpDocType ?? $this->return->type;
1547 …return "\tF" . $this->return->refcount . '("' . addslashes($this->name->__toString()) . '", ' . $t…
1551 $this->attributes = [];
1552 $this->return->type = null;
1553 $this->framelessFunctionInfos = [];
1554 $this->exposedDocComment = null;
1555 $this->supportsCompileTimeEval = false;
1556 foreach ($this->args as $arg) {
1561 $this->minimumPhpVersionIdCompatibility = $minimumPhpVersionIdCompatibility;
1569 if ($this->isMethod()) {
1570 if ($this->flags & Modifiers::PROTECTED) {
1572 } elseif ($this->flags & Modifiers::PRIVATE) {
1578 if ($this->flags & Modifiers::STATIC) {
1582 if ($this->flags & Modifiers::FINAL) {
1586 if ($this->flags & Modifiers::ABSTRACT) {
1591 if ($this->isDeprecated) {
1595 foreach ($this->attributes as $attr) {
1603 if ($this->isMethod() === false && $this->supportsCompileTimeEval) {
1649 if ($this->isMethod()) {
1650 assert($this->name instanceof MethodName);
1654 str_replace('\\', '-', $this->name->className->__toString())
1656 . str_replace('_', '-', ltrim($this->name->methodName, '_'))
1659 $id = 'function.' . strtolower(str_replace('_', '-', $this->name->__toString()));
1673 $refname = $doc->createElement('refname', $this->name->__toString());
1683 $descriptionRefSec = $this->generateRefSect1($doc, 'description');
1685 $methodSynopsis = $this->getMethodSynopsisElement($funcMap, $aliasMap, $doc);
1702 $parametersRefSec = $this->getParameterSection($doc);
1706 if (!$this->name->isConstructor() && !$this->name->isDestructor()) {
1707 $returnRefSec = $this->getReturnValueSection($doc);
1712 $errorsRefSec = $this->generateRefSect1($doc, 'errors');
1731 $changelogRefSec = $this->getChangelogSection($doc);
1734 $exampleRefSec = $this->getExampleSection($doc, $id);
1738 $notesRefSec = $this->generateRefSect1($doc, 'notes');
1751 $seeAlsoRefSec = $this->generateRefSect1($doc, 'seealso');
1815 $parametersRefSec = $this->generateRefSect1($doc, 'parameters');
1816 if (empty($this->args)) {
1838 foreach ($this->args as $arg) {
1877 $returnRefSec = $this->generateRefSect1($doc, 'returnvalues');
1882 $returnType = $this->return->getMethodSynopsisType();
1982 $refSec = $this->generateRefSect1($doc, 'changelog');
1991 $table = $this->generateDocbookInformalTable(
2005 $refSec = $this->generateRefSect1($doc, 'examples');
2008 $fnName = $this->name->__toString();
2012 $fn = $doc->createElement($this->isMethod() ? 'methodname' : 'function');
2071 if ($this->hasParamWithUnknownDefaultValue()) {
2075 if ($this->name->isConstructor()) {
2077 } elseif ($this->name->isDestructor()) {
2085 if ($this->isMethod()) {
2086 assert($this->name instanceof MethodName);
2088 $role->value = addslashes($this->name->className->__toString());
2094 foreach ($this->getModifierNames() as $modifierString) {
2100 $returnType = $this->return->getMethodSynopsisType();
2105 $methodname = $doc->createElement('methodname', $this->name->__toString());
2108 if (empty($this->args)) {
2113 foreach ($this->args as $arg) {
2159 foreach ($this->args as $key => $argInfo) {
2160 $this->args[$key] = clone $argInfo;
2162 $this->return = clone $this->return;
2163 foreach ($this->attributes as $key => $attribute) {
2164 $this->attributes[$key] = clone $attribute;
2166 foreach ($this->framelessFunctionInfos as $key => $framelessFunctionInfo) {
2167 $this->framelessFunctionInfos[$key] = clone $framelessFunctionInfo;
2169 if ($this->exposedDocComment) {
2170 $this->exposedDocComment = clone $this->exposedDocComment;
2201 $this->allConstInfos = $allConstInfos;
2221 $const = $this->allConstInfos[$originatingConstName->__toString()] ?? null;
2223 $this->visitedConstants[] = $const;
2224 return $const->getValue($this->allConstInfos)->expr;
2239 …throw new Exception($this->getVariableTypeName() . " " . $this->name->__toString() . " has an unsu…
2297 $this->value = $value;
2298 $this->type = $type;
2299 $this->expr = $expr;
2300 $this->originatingConsts = $originatingConsts;
2301 $this->isUnknownConstValue = $isUnknownConstValue;
2306 $cExpr = $this->getCExpr();
2310 if ($this->type->isNull()) {
2312 } elseif ($this->type->isBool()) {
2320 } elseif ($this->type->isInt()) {
2322 } elseif ($this->type->isFloat()) {
2324 } elseif ($this->type->isString()) {
2331 } elseif ($this->type->isArray()) {
2338 …w new Exception("Invalid default value: " . print_r($this->value, true) . ", type: " . print_r($th…
2348 $expr = $prettyPrinter->prettyPrintExpr($this->expr);
2350 if ($this->type->isString()) {
2380 $this->flags = $flags;
2381 $this->type = $type;
2382 $this->phpDocType = $phpDocType;
2383 $this->link = $link;
2384 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
2385 $this->attributes = $attributes;
2386 $this->exposedDocComment = $exposedDocComment;
2404 $type = $this->phpDocType ?? $this->type;
2418 if ($this->flags & Modifiers::PROTECTED) {
2420 } elseif ($this->flags & Modifiers::PRIVATE) {
2436 $variableLikeType = $this->getVariableTypeName();
2439 if ($this->type) {
2440 $arginfoType = $this->type->toArginfoType();
2458 $typeMaskCode = $this->type->toArginfoType()->toTypeMask();
2460 if ($this->type->isIntersection) {
2488 $this->addModifiersToFieldSynopsis($doc, $fieldsynopsisElement);
2490 $this->addTypeToFieldSynopsis($doc, $fieldsynopsisElement);
2492 $varnameElement = $doc->createElement("varname", $this->getFieldSynopsisName());
2493 if ($this->link) {
2494 $varnameElement->setAttribute("linkend", $this->link);
2496 $varnameElement->setAttribute("linkend", $this->getFieldSynopsisDefaultLinkend());
2502 $valueString = $this->getFieldSynopsisValueString($allConstInfos);
2516 if ($this->flags & Modifiers::PUBLIC) {
2519 } elseif ($this->flags & Modifiers::PROTECTED) {
2522 } elseif ($this->flags & Modifiers::PRIVATE) {
2578 $this->name = $name;
2579 $this->value = $value;
2580 $this->valueString = $valueString;
2581 $this->isDeprecated = $isDeprecated;
2582 $this->cond = $cond;
2583 $this->cValue = $cValue;
2584 $this->isUndocumentable = $isUndocumentable;
2585 $this->isFileCacheAllowed = $isFileCacheAllowed;
2593 $this->value,
2594 ($this->phpDocType ?? $this->type)->tryToSimpleType(),
2595 $this->cValue,
2612 $className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
2614 …return "$className.constants." . strtolower(str_replace(["__", "_"], ["", "-"], $this->name->getDe…
2619 return $this->name->__toString();
2625 … $value = EvaluatedValue::createFromExpression($this->value, null, $this->cValue, $allConstInfos);
2636 return $this->valueString;
2645 $constantElement->textContent = $this->name->__toString();
2647 $typeElement = ($this->phpDocType ?? $this->type)->getTypeForDoc($doc);
2664 $constantElement->textContent = $this->name->__toString();
2665 $typeElement = ($this->phpDocType ?? $this->type)->getTypeForDoc($doc);
2677 $this->type = null;
2678 $this->flags &= ~Modifiers::FINAL;
2679 $this->isDeprecated = false;
2680 $this->attributes = [];
2681 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
2687 $type = $this->phpDocType ?? $this->type;
2693 …$value = EvaluatedValue::createFromExpression($this->value, $simpleType, $this->cValue, $allConstI…
2695 …throw new Exception("Constant " . $this->name->__toString() . " must have a built-in PHPDoc type a…
2699 …if ($value->isUnknownConstValue && $this->cValue === null && $value->expr instanceof Expr\ConstFet…
2700 … throw new Exception("Constant " . $this->name->__toString() . " must have a @cvalue annotation");
2705 if ($this->cond) {
2706 $code .= "#if {$this->cond}\n";
2709 if ($this->name->isClassConst()) {
2710 $code .= $this->getClassConstDeclaration($value, $allConstInfos);
2712 $code .= $this->getGlobalConstDeclaration($value, $allConstInfos);
2714 $code .= $this->getValueAssertion($value);
2716 if ($this->cond) {
2726 $constName = str_replace('\\', '\\\\', $this->name->__toString());
2731 if (!$this->isFileCacheAllowed) {
2734 …if ($this->phpVersionIdMinimumCompatibility !== null && $this->phpVersionIdMinimumCompatibility < …
2738 if ($this->isDeprecated) {
2767 $constName = $this->name->getDeclarationName();
2776 if ($this->exposedDocComment) {
2778 $escapedComment = $this->exposedDocComment->escape();
2779 $escapedCommentLength = $this->exposedDocComment->getLength();
2785 …$php83MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
2787 if ($this->type && !$php83MinimumCompatibility) {
2791 if ($this->type) {
2792 $typeCode = $this->getTypeCode($constName, $code);
2794 if (!empty($this->attributes)) {
2795 … $template = "\tzend_class_constant *const_" . $this->name->getDeclarationName() . " = ";
2803 $this->getFlagsByPhpVersion(),
2804 $this->phpVersionIdMinimumCompatibility
2809 if ($this->type && !$php83MinimumCompatibility) {
2813 if (!$this->type || !$php83MinimumCompatibility) {
2814 if (!empty($this->attributes)) {
2815 … $template = "\tzend_class_constant *const_" . $this->name->getDeclarationName() . " = ";
2822 $this->getFlagsByPhpVersion(),
2823 $this->phpVersionIdMinimumCompatibility
2828 if ($this->type && !$php83MinimumCompatibility) {
2839 if ($value->isUnknownConstValue || $value->originatingConsts || $this->cValue === null) {
2880 if ($this->isDeprecated) {
2881 … $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_DEPRECATED", PHP_80_VERSION_ID);
2884 foreach ($this->attributes as $attr) {
2886 … $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_DEPRECATED", PHP_80_VERSION_ID);
2891 if ($this->flags & Modifiers::FINAL) {
2892 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_FINAL", PHP_81_VERSION_ID);
2902 if ($this->flags & Modifiers::FINAL) {
2939 $this->name = $name;
2940 $this->classFlags = $classFlags;
2941 $this->defaultValue = $defaultValue;
2942 $this->defaultValueString = $defaultValueString;
2943 $this->isDocReadonly = $isDocReadonly;
2944 $this->isVirtual = $isVirtual;
2960 $className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
2962 …return "$className.props." . strtolower(str_replace(["__", "_"], ["", "-"], $this->name->getDeclar…
2967 return $this->name->getDeclarationName();
2973 return $this->defaultValueString;
2977 $this->type = null;
2978 $this->flags &= ~Modifiers::READONLY;
2979 $this->attributes = [];
2980 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
2987 $propertyName = $this->name->getDeclarationName();
2989 if ($this->defaultValue === null) {
2992 …$defaultValue = EvaluatedValue::createFromExpression($this->defaultValue, null, null, $allConstInf…
2994 …echo "Skipping code generation for property $this->name, because it has an unknown constant defaul…
3000 if ($this->defaultValue === null && $this->type !== null) {
3009 if ($this->exposedDocComment) {
3011 $escapedComment = $this->exposedDocComment->escape();
3012 $escapedCommentLength = $this->exposedDocComment->getLength();
3018 if (!empty($this->attributes)) {
3019 … $template = "\tzend_property_info *property_" . $this->name->getDeclarationName() . " = ";
3024 …if ($this->phpVersionIdMinimumCompatibility === null || $this->phpVersionIdMinimumCompatibility >=…
3025 $typeCode = $this->getTypeCode($propertyName, $code);
3033 $this->getFlagsByPhpVersion(),
3034 $this->phpVersionIdMinimumCompatibility
3050 if ($this->flags & Modifiers::STATIC) {
3051 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_STATIC", PHP_70_VERSION_ID);
3054 if ($this->flags & Modifiers::READONLY) {
3055 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_READONLY", PHP_81_VERSION_ID);
3056 } elseif ($this->classFlags & Modifiers::READONLY) {
3057 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_READONLY", PHP_82_VERSION_ID);
3060 if ($this->isVirtual) {
3061 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_VIRTUAL", PHP_84_VERSION_ID);
3071 if ($this->flags & Modifiers::STATIC) {
3076 if ($this->flags & Modifiers::READONLY || $this->isDocReadonly) {
3084 if ($this->type) {
3085 $this->type = clone $this->type;
3087 foreach ($this->attributes as $key => $attribute) {
3088 $this->attributes[$key] = clone $attribute;
3090 if ($this->exposedDocComment) {
3091 $this->exposedDocComment = clone $this->exposedDocComment;
3101 $this->name = $name;
3102 $this->value = $value;
3107 $escapedName = addslashes($this->name);
3108 if ($this->value === null) {
3111 $value = EvaluatedValue::createFromExpression($this->value, null, null, $allConstInfos);
3129 $this->class = $class;
3130 $this->args = $args;
3150 $escapedAttributeName = strtr($this->class, '\\', '_');
3152this->args ? "zend_attribute *attribute_{$escapedAttributeName}_$nameSuffix = " : "") . "$invocati…
3154 … = zend_string_init_interned(\"" . addcslashes($this->class, "\\") . "\", sizeof(\"" . addcslashes…
3155this->args ? "zend_attribute *attribute_{$escapedAttributeName}_$nameSuffix = " : "") . "$invocati…
3158 foreach ($this->args as $i => $arg) {
3233 $this->name = $name;
3234 $this->flags = $flags;
3235 $this->type = $type;
3236 $this->alias = $alias;
3237 $this->enumBackingType = $enumBackingType;
3238 $this->isDeprecated = $isDeprecated;
3239 $this->isStrictProperties = $isStrictProperties;
3240 $this->attributes = $attributes;
3241 $this->exposedDocComment = $exposedDocComment;
3242 $this->isNotSerializable = $isNotSerializable;
3243 $this->extends = $extends;
3244 $this->implements = $implements;
3245 $this->constInfos = $constInfos;
3246 $this->propertyInfos = $propertyInfos;
3247 $this->funcInfos = $funcInfos;
3248 $this->enumCaseInfos = $enumCaseInfos;
3249 $this->cond = $cond;
3250 $this->phpVersionIdMinimumCompatibility = $minimumPhpVersionIdCompatibility;
3251 $this->isUndocumentable = $isUndocumentable;
3258 foreach ($this->extends as $extends) {
3261 foreach ($this->implements as $implements) {
3265 $escapedName = implode("_", $this->name->getParts());
3269 …$php80MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
3270 …$php81MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
3271 …$php84MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
3273 if ($this->type === "enum" && !$php81MinimumCompatibility) {
3277 if ($this->cond) {
3278 $code .= "#if {$this->cond}\n";
3285 …$flagCodes = generateVersionDependentFlagCode("%s", $this->getFlagsByPhpVersion(), $this->phpVersi…
3288 $classMethods = ($this->funcInfos === []) ? 'NULL' : "class_{$escapedName}_methods";
3289 if ($this->type === "enum") {
3290 $name = addslashes((string) $this->name);
3291 $backingType = $this->enumBackingType
3292 ? $this->enumBackingType->toTypeCode() : "IS_UNDEF";
3299 if (count($this->name->getParts()) > 1) {
3300 $className = $this->name->getLast();
3301 $namespace = addslashes((string) $this->name->slice(0, -1));
3305 $code .= "\tINIT_CLASS_ENTRY(ce, \"$this->name\", $classMethods);\n";
3308 if ($this->type === "class" || $this->type === "trait") {
3313 …_internal_class_with_flags(&ce, " . (isset($this->extends[0]) ? "class_entry_" . str_replace("\\",…
3318 …register_internal_class_ex(&ce, " . (isset($this->extends[0]) ? "class_entry_" . str_replace("\\",…
3332 if ($this->exposedDocComment) {
3337 …ry->doc_comment = zend_string_init_interned(\"" . $this->exposedDocComment->escape() . "\", " . $t…
3348 $this->type === "interface" ? $this->extends : $this->implements
3355 if ($this->alias) {
3356 …$code .= "\tzend_register_class_alias(\"" . str_replace("\\", "\\\\", $this->alias) . "\", class_e…
3359 foreach ($this->constInfos as $const) {
3363 foreach ($this->enumCaseInfos as $enumCase) {
3367 foreach ($this->propertyInfos as $property) {
3371 if (!empty($this->attributes)) {
3376 foreach ($this->attributes as $key => $attribute) {
3381 $this->phpVersionIdMinimumCompatibility
3390 …ateConstantAttributeInitialization($this->constInfos, $allConstInfos, $this->phpVersionIdMinimumCo…
3402 …izationCode = generatePropertyAttributeInitialization($this->propertyInfos, $allConstInfos, $this-…
3414 …rateFunctionAttributeInitialization($this->funcInfos, $allConstInfos, $this->phpVersionIdMinimumCo…
3430 if ($this->cond) {
3434 if ($this->type === "enum" && !$php81MinimumCompatibility) {
3448 if ($this->type === "trait") {
3452 if ($this->flags & Modifiers::FINAL) {
3456 if ($this->flags & Modifiers::ABSTRACT) {
3460 if ($this->isDeprecated) {
3466 if ($this->isStrictProperties) {
3472 if ($this->isNotSerializable) {
3478 if ($this->flags & Modifiers::READONLY) {
3482 foreach ($this->attributes as $attr) {
3503 $this->attributes = [];
3504 $this->flags &= ~Modifiers::READONLY;
3505 $this->exposedDocComment = null;
3506 $this->isStrictProperties = false;
3507 $this->isNotSerializable = false;
3509 foreach ($this->propertyInfos as $propertyInfo) {
3512 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
3524 $classSynopsis = $this->getClassSynopsisElement($doc, $classMap, $allConstInfos);
3541 $classSynopsis->setAttribute("class", $this->type === "interface" ? "interface" : "class");
3543 …$exceptionOverride = $this->type === "class" && $this->isException($classMap) ? "exception" : null;
3544 $ooElement = self::createOoElement($doc, $this, $exceptionOverride, true, null, 4);
3551 foreach ($this->extends as $k => $parent) {
3573 foreach ($this->implements as $k => $interface) {
3594 $this->collectInheritedMembers(
3598 $this->hasConstructor(),
3602 $this->appendInheritedMemberSectionToClassSynopsis(
3610 if (!empty($this->constInfos)) {
3616 foreach ($this->constInfos as $constInfo) {
3623 if (!empty($this->propertyInfos)) {
3629 foreach ($this->propertyInfos as $propertyInfo) {
3636 $this->appendInheritedMemberSectionToClassSynopsis(
3644 if (!empty($this->funcInfos)) {
3650 $classReference = self::getClassSynopsisReference($this->name);
3651 $escapedName = addslashes($this->name->__toString());
3653 if ($this->hasConstructor()) {
3655 $includeElement = $this->createIncludeElement(
3662 if ($this->hasMethods()) {
3664 $includeElement = $this->createIncludeElement(
3671 if ($this->hasDestructor()) {
3673 $includeElement = $this->createIncludeElement(
3696 $includeElement = $this->createIncludeElement(
3776 foreach ($this->extends as $parent) {
3816 foreach ($this->implements as $parent) {
3842 if ($this->name->toString() === "Throwable") {
3846 foreach ($this->extends as $parentName) {
3857 if ($this->type === "class") {
3858 foreach ($this->implements as $interfaceName) {
3875 foreach ($this->funcInfos as $funcInfo) {
3886 foreach ($this->funcInfos as $funcInfo) {
3897 foreach ($this->funcInfos as $funcInfo) {
3908 foreach ($this->funcInfos as $funcInfo) {
3933 foreach ($this->constInfos as $key => $constInfo) {
3934 $this->constInfos[$key] = clone $constInfo;
3937 foreach ($this->propertyInfos as $key => $propertyInfo) {
3938 $this->propertyInfos[$key] = clone $propertyInfo;
3941 foreach ($this->funcInfos as $key => $funcInfo) {
3942 $this->funcInfos[$key] = clone $funcInfo;
3945 foreach ($this->attributes as $key => $attribute) {
3946 $this->attributes[$key] = clone $attribute;
3949 if ($this->exposedDocComment) {
3950 $this->exposedDocComment = clone $this->exposedDocComment;
3972 $includeElement = $this->createIncludeElement(
4001 yield from $this->funcInfos;
4002 foreach ($this->classInfos as $classInfo) {
4011 foreach ($this->constInfos as $constInfo) {
4015 foreach ($this->classInfos as $classInfo) {
4028 foreach ($this->classInfos as $classInfo) {
4035 foreach ($this->constInfos as $key => $constInfo) {
4036 $this->constInfos[$key] = clone $constInfo;
4039 foreach ($this->funcInfos as $key => $funcInfo) {
4040 $this->funcInfos[$key] = clone $funcInfo;
4043 foreach ($this->classInfos as $key => $classInfo) {
4044 $this->classInfos[$key] = clone $classInfo;
4049 $this->minimumPhpVersionIdCompatibility = $minimumPhpVersionIdCompatibility;
4054 if (!$this->legacyArginfoGeneration &&
4055 $this->minimumPhpVersionIdCompatibility !== null &&
4056 $this->minimumPhpVersionIdCompatibility < PHP_80_VERSION_ID
4061 return $this->minimumPhpVersionIdCompatibility;
4065 …return $this->minimumPhpVersionIdCompatibility !== null && $this->minimumPhpVersionIdCompatibility…
4074 $this->name = $name;
4075 $this->value = $value;
4079 if ($this->value === null) {
4080 throw new Exception("@$this->name does not have a value");
4083 return $this->value;
4087 $value = $this->getValue();
4091 if ($this->name === "param") {
4093 } elseif ($this->name === "return" || $this->name === "var") {
4098 … throw new Exception("@$this->name doesn't contain a type or has an invalid format \"$value\"");
4105 $value = $this->value;
4107 throw new Exception("@$this->name doesn't have any value");
4112 if ($this->name === "param") {
4115 } elseif ($this->name === "prefer-ref") {
4120 …throw new Exception("@$this->name doesn't contain a variable name or has an invalid format \"$valu…
4131 $this->docComment = $docComment;
4135 return str_replace("\n", '\n', addslashes($this->docComment));
4139 return strlen($this->docComment);