Webino::application()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Webino™ (http://webino.sk)
4
 *
5
 * @link        https://github.com/webino for the canonical source repository
6
 * @copyright   Copyright (c) 2015-2017 Webino, s.r.o. (http://webino.sk)
7
 * @author      Peter Bačinský <[email protected]>
8
 * @license     BSD-3-Clause
9
 */
10
11
use Webino\Version;
12
use WebinoAppLib\Application\CoreConfig;
13
use WebinoAppLib\Factory;
14
use WebinoAppLib\Options\DebuggerOptions;
15
use WebinoAppLib\Service\Debugger;
16
use WebinoAppLib\Service\DebuggerInterface;
17
18
/**
19
 * Class Webino
20
 */
21
class Webino
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
22
{
23
    /**
24
     * Webino™ version
25
     */
26
    const VERSION = Version::VERSION;
27
28
    /**
29
     * Create application core config
30
     *
31
     * @param array $config
32
     * @return CoreConfig
33
     */
34
    public static function config(array $config)
35
    {
36
        return new CoreConfig($config);
37
    }
38
39
    /**
40
     * Create Webino application
41
     *
42
     * @param array|object $config
43
     * @param DebuggerInterface $debugger
44
     * @return \WebinoAppLib\Application\AbstractBaseApplication
45
     */
46
    public static function application($config = null, DebuggerInterface $debugger = null)
47
    {
48
        return (new Factory)->create($config, $debugger);
49
    }
50
51
    /**
52
     * Create application debugger
53
     *
54
     * @param array|DebuggerOptions $options
55
     * @return Debugger
56
     */
57
    public static function debugger($options = [])
58
    {
59
        return new Debugger($options);
60
    }
61
62
    /**
63
     * Create application debugger options
64
     *
65
     * @return DebuggerOptions
66
     */
67
    public static function debuggerOptions()
68
    {
69
        return new DebuggerOptions;
70
    }
71
}
72