original_string: protected function findRelationMethodCall($methodBody)
      {
          $methodBody = trim(preg_replace('#\\n\\s*#', '', $methodBody));
  
          // find the last potential relation method opener and position
          $foundOpener  = null;
          $lastPosition = -1;
  
          foreach ($this->relationMethodCallOpeners() as $opener) {
  
              if (    false === ($pos = strrpos($methodBody, $opener))
                  ||  $pos <= $lastPosition
              ) {
                  continue;
              }
  
              $foundOpener  = $opener;
              $lastPosition = $pos;
          }
  
  
          if ( ! $foundOpener || $lastPosition < 0) {
              return false;
          }
  
          // todo further checks to prevent false positives
          // use https://github.com/nikic/PHP-Parser/
  
          return $foundOpener;
      }
code: protected function findRelationMethodCall($methodBody)
      {
          $methodBody = trim(preg_replace('#\\n\\s*#', '', $methodBody));
  
          // find the last potential relation method opener and position
          $foundOpener  = null;
          $lastPosition = -1;
  
          foreach ($this->relationMethodCallOpeners() as $opener) {
  
              if (    false === ($pos = strrpos($methodBody, $opener))
                  ||  $pos <= $lastPosition
              ) {
                  continue;
              }
  
              $foundOpener  = $opener;
              $lastPosition = $pos;
          }
  
  
          if ( ! $foundOpener || $lastPosition < 0) {
              return false;
          }
  
          // todo further checks to prevent false positives
          // use https://github.com/nikic/PHP-Parser/
  
          return $foundOpener;
      }
code_tokens: protected function findRelationMethodCall ( $ methodBody ) { $ methodBody = trim ( preg_replace ( '#\\n\\s*#' , '' , $ methodBody ) ) ; // find the last potential relation method opener and position $ foundOpener = null ; $ lastPosition = - 1 ; foreach ( $ this -> relationMethodCallOpeners ( ) as $ opener ) { if ( false === ( $ pos = strrpos ( $ methodBody , $ opener ) ) || $ pos <= $ lastPosition ) { continue ; } $ foundOpener = $ opener ; $ lastPosition = $ pos ; } if ( ! $ foundOpener || $ lastPosition < 0 ) { return false ; } // todo further checks to prevent false positives // use https://github.com/nikic/PHP-Parser/ return $ foundOpener ; }
docstring: Attempts to find the relation method call in a string method body.
  
  This looks for $this->belongsTo(...) and the like.
  
  @param string $methodBody
  @return string|false
docstring_tokens: Attempts to find the relation method call in a string method body .