Skip to content

Commit ffb9c5e

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 626d585 commit ffb9c5e

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

build/gen_stub.php

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,11 +1657,9 @@ private function generateRefSect1(DOMDocument $doc, string $role): DOMElement {
16571657
}
16581658

16591659
/**
1660-
* @param array<string, FuncInfo> $funcMap
1661-
* @param array<string, FuncInfo> $aliasMap
16621660
* @throws Exception
16631661
*/
1664-
public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?string {
1662+
public function getMethodSynopsisDocument(): ?string {
16651663
$REFSEC1_SEPERATOR = "\n\n ";
16661664

16671665
$doc = new DOMDocument("1.0", "utf-8");
@@ -1706,7 +1704,7 @@ public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?str
17061704
/* Creation of <refsect1 role="description"> */
17071705
$descriptionRefSec = $this->generateRefSect1($doc, 'description');
17081706

1709-
$methodSynopsis = $this->getMethodSynopsisElement($funcMap, $aliasMap, $doc);
1707+
$methodSynopsis = $this->getMethodSynopsisElement($doc);
17101708
if (!$methodSynopsis) {
17111709
return null;
17121710
}
@@ -2090,11 +2088,9 @@ private function getExampleSection(DOMDocument $doc, string $id): DOMElement {
20902088
}
20912089

20922090
/**
2093-
* @param array<string, FuncInfo> $funcMap
2094-
* @param array<string, FuncInfo> $aliasMap
20952091
* @throws Exception
20962092
*/
2097-
public function getMethodSynopsisElement(array $funcMap, array $aliasMap, DOMDocument $doc): ?DOMElement {
2093+
public function getMethodSynopsisElement(DOMDocument $doc): ?DOMElement {
20982094
if ($this->hasParamWithUnknownDefaultValue()) {
20992095
return null;
21002096
}
@@ -2746,7 +2742,7 @@ public function getDeclaration(array $allConstInfos): string
27462742
if ($this->name->isClassConst()) {
27472743
$code .= $this->getClassConstDeclaration($value, $allConstInfos);
27482744
} else {
2749-
$code .= $this->getGlobalConstDeclaration($value, $allConstInfos);
2745+
$code .= $this->getGlobalConstDeclaration($value);
27502746
}
27512747
$code .= $this->getValueAssertion($value);
27522748

@@ -2757,8 +2753,7 @@ public function getDeclaration(array $allConstInfos): string
27572753
return $code;
27582754
}
27592755

2760-
/** @param array<string, ConstInfo> $allConstInfos */
2761-
private function getGlobalConstDeclaration(EvaluatedValue $value, array $allConstInfos): string
2756+
private function getGlobalConstDeclaration(EvaluatedValue $value): string
27622757
{
27632758
$constName = str_replace('\\', '\\\\', $this->name->__toString());
27642759
$constValue = $value->value;
@@ -5756,14 +5751,13 @@ function getReplacedSynopsisXml(string $xml): string
57565751

57575752
/**
57585753
* @param array<string, FuncInfo> $funcMap
5759-
* @param array<string, FuncInfo> $aliasMap
57605754
* @return array<string, string>
57615755
*/
5762-
function generateMethodSynopses(array $funcMap, array $aliasMap): array {
5756+
function generateMethodSynopses(array $funcMap): array {
57635757
$result = [];
57645758

57655759
foreach ($funcMap as $funcInfo) {
5766-
$methodSynopsis = $funcInfo->getMethodSynopsisDocument($funcMap, $aliasMap);
5760+
$methodSynopsis = $funcInfo->getMethodSynopsisDocument();
57675761
if ($methodSynopsis !== null) {
57685762
$result[$funcInfo->name->getMethodSynopsisFilename() . ".xml"] = $methodSynopsis;
57695763
}
@@ -5774,15 +5768,13 @@ function generateMethodSynopses(array $funcMap, array $aliasMap): array {
57745768

57755769
/**
57765770
* @param array<string, FuncInfo> $funcMap
5777-
* @param array<string, FuncInfo> $aliasMap
57785771
* @param array<int, string> $methodSynopsisWarnings
57795772
* @param array<string, FuncInfo> $undocumentedFuncMap
57805773
* @return array<string, string>
57815774
*/
57825775
function replaceMethodSynopses(
57835776
string $targetDirectory,
57845777
array $funcMap,
5785-
array $aliasMap,
57865778
bool $isVerifyManual,
57875779
array &$methodSynopsisWarnings,
57885780
array &$undocumentedFuncMap
@@ -5881,7 +5873,7 @@ function replaceMethodSynopses(
58815873
$funcInfo = $funcMap[$funcName];
58825874
$documentedFuncMap[$funcInfo->name->__toString()] = $funcInfo->name->__toString();
58835875

5884-
$newMethodSynopsis = $funcInfo->getMethodSynopsisElement($funcMap, $aliasMap, $doc);
5876+
$newMethodSynopsis = $funcInfo->getMethodSynopsisElement($doc);
58855877
if ($newMethodSynopsis === null) {
58865878
continue;
58875879
}
@@ -6299,7 +6291,7 @@ function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc
62996291
}
63006292

63016293
if ($generateMethodSynopses) {
6302-
$methodSynopses = generateMethodSynopses($funcMap, $aliasMap);
6294+
$methodSynopses = generateMethodSynopses($funcMap);
63036295
if (!file_exists($manualTarget)) {
63046296
mkdir($manualTarget);
63056297
}
@@ -6318,7 +6310,7 @@ function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc
63186310
}
63196311

63206312
if ($replaceMethodSynopses || $verifyManual) {
6321-
$methodSynopses = replaceMethodSynopses($manualTarget, $funcMap, $aliasMap, $verifyManual, $methodSynopsisWarnings, $undocumentedFuncMap);
6313+
$methodSynopses = replaceMethodSynopses($manualTarget, $funcMap, $verifyManual, $methodSynopsisWarnings, $undocumentedFuncMap);
63226314

63236315
if ($replaceMethodSynopses) {
63246316
foreach ($methodSynopses as $filename => $content) {

0 commit comments

Comments
 (0)