bootstrap.php 535 Bytes
Newer Older
1 2 3 4
<?php

declare(strict_types=1);

Sergei Morozov's avatar
Sergei Morozov committed
5
(static function () : void {
6 7 8 9 10 11 12 13
    $pos = array_search('--coverage-clover', $_SERVER['argv'], true);

    if ($pos === false) {
        return;
    }

    $file = $_SERVER['argv'][$pos + 1];

Sergei Morozov's avatar
Sergei Morozov committed
14
    register_shutdown_function(static function () use ($file) : void {
15 16 17 18 19 20
        $cmd = 'wget https://github.com/scrutinizer-ci/ocular/releases/download/1.5.2/ocular.phar'
            . ' && php ocular.phar code-coverage:upload --format=php-clover ' . escapeshellarg($file);

        passthru($cmd);
    });
})();