original_string: protected function extractCallParametersFromMagicCall($method, array $arguments)
      {
          if (count($arguments) < 1) {
              throw new \InvalidArgumentException(sprintf(
                  '"%s" must be called with at least one argument denoting the path', $method
              ));
          }
  
          $path   = array_shift($arguments);
          $args   = array();
          $stdIn  = null;
  
          if (count($arguments) > 0) {
              $args   = array_shift($arguments);
              if (!is_array($args)) {
                  $args   = array($args);
              }
  
              if (count($arguments) > 0) {
                  $stdIn  = array_shift($arguments);
                  if (!is_string($stdIn)) {
                      $stdIn   = null;
                  }
              }
          }
          return array($path, $method, $args, $stdIn);
      }
code: protected function extractCallParametersFromMagicCall($method, array $arguments)
      {
          if (count($arguments) < 1) {
              throw new \InvalidArgumentException(sprintf(
                  '"%s" must be called with at least one argument denoting the path', $method
              ));
          }
  
          $path   = array_shift($arguments);
          $args   = array();
          $stdIn  = null;
  
          if (count($arguments) > 0) {
              $args   = array_shift($arguments);
              if (!is_array($args)) {
                  $args   = array($args);
              }
  
              if (count($arguments) > 0) {
                  $stdIn  = array_shift($arguments);
                  if (!is_string($stdIn)) {
                      $stdIn   = null;
                  }
              }
          }
          return array($path, $method, $args, $stdIn);
      }
code_tokens: protected function extractCallParametersFromMagicCall ( $ method , array $ arguments ) { if ( count ( $ arguments ) < 1 ) { throw new \ InvalidArgumentException ( sprintf ( '"%s" must be called with at least one argument denoting the path' , $ method ) ) ; } $ path = array_shift ( $ arguments ) ; $ args = array ( ) ; $ stdIn = null ; if ( count ( $ arguments ) > 0 ) { $ args = array_shift ( $ arguments ) ; if ( ! is_array ( $ args ) ) { $ args = array ( $ args ) ; } if ( count ( $ arguments ) > 0 ) { $ stdIn = array_shift ( $ arguments ) ; if ( ! is_string ( $ stdIn ) ) { $ stdIn = null ; } } } return array ( $ path , $ method , $ args , $ stdIn ) ; }
docstring: Extracts the CLI call parameters from the arguments to a magic method call
  
  @param   string  $method             The VCS command, e.g. show, commit or add
  @param   array   $arguments          The command arguments with the path to the VCS
  repository being the first argument
  @return  array                       An array with (path, method, args, stdIn)
  @throws \InvalidArgumentException    If the method is called with less than one argument
docstring_tokens: Extracts the CLI call parameters from the arguments to a magic method call