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

Utils   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRepository() 0 9 2
A getSetupFactory() 0 4 1
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