ServiceProvider::__call()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
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