PhpInfoComposer::compose()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 10
c 2
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php namespace Arcanesoft\Foundation\ViewComposers\System;
2
3
use Illuminate\View\View;
0 ignored issues
show
Bug introduced by
The type Illuminate\View\View was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
4
5
/**
6
 * Class     PhpInfoComposer
7
 *
8
 * @package  Arcanesoft\Foundation\ViewComposers\System
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class PhpInfoComposer
12
{
13
    /* -----------------------------------------------------------------
14
     |  Constants
15
     | -----------------------------------------------------------------
16
     */
17
18
    const VIEW = 'foundation::admin.system.information._includes.php-info';
19
20
    /* -----------------------------------------------------------------
21
     |  Main Methods
22
     | -----------------------------------------------------------------
23
     */
24
25
    /**
26
     * Compose the view.
27
     *
28
     * @param  \Illuminate\View\View  $view
29
     */
30
    public function compose(View $view)
31
    {
32
        $view->with('phpInfo', [
33
            'version'      => phpversion(),
34
            'extensions'   => get_loaded_extensions(),
35
            'requirements' => $this->checkPhpRequirements(),
36
        ]);
37
    }
38
39
    /* -----------------------------------------------------------------
40
     |  Other Methods
41
     | -----------------------------------------------------------------
42
     */
43
44
    /**
45
     * Check the PHP requirements.
46
     *
47
     * @return \Illuminate\Support\Collection
48
     */
49
    private function checkPhpRequirements()
50
    {
51
        return collect(['openssl', 'pdo', 'mbstring', 'tokenizer', 'xml'])->mapWithKeys(function ($requirement) {
52
            return [$requirement => extension_loaded($requirement)];
53
        });
54
    }
55
}
56