Completed
Push — fix_ezp29385 ( 36b56f...415bc3 )
by
unknown
56:19 queued 22:25
created

Utils::getSetupFactory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * File contains: eZ\Publish\Core\Repository\Tests\Service\Integration\Legacy\Utils class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\Repository\Tests\Service\Integration\Legacy;
10
11
/**
12
 * Utils class for LegacySE test.
13
 */
14
abstract class Utils
15
{
16
    /**
17
     * @var \eZ\Publish\API\Repository\Tests\SetupFactory
18
     */
19
    public static $setupFactory;
20
21
    /**
22
     * @return \eZ\Publish\API\Repository\Repository
23
     */
24
    final public static function getRepository()
25
    {
26
        if (static::$setupFactory === null) {
27
            static::$setupFactory = static::getSetupFactory();
28
        }
29
30
        // Return repository
31
        return static::$setupFactory->getRepository();
32
    }
33
34
    /**
35
     * @return \eZ\Publish\API\Repository\Tests\SetupFactory
36
     */
37
    protected static function getSetupFactory()
38
    {
39
        return new SetupFactory();
40
    }
41
}
42