/** * @param $path * @param $requestType * @return RouteRule */ private function findRouteRule($path, $requestType) { return Arrays::find(Route::getRoutes(), function (RouteRule $rule) use($path, $requestType) { return $rule->matches($path, $requestType); }); }
/** * @test */ public function findShouldReturnNullWhenElementWasNotFound() { //when $value = Arrays::find(array('a', 'c'), function ($element) { return $element == 'b'; }); //then $this->assertNull($value); }
/** * @return Parameter|null */ public function getHeaderParameter() { return Arrays::find($this->parameters, function (Parameter $parameter) { return $parameter->isHeader(); }); }
protected function _wasCalled($name, $arguments) { return Arrays::find($this->mock->_called_methods, new MethodCallMatcher($name, $arguments)); }