public function getMethod($name) {
    $methods = $this
      ->getMethods()
      ->filter(function (InterfaceMethodNode $method) use ($name) {
        return $method->getName()->getText() === $name;
      });
    return $methods->isEmpty() ? NULL : $methods[0];
  }
public function getMethod($name) {
    $methods = $this
      ->getMethods()
      ->filter(function (InterfaceMethodNode $method) use ($name) {
        return $method->getName()->getText() === $name;
      });
    return $methods->isEmpty() ? NULL : $methods[0];
  }
public function getMethod ( $ name ) { $ methods = $ this -> getMethods ( ) -> filter ( function ( InterfaceMethodNode $ method ) use ( $ name ) { return $ method -> getName ( ) -> getText ( ) === $ name ; } ) ; return $ methods -> isEmpty ( ) ? NULL : $ methods [ 0 ] ; }
Returns a method by name, if it exists.

@param string $name
The method name.

@return InterfaceMethodNode|NULL
Returns a method by name if it exists .