Skip to content

Commit 282c4f6

Browse files
committed
Terminology improvements.
1 parent 4136098 commit 282c4f6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$httpReturnType = 'array{headers:Requests_Utility_CaseInsensitiveDictionary,body:string,response:array{code:int,message:string},cookies:array<int,WP_HTTP_Cookie>,filename:string|null,http_response:WP_HTTP_Requests_Response}|WP_Error';
44

55
/**
6-
* This array is in the same format as the stubs array in PHPStan:
6+
* This array is in the same format as the function map array in PHPStan:
77
*
88
* '<function_name>' => ['<return_type>, '<arg_name>'=>'<arg_type>']
99
*

visitor.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/**
2323
* @var array<string,array<int|string,string>>
2424
*/
25-
private $additionalParams;
25+
private $functionMap;
2626

2727
/**
2828
* @var string
@@ -137,23 +137,23 @@ private function addArrayHashNotation(Doc $docComment): ?Doc
137137

138138
private function addAdditionalParams(Doc $docComment): ?Doc
139139
{
140-
if (! isset($this->additionalParams)) {
141-
$this->additionalParams = require __DIR__ . '/additionalParams.php';
140+
if (! isset($this->functionMap)) {
141+
$this->functionMap = require __DIR__ . '/functionMap.php';
142142
}
143143

144-
if (! isset($this->additionalParams[$this->currentSymbolName])) {
144+
if (! isset($this->functionMap[$this->currentSymbolName])) {
145145
return null;
146146
}
147147

148-
$params = $this->additionalParams[$this->currentSymbolName];
149-
$returnType = array_shift($params);
148+
$parameters = $this->functionMap[$this->currentSymbolName];
149+
$returnType = array_shift($parameters);
150150
$additions = [];
151151

152-
foreach ($params as $param => $paramType) {
152+
foreach ($parameters as $paramName => $paramType) {
153153
$additions[] = sprintf(
154154
'@phpstan-param %s $%s',
155155
$paramType,
156-
$param
156+
$paramName
157157
);
158158
}
159159

0 commit comments

Comments
 (0)