Completed
Pull Request — master (#424)
by Anton
04:19
created

Messages   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A initInstance() 0 6 1
1
<?php
2
/**
3
 * Bluz Framework Component
4
 *
5
 * @copyright Bluz PHP Team
6
 * @link      https://github.com/bluzphp/framework
7
 */
8
9
declare(strict_types=1);
10
11
namespace Bluz\Proxy;
12
13
use Bluz\Messages\Messages as Instance;
14
15
/**
16
 * Proxy to Messages
17
 *
18
 * Example of usage
19
 * <code>
20
 *     use Bluz\Proxy\Messages;
21
 *
22
 *     Messages::addSuccess('All Ok!');
23
 * </code>
24
 *
25
 * @package  Bluz\Proxy
26
 * @author   Anton Shevchuk
27
 *
28
 * @method   static Instance getInstance()
29
 *
30
 * @method   static Messages addNotice($message, ...$text)
31
 * @see      Instance::addNotice()
32
 *
33
 * @method   static Messages addSuccess($message, ...$text)
34
 * @see      Instance::addSuccess()
35
 *
36
 * @method   static Messages addError($message, ...$text)
37
 * @see      Instance::addError()
38
 *
39
 * @method   static integer count()
40
 * @see      Instance::count()
41
 *
42
 * @method   static \stdClass pop($type = null)
43
 * @see      Instance::pop()
44
 *
45
 * @method   static \ArrayObject popAll()
46
 * @see      Instance::popAll()
47
 *
48
 * @method   static void reset()
49
 * @see      Instance::reset()
50
 */
51
final class Messages
52
{
53
    use ProxyTrait;
54
55
    /**
56
     * Init instance
57
     *
58
     * @return Instance
59
     */
60 1
    protected static function initInstance()
61
    {
62 1
        $instance = new Instance();
63 1
        $instance->setOptions(Config::getData('messages'));
64 1
        return $instance;
65
    }
66
}
67