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";
1175 $this->byRef = $byRef;
1176 $this->setTypes($type, $phpDocType, $tentativeReturnType);
1177 $this->setRefcount($refcount);
1181 return $this->byRef === $other->byRef
1182 && Type::equals($this->type, $other->type)
1183 && $this->tentativeReturnType === $other->tentativeReturnType;
1187 return $this->type ?? $this->phpDocType;
1192 $this->type = $type;
1193 $this->phpDocType = $phpDocType;
1194 $this->tentativeReturnType = $tentativeReturnType;
1199 $type = $this->phpDocType ?? $this->type;
1203 $this->refcount = $isScalarType ? self::REFCOUNT_0 : self::REFCOUNT_N;
1219 $this->refcount = $refcount;
1269 $this->name = $name;
1270 $this->classFlags = $classFlags;
1271 $this->flags = $flags;
1272 $this->aliasType = $aliasType;
1273 $this->alias = $alias;
1274 $this->isDeprecated = $isDeprecated;
1275 $this->supportsCompileTimeEval = $supportsCompileTimeEval;
1276 $this->verify = $verify;
1277 $this->args = $args;
1278 $this->return = $return;
1279 $this->numRequiredArgs = $numRequiredArgs;
1280 $this->cond = $cond;
1281 $this->isUndocumentable = $isUndocumentable;
1282 $this->minimumPhpVersionIdCompatibility = $minimumPhpVersionIdCompatibility;
1283 $this->attributes = $attributes;
1284 $this->framelessFunctionInfos = $framelessFunctionInfos;
1285 $this->exposedDocComment = $exposedDocComment;
1286 if ($return->tentativeReturnType && $this->isFinalMethod()) {
1293 return $this->name->isMethod();
1298 return ($this->flags & Modifiers::FINAL) || ($this->classFlags & Modifiers::FINAL);
1303 … return !($this->flags & Modifiers::STATIC) && $this->isMethod() && !$this->name->isConstructor();
1309 if (!$this->isMethod()) {
1315 if ($this->flags & Modifiers::FINAL) {
1317 } elseif ($this->flags & Modifiers::ABSTRACT && $this->classFlags & ~Modifiers::ABSTRACT) {
1321 if ($this->flags & Modifiers::PROTECTED) {
1323 } elseif ($this->flags & Modifiers::PRIVATE) {
1329 if ($this->flags & Modifiers::STATIC) {
1338 foreach ($this->args as $arg) {
1348 if (count($this->args) !== count($other->args)) {
1352 for ($i = 0; $i < count($this->args); $i++) {
1353 if (!$this->args[$i]->equals($other->args[$i])) {
1358 return $this->return->equalsApartFromPhpDocAndRefcount($other->return)
1359 && $this->numRequiredArgs === $other->numRequiredArgs
1360 && $this->cond === $other->cond;
1364 return $this->name->getArgInfoName();
1369 $name = $this->alias ?? $this->name;
1371 return "$name|$this->cond";
1376 if ($this->flags & Modifiers::ABSTRACT) {
1380 $name = $this->alias ?? $this->name;
1386 if (empty($this->framelessFunctionInfos)) {
1390 …$php84MinimumCompatibility = $this->minimumPhpVersionIdCompatibility === null || $this->minimumPhp…
1398 foreach ($this->framelessFunctionInfos as $framelessFunctionInfo) {
1399 …$code .= "ZEND_FRAMELESS_FUNCTION({$this->name->getFunctionName()}, {$framelessFunctionInfo->arity…
1402 …$code .= 'static const zend_frameless_function_info ' . $this->getFramelessFunctionInfosName() . "…
1403 foreach ($this->framelessFunctionInfos as $framelessFunctionInfo) {
1404 …$code .= "\t{ ZEND_FRAMELESS_FUNCTION_NAME({$this->name->getFunctionName()}, {$framelessFunctionIn…
1417 return $this->name->getFramelessFunctionInfosName();
1423 …$php84MinimumCompatibility = $this->minimumPhpVersionIdCompatibility === null || $this->minimumPhp…
1424 …$isVanillaEntry = $this->alias === null && !$this->supportsCompileTimeEval && $this->exposedDocCom…
1425 $argInfoName = $this->getArgInfoName();
1426 $flagsByPhpVersions = $this->getArginfoFlagsByPhpVersions();
1429 if (!empty($this->framelessFunctionInfos)) {
1430 if ($this->isMethod()) {
1433 if ($this->name->getNamespace()) {
1436 if ($this->alias) {
1441 if ($this->isMethod()) {
1442 $zendName = '"' . $this->name->methodName . '"';
1443 if ($this->alias) {
1444 if ($this->alias instanceof MethodName) {
1445 … $name = "zim_" . $this->alias->getDeclarationClassName() . "_" . $this->alias->methodName;
1446 } else if ($this->alias instanceof FunctionName) {
1447 $name = "zif_" . $this->alias->getNonNamespacedName();
1452 if ($this->flags & Modifiers::ABSTRACT) {
1455 … $name = "zim_" . $this->name->getDeclarationClassName() . "_" . $this->name->methodName;
1458 …$functionEntryCode = "\tZEND_ME(" . $this->name->getDeclarationClassName() . ", " . $this->name->m…
1462 } else if ($this->name instanceof FunctionName) {
1463 $functionName = $this->name->getFunctionName();
1464 …$declarationName = $this->alias ? $this->alias->getNonNamespacedName() : $this->name->getDeclarati…
1466 if ($this->name->getNamespace()) {
1467 $namespace = addslashes($this->name->getNamespace());
1490 … $docComment = $this->exposedDocComment ? '"' . $this->exposedDocComment->escape() . '"' : "NULL";
1491 …$framelessFuncInfosName = !empty($this->framelessFunctionInfos) ? $this->getFramelessFunctionInfos…
1511 $this->minimumPhpVersionIdCompatibility
1525 if ($this->isMethod()) {
1529 if ($this->alias !== null) {
1533 … if ($this->return->refcount !== ReturnInfo::REFCOUNT_1 && $this->return->phpDocType === null) {
1537 $type = $this->return->phpDocType ?? $this->return->type;
1542 …return "\tF" . $this->return->refcount . '("' . addslashes($this->name->__toString()) . '", ' . $t…
1546 $this->attributes = [];
1547 $this->return->type = null;
1548 $this->framelessFunctionInfos = [];
1549 $this->exposedDocComment = null;
1550 $this->supportsCompileTimeEval = false;
1551 foreach ($this->args as $arg) {
1556 $this->minimumPhpVersionIdCompatibility = $minimumPhpVersionIdCompatibility;
1564 if ($this->isMethod()) {
1565 if ($this->flags & Modifiers::PROTECTED) {
1567 } elseif ($this->flags & Modifiers::PRIVATE) {
1573 if ($this->flags & Modifiers::STATIC) {
1577 if ($this->flags & Modifiers::FINAL) {
1581 if ($this->flags & Modifiers::ABSTRACT) {
1586 if ($this->isDeprecated) {
1590 foreach ($this->attributes as $attr) {
1598 if ($this->isMethod() === false && $this->supportsCompileTimeEval) {
1644 if ($this->isMethod()) {
1645 assert($this->name instanceof MethodName);
1649 str_replace('\\', '-', $this->name->className->__toString())
1651 . str_replace('_', '-', ltrim($this->name->methodName, '_'))
1654 $id = 'function.' . strtolower(str_replace('_', '-', $this->name->__toString()));
1668 $refname = $doc->createElement('refname', $this->name->__toString());
1678 $descriptionRefSec = $this->generateRefSect1($doc, 'description');
1680 $methodSynopsis = $this->getMethodSynopsisElement($funcMap, $aliasMap, $doc);
1697 $parametersRefSec = $this->getParameterSection($doc);
1701 if (!$this->name->isConstructor() && !$this->name->isDestructor()) {
1702 $returnRefSec = $this->getReturnValueSection($doc);
1707 $errorsRefSec = $this->generateRefSect1($doc, 'errors');
1726 $changelogRefSec = $this->getChangelogSection($doc);
1729 $exampleRefSec = $this->getExampleSection($doc, $id);
1733 $notesRefSec = $this->generateRefSect1($doc, 'notes');
1746 $seeAlsoRefSec = $this->generateRefSect1($doc, 'seealso');
1810 $parametersRefSec = $this->generateRefSect1($doc, 'parameters');
1811 if (empty($this->args)) {
1832 foreach ($this->args as $arg) {
1872 $returnRefSec = $this->generateRefSect1($doc, 'returnvalues');
1877 $returnType = $this->return->getMethodSynopsisType();
1977 $refSec = $this->generateRefSect1($doc, 'changelog');
1986 $table = $this->generateDocbookInformalTable(
2000 $refSec = $this->generateRefSect1($doc, 'examples');
2003 $fnName = $this->name->__toString();
2007 $fn = $doc->createElement($this->isMethod() ? 'methodname' : 'function');
2066 if ($this->hasParamWithUnknownDefaultValue()) {
2070 if ($this->name->isConstructor()) {
2072 } elseif ($this->name->isDestructor()) {
2080 if ($this->isMethod()) {
2081 assert($this->name instanceof MethodName);
2083 $role->value = addslashes($this->name->className->__toString());
2089 foreach ($this->getModifierNames() as $modifierString) {
2095 $returnType = $this->return->getMethodSynopsisType();
2100 $methodname = $doc->createElement('methodname', $this->name->__toString());
2103 if (empty($this->args)) {
2108 foreach ($this->args as $arg) {
2154 foreach ($this->args as $key => $argInfo) {
2155 $this->args[$key] = clone $argInfo;
2157 $this->return = clone $this->return;
2158 foreach ($this->attributes as $key => $attribute) {
2159 $this->attributes[$key] = clone $attribute;
2161 foreach ($this->framelessFunctionInfos as $key => $framelessFunctionInfo) {
2162 $this->framelessFunctionInfos[$key] = clone $framelessFunctionInfo;
2164 if ($this->exposedDocComment) {
2165 $this->exposedDocComment = clone $this->exposedDocComment;
2196 $this->allConstInfos = $allConstInfos;
2216 $const = $this->allConstInfos[$originatingConstName->__toString()] ?? null;
2218 $this->visitedConstants[] = $const;
2219 return $const->getValue($this->allConstInfos)->expr;
2234 …throw new Exception($this->getVariableTypeName() . " " . $this->name->__toString() . " has an unsu…
2292 $this->value = $value;
2293 $this->type = $type;
2294 $this->expr = $expr;
2295 $this->originatingConsts = $originatingConsts;
2296 $this->isUnknownConstValue = $isUnknownConstValue;
2301 $cExpr = $this->getCExpr();
2305 if ($this->type->isNull()) {
2307 } elseif ($this->type->isBool()) {
2315 } elseif ($this->type->isInt()) {
2317 } elseif ($this->type->isFloat()) {
2319 } elseif ($this->type->isString()) {
2326 } elseif ($this->type->isArray()) {
2333 …w new Exception("Invalid default value: " . print_r($this->value, true) . ", type: " . print_r($th…
2343 $expr = $prettyPrinter->prettyPrintExpr($this->expr);
2345 if ($this->type->isString()) {
2375 $this->flags = $flags;
2376 $this->type = $type;
2377 $this->phpDocType = $phpDocType;
2378 $this->link = $link;
2379 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
2380 $this->attributes = $attributes;
2381 $this->exposedDocComment = $exposedDocComment;
2399 $type = $this->phpDocType ?? $this->type;
2413 if ($this->flags & Modifiers::PROTECTED) {
2415 } elseif ($this->flags & Modifiers::PRIVATE) {
2431 $variableLikeType = $this->getVariableTypeName();
2434 if ($this->type) {
2435 $arginfoType = $this->type->toArginfoType();
2453 $typeMaskCode = $this->type->toArginfoType()->toTypeMask();
2455 if ($this->type->isIntersection) {
2483 $this->addModifiersToFieldSynopsis($doc, $fieldsynopsisElement);
2485 $this->addTypeToFieldSynopsis($doc, $fieldsynopsisElement);
2487 $varnameElement = $doc->createElement("varname", $this->getFieldSynopsisName());
2488 if ($this->link) {
2489 $varnameElement->setAttribute("linkend", $this->link);
2491 $varnameElement->setAttribute("linkend", $this->getFieldSynopsisDefaultLinkend());
2497 $valueString = $this->getFieldSynopsisValueString($allConstInfos);
2511 if ($this->flags & Modifiers::PUBLIC) {
2514 } elseif ($this->flags & Modifiers::PROTECTED) {
2517 } elseif ($this->flags & Modifiers::PRIVATE) {
2573 $this->name = $name;
2574 $this->value = $value;
2575 $this->valueString = $valueString;
2576 $this->isDeprecated = $isDeprecated;
2577 $this->cond = $cond;
2578 $this->cValue = $cValue;
2579 $this->isUndocumentable = $isUndocumentable;
2580 $this->isFileCacheAllowed = $isFileCacheAllowed;
2588 $this->value,
2589 ($this->phpDocType ?? $this->type)->tryToSimpleType(),
2590 $this->cValue,
2607 $className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
2609 …return "$className.constants." . strtolower(str_replace(["__", "_"], ["", "-"], $this->name->getDe…
2614 return $this->name->__toString();
2620 … $value = EvaluatedValue::createFromExpression($this->value, null, $this->cValue, $allConstInfos);
2631 return $this->valueString;
2640 $constantElement->textContent = $this->name->__toString();
2642 $typeElement = ($this->phpDocType ?? $this->type)->getTypeForDoc($doc);
2659 $constantElement->textContent = $this->name->__toString();
2660 $typeElement = ($this->phpDocType ?? $this->type)->getTypeForDoc($doc);
2672 $this->type = null;
2673 $this->flags &= ~Modifiers::FINAL;
2674 $this->isDeprecated = false;
2675 $this->attributes = [];
2676 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
2682 $type = $this->phpDocType ?? $this->type;
2688 …$value = EvaluatedValue::createFromExpression($this->value, $simpleType, $this->cValue, $allConstI…
2690 …throw new Exception("Constant " . $this->name->__toString() . " must have a built-in PHPDoc type a…
2694 …if ($value->isUnknownConstValue && $this->cValue === null && $value->expr instanceof Expr\ConstFet…
2695 … throw new Exception("Constant " . $this->name->__toString() . " must have a @cvalue annotation");
2700 if ($this->cond) {
2701 $code .= "#if {$this->cond}\n";
2704 if ($this->name->isClassConst()) {
2705 $code .= $this->getClassConstDeclaration($value, $allConstInfos);
2707 $code .= $this->getGlobalConstDeclaration($value, $allConstInfos);
2709 $code .= $this->getValueAssertion($value);
2711 if ($this->cond) {
2721 $constName = str_replace('\\', '\\\\', $this->name->__toString());
2726 if (!$this->isFileCacheAllowed) {
2729 …if ($this->phpVersionIdMinimumCompatibility !== null && $this->phpVersionIdMinimumCompatibility < …
2733 if ($this->isDeprecated) {
2762 $constName = $this->name->getDeclarationName();
2771 if ($this->exposedDocComment) {
2773 $escapedComment = $this->exposedDocComment->escape();
2774 $escapedCommentLength = $this->exposedDocComment->getLength();
2780 …$php83MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
2782 if ($this->type && !$php83MinimumCompatibility) {
2786 if ($this->type) {
2787 $typeCode = $this->getTypeCode($constName, $code);
2789 if (!empty($this->attributes)) {
2790 … $template = "\tzend_class_constant *const_" . $this->name->getDeclarationName() . " = ";
2798 $this->getFlagsByPhpVersion(),
2799 $this->phpVersionIdMinimumCompatibility
2804 if ($this->type && !$php83MinimumCompatibility) {
2808 if (!$this->type || !$php83MinimumCompatibility) {
2809 if (!empty($this->attributes)) {
2810 … $template = "\tzend_class_constant *const_" . $this->name->getDeclarationName() . " = ";
2817 $this->getFlagsByPhpVersion(),
2818 $this->phpVersionIdMinimumCompatibility
2823 if ($this->type && !$php83MinimumCompatibility) {
2834 if ($value->isUnknownConstValue || $value->originatingConsts || $this->cValue === null) {
2875 if ($this->isDeprecated) {
2876 … $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_DEPRECATED", PHP_80_VERSION_ID);
2879 foreach ($this->attributes as $attr) {
2881 … $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_DEPRECATED", PHP_80_VERSION_ID);
2886 if ($this->flags & Modifiers::FINAL) {
2887 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_FINAL", PHP_81_VERSION_ID);
2897 if ($this->flags & Modifiers::FINAL) {
3028 $this->name = $name;
3029 $this->classFlags = $classFlags;
3030 $this->defaultValue = $defaultValue;
3031 $this->defaultValueString = $defaultValueString;
3032 $this->isDocReadonly = $isDocReadonly;
3033 $this->isVirtual = $isVirtual;
3049 $className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
3051 …return "$className.props." . strtolower(str_replace(["__", "_"], ["", "-"], $this->name->getDeclar…
3056 return $this->name->getDeclarationName();
3062 return $this->defaultValueString;
3066 $this->type = null;
3067 $this->flags &= ~Modifiers::READONLY;
3068 $this->attributes = [];
3069 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
3076 $propertyName = $this->name->getDeclarationName();
3078 if ($this->defaultValue === null) {
3081 …$defaultValue = EvaluatedValue::createFromExpression($this->defaultValue, null, null, $allConstInf…
3083 …echo "Skipping code generation for property $this->name, because it has an unknown constant defaul…
3089 if ($this->defaultValue === null && $this->type !== null) {
3095 [$stringInit, $nameCode, $stringRelease] = $this->getString($propertyName);
3098 if ($this->exposedDocComment) {
3100 $escapedComment = $this->exposedDocComment->escape();
3101 $escapedCommentLength = $this->exposedDocComment->getLength();
3107 if (!empty($this->attributes)) {
3108 … $template = "\tzend_property_info *property_" . $this->name->getDeclarationName() . " = ";
3113 …if ($this->phpVersionIdMinimumCompatibility === null || $this->phpVersionIdMinimumCompatibility >=…
3114 $typeCode = $this->getTypeCode($propertyName, $code);
3122 $this->getFlagsByPhpVersion(),
3123 $this->phpVersionIdMinimumCompatibility
3189 if ($this->flags & Modifiers::STATIC) {
3190 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_STATIC", PHP_70_VERSION_ID);
3193 if ($this->flags & Modifiers::READONLY) {
3194 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_READONLY", PHP_81_VERSION_ID);
3195 } elseif ($this->classFlags & Modifiers::READONLY) {
3196 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_READONLY", PHP_82_VERSION_ID);
3199 if ($this->isVirtual) {
3200 $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_VIRTUAL", PHP_84_VERSION_ID);
3210 if ($this->flags & Modifiers::STATIC) {
3215 if ($this->flags & Modifiers::READONLY || $this->isDocReadonly) {
3223 if ($this->type) {
3224 $this->type = clone $this->type;
3226 foreach ($this->attributes as $key => $attribute) {
3227 $this->attributes[$key] = clone $attribute;
3229 if ($this->exposedDocComment) {
3230 $this->exposedDocComment = clone $this->exposedDocComment;
3240 $this->name = $name;
3241 $this->value = $value;
3246 $escapedName = addslashes($this->name);
3247 if ($this->value === null) {
3250 $value = EvaluatedValue::createFromExpression($this->value, null, null, $allConstInfos);
3268 $this->class = $class;
3269 $this->args = $args;
3289 $escapedAttributeName = strtr($this->class, '\\', '_');
3291 …this->args ? "zend_attribute *attribute_{$escapedAttributeName}_$nameSuffix = " : "") . "$invocati…
3293 … = zend_string_init_interned(\"" . addcslashes($this->class, "\\") . "\", sizeof(\"" . addcslashes…
3294 …this->args ? "zend_attribute *attribute_{$escapedAttributeName}_$nameSuffix = " : "") . "$invocati…
3297 foreach ($this->args as $i => $arg) {
3372 $this->name = $name;
3373 $this->flags = $flags;
3374 $this->type = $type;
3375 $this->alias = $alias;
3376 $this->enumBackingType = $enumBackingType;
3377 $this->isDeprecated = $isDeprecated;
3378 $this->isStrictProperties = $isStrictProperties;
3379 $this->attributes = $attributes;
3380 $this->exposedDocComment = $exposedDocComment;
3381 $this->isNotSerializable = $isNotSerializable;
3382 $this->extends = $extends;
3383 $this->implements = $implements;
3384 $this->constInfos = $constInfos;
3385 $this->propertyInfos = $propertyInfos;
3386 $this->funcInfos = $funcInfos;
3387 $this->enumCaseInfos = $enumCaseInfos;
3388 $this->cond = $cond;
3389 $this->phpVersionIdMinimumCompatibility = $minimumPhpVersionIdCompatibility;
3390 $this->isUndocumentable = $isUndocumentable;
3397 foreach ($this->extends as $extends) {
3400 foreach ($this->implements as $implements) {
3404 $escapedName = implode("_", $this->name->getParts());
3408 …$php80MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
3409 …$php81MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
3410 …$php84MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersion…
3412 if ($this->type === "enum" && !$php81MinimumCompatibility) {
3416 if ($this->cond) {
3417 $code .= "#if {$this->cond}\n";
3424 …$flagCodes = generateVersionDependentFlagCode("%s", $this->getFlagsByPhpVersion(), $this->phpVersi…
3427 $classMethods = ($this->funcInfos === []) ? 'NULL' : "class_{$escapedName}_methods";
3428 if ($this->type === "enum") {
3429 $name = addslashes((string) $this->name);
3430 $backingType = $this->enumBackingType
3431 ? $this->enumBackingType->toTypeCode() : "IS_UNDEF";
3438 if (count($this->name->getParts()) > 1) {
3439 $className = $this->name->getLast();
3440 $namespace = addslashes((string) $this->name->slice(0, -1));
3444 $code .= "\tINIT_CLASS_ENTRY(ce, \"$this->name\", $classMethods);\n";
3447 if ($this->type === "class" || $this->type === "trait") {
3452 …_internal_class_with_flags(&ce, " . (isset($this->extends[0]) ? "class_entry_" . str_replace("\\",…
3457 …register_internal_class_ex(&ce, " . (isset($this->extends[0]) ? "class_entry_" . str_replace("\\",…
3471 if ($this->exposedDocComment) {
3476 …ry->doc_comment = zend_string_init_interned(\"" . $this->exposedDocComment->escape() . "\", " . $t…
3487 $this->type === "interface" ? $this->extends : $this->implements
3494 if ($this->alias) {
3495 …$code .= "\tzend_register_class_alias(\"" . str_replace("\\", "\\\\", $this->alias) . "\", class_e…
3498 foreach ($this->constInfos as $const) {
3502 foreach ($this->enumCaseInfos as $enumCase) {
3506 foreach ($this->propertyInfos as $property) {
3510 if (!empty($this->attributes)) {
3515 foreach ($this->attributes as $key => $attribute) {
3520 $this->phpVersionIdMinimumCompatibility
3529 …ateConstantAttributeInitialization($this->constInfos, $allConstInfos, $this->phpVersionIdMinimumCo…
3541 …izationCode = generatePropertyAttributeInitialization($this->propertyInfos, $allConstInfos, $this-…
3553 …rateFunctionAttributeInitialization($this->funcInfos, $allConstInfos, $this->phpVersionIdMinimumCo…
3569 if ($this->cond) {
3573 if ($this->type === "enum" && !$php81MinimumCompatibility) {
3587 if ($this->type === "trait") {
3591 if ($this->flags & Modifiers::FINAL) {
3595 if ($this->flags & Modifiers::ABSTRACT) {
3599 if ($this->isDeprecated) {
3605 if ($this->isStrictProperties) {
3611 if ($this->isNotSerializable) {
3617 if ($this->flags & Modifiers::READONLY) {
3621 foreach ($this->attributes as $attr) {
3642 $this->attributes = [];
3643 $this->flags &= ~Modifiers::READONLY;
3644 $this->exposedDocComment = null;
3645 $this->isStrictProperties = false;
3646 $this->isNotSerializable = false;
3648 foreach ($this->propertyInfos as $propertyInfo) {
3651 $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility;
3663 $classSynopsis = $this->getClassSynopsisElement($doc, $classMap, $allConstInfos);
3680 $classSynopsis->setAttribute("class", $this->type === "interface" ? "interface" : "class");
3682 …$exceptionOverride = $this->type === "class" && $this->isException($classMap) ? "exception" : null;
3683 $ooElement = self::createOoElement($doc, $this, $exceptionOverride, true, null, 4);
3690 foreach ($this->extends as $k => $parent) {
3712 foreach ($this->implements as $k => $interface) {
3733 $this->collectInheritedMembers(
3737 $this->hasConstructor(),
3741 $this->appendInheritedMemberSectionToClassSynopsis(
3749 if (!empty($this->constInfos)) {
3755 foreach ($this->constInfos as $constInfo) {
3762 if (!empty($this->propertyInfos)) {
3768 foreach ($this->propertyInfos as $propertyInfo) {
3775 $this->appendInheritedMemberSectionToClassSynopsis(
3783 if (!empty($this->funcInfos)) {
3789 $classReference = self::getClassSynopsisReference($this->name);
3790 $escapedName = addslashes($this->name->__toString());
3792 if ($this->hasConstructor()) {
3794 $includeElement = $this->createIncludeElement(
3801 if ($this->hasMethods()) {
3803 $includeElement = $this->createIncludeElement(
3810 if ($this->hasDestructor()) {
3812 $includeElement = $this->createIncludeElement(
3835 $includeElement = $this->createIncludeElement(
3915 foreach ($this->extends as $parent) {
3955 foreach ($this->implements as $parent) {
3981 if ($this->name->toString() === "Throwable") {
3985 foreach ($this->extends as $parentName) {
3996 if ($this->type === "class") {
3997 foreach ($this->implements as $interfaceName) {
4014 foreach ($this->funcInfos as $funcInfo) {
4025 foreach ($this->funcInfos as $funcInfo) {
4036 foreach ($this->funcInfos as $funcInfo) {
4047 foreach ($this->funcInfos as $funcInfo) {
4072 foreach ($this->constInfos as $key => $constInfo) {
4073 $this->constInfos[$key] = clone $constInfo;
4076 foreach ($this->propertyInfos as $key => $propertyInfo) {
4077 $this->propertyInfos[$key] = clone $propertyInfo;
4080 foreach ($this->funcInfos as $key => $funcInfo) {
4081 $this->funcInfos[$key] = clone $funcInfo;
4084 foreach ($this->attributes as $key => $attribute) {
4085 $this->attributes[$key] = clone $attribute;
4088 if ($this->exposedDocComment) {
4089 $this->exposedDocComment = clone $this->exposedDocComment;
4111 $includeElement = $this->createIncludeElement(
4140 yield from $this->funcInfos;
4141 foreach ($this->classInfos as $classInfo) {
4150 foreach ($this->constInfos as $constInfo) {
4154 foreach ($this->classInfos as $classInfo) {
4167 foreach ($this->classInfos as $classInfo) {
4174 foreach ($this->constInfos as $key => $constInfo) {
4175 $this->constInfos[$key] = clone $constInfo;
4178 foreach ($this->funcInfos as $key => $funcInfo) {
4179 $this->funcInfos[$key] = clone $funcInfo;
4182 foreach ($this->classInfos as $key => $classInfo) {
4183 $this->classInfos[$key] = clone $classInfo;
4188 $this->minimumPhpVersionIdCompatibility = $minimumPhpVersionIdCompatibility;
4193 if (!$this->legacyArginfoGeneration &&
4194 $this->minimumPhpVersionIdCompatibility !== null &&
4195 $this->minimumPhpVersionIdCompatibility < PHP_80_VERSION_ID
4200 return $this->minimumPhpVersionIdCompatibility;
4204 …return $this->minimumPhpVersionIdCompatibility !== null && $this->minimumPhpVersionIdCompatibility…
4213 $this->name = $name;
4214 $this->value = $value;
4218 if ($this->value === null) {
4219 throw new Exception("@$this->name does not have a value");
4222 return $this->value;
4226 $value = $this->getValue();
4230 if ($this->name === "param") {
4232 } elseif ($this->name === "return" || $this->name === "var") {
4237 … throw new Exception("@$this->name doesn't contain a type or has an invalid format \"$value\"");
4244 $value = $this->value;
4246 throw new Exception("@$this->name doesn't have any value");
4251 if ($this->name === "param") {
4254 } elseif ($this->name === "prefer-ref") {
4259 …throw new Exception("@$this->name doesn't contain a variable name or has an invalid format \"$valu…
4270 $this->docComment = $docComment;
4274 return str_replace("\n", '\n', addslashes($this->docComment));
4278 return strlen($this->docComment);