1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Firegento\DevDashboard\ViewModel\Widget; |
4
|
|
|
|
5
|
|
|
use Magento\Framework\View\Element\Block\ArgumentInterface; |
6
|
|
|
use Magento\Framework\Composer\ComposerInformation; |
7
|
|
|
use Magento\Setup\Model\PhpInformation; |
|
|
|
|
8
|
|
|
|
9
|
|
|
class PhpExtensions implements ArgumentInterface |
10
|
|
|
{ |
11
|
|
|
private $composerInformation; |
12
|
|
|
|
13
|
|
|
private $phpInformation; |
14
|
|
|
|
15
|
|
|
public function __construct( |
16
|
|
|
ComposerInformation $composerInformation, |
17
|
|
|
PhpInformation $phpInformation |
18
|
|
|
) { |
19
|
|
|
$this->composerInformation = $composerInformation; |
20
|
|
|
$this->phpInformation = $phpInformation; |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function getPhpExtensions() |
24
|
|
|
{ |
25
|
|
|
$required = $this->composerInformation->getRequiredExtensions(); |
26
|
|
|
$current = $this->phpInformation->getCurrent(); |
27
|
|
|
return array_values($required + $current); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
public function getPhpExtensionStatus($extension) |
31
|
|
|
{ |
32
|
|
|
$required = $this->composerInformation->getRequiredExtensions(); |
33
|
|
|
$current = $this->phpInformation->getCurrent(); |
34
|
|
|
|
35
|
|
|
$requiredInstalledPhpExtensions = array_intersect($required, $current); |
36
|
|
|
$requiredMissingPhpExtensions = array_diff($required, $current); |
37
|
|
|
|
38
|
|
|
if (in_array($extension, $requiredInstalledPhpExtensions)) { |
39
|
|
|
return 'required-installed'; |
40
|
|
|
} |
41
|
|
|
if (in_array($extension, $requiredMissingPhpExtensions)) { |
42
|
|
|
return 'required-missing'; |
43
|
|
|
} |
44
|
|
|
return 'optional-installed'; |
45
|
|
|
} |
46
|
|
|
} |
47
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths