Total Complexity | 9 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class Composer extends Executable |
||
6 | { |
||
7 | /** @var array Content of composer.json decoded */ |
||
8 | protected $config = []; |
||
9 | |||
10 | /** @var string The binary executable */ |
||
11 | protected $binary = 'composer'; |
||
12 | |||
13 | public function createProject($project, $using) |
||
14 | { |
||
15 | $this->runCommand(sprintf('create-project %s %s', $using, $project)); |
||
16 | |||
17 | return $this; |
||
18 | } |
||
19 | |||
20 | public function install() |
||
21 | { |
||
22 | $this->runCommand('install --prefer-dist --optimize-autoloader --no-suggest'); |
||
23 | |||
24 | return $this; |
||
25 | } |
||
26 | |||
27 | public function update() |
||
28 | { |
||
29 | $this->runCommand('update --prefer-dist --optimize-autoloader --no-suggest'); |
||
30 | |||
31 | return $this; |
||
32 | } |
||
33 | |||
34 | public function dumpAutoload() |
||
35 | { |
||
36 | $this->runCommand('dump-autoload --optimize'); |
||
37 | |||
38 | return $this; |
||
39 | } |
||
40 | |||
41 | public function config(string $key, $default = null) |
||
57 | } |
||
58 | } |
||
59 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.