Completed
Push — master ( d4d7bc...0f591f )
by yuuki
03:49 queued 01:43
created

AsyncModule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 2
c 2
b 0
f 2
lcom 0
cbo 2
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A registerPointCut() 0 9 2
1
<?php
2
3
/**
4
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
7
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
9
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
10
 * THE SOFTWARE.
11
 *
12
 * This software consists of voluntary contributions made by many individuals
13
 * and is licensed under the MIT license.
14
 *
15
 * Copyright (c) 2015-2016 Yuuki Takezawa
16
 *
17
 */
18
namespace Ytake\LaravelAspect\Modules;
19
20
use Ytake\LaravelAspect\PointCut\PointCutable;
21
use Ytake\LaravelAspect\PointCut\AsyncPointCut;
22
23
/**
24
 * Class AsyncModule
25
 */
26
class AsyncModule extends AspectModule
27
{
28
    /** @var array */
29
    protected $classes = [];
30
31
    /**
32
     * @return PointCutable
33
     */
34
    protected function registerPointCut()
35
    {
36
        // @codeCoverageIgnoreStart
37
        if (!extension_loaded('pcntl')) {
38
            throw new \LogicException("Asynchronous Execution requires pcntl extensions to be installed");
39
        }
40
        // @codeCoverageIgnoreEnd
41
        return new AsyncPointCut;
42
    }
43
}
44