$array = array('id' => 1, 'name' => 'john'); $return = Arrays::keyExists($array, 'name');
true
/** * @test */ public function shouldCheckIsKeyExists() { //given $array = array('id' => 1, 'name' => 'john'); //when $return = Arrays::keyExists($array, 'name'); //then $this->assertTrue($return); }
private static function existRouteRule($methods, $uri) { $routeKeys = Route::$routeKeys; return Arrays::any($methods, function ($method) use($routeKeys, $uri) { return Arrays::keyExists($routeKeys, $method . $uri); }); }