kylekatarnls / multi-tester

@@ -76,7 +76,7 @@
Loading
76 76
        $arguments = array_filter($arguments, function ($argument) {
77 77
            return $argument !== '--verbose' && $argument !== '-v';
78 78
        });
79 -
        $this->configFile = isset($arguments[1]) ? $arguments[1] : $multiTester->getMultiTesterFile();
79 +
        $this->configFile = $arguments[1] ?? $multiTester->getMultiTesterFile();
80 80
        $this->addProjects();
81 81
82 82
        if (!file_exists($this->configFile)) {
@@ -157,7 +157,7 @@
Loading
157 157
            unset($config['config']);
158 158
        }
159 159
160 -
        $this->projects = isset($config['projects']) ? $config['projects'] : $config;
160 +
        $this->projects = $config['projects'] ?? $config;
161 161
    }
162 162
163 163
    /**
@@ -168,10 +168,13 @@
Loading
168 168
        if (!file_exists($this->composerFile)) {
169 169
            throw new MultiTesterException("Set the 'directory' entry to a path containing a composer.json file.");
170 170
        }
171 +
171 172
        $this->data = new File($this->composerFile);
173 +
172 174
        if (!isset($this->data['name'])) {
173 175
            throw new MultiTesterException("The composer.json file must contains a 'name' entry.");
174 176
        }
177 +
175 178
        $this->packageName = $this->data['name'];
176 179
    }
177 180
}

@@ -17,6 +17,7 @@
Loading
17 17
    use StorageDirectory;
18 18
    use ProcStreams;
19 19
    use Verbose;
20 +
20 21
    /**
21 22
     * @var array|File Composer package settings cache.
22 23
     */
@@ -29,7 +30,7 @@
Loading
29 30
30 31
    public function __construct($storageDirectory = null)
31 32
    {
32 -
        $this->storageDirectory = $storageDirectory ?? sys_get_temp_dir();
33 +
        $this->storageDirectory = $storageDirectory ?: sys_get_temp_dir();
33 34
    }
34 35
35 36
    public function exec($command, $quiet = false)
@@ -43,9 +44,7 @@
Loading
43 44
    {
44 45
        if (!isset($this->composerSettings[$package])) {
45 46
            $this->composerSettings[$package] = new File("https://repo.packagist.org/p/$package.json");
46 -
            $this->composerSettings[$package] = isset($this->composerSettings[$package]['packages'], $this->composerSettings[$package]['packages'][$package])
47 -
                ? $this->composerSettings[$package]['packages'][$package]
48 -
                : null;
47 +
            $this->composerSettings[$package] = ($this->composerSettings[$package]['packages'] ?? [])[$package] ?? null;
49 48
        }
50 49
51 50
        return $this->composerSettings[$package];
@@ -55,6 +54,7 @@
Loading
55 54
    {
56 55
        $streams = $this->getProcStreams();
57 56
        $stdout = is_array($streams) && isset($streams[1]) ? $streams[1] : null;
57 +
58 58
        if (is_array($stdout) && $stdout[0] === 'file') {
59 59
            $file = fopen($stdout[1], $stdout[2]);
60 60
            fwrite($file, $text);
@@ -197,7 +197,7 @@
Loading
197 197
198 198
    protected function extractVersion(&$package, &$settings)
199 199
    {
200 -
        list($package, $version) = explode(':', "$package:");
200 +
        [$package, $version] = explode(':', "$package:");
201 201
202 202
        if ($version !== '' && !isset($settings['version'])) {
203 203
            $settings['version'] = $version;
@@ -226,7 +226,7 @@
Loading
226 226
        } catch (TestFailedException $exception) {
227 227
            $state = false;
228 228
229 -
            if (isset($config->config['stop_on_failure']) && $config->config['stop_on_failure']) {
229 +
            if ($config->config['stop_on_failure'] ?? false) {
230 230
                $this->error($exception);
231 231
            }
232 232
        } catch (MultiTesterException $exception) {

@@ -25,10 +25,9 @@
Loading
25 25
     */
26 26
    public function isColored()
27 27
    {
28 -
        return isset($this->config['color_support'])
29 -
            ? $this->config['color_support']
28 +
        return $this->config['color_support'] ??
30 29
            // @codeCoverageIgnoreStart
31 -
            : (DIRECTORY_SEPARATOR === '\\'
30 +
            (DIRECTORY_SEPARATOR === '\\'
32 31
                ? false !== getenv('ANSICON') ||
33 32
                'ON' === getenv('ConEmuANSI') ||
34 33
                false !== getenv('BABUN_HOME')

@@ -174,7 +174,7 @@
Loading
174 174
            $package = $this->getPackage();
175 175
            $tester = $this->getConfig()->getTester();
176 176
            $composerSettings = $tester->getComposerSettings($package);
177 -
            $version = $this->filterVersion($settings['version'], array_keys($composerSettings ?? []));
177 +
            $version = $this->filterVersion($settings['version'], array_keys($composerSettings ?: []));
178 178
179 179
            $settings['source'] = isset($composerSettings[$version]['source'])
180 180
                ? $composerSettings[$version]['source']

@@ -81,6 +81,7 @@
Loading
81 81
    protected function copyItem($source, $destination, $file, &$success)
82 82
    {
83 83
        $path = "$source/$file";
84 +
84 85
        if (@is_dir($path)) {
85 86
            if (!(new static($path))->copy("$destination/$file")) {
86 87
                $success = false;
Files Complexity Coverage
src/MultiTester 188 100.00%
Project Totals (12 files) 188 100.00%
107.2
7.2=.2
TRAVIS_OS_NAME=linux
107.1
7.1=.1
TRAVIS_OS_NAME=linux
107.3
7.3=.3
TRAVIS_OS_NAME=linux
107.4
TRAVIS_OS_NAME=linux
7.4=.4

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading