Skip to content

Commit 4d230d2

Browse files
committed
Request->validate() now accepts variable length list of parameters
1 parent 6ca44f1 commit 4d230d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Omnipay/Common/Message/AbstractRequest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ public function setTestMode($value)
115115
* This method is called internally by gateways to avoid wasting time with an API call
116116
* when the request is clearly invalid.
117117
*
118-
* @param array an array of required parameters
118+
* @param string a variable length list of required parameters
119119
*/
120-
public function validate(array $required)
120+
public function validate()
121121
{
122-
foreach ($required as $key) {
122+
foreach (func_get_args() as $key) {
123123
$value = $this->parameters->get($key);
124124
if (empty($value)) {
125125
throw new InvalidRequestException("The $key parameter is required");

0 commit comments

Comments
 (0)