Skip to content

Commit c965643

Browse files
committed
fix some more bugs detected by scrutinizer
1 parent 9dc82e0 commit c965643

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/Trello/Api/AbstractApi.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ public function __call($method, $arguments)
5959
{
6060
if (isset($this->fields) && substr($method, 0, 3) === 'get') {
6161
$property = lcfirst(substr($method, 3));
62-
if (in_array($property, $this->fields)) {
63-
$field = reset($arguments);
64-
65-
return $this->getField($field);
62+
if (in_array($property, $this->fields) && count($arguments) === 2) {
63+
return $this->getField($arguments[0], $arguments[1]);
6664
}
6765
}
6866

@@ -298,8 +296,8 @@ protected function validateRequiredParameters(array $required, array $params)
298296
* Validate allowed parameters array
299297
* Checks whether the passed parameters are allowed
300298
*
301-
* @param array $allowed allowed properties
302-
* @param array $params array to check
299+
* @param array $allowed allowed properties
300+
* @param array|string $params array to check
303301
*
304302
* @return array array of validated parameters
305303
*

0 commit comments

Comments
 (0)