Skip to content

Commit 6b741e3

Browse files
DanielEScherzerkocsismate
authored andcommitted
gen_stub: whitespace and readability improvements
Remove blank lines at the start of functions, ensure there are spaces between parameters, split a long function call across multiple lines
1 parent c2f8107 commit 6b741e3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

build/gen_stub.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3087,7 +3087,7 @@ private function getString(string $propName): array {
30873087
$include = array_merge($include, self::PHP_81_KNOWN);
30883088
break;
30893089
}
3090-
if (array_key_exists($propName,$include)) {
3090+
if (array_key_exists($propName, $include)) {
30913091
$knownStr = $include[$propName];
30923092
return [
30933093
'',
@@ -3584,7 +3584,6 @@ public function discardInfoForOldPhpVersions(?int $phpVersionIdMinimumCompatibil
35843584
* @param iterable<ConstInfo> $allConstInfo
35853585
*/
35863586
public function getClassSynopsisDocument(array $classMap, array $allConstInfos): ?string {
3587-
35883587
$doc = new DOMDocument();
35893588
$doc->formatOutput = true;
35903589
$classSynopsis = $this->getClassSynopsisElement($doc, $classMap, $allConstInfos);
@@ -3602,7 +3601,6 @@ public function getClassSynopsisDocument(array $classMap, array $allConstInfos):
36023601
* @param array<string, ConstInfo> $allConstInfos
36033602
*/
36043603
public function getClassSynopsisElement(DOMDocument $doc, array $classMap, array $allConstInfos): ?DOMElement {
3605-
36063604
$classSynopsis = $doc->createElement("classsynopsis");
36073605
$classSynopsis->setAttribute("class", $this->type === "interface" ? "interface" : "class");
36083606

@@ -4888,7 +4886,15 @@ function handleStatements(FileInfo $fileInfo, array $stmts, PrettyPrinterAbstrac
48884886
}
48894887

48904888
$fileInfo->classInfos[] = parseClass(
4891-
$className, $stmt, $constInfos, $propertyInfos, $methodInfos, $enumCaseInfos, $cond, $fileInfo->getMinimumPhpVersionIdCompatibility(), $fileInfo->isUndocumentable
4889+
$className,
4890+
$stmt,
4891+
$constInfos,
4892+
$propertyInfos,
4893+
$methodInfos,
4894+
$enumCaseInfos,
4895+
$cond,
4896+
$fileInfo->getMinimumPhpVersionIdCompatibility(),
4897+
$fileInfo->isUndocumentable
48924898
);
48934899
continue;
48944900
}
@@ -5034,7 +5040,7 @@ function funcInfoToCode(FileInfo $fileInfo, FuncInfo $funcInfo): string {
50345040
} else {
50355041
$code .= sprintf(
50365042
"\tZEND_%s_OBJ_INFO%s(%s, %s, %s, %d%s)\n",
5037-
$argKind,$argDefaultKind, $argInfo->sendBy, $argInfo->name,
5043+
$argKind, $argDefaultKind, $argInfo->sendBy, $argInfo->name,
50385044
$simpleArgType->toEscapedName(), $argType->isNullable(),
50395045
$argInfo->hasProperDefaultValue() ? ", " . $argInfo->getDefaultValueAsArginfoString() : ""
50405046
);
@@ -5376,7 +5382,6 @@ function generatePropertyAttributeInitialization(
53765382

53775383
/** @param array<string, FuncInfo> $funcMap */
53785384
function generateOptimizerInfo(array $funcMap): string {
5379-
53805385
$code = "/* This is a generated file, edit the .stub.php files instead. */\n\n";
53815386

53825387
$code .= "static const func_info_t func_infos[] = {\n";

0 commit comments

Comments
 (0)