original_string: public function findFirstPropertyFetchAssignment(array $statements, $variable, $property, $notFoundError = null)
      {
          foreach ($this->filterAssignments($statements) as $assign) {
              if (!$assign->var instanceof PropertyFetch) {
                  continue;
              }
              if ($assign->var->name !== $property) {
                  continue;
              }
              $var = $assign->var->var;
              if ($var instanceof Variable && $var->name === $variable) {
                  return $assign;
              }
          }
  
          throw new \RuntimeException($notFoundError ?: sprintf('Variable assignment $%s->%s not found', $variable, $property));
      }
code: public function findFirstPropertyFetchAssignment(array $statements, $variable, $property, $notFoundError = null)
      {
          foreach ($this->filterAssignments($statements) as $assign) {
              if (!$assign->var instanceof PropertyFetch) {
                  continue;
              }
              if ($assign->var->name !== $property) {
                  continue;
              }
              $var = $assign->var->var;
              if ($var instanceof Variable && $var->name === $variable) {
                  return $assign;
              }
          }
  
          throw new \RuntimeException($notFoundError ?: sprintf('Variable assignment $%s->%s not found', $variable, $property));
      }
code_tokens: public function findFirstPropertyFetchAssignment ( array $ statements , $ variable , $ property , $ notFoundError = null ) { foreach ( $ this -> filterAssignments ( $ statements ) as $ assign ) { if ( ! $ assign -> var instanceof PropertyFetch ) { continue ; } if ( $ assign -> var -> name !== $ property ) { continue ; } $ var = $ assign -> var -> var ; if ( $ var instanceof Variable && $ var -> name === $ variable ) { return $ assign ; } } throw new \ RuntimeException ( $ notFoundError ? : sprintf ( 'Variable assignment $%s->%s not found' , $ variable , $ property ) ) ; }
docstring: Find first property fetch assignment with a given name.
  
  EG: Find $foo->bar = something.
  
  @param array       $statements    PHP statements
  @param string      $variable      The variable name, EG: foo in $foo->bar
  @param string      $property      The property name, EG: bar in $foo->bar
  @param string|null $notFoundError Use this error when not found
  
  @return Assign
docstring_tokens: Find first property fetch assignment with a given name .