Skip to content

Commit 3ad10f8

Browse files
Optimized the parameters of method __call() to make them more standardized. (#7637)
Co-authored-by: 李铭昕 <[email protected]>
1 parent 022662a commit 3ad10f8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Validator.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,22 +189,20 @@ public function __construct(
189189
/**
190190
* Handle dynamic calls to class methods.
191191
*
192-
* @param mixed $method
193-
* @param mixed $parameters
194192
* @throws BadMethodCallException when method does not exist
195193
*/
196-
public function __call($method, $parameters)
194+
public function __call(string $name, array $arguments): mixed
197195
{
198-
$rule = StrCache::snake(substr($method, 8));
196+
$rule = StrCache::snake(substr($name, 8));
199197

200198
if (isset($this->extensions[$rule])) {
201-
return $this->callExtension($rule, $parameters);
199+
return $this->callExtension($rule, $arguments);
202200
}
203201

204202
throw new BadMethodCallException(sprintf(
205203
'Method %s::%s does not exist.',
206204
static::class,
207-
$method
205+
$name
208206
));
209207
}
210208

0 commit comments

Comments
 (0)