original_string: public function getStatus()
      {
          /** @var $result CallResult */
          $result = $this->getGit()->{'status'}($this->getRepositoryPath(), array(
              '--short'
          ));
          $result->assertSuccess(
              sprintf('Cannot retrieve status from "%s"', $this->getRepositoryPath())
          );
  
          $output = rtrim($result->getStdOut());
          if (empty($output)) {
              return array();
          }
  
          $status = array_map(function($f) {
              $line   = rtrim($f);
              $parts  = array();
              preg_match('/^(?<x>.)(?<y>.)\s(?<f>.+?)(?:\s->\s(?<f2>.+))?$/', $line, $parts);
  
              $status = array(
                  'file'      => $parts['f'],
                  'x'         => trim($parts['x']),
                  'y'         => trim($parts['y']),
                  'renamed'   => (array_key_exists('f2', $parts)) ? $parts['f2'] : null
              );
              return $status;
          }, explode("\n", $output));
          return $status;
      }
code: public function getStatus()
      {
          /** @var $result CallResult */
          $result = $this->getGit()->{'status'}($this->getRepositoryPath(), array(
              '--short'
          ));
          $result->assertSuccess(
              sprintf('Cannot retrieve status from "%s"', $this->getRepositoryPath())
          );
  
          $output = rtrim($result->getStdOut());
          if (empty($output)) {
              return array();
          }
  
          $status = array_map(function($f) {
              $line   = rtrim($f);
              $parts  = array();
              preg_match('/^(?<x>.)(?<y>.)\s(?<f>.+?)(?:\s->\s(?<f2>.+))?$/', $line, $parts);
  
              $status = array(
                  'file'      => $parts['f'],
                  'x'         => trim($parts['x']),
                  'y'         => trim($parts['y']),
                  'renamed'   => (array_key_exists('f2', $parts)) ? $parts['f2'] : null
              );
              return $status;
          }, explode("\n", $output));
          return $status;
      }
code_tokens: public function getStatus ( ) { /** @var $result CallResult */ $ result = $ this -> getGit ( ) -> { 'status' } ( $ this -> getRepositoryPath ( ) , array ( '--short' ) ) ; $ result -> assertSuccess ( sprintf ( 'Cannot retrieve status from "%s"' , $ this -> getRepositoryPath ( ) ) ) ; $ output = rtrim ( $ result -> getStdOut ( ) ) ; if ( empty ( $ output ) ) { return array ( ) ; } $ status = array_map ( function ( $ f ) { $ line = rtrim ( $ f ) ; $ parts = array ( ) ; preg_match ( '/^(?<x>.)(?<y>.)\s(?<f>.+?)(?:\s->\s(?<f2>.+))?$/' , $ line , $ parts ) ; $ status = array ( 'file' => $ parts [ 'f' ] , 'x' => trim ( $ parts [ 'x' ] ) , 'y' => trim ( $ parts [ 'y' ] ) , 'renamed' => ( array_key_exists ( 'f2' , $ parts ) ) ? $ parts [ 'f2' ] : null ) ; return $ status ; } , explode ( "\n" , $ output ) ) ; return $ status ; }
docstring: Returns the current status of the working directory and the staging area
  
  The returned array structure is
  array(
  'file'      => '...',
  'x'         => '.',
  'y'         => '.',
  'renamed'   => null/'...'
  )
  
  @return  array
docstring_tokens: Returns the current status of the working directory and the staging area