Passed
Pull Request — master (#213)
by Théo
03:07
created

IsExtensionFulfilled::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
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