public function getProperty($name) {
    $name = ltrim($name, '$');

    $properties = $this
      ->getProperties()
      ->filter(function (ClassMemberNode $property) use ($name) {
        return ltrim($property->getName(), '$') === $name;
      });
    return $properties->isEmpty() ? NULL : $properties[0];
  }
public function getProperty($name) {
    $name = ltrim($name, '$');

    $properties = $this
      ->getProperties()
      ->filter(function (ClassMemberNode $property) use ($name) {
        return ltrim($property->getName(), '$') === $name;
      });
    return $properties->isEmpty() ? NULL : $properties[0];
  }
public function getProperty ( $ name ) { $ name = ltrim ( $ name , '$' ) ; $ properties = $ this -> getProperties ( ) -> filter ( function ( ClassMemberNode $ property ) use ( $ name ) { return ltrim ( $ property -> getName ( ) , '$' ) === $ name ; } ) ; return $ properties -> isEmpty ( ) ? NULL : $ properties [ 0 ] ; }
Returns a property by name, if it exists.

@param string $name
The property name, with or without the $.

@return ClassMemberNode|NULL
Returns a property by name if it exists .