/*
* This file is part of Psy Shell.
*
- * (c) 2012-2017 Justin Hileman
+ * (c) 2012-2018 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
class ObjectMethodDefaultParametersMatcher extends AbstractDefaultParametersMatcher
{
- public function getMatches(array $tokens, array $info = array())
+ public function getMatches(array $tokens, array $info = [])
{
$openBracket = array_pop($tokens);
$functionName = array_pop($tokens);
$objectToken = array_pop($tokens);
if (!is_array($objectToken)) {
- return array();
+ return [];
}
$objectName = str_replace('$', '', $objectToken[1]);
try {
$object = $this->getVariable($objectName);
$reflection = new \ReflectionObject($object);
- } catch (InvalidArgumentException $e) {
- return array();
+ } catch (\InvalidArgumentException $e) {
+ return [];
} catch (\ReflectionException $e) {
- return array();
+ return [];
}
$methods = $reflection->getMethods();
}
}
- return array();
+ return [];
}
public function hasMatched(array $tokens)