Passed
Push — master ( c8570b...99b6ec )
by Korotkov
01:50 queued 17s
created

PublicApplicationTrait   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 14
eloc 16
c 1
b 0
f 0
dl 0
loc 73
rs 10

14 Methods

Rating   Name   Duplication   Size   Complexity  
A config() 0 3 1
A get() 0 3 1
A __call() 0 2 1
A __callStatic() 0 3 1
A set() 0 3 1
A binding() 0 3 1
A new() 0 3 1
A cookie() 0 3 1
A services() 0 3 1
A response() 0 3 1
A has() 0 3 1
A session() 0 3 1
A setServices() 0 3 1
A request() 0 3 1
1
<?php
2
3
/**
4
 * @author    : Jagepard <[email protected]">
5
 * @license   https://mit-license.org/ MIT
6
 */
7
8
namespace Rudra\Container\Traits;
9
10
use Rudra\Container\{
11
    Abstracts\AbstractRequest, Abstracts\AbstractResponse, Abstracts\ContainerInterface, Cookie, Rudra, Session
12
};
13
14
trait PublicApplicationTrait
15
{
16
    public function setServices(array $services): void
17
    {
18
        $this->_setServices($services);
0 ignored issues
show
Bug introduced by
The method _setServices() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        $this->/** @scrutinizer ignore-call */ 
19
               _setServices($services);
Loading history...
19
    }
20
21
    public function binding(): ContainerInterface
22
    {
23
        return $this->_binding();
0 ignored issues
show
Bug introduced by
The method _binding() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        return $this->/** @scrutinizer ignore-call */ _binding();
Loading history...
24
    }
25
26
    public function services(): ContainerInterface
27
    {
28
        return $this->_services();
0 ignored issues
show
Bug introduced by
The method _services() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
        return $this->/** @scrutinizer ignore-call */ _services();
Loading history...
29
    }
30
31
    public function config(): ContainerInterface
32
    {
33
        return $this->_config();
0 ignored issues
show
Bug introduced by
The method _config() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
        return $this->/** @scrutinizer ignore-call */ _config();
Loading history...
34
    }
35
36
    public function request(): AbstractRequest
37
    {
38
        return $this->_request();
0 ignored issues
show
Bug introduced by
The method _request() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

38
        return $this->/** @scrutinizer ignore-call */ _request();
Loading history...
39
    }
40
41
    public function response(): AbstractResponse
42
    {
43
        return $this->_response();
0 ignored issues
show
Bug introduced by
The method _response() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

43
        return $this->/** @scrutinizer ignore-call */ _response();
Loading history...
44
    }
45
46
    public function cookie(): Cookie
47
    {
48
        return $this->_cookie();
0 ignored issues
show
Bug introduced by
The method _cookie() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

48
        return $this->/** @scrutinizer ignore-call */ _cookie();
Loading history...
49
    }
50
51
    public function session(): Session
52
    {
53
        return $this->_session();
0 ignored issues
show
Bug introduced by
The method _session() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

53
        return $this->/** @scrutinizer ignore-call */ _session();
Loading history...
54
    }
55
56
    /*
57
     | Creates an object without adding to the container
58
     */
59
    public function new($object, $params = null)
60
    {
61
        return new $this->_new($object, $params);
62
    }
63
64
    public function get(string $key = null)
65
    {
66
        return $this->_get($key);
0 ignored issues
show
Bug introduced by
The method _get() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

66
        return $this->/** @scrutinizer ignore-call */ _get($key);
Loading history...
67
    }
68
69
    public function set(array $data): void
70
    {
71
        $this->_set($data);
0 ignored issues
show
Bug introduced by
The method _set() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

71
        $this->/** @scrutinizer ignore-call */ 
72
               _set($data);
Loading history...
72
    }
73
74
    public function has(string $key): bool
75
    {
76
        return $this->_has($key);
0 ignored issues
show
Bug introduced by
The method _has() does not exist on Rudra\Container\Traits\PublicApplicationTrait. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

76
        return $this->/** @scrutinizer ignore-call */ _has($key);
Loading history...
77
    }
78
79
80
    public function __call($method, $parameters) {
81
        return $this->$method(...$parameters);
82
    }
83
84
    public static function __callStatic($method, $parameters)
85
    {
86
        return Rudra::run()->$method(...$parameters);
87
    }
88
}
89