Composer::installDryRun()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 0
cts 17
cp 0
rs 9.584
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
namespace BeyondCode\SelfDiagnosis;
4
5
class Composer extends \Illuminate\Support\Composer
6
{
7
    public function installDryRun(string $options = null)
8
    {
9
        $composer = $this->findComposer();
10
11
        $command = array_merge(
12
            (array) $composer,
13
            ['install', '--dry-run'],
14
            array_filter(array_map('trim', explode(' ', $options)))
15
        );
16
17
        if (is_array($composer)) {
18
            $process = $this->getProcess($command);
19
        } else {
20
            $process = $this->getProcess();
0 ignored issues
show
Bug introduced by
The call to getProcess() misses a required argument $command.

This check looks for function calls that miss required arguments.

Loading history...
21
            $process->setCommandLine(trim(implode(' ', $command)));
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\Proces...ocess::setCommandLine() has been deprecated with message: since Symfony 4.2.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
22
        }
23
24
        $process->run();
25
26
        return $process->getOutput() . $process->getErrorOutput();
27
    }
28
}