forked from EdgedesignCZ/phpqa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpqa
More file actions
executable file
·34 lines (30 loc) · 955 Bytes
/
phpqa
File metadata and controls
executable file
·34 lines (30 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env php
<?php
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
define('COMPOSER_BINARY_DIR', __DIR__ . "/vendor/bin/");
require_once __DIR__ . '/vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/../../autoload.php')) {
define('COMPOSER_BINARY_DIR', __DIR__ . "/../../bin/");
require_once __DIR__ . '/../../autoload.php';
}
/**
* RoboFile is in phpqa repository, but analysis is runned in cwd.
* Robo\Runner:loadRoboFile calls chdir when option --load-from=__DIR__
*/
class QARunner extends \Robo\Runner
{
protected function loadRoboFile()
{
require_once __DIR__ . "/RoboFile.php";
return true;
}
}
// IO
$isNotToolsCommand = !(count($argv) >= 2 && $argv[1] == 'tools');
if ($isNotToolsCommand) {
// add robo command between the application name and the arguments
array_splice($argv, 1, 0, 'ci');
}
// run robo
$robo = new QARunner('Edge\QA\RoboFile');
$robo->execute($argv);