/** * Tries to find the right class to call * * @param string $callingClass The original class * @param string $method The method * @param array $arguments The arguments * * @return string The correct class */ protected static function computeClassToCall($callingClass, $method, $arguments) { if (!StringMethods::find($callingClass, 'Underscore\\Types')) { if (isset($arguments[0])) { $callingClass = Dispatch::toClass($arguments[0]); } else { $callingClass = Method::findInClasses($callingClass, $method); } } return $callingClass; }
public function testCanFindMethodsInClasses() { $method = Method::findInClasses('\\Underscore\\Underscore', 'range'); $this->assertEquals('\\Underscore\\Types\\Arrays', $method); }