コード例 #1
0
/**
 * Runs pull request validation
 *
 * @param Client $client    GitHub client
 * @param Config $config    Configuration
 * @param array  $arguments Command line arguments
 *
 * @return int              Exit code
 * @throws \InvalidArgumentException
 */
function run(Client $client, Config $config, array $arguments)
{
    $config = $config->getParams();
    $client->authenticate($config['token'], null, Client::AUTH_URL_TOKEN);
    $changeset = new Changeset($client, array_shift($arguments), array_shift($arguments), array_shift($arguments));
    $runner = new Runner();
    return $runner->run($changeset, $arguments);
}
コード例 #2
0
 /**
  * Runs CodeSniffer in pre-commit mode against specified directory
  *
  * @param string $cwd       Current directory
  * @param array  $arguments PHP_CodeSniffer command line arguments
  *
  * @return int
  */
 public function run($cwd, $arguments)
 {
     $changeset = new Changeset($cwd);
     return $this->runner->run($changeset, $arguments);
 }