mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
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`
This commit is contained in:
parent
4861391501
commit
722eba20ae
1 changed files with 10 additions and 18 deletions
|
@ -1684,11 +1684,9 @@ class FuncInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<string, FuncInfo> $funcMap
|
|
||||||
* @param array<string, FuncInfo> $aliasMap
|
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?string {
|
public function getMethodSynopsisDocument(): ?string {
|
||||||
$REFSEC1_SEPERATOR = "\n\n ";
|
$REFSEC1_SEPERATOR = "\n\n ";
|
||||||
|
|
||||||
$doc = new DOMDocument("1.0", "utf-8");
|
$doc = new DOMDocument("1.0", "utf-8");
|
||||||
|
@ -1733,7 +1731,7 @@ class FuncInfo {
|
||||||
/* Creation of <refsect1 role="description"> */
|
/* Creation of <refsect1 role="description"> */
|
||||||
$descriptionRefSec = $this->generateRefSect1($doc, 'description');
|
$descriptionRefSec = $this->generateRefSect1($doc, 'description');
|
||||||
|
|
||||||
$methodSynopsis = $this->getMethodSynopsisElement($funcMap, $aliasMap, $doc);
|
$methodSynopsis = $this->getMethodSynopsisElement($doc);
|
||||||
if (!$methodSynopsis) {
|
if (!$methodSynopsis) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -2117,11 +2115,9 @@ OUPUT_EXAMPLE
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<string, FuncInfo> $funcMap
|
|
||||||
* @param array<string, FuncInfo> $aliasMap
|
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function getMethodSynopsisElement(array $funcMap, array $aliasMap, DOMDocument $doc): ?DOMElement {
|
public function getMethodSynopsisElement(DOMDocument $doc): ?DOMElement {
|
||||||
if ($this->hasParamWithUnknownDefaultValue()) {
|
if ($this->hasParamWithUnknownDefaultValue()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -2773,7 +2769,7 @@ class ConstInfo extends VariableLike
|
||||||
if ($this->name->isClassConst()) {
|
if ($this->name->isClassConst()) {
|
||||||
$code .= $this->getClassConstDeclaration($value, $allConstInfos);
|
$code .= $this->getClassConstDeclaration($value, $allConstInfos);
|
||||||
} else {
|
} else {
|
||||||
$code .= $this->getGlobalConstDeclaration($value, $allConstInfos);
|
$code .= $this->getGlobalConstDeclaration($value);
|
||||||
}
|
}
|
||||||
$code .= $this->getValueAssertion($value);
|
$code .= $this->getValueAssertion($value);
|
||||||
|
|
||||||
|
@ -2784,8 +2780,7 @@ class ConstInfo extends VariableLike
|
||||||
return $code;
|
return $code;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param array<string, ConstInfo> $allConstInfos */
|
private function getGlobalConstDeclaration(EvaluatedValue $value): string
|
||||||
private function getGlobalConstDeclaration(EvaluatedValue $value, array $allConstInfos): string
|
|
||||||
{
|
{
|
||||||
$constName = str_replace('\\', '\\\\', $this->name->__toString());
|
$constName = str_replace('\\', '\\\\', $this->name->__toString());
|
||||||
$constValue = $value->value;
|
$constValue = $value->value;
|
||||||
|
@ -5783,14 +5778,13 @@ function getReplacedSynopsisXml(string $xml): string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<string, FuncInfo> $funcMap
|
* @param array<string, FuncInfo> $funcMap
|
||||||
* @param array<string, FuncInfo> $aliasMap
|
|
||||||
* @return array<string, string>
|
* @return array<string, string>
|
||||||
*/
|
*/
|
||||||
function generateMethodSynopses(array $funcMap, array $aliasMap): array {
|
function generateMethodSynopses(array $funcMap): array {
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
foreach ($funcMap as $funcInfo) {
|
foreach ($funcMap as $funcInfo) {
|
||||||
$methodSynopsis = $funcInfo->getMethodSynopsisDocument($funcMap, $aliasMap);
|
$methodSynopsis = $funcInfo->getMethodSynopsisDocument();
|
||||||
if ($methodSynopsis !== null) {
|
if ($methodSynopsis !== null) {
|
||||||
$result[$funcInfo->name->getMethodSynopsisFilename() . ".xml"] = $methodSynopsis;
|
$result[$funcInfo->name->getMethodSynopsisFilename() . ".xml"] = $methodSynopsis;
|
||||||
}
|
}
|
||||||
|
@ -5801,7 +5795,6 @@ function generateMethodSynopses(array $funcMap, array $aliasMap): array {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<string, FuncInfo> $funcMap
|
* @param array<string, FuncInfo> $funcMap
|
||||||
* @param array<string, FuncInfo> $aliasMap
|
|
||||||
* @param array<int, string> $methodSynopsisWarnings
|
* @param array<int, string> $methodSynopsisWarnings
|
||||||
* @param array<string, FuncInfo> $undocumentedFuncMap
|
* @param array<string, FuncInfo> $undocumentedFuncMap
|
||||||
* @return array<string, string>
|
* @return array<string, string>
|
||||||
|
@ -5809,7 +5802,6 @@ function generateMethodSynopses(array $funcMap, array $aliasMap): array {
|
||||||
function replaceMethodSynopses(
|
function replaceMethodSynopses(
|
||||||
string $targetDirectory,
|
string $targetDirectory,
|
||||||
array $funcMap,
|
array $funcMap,
|
||||||
array $aliasMap,
|
|
||||||
bool $isVerifyManual,
|
bool $isVerifyManual,
|
||||||
array &$methodSynopsisWarnings,
|
array &$methodSynopsisWarnings,
|
||||||
array &$undocumentedFuncMap
|
array &$undocumentedFuncMap
|
||||||
|
@ -5908,7 +5900,7 @@ function replaceMethodSynopses(
|
||||||
$funcInfo = $funcMap[$funcName];
|
$funcInfo = $funcMap[$funcName];
|
||||||
$documentedFuncMap[$funcInfo->name->__toString()] = $funcInfo->name->__toString();
|
$documentedFuncMap[$funcInfo->name->__toString()] = $funcInfo->name->__toString();
|
||||||
|
|
||||||
$newMethodSynopsis = $funcInfo->getMethodSynopsisElement($funcMap, $aliasMap, $doc);
|
$newMethodSynopsis = $funcInfo->getMethodSynopsisElement($doc);
|
||||||
if ($newMethodSynopsis === null) {
|
if ($newMethodSynopsis === null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -6326,7 +6318,7 @@ if ($replaceClassSynopses || $verifyManual) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($generateMethodSynopses) {
|
if ($generateMethodSynopses) {
|
||||||
$methodSynopses = generateMethodSynopses($funcMap, $aliasMap);
|
$methodSynopses = generateMethodSynopses($funcMap);
|
||||||
if (!file_exists($manualTarget)) {
|
if (!file_exists($manualTarget)) {
|
||||||
mkdir($manualTarget);
|
mkdir($manualTarget);
|
||||||
}
|
}
|
||||||
|
@ -6345,7 +6337,7 @@ if ($generateMethodSynopses) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($replaceMethodSynopses || $verifyManual) {
|
if ($replaceMethodSynopses || $verifyManual) {
|
||||||
$methodSynopses = replaceMethodSynopses($manualTarget, $funcMap, $aliasMap, $verifyManual, $methodSynopsisWarnings, $undocumentedFuncMap);
|
$methodSynopses = replaceMethodSynopses($manualTarget, $funcMap, $verifyManual, $methodSynopsisWarnings, $undocumentedFuncMap);
|
||||||
|
|
||||||
if ($replaceMethodSynopses) {
|
if ($replaceMethodSynopses) {
|
||||||
foreach ($methodSynopses as $filename => $content) {
|
foreach ($methodSynopses as $filename => $content) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue