Completed
Push — develop ( 72af12...99cf9a )
by Peter
01:13
created

AppAwareTrait::getApp()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 2
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Webino (http://webino.sk/)
4
 *
5
 * @link        https://github.com/webino/WebinoDev/ for the canonical source repository
6
 * @copyright   Copyright (c) 2012-2019 Webino, s. r. o. (http://webino.sk/)
7
 * @license     BSD-3-Clause
8
 */
9
10
namespace WebinoDev\Test;
11
12
/**
13
 * AppAwareTrait
14
 */
15
trait AppAwareTrait
16
{
17
    /**
18
     * @var \Zend\Mvc\Application|null
19
     */
20
    protected $app;
21
22
    /**
23
     * @return \Zend\Mvc\Application|null
24
     */
25
    public function getApp()
26
    {
27
        if (!$this->app && function_exists('createApp')) {
28
            $this->app = createApp();
29
        }
30
        return $this->app;
31
    }
32
}
33