IncludePlugin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 22
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMethod() 0 4 1
A handle() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Rocketeer
5
 *
6
 * (c) Maxime Fabre <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 */
12
13
namespace Rocketeer\Services\Filesystem\Plugins;
14
15
use League\Flysystem\Plugin\AbstractPlugin;
16
17
/**
18
 * Includes a PHP file from the filesystem.
19
 */
20
class IncludePlugin extends AbstractPlugin
21
{
22
    /**
23
     * Get the method name.
24
     *
25
     * @return string
26
     */
27 442
    public function getMethod()
28
    {
29 442
        return 'includeFile';
30
    }
31
32
    /**
33
     * @param string|null $path
34
     *
35
     * @return bool
36
     */
37
    public function handle($path)
38
    {
39
        return include $this->filesystem->getAdapter()->applyPathPrefix($path);
40
    }
41
}
42