Lines Matching refs:this

198         $this->keyType = $keyType;
199 $this->valueType = $valueType;
205 $this->keyType->toOptimizerTypeMaskForArrayKey(),
206 $this->valueType->toOptimizerTypeMaskForArrayValue(),
219 return Type::equals($this->keyType, $other->keyType) &&
220 Type::equals($this->valueType, $other->valueType);
366 $this->name = $name;
367 $this->isBuiltin = $isBuiltin;
371 …return $this->isBuiltin && in_array($this->name, ["null", "false", "true", "bool", "int", "float"]…
375 return $this->isBuiltin && $this->name === 'null';
379 return $this->isBuiltin && $this->name === 'bool';
383 return $this->isBuiltin && $this->name === 'int';
387 return $this->isBuiltin && $this->name === 'float';
391 return $this->isBuiltin && $this->name === 'string';
395 return $this->isBuiltin && $this->name === 'array';
399 return $this->isBuiltin && $this->name === 'mixed';
403 assert($this->isBuiltin);
404 switch ($this->name) {
434 throw new Exception("Not implemented: $this->name");
439 assert($this->isBuiltin);
441 switch ($this->name) {
471 throw new Exception("Not implemented: $this->name");
476 assert($this->isBuiltin);
478 switch ($this->name) {
484 throw new Exception("Type $this->name cannot be an array key");
489 if (!$this->isBuiltin) {
493 switch ($this->name) {
519 throw new Exception("Type $this->name cannot be an array value");
524 if (!$this->isBuiltin) {
528 switch ($this->name) {
539 return $this->toTypeMask();
547 $this->name
552 return str_replace('\\', '_', $this->name);
556 return $this->name === $other->name && $this->isBuiltin === $other->isBuiltin;
640 $this->types = $types;
641 $this->isIntersection = $isIntersection;
645 foreach ($this->types as $type) {
655 foreach ($this->types as $type) {
668 $this->types,
679 $withoutNull = $this->getWithoutNull();
682 return $this->types[0];
693 foreach ($this->types as $type) {
706 foreach ($this->types as $type) {
717 foreach ($this->types as $type) {
727 foreach ($this->types as $type) {
735 if (count($this->types) > 1) {
736 $typeSort = $this->isIntersection ? "intersection" : "union";
740 foreach ($this->types as $type) {
745 $type = $this->types[0];
773 if ($this->types === null) {
777 $char = $this->isIntersection ? '&' : '|';
780 $this->types)
796 $this->classTypes = $classTypes;
797 $this->builtinTypes = $builtinTypes;
801 return !empty($this->classTypes);
807 }, $this->classTypes));
811 if (empty($this->builtinTypes)) {
816 }, $this->builtinTypes));
846 $this->name = $name;
847 $this->sendBy = $sendBy;
848 $this->isVariadic = $isVariadic;
849 $this->setTypes($type, $phpDocType);
850 $this->defaultValue = $defaultValue;
851 $this->attributes = $attributes;
855 return $this->name === $other->name
856 && $this->sendBy === $other->sendBy
857 && $this->isVariadic === $other->isVariadic
858 && Type::equals($this->type, $other->type)
859 && $this->defaultValue === $other->defaultValue;
863 switch ($this->sendBy) {
875 if ($this->type) {
876 return $this->type;
879 if ($this->phpDocType) {
880 return $this->phpDocType;
887 return $this->defaultValue !== null && $this->defaultValue !== "UNKNOWN";
891 if ($this->hasProperDefaultValue()) {
892 return '"' . addslashes($this->defaultValue) . '"';
899 if ($this->defaultValue === null) {
903 switch ($this->defaultValue) {
909 return "&{$this->defaultValue};";
912 return $this->defaultValue;
917 $this->type = $type;
918 $this->phpDocType = $phpDocType;
937 return $this->__toString() === $const->__toString();
942 return strtolower($this->__toString()) === "unknown";
954 $this->const = $const;
964 $name = $this->__toString();
973 return $this->const;
978 return $this->name->toString();
988 $this->class = $class;
989 $this->const = $const;
999 return $this->class->toString() . "::" . $this->const;
1004 return $this->const;
1014 $this->class = $class;
1015 $this->property = $property;
1020 return $this->class->toString() . "::$" . $this->property;
1025 return $this->property;
1044 $this->name = $name;
1048 if ($this->name->isQualified()) {
1049 return $this->name->slice(0, -1)->toString();
1055 if ($this->name->isQualified()) {
1058 return $this->name->toString();
1062 return implode('_', $this->name->getParts());
1066 return $this->name->getLast();
1070 return "ZEND_FUNCTION({$this->getDeclarationName()});\n";
1074 $underscoreName = implode('_', $this->name->getParts());
1079 $underscoreName = implode('_', $this->name->getParts());
1084 return 'functions/' . implode('/', str_replace('_', '-', $this->name->getParts()));
1088 return strtolower($this->name->toString());
1092 return $this->name->toString();
1113 $this->className = $className;
1114 $this->methodName = $methodName;
1118 return implode('_', $this->className->getParts());
1122 return "ZEND_METHOD({$this->getDeclarationClassName()}, $this->methodName);\n";
1126 return "arginfo_class_{$this->getDeclarationClassName()}_{$this->methodName}";
1131 $parts = [...$this->className->getParts(), ltrim($this->methodName, '_')];
1137 return strtolower($this->methodName);
1141 return "$this->className::$this->methodName";
1149 return $this->methodName === "__construct";
1153 return $this->methodName === "__destruct";
1174 $this->byRef = $byRef;
1175 $this->setTypes($type, $phpDocType, $tentativeReturnType);
1176 $this->setRefcount($refcount);
1180 return $this->byRef === $other->byRef
1181 && Type::equals($this->type, $other->type)
1182 && $this->tentativeReturnType === $other->tentativeReturnType;
1186 return $this->type ?? $this->phpDocType;
1191 $this->type = $type;
1192 $this->phpDocType = $phpDocType;
1193 $this->tentativeReturnType = $tentativeReturnType;
1198 $type = $this->phpDocType ?? $this->type;
1202 $this->refcount = $isScalarType ? self::REFCOUNT_0 : self::REFCOUNT_N;
1216 $this->refcount = $refcount;
1266 $this->name = $name;
1267 $this->classFlags = $classFlags;
1268 $this->flags = $flags;
1269 $this->aliasType = $aliasType;
1270 $this->alias = $alias;
1271 $this->isDeprecated = $isDeprecated;
1272 $this->supportsCompileTimeEval = $supportsCompileTimeEval;
1273 $this->verify = $verify;
1274 $this->args = $args;
1275 $this->return = $return;
1276 $this->numRequiredArgs = $numRequiredArgs;
1277 $this->cond = $cond;
1278 $this->isUndocumentable = $isUndocumentable;
1279 $this->minimumPhpVersionIdCompatibility = $minimumPhpVersionIdCompatibility;
1280 $this->attributes = $attributes;
1281 $this->framelessFunctionInfos = $framelessFunctionInfos;
1282 $this->exposedDocComment = $exposedDocComment;
1283 if ($return->tentativeReturnType && $this->isFinalMethod()) {
1290 return $this->name->isMethod();
1295 return ($this->flags & Modifiers::FINAL) || ($this->classFlags & Modifiers::FINAL);
1300 … return !($this->flags & Modifiers::STATIC) && $this->isMethod() && !$this->name->isConstructor();
1306 if (!$this->isMethod()) {
1312 if ($this->flags & Modifiers::FINAL) {
1314 } elseif ($this->flags & Modifiers::ABSTRACT && $this->classFlags & ~Modifiers::ABSTRACT) {
1318 if ($this->flags & Modifiers::PROTECTED) {
1320 } elseif ($this->flags & Modifiers::PRIVATE) {
1326 if ($this->flags & Modifiers::STATIC) {
1335 foreach ($this->args as $arg) {
1345 if (count($this->args) !== count($other->args)) {
1349 for ($i = 0; $i < count($this->args); $i++) {
1350 if (!$this->args[$i]->equals($other->args[$i])) {
1355 return $this->return->equalsApartFromPhpDocAndRefcount($other->return)
1356 && $this->numRequiredArgs === $other->numRequiredArgs
1357 && $this->cond === $other->cond;
1361 return $this->name->getArgInfoName();
1366 $name = $this->alias ?? $this->name;
1368 return "$name|$this->cond";
1373 if ($this->flags & Modifiers::ABSTRACT) {
1377 $name = $this->alias ?? $this->name;
1383 if (empty($this->framelessFunctionInfos)) {
1387 …$php84MinimumCompatibility = $this->minimumPhpVersionIdCompatibility === null || $this->minimumPhp…
1395 foreach ($this->framelessFunctionInfos as $framelessFunctionInfo) {
1396 …$code .= "ZEND_FRAMELESS_FUNCTION({$this->name->getFunctionName()}, {$framelessFunctionInfo->arity…
1399 …$code .= 'static const zend_frameless_function_info ' . $this->getFramelessFunctionInfosName() . "…
1400 foreach ($this->framelessFunctionInfos as $framelessFunctionInfo) {
1401 …$code .= "\t{ ZEND_FRAMELESS_FUNCTION_NAME({$this->name->getFunctionName()}, {$framelessFunctionIn…
1414 return $this->name->getFramelessFunctionInfosName();
1420 …$php84MinimumCompatibility = $this->minimumPhpVersionIdCompatibility === null || $this->minimumPhp…
1421 …$isVanillaEntry = $this->alias === null && !$this->supportsCompileTimeEval && $this->exposedDocCom…
1422 $argInfoName = $this->getArgInfoName();
1423 $flagsByPhpVersions = $this->getArginfoFlagsByPhpVersions();
1426 if (!empty($this->framelessFunctionInfos)) {
1427 if ($this->isMethod()) {
1430 if ($this->name->getNamespace()) {
1433 if ($this->alias) {
1438 if ($this->isMethod()) {
1439 $zendName = '"' . $this->name->methodName . '"';
1440 if ($this->alias) {
1441 if ($this->alias instanceof MethodName) {
1442 … $name = "zim_" . $this->alias->getDeclarationClassName() . "_" . $this->alias->methodName;
1443 } else if ($this->alias instanceof FunctionName) {
1444 $name = "zif_" . $this->alias->getNonNamespacedName();
1449 if ($this->flags & Modifiers::ABSTRACT) {
1452 … $name = "zim_" . $this->name->getDeclarationClassName() . "_" . $this->name->methodName;
1455 …$functionEntryCode = "\tZEND_ME(" . $this->name->getDeclarationClassName() . ", " . $this->name->m…
1459 } else if ($this->name instanceof FunctionName) {
1460 $functionName = $this->name->getFunctionName();
1461 …$declarationName = $this->alias ? $this->alias->getNonNamespacedName() : $this->name->getDeclarati…
1463 if ($this->name->getNamespace()) {
1464 $namespace = addslashes($this->name->getNamespace());
1487 … $docComment = $this->exposedDocComment ? '"' . $this->exposedDocComment->escape() . '"' : "NULL";
1488 …$framelessFuncInfosName = !empty($this->framelessFunctionInfos) ? $this->getFramelessFunctionInfos…
1508 $this->minimumPhpVersionIdCompatibility
1522 if ($this->isMethod()) {
1526 if ($this->alias !== null) {
1530 … if ($this->return->refcount !== ReturnInfo::REFCOUNT_1 && $this->return->phpDocType === null) {
1534 $type = $this->return->phpDocType ?? $this->return->type;
1539 …return "\tF" . $this->return->refcount . '("' . addslashes($this->name->__toString()) . '", ' . $t…
1543 $this->attributes = [];
1544 $this->return->type = null;
1545 $this->framelessFunctionInfos = [];
1546 $this->exposedDocComment = null;
1547 $this->supportsCompileTimeEval = false;
1548 foreach ($this->args as $arg) {
1553 $this->minimumPhpVersionIdCompatibility = $minimumPhpVersionIdCompatibility;
1561 if ($this->isMethod()) {
1562 if ($this->flags & Modifiers::PROTECTED) {
1564 } elseif ($this->flags & Modifiers::PRIVATE) {
1570 if ($this->flags & Modifiers::STATIC) {
1574 if ($this->flags & Modifiers::FINAL) {
1578 if ($this->flags & Modifiers::ABSTRACT) {
1583 if ($this->isDeprecated) {
1587 foreach ($this->attributes as $attr) {
1595 if ($this->isMethod() === false && $this->supportsCompileTimeEval) {
1641 if ($this->isMethod()) {
1642 assert($this->name instanceof MethodName);
1646 str_replace('\\', '-', $this->name->className->__toString())
1648 . str_replace('_', '-', ltrim($this->name->methodName, '_'))
1651 $id = 'function.' . strtolower(str_replace('_', '-', $this->name->__toString()));
1665 $refname = $doc->createElement('refname', $this->name->__toString());
1675 $descriptionRefSec = $this->generateRefSect1($doc, 'description');
1677 $methodSynopsis = $this->getMethodSynopsisElement($funcMap, $aliasMap, $doc);
1694 $parametersRefSec = $this->getParameterSection($doc);
1698 if (!$this->name->isConstructor() && !$this->name->isDestructor()) {
1699 $returnRefSec = $this->getReturnValueSection($doc);
1704 $errorsRefSec = $this->generateRefSect1($doc, 'errors');
1723 $changelogRefSec = $this->getChangelogSection($doc);
1726 $exampleRefSec = $this->getExampleSection($doc, $id);
1730 $notesRefSec = $this->generateRefSect1($doc, 'notes');
1743 $seeAlsoRefSec = $this->generateRefSect1($doc, 'seealso');
1807 $parametersRefSec = $this->generateRefSect1($doc, 'parameters');
1808 if (empty($this->args)) {
1829 foreach ($this->args as $arg) {
1869 $returnRefSec = $this->generateRefSect1($doc, 'returnvalues');
1874 $returnType = $this->return->getMethodSynopsisType();
1974 $refSec = $this->generateRefSect1($doc, 'changelog');
1983 $table = $this->generateDocbookInformalTable(
1997 $refSec = $this->generateRefSect1($doc, 'examples');
2000 $fnName = $this->name->__toString();
2004 $fn = $doc->createElement($this->isMethod() ? 'methodname' : 'function');
2063 if ($this->hasParamWithUnknownDefaultValue()) {
2067 if ($this->name->isConstructor()) {
2069 } elseif ($this->name->isDestructor()) {
2077 if ($this->isMethod()) {
2078 assert($this->name instanceof MethodName);
2080 $role->value = addslashes($this->name->className->__toString());
2086 foreach ($this->attributes as $attribute) {
2093 foreach ($this->getModifierNames() as $modifierString) {
2099 $returnType = $this->return->getMethodSynopsisType();
2104 $methodname = $doc->createElement('methodname', $this->name->__toString());
2107 if (empty($this->args)) {
2112 foreach ($this->args as $arg) {
2158 foreach ($this->args as $key => $argInfo) {
2159 $this->args[$key] = clone $argInfo;
2161 $this->return = clone $this->return;
2162 foreach ($this->attributes as $key => $attribute) {
2163 $this->attributes[$key] = clone $attribute;
2165 foreach ($this->framelessFunctionInfos as $key => $framelessFunctionInfo) {
2166 $this->framelessFunctionInfos[$key] = clone $framelessFunctionInfo;
2168 if ($this->exposedDocComment) {
2169 $this->exposedDocComment = clone $this->exposedDocComment;
2200 $this->allConstInfos = $allConstInfos;
2220 $const = $this->allConstInfos[$originatingConstName->__toString()] ?? null;
2222 $this->visitedConstants[] = $const;
2223 return $const->getValue($this->allConstInfos)->expr;
2238 …throw new Exception($this->getVariableTypeName() . " " . $this->name->__toString() . " has an unsu…
2296 $this->value = $value;
2297 $this->type = $type;
2298 $this->expr = $expr;
2299 $this->originatingConsts = $originatingConsts;
2300 $this->isUnknownConstValue = $isUnknownConstValue;
2305 $cExpr = $this->getCExpr();
2309 if ($this->type->isNull()) {
2311 } elseif ($this->type->isBool()) {
2319 } elseif ($this->type->isInt()) {
2321 } elseif ($this->type->isFloat()) {
2323 } elseif ($this->type->isString()) {
2330 } elseif ($this->type->isArray()) {
2337 …w new Exception("Invalid default value: " . print_r($this->value, true) . ", type: " . print_r($th…
2347 $expr = $prettyPrinter->prettyPrintExpr($this->expr);
2349 if ($this->type->isString()) {
2379 $this->flags = $flags;
2380 $this->type = $type;
2381 $this->phpDocType = $phpDocType;
2382 $this->link = $link;
2383 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
2384 $this->attributes = $attributes;
2385 $this->exposedDocComment = $exposedDocComment;
2403 $type = $this->phpDocType ?? $this->type;
2417 if ($this->flags & Modifiers::PROTECTED) {
2419 } elseif ($this->flags & Modifiers::PRIVATE) {
2435 $variableLikeType = $this->getVariableTypeName();
2438 if ($this->type) {
2439 $arginfoType = $this->type->toArginfoType();
2457 $typeMaskCode = $this->type->toArginfoType()->toTypeMask();
2459 if ($this->type->isIntersection) {
2487 $this->addModifiersToFieldSynopsis($doc, $fieldsynopsisElement);
2489 $this->addTypeToFieldSynopsis($doc, $fieldsynopsisElement);
2491 $varnameElement = $doc->createElement("varname", $this->getFieldSynopsisName());
2492 if ($this->link) {
2493 $varnameElement->setAttribute("linkend", $this->link);
2495 $varnameElement->setAttribute("linkend", $this->getFieldSynopsisDefaultLinkend());
2501 $valueString = $this->getFieldSynopsisValueString($allConstInfos);
2515 if ($this->flags & Modifiers::PUBLIC) {
2518 } elseif ($this->flags & Modifiers::PROTECTED) {
2521 } elseif ($this->flags & Modifiers::PRIVATE) {
2577 $this->name = $name;
2578 $this->value = $value;
2579 $this->valueString = $valueString;
2580 $this->isDeprecated = $isDeprecated;
2581 $this->cond = $cond;
2582 $this->cValue = $cValue;
2583 $this->isUndocumentable = $isUndocumentable;
2584 $this->isFileCacheAllowed = $isFileCacheAllowed;
2592 $this->value,
2593 ($this->phpDocType ?? $this->type)->tryToSimpleType(),
2594 $this->cValue,
2611 $className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
2613 …return "$className.constants." . strtolower(str_replace("_", "-", trim($this->name->getDeclaration…
2618 return $this->name->__toString();
2624 … $value = EvaluatedValue::createFromExpression($this->value, null, $this->cValue, $allConstInfos);
2635 return $this->valueString;
2644 $constantElement->textContent = $this->name->__toString();
2646 $typeElement = ($this->phpDocType ?? $this->type)->getTypeForDoc($doc);
2663 $constantElement->textContent = $this->name->__toString();
2664 $typeElement = ($this->phpDocType ?? $this->type)->getTypeForDoc($doc);
2676 $this->type = null;
2677 $this->flags &= ~Modifiers::FINAL;
2678 $this->isDeprecated = false;
2679 $this->attributes = [];
2680 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
2686 $type = $this->phpDocType ?? $this->type;
2692 …$value = EvaluatedValue::createFromExpression($this->value, $simpleType, $this->cValue, $allConstI…
2694 …throw new Exception("Constant " . $this->name->__toString() . " must have a built-in PHPDoc type a…
2698 …if ($value->isUnknownConstValue && $this->cValue === null && $value->expr instanceof Expr\ConstFet…
2699 … throw new Exception("Constant " . $this->name->__toString() . " must have a @cvalue annotation");
2704 if ($this->cond) {
2705 $code .= "#if {$this->cond}\n";
2708 if ($this->name->isClassConst()) {
2709 $code .= $this->getClassConstDeclaration($value, $allConstInfos);
2711 $code .= $this->getGlobalConstDeclaration($value, $allConstInfos);
2713 $code .= $this->getValueAssertion($value);
2715 if ($this->cond) {
2725 $constName = str_replace('\\', '\\\\', $this->name->__toString());
2730 if (!$this->isFileCacheAllowed) {
2733 …if ($this->phpVersionIdMinimumCompatibility !== null && $this->phpVersionIdMinimumCompatibility < …
2737 if ($this->isDeprecated) {
2766 $constName = $this->name->getDeclarationName();
2775 if ($this->exposedDocComment) {
2777 $escapedComment = $this->exposedDocComment->escape();
2778 $escapedCommentLength = $this->exposedDocComment->getLength();
2784 …$php83MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
2786 if ($this->type && !$php83MinimumCompatibility) {
2790 if ($this->type) {
2791 $typeCode = $this->getTypeCode($constName, $code);
2793 if (!empty($this->attributes)) {
2794 … $template = "\tzend_class_constant *const_" . $this->name->getDeclarationName() . " = ";
2802 $this->getFlagsByPhpVersion(),
2803 $this->phpVersionIdMinimumCompatibility
2808 if ($this->type && !$php83MinimumCompatibility) {
2812 if (!$this->type || !$php83MinimumCompatibility) {
2813 if (!empty($this->attributes)) {
2814 … $template = "\tzend_class_constant *const_" . $this->name->getDeclarationName() . " = ";
2821 $this->getFlagsByPhpVersion(),
2822 $this->phpVersionIdMinimumCompatibility
2827 if ($this->type && !$php83MinimumCompatibility) {
2838 if ($value->isUnknownConstValue || $value->originatingConsts || $this->cValue === null) {
2879 if ($this->isDeprecated) {
2880 … $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_DEPRECATED", PHP_80_VERSION_ID);
2883 foreach ($this->attributes as $attr) {
2885 … $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_DEPRECATED", PHP_80_VERSION_ID);
2890 if ($this->flags & Modifiers::FINAL) {
2891 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_FINAL", PHP_81_VERSION_ID);
2901 if ($this->flags & Modifiers::FINAL) {
3032 $this->name = $name;
3033 $this->classFlags = $classFlags;
3034 $this->defaultValue = $defaultValue;
3035 $this->defaultValueString = $defaultValueString;
3036 $this->isDocReadonly = $isDocReadonly;
3037 $this->isVirtual = $isVirtual;
3053 $className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
3055 …return "$className.props." . strtolower(str_replace("_", "-", trim($this->name->getDeclarationName…
3060 return $this->name->getDeclarationName();
3066 return $this->defaultValueString;
3070 $this->type = null;
3071 $this->flags &= ~Modifiers::READONLY;
3072 $this->attributes = [];
3073 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
3080 $propertyName = $this->name->getDeclarationName();
3082 if ($this->defaultValue === null) {
3085 …$defaultValue = EvaluatedValue::createFromExpression($this->defaultValue, null, null, $allConstInf…
3087 …echo "Skipping code generation for property $this->name, because it has an unknown constant defaul…
3093 if ($this->defaultValue === null && $this->type !== null) {
3099 [$stringInit, $nameCode, $stringRelease] = $this->getString($propertyName);
3102 if ($this->exposedDocComment) {
3104 $escapedComment = $this->exposedDocComment->escape();
3105 $escapedCommentLength = $this->exposedDocComment->getLength();
3111 if (!empty($this->attributes)) {
3112 … $template = "\tzend_property_info *property_" . $this->name->getDeclarationName() . " = ";
3117 …if ($this->phpVersionIdMinimumCompatibility === null || $this->phpVersionIdMinimumCompatibility >=…
3118 $typeCode = $this->getTypeCode($propertyName, $code);
3126 $this->getFlagsByPhpVersion(),
3127 $this->phpVersionIdMinimumCompatibility
3193 if ($this->flags & Modifiers::STATIC) {
3194 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_STATIC", PHP_70_VERSION_ID);
3197 if ($this->flags & Modifiers::READONLY) {
3198 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_READONLY", PHP_81_VERSION_ID);
3199 } elseif ($this->classFlags & Modifiers::READONLY) {
3200 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_READONLY", PHP_82_VERSION_ID);
3203 if ($this->isVirtual) {
3204 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_VIRTUAL", PHP_84_VERSION_ID);
3214 if ($this->flags & Modifiers::STATIC) {
3219 if ($this->flags & Modifiers::READONLY || $this->isDocReadonly) {
3227 if ($this->type) {
3228 $this->type = clone $this->type;
3230 foreach ($this->attributes as $key => $attribute) {
3231 $this->attributes[$key] = clone $attribute;
3233 if ($this->exposedDocComment) {
3234 $this->exposedDocComment = clone $this->exposedDocComment;
3244 $this->name = $name;
3245 $this->value = $value;
3250 $escapedName = addslashes($this->name);
3251 if ($this->value === null) {
3254 $value = EvaluatedValue::createFromExpression($this->value, null, null, $allConstInfos);
3272 $this->class = $class;
3273 $this->args = $args;
3293 $escapedAttributeName = strtr($this->class, '\\', '_');
3295this->args ? "zend_attribute *attribute_{$escapedAttributeName}_$nameSuffix = " : "") . "$invocati…
3297 … = zend_string_init_interned(\"" . addcslashes($this->class, "\\") . "\", sizeof(\"" . addcslashes…
3298this->args ? "zend_attribute *attribute_{$escapedAttributeName}_$nameSuffix = " : "") . "$invocati…
3301 foreach ($this->args as $i => $arg) {
3376 $this->name = $name;
3377 $this->flags = $flags;
3378 $this->type = $type;
3379 $this->alias = $alias;
3380 $this->enumBackingType = $enumBackingType;
3381 $this->isDeprecated = $isDeprecated;
3382 $this->isStrictProperties = $isStrictProperties;
3383 $this->attributes = $attributes;
3384 $this->exposedDocComment = $exposedDocComment;
3385 $this->isNotSerializable = $isNotSerializable;
3386 $this->extends = $extends;
3387 $this->implements = $implements;
3388 $this->constInfos = $constInfos;
3389 $this->propertyInfos = $propertyInfos;
3390 $this->funcInfos = $funcInfos;
3391 $this->enumCaseInfos = $enumCaseInfos;
3392 $this->cond = $cond;
3393 $this->phpVersionIdMinimumCompatibility = $minimumPhpVersionIdCompatibility;
3394 $this->isUndocumentable = $isUndocumentable;
3401 foreach ($this->extends as $extends) {
3404 foreach ($this->implements as $implements) {
3408 $escapedName = implode("_", $this->name->getParts());
3412 …$php80MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
3413 …$php81MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
3414 …$php84MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
3416 if ($this->type === "enum" && !$php81MinimumCompatibility) {
3420 if ($this->cond) {
3421 $code .= "#if {$this->cond}\n";
3428 …$flagCodes = generateVersionDependentFlagCode("%s", $this->getFlagsByPhpVersion(), $this->phpVersi…
3431 $classMethods = ($this->funcInfos === []) ? 'NULL' : "class_{$escapedName}_methods";
3432 if ($this->type === "enum") {
3433 $name = addslashes((string) $this->name);
3434 $backingType = $this->enumBackingType
3435 ? $this->enumBackingType->toTypeCode() : "IS_UNDEF";
3442 if (count($this->name->getParts()) > 1) {
3443 $className = $this->name->getLast();
3444 $namespace = addslashes((string) $this->name->slice(0, -1));
3448 $code .= "\tINIT_CLASS_ENTRY(ce, \"$this->name\", $classMethods);\n";
3451 if ($this->type === "class" || $this->type === "trait") {
3456 …_internal_class_with_flags(&ce, " . (isset($this->extends[0]) ? "class_entry_" . str_replace("\\",…
3461 …register_internal_class_ex(&ce, " . (isset($this->extends[0]) ? "class_entry_" . str_replace("\\",…
3475 if ($this->exposedDocComment) {
3480 …ry->doc_comment = zend_string_init_interned(\"" . $this->exposedDocComment->escape() . "\", " . $t…
3491 $this->type === "interface" ? $this->extends : $this->implements
3498 if ($this->alias) {
3499 …$code .= "\tzend_register_class_alias(\"" . str_replace("\\", "\\\\", $this->alias) . "\", class_e…
3502 foreach ($this->constInfos as $const) {
3506 foreach ($this->enumCaseInfos as $enumCase) {
3510 foreach ($this->propertyInfos as $property) {
3514 if (!empty($this->attributes)) {
3519 foreach ($this->attributes as $key => $attribute) {
3524 $this->phpVersionIdMinimumCompatibility
3533 …ateConstantAttributeInitialization($this->constInfos, $allConstInfos, $this->phpVersionIdMinimumCo…
3545 …izationCode = generatePropertyAttributeInitialization($this->propertyInfos, $allConstInfos, $this-…
3557 …rateFunctionAttributeInitialization($this->funcInfos, $allConstInfos, $this->phpVersionIdMinimumCo…
3573 if ($this->cond) {
3577 if ($this->type === "enum" && !$php81MinimumCompatibility) {
3591 if ($this->type === "trait") {
3595 if ($this->flags & Modifiers::FINAL) {
3599 if ($this->flags & Modifiers::ABSTRACT) {
3603 if ($this->isDeprecated) {
3609 if ($this->isStrictProperties) {
3615 if ($this->isNotSerializable) {
3621 if ($this->flags & Modifiers::READONLY) {
3625 foreach ($this->attributes as $attr) {
3646 $this->attributes = [];
3647 $this->flags &= ~Modifiers::READONLY;
3648 $this->exposedDocComment = null;
3649 $this->isStrictProperties = false;
3650 $this->isNotSerializable = false;
3652 foreach ($this->propertyInfos as $propertyInfo) {
3655 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
3667 $classSynopsis = $this->getClassSynopsisElement($doc, $classMap, $allConstInfos);
3684 $classSynopsis->setAttribute("class", $this->type === "interface" ? "interface" : "class");
3686 …$exceptionOverride = $this->type === "class" && $this->isException($classMap) ? "exception" : null;
3687 $ooElement = self::createOoElement($doc, $this, $exceptionOverride, true, null, 4);
3694 foreach ($this->extends as $k => $parent) {
3716 foreach ($this->implements as $k => $interface) {
3737 $this->collectInheritedMembers(
3741 $this->hasConstructor(),
3745 $this->appendInheritedMemberSectionToClassSynopsis(
3753 if (!empty($this->constInfos)) {
3759 foreach ($this->constInfos as $constInfo) {
3766 if (!empty($this->propertyInfos)) {
3772 foreach ($this->propertyInfos as $propertyInfo) {
3779 $this->appendInheritedMemberSectionToClassSynopsis(
3787 if (!empty($this->funcInfos)) {
3793 $classReference = self::getClassSynopsisReference($this->name);
3794 $escapedName = addslashes($this->name->__toString());
3796 if ($this->hasConstructor()) {
3798 $includeElement = $this->createIncludeElement(
3805 if ($this->hasMethods()) {
3807 $includeElement = $this->createIncludeElement(
3814 if ($this->hasDestructor()) {
3816 $includeElement = $this->createIncludeElement(
3839 $includeElement = $this->createIncludeElement(
3926 foreach ($this->extends as $parent) {
3966 foreach ($this->implements as $parent) {
3992 if ($this->name->toString() === "Throwable") {
3996 foreach ($this->extends as $parentName) {
4007 if ($this->type === "class") {
4008 foreach ($this->implements as $interfaceName) {
4025 foreach ($this->funcInfos as $funcInfo) {
4036 foreach ($this->funcInfos as $funcInfo) {
4047 foreach ($this->funcInfos as $funcInfo) {
4058 foreach ($this->funcInfos as $funcInfo) {
4083 foreach ($this->constInfos as $key => $constInfo) {
4084 $this->constInfos[$key] = clone $constInfo;
4087 foreach ($this->propertyInfos as $key => $propertyInfo) {
4088 $this->propertyInfos[$key] = clone $propertyInfo;
4091 foreach ($this->funcInfos as $key => $funcInfo) {
4092 $this->funcInfos[$key] = clone $funcInfo;
4095 foreach ($this->attributes as $key => $attribute) {
4096 $this->attributes[$key] = clone $attribute;
4099 if ($this->exposedDocComment) {
4100 $this->exposedDocComment = clone $this->exposedDocComment;
4122 $includeElement = $this->createIncludeElement(
4151 yield from $this->funcInfos;
4152 foreach ($this->classInfos as $classInfo) {
4161 foreach ($this->constInfos as $constInfo) {
4165 foreach ($this->classInfos as $classInfo) {
4178 foreach ($this->classInfos as $classInfo) {
4185 foreach ($this->constInfos as $key => $constInfo) {
4186 $this->constInfos[$key] = clone $constInfo;
4189 foreach ($this->funcInfos as $key => $funcInfo) {
4190 $this->funcInfos[$key] = clone $funcInfo;
4193 foreach ($this->classInfos as $key => $classInfo) {
4194 $this->classInfos[$key] = clone $classInfo;
4199 $this->minimumPhpVersionIdCompatibility = $minimumPhpVersionIdCompatibility;
4204 if (!$this->legacyArginfoGeneration &&
4205 $this->minimumPhpVersionIdCompatibility !== null &&
4206 $this->minimumPhpVersionIdCompatibility < PHP_80_VERSION_ID
4211 return $this->minimumPhpVersionIdCompatibility;
4215 …return $this->minimumPhpVersionIdCompatibility !== null && $this->minimumPhpVersionIdCompatibility…
4224 $this->name = $name;
4225 $this->value = $value;
4229 if ($this->value === null) {
4230 throw new Exception("@$this->name does not have a value");
4233 return $this->value;
4237 $value = $this->getValue();
4241 if ($this->name === "param") {
4243 } elseif ($this->name === "return" || $this->name === "var") {
4248 … throw new Exception("@$this->name doesn't contain a type or has an invalid format \"$value\"");
4255 $value = $this->value;
4257 throw new Exception("@$this->name doesn't have any value");
4262 if ($this->name === "param") {
4265 } elseif ($this->name === "prefer-ref") {
4270 …throw new Exception("@$this->name doesn't contain a variable name or has an invalid format \"$valu…
4281 $this->docComment = $docComment;
4285 return str_replace("\n", '\n', addslashes($this->docComment));
4289 return strlen($this->docComment);