Skip to content

Commit 722eba2

Browse files
gen_stub: drop unused parameters
The following parameters were either unused before this commit or became unused as part of updating callers to stop passing unused parameters to other functions updated in this commit: * `FuncInfo::getMethodSynopsisDocument()` - `$funcMap`, `$aliasMap` * `FuncInfo::getMethodSynopsisElement()` - `$funcMap`, `$aliasMap` * `ConstInfo::getGlobalConstDeclaration()` - `$allConstInfos` * `generateMethodSynopses()` - `$aliasMap` * `replaceMethodSynopses()` - `$aliasMap`
1 parent 4861391 commit 722eba2

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

build/gen_stub.php

+10-18
Original file line numberDiff line numberDiff line change
@@ -1684,11 +1684,9 @@ private function generateRefSect1(DOMDocument $doc, string $role): DOMElement {
16841684
}
16851685

16861686
/**
1687-
* @param array<string, FuncInfo> $funcMap
1688-
* @param array<string, FuncInfo> $aliasMap
16891687
* @throws Exception
16901688
*/
1691-
public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?string {
1689+
public function getMethodSynopsisDocument(): ?string {
16921690
$REFSEC1_SEPERATOR = "\n\n ";
16931691

16941692
$doc = new DOMDocument("1.0", "utf-8");
@@ -1733,7 +1731,7 @@ public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?str
17331731
/* Creation of <refsect1 role="description"> */
17341732
$descriptionRefSec = $this->generateRefSect1($doc, 'description');
17351733

1736-
$methodSynopsis = $this->getMethodSynopsisElement($funcMap, $aliasMap, $doc);
1734+
$methodSynopsis = $this->getMethodSynopsisElement($doc);
17371735
if (!$methodSynopsis) {
17381736
return null;
17391737
}
@@ -2117,11 +2115,9 @@ private function getExampleSection(DOMDocument $doc, string $id): DOMElement {
21172115
}
21182116

21192117
/**
2120-
* @param array<string, FuncInfo> $funcMap
2121-
* @param array<string, FuncInfo> $aliasMap
21222118
* @throws Exception
21232119
*/
2124-
public function getMethodSynopsisElement(array $funcMap, array $aliasMap, DOMDocument $doc): ?DOMElement {
2120+
public function getMethodSynopsisElement(DOMDocument $doc): ?DOMElement {
21252121
if ($this->hasParamWithUnknownDefaultValue()) {
21262122
return null;
21272123
}
@@ -2773,7 +2769,7 @@ public function getDeclaration(array $allConstInfos): string
27732769
if ($this->name->isClassConst()) {
27742770
$code .= $this->getClassConstDeclaration($value, $allConstInfos);
27752771
} else {
2776-
$code .= $this->getGlobalConstDeclaration($value, $allConstInfos);
2772+
$code .= $this->getGlobalConstDeclaration($value);
27772773
}
27782774
$code .= $this->getValueAssertion($value);
27792775

@@ -2784,8 +2780,7 @@ public function getDeclaration(array $allConstInfos): string
27842780
return $code;
27852781
}
27862782

2787-
/** @param array<string, ConstInfo> $allConstInfos */
2788-
private function getGlobalConstDeclaration(EvaluatedValue $value, array $allConstInfos): string
2783+
private function getGlobalConstDeclaration(EvaluatedValue $value): string
27892784
{
27902785
$constName = str_replace('\\', '\\\\', $this->name->__toString());
27912786
$constValue = $value->value;
@@ -5783,14 +5778,13 @@ function getReplacedSynopsisXml(string $xml): string
57835778

57845779
/**
57855780
* @param array<string, FuncInfo> $funcMap
5786-
* @param array<string, FuncInfo> $aliasMap
57875781
* @return array<string, string>
57885782
*/
5789-
function generateMethodSynopses(array $funcMap, array $aliasMap): array {
5783+
function generateMethodSynopses(array $funcMap): array {
57905784
$result = [];
57915785

57925786
foreach ($funcMap as $funcInfo) {
5793-
$methodSynopsis = $funcInfo->getMethodSynopsisDocument($funcMap, $aliasMap);
5787+
$methodSynopsis = $funcInfo->getMethodSynopsisDocument();
57945788
if ($methodSynopsis !== null) {
57955789
$result[$funcInfo->name->getMethodSynopsisFilename() . ".xml"] = $methodSynopsis;
57965790
}
@@ -5801,15 +5795,13 @@ function generateMethodSynopses(array $funcMap, array $aliasMap): array {
58015795

58025796
/**
58035797
* @param array<string, FuncInfo> $funcMap
5804-
* @param array<string, FuncInfo> $aliasMap
58055798
* @param array<int, string> $methodSynopsisWarnings
58065799
* @param array<string, FuncInfo> $undocumentedFuncMap
58075800
* @return array<string, string>
58085801
*/
58095802
function replaceMethodSynopses(
58105803
string $targetDirectory,
58115804
array $funcMap,
5812-
array $aliasMap,
58135805
bool $isVerifyManual,
58145806
array &$methodSynopsisWarnings,
58155807
array &$undocumentedFuncMap
@@ -5908,7 +5900,7 @@ function replaceMethodSynopses(
59085900
$funcInfo = $funcMap[$funcName];
59095901
$documentedFuncMap[$funcInfo->name->__toString()] = $funcInfo->name->__toString();
59105902

5911-
$newMethodSynopsis = $funcInfo->getMethodSynopsisElement($funcMap, $aliasMap, $doc);
5903+
$newMethodSynopsis = $funcInfo->getMethodSynopsisElement($doc);
59125904
if ($newMethodSynopsis === null) {
59135905
continue;
59145906
}
@@ -6326,7 +6318,7 @@ function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc
63266318
}
63276319

63286320
if ($generateMethodSynopses) {
6329-
$methodSynopses = generateMethodSynopses($funcMap, $aliasMap);
6321+
$methodSynopses = generateMethodSynopses($funcMap);
63306322
if (!file_exists($manualTarget)) {
63316323
mkdir($manualTarget);
63326324
}
@@ -6345,7 +6337,7 @@ function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc
63456337
}
63466338

63476339
if ($replaceMethodSynopses || $verifyManual) {
6348-
$methodSynopses = replaceMethodSynopses($manualTarget, $funcMap, $aliasMap, $verifyManual, $methodSynopsisWarnings, $undocumentedFuncMap);
6340+
$methodSynopses = replaceMethodSynopses($manualTarget, $funcMap, $verifyManual, $methodSynopsisWarnings, $undocumentedFuncMap);
63496341

63506342
if ($replaceMethodSynopses) {
63516343
foreach ($methodSynopses as $filename => $content) {

0 commit comments

Comments
 (0)