ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
register() 0 1 ?
A __call() 0 8 2
1
<?php
2
3
namespace Magister\Services\Support;
4
5
use BadMethodCallException;
6
use Magister\Magister;
7
8
/**
9
 * Class ServiceProvider.
10
 */
11
abstract class ServiceProvider
12
{
13
    /**
14
     * The application implementation.
15
     *
16
     * @var \Magister\Magister
17
     */
18
    protected $app;
19
20
    /**
21
     * Create a new service provider instance.
22
     *
23
     * @param \Magister\Magister $app
24
     */
25
    public function __construct(Magister $app)
26
    {
27
        $this->app = $app;
28
    }
29
30
    /**
31
     * Register bindings in the container.
32
     *
33
     * @return void
34
     */
35
    abstract public function register();
36
37
    /**
38
     * Dynamically handle missing method calls.
39
     *
40
     * @param string $method
41
     * @param array  $parameters
42
     *
43
     * @throws \BadMethodCallException
44
     *
45
     * @return mixed
46
     */
47
    public function __call($method, $parameters)
48
    {
49
        if ($method == 'boot') {
50
            return;
51
        }
52
53
        throw new BadMethodCallException(sprintf('Call to undefined method "%s"', $method));
54
    }
55
}
56