Passed
Push — master ( 8bd994...8bfb27 )
by Théo
02:28
created

IsExtensionFulfilled   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the box project.
5
 *
6
 * (c) Kevin Herrera <[email protected]>
7
 *     Théo Fidry <[email protected]>
8
 *
9
 * This source file is subject to the MIT license that is bundled
10
 * with this source code in the file LICENSE.
11
 */
12
13
namespace KevinGH\RequirementChecker;
14
15
/**
16
 * @private
17
 */
18
final class IsExtensionFulfilled implements IsFulfilled
19
{
20
    private $requiredExtension;
21
22
    /**
23
     * @param string $requiredExtension
24
     */
25
    public function __construct($requiredExtension)
26
    {
27
        $this->requiredExtension = $requiredExtension;
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function __invoke()
34
    {
35
        return \extension_loaded($this->requiredExtension);
36
    }
37
}
38