Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
24 | public function shouldAllow() |
||
25 | { |
||
26 | if (!$this->isPluginAvailable()) { |
||
27 | return false; |
||
28 | } |
||
29 | |||
30 | $lockUpdateArgument = 'lock'; |
||
31 | |||
32 | try { |
||
33 | $input = new \Symfony\Component\Console\Input\ArgvInput(); |
||
34 | |||
35 | return !$input->hasParameterOption(sprintf('--%s', $lockUpdateArgument)); |
||
36 | } catch (\Exception $e) { |
||
37 | // There are situations where composer is accessed from non-CLI entry-points, |
||
38 | // which will cause $argv not to be available, resulting a crash. |
||
39 | } |
||
40 | |||
41 | return false; |
||
42 | } |
||
63 |