Aimeos   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
c 0
b 0
f 0
dl 0
loc 32
rs 10
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 22 5
1
<?php
2
3
/**
4
 * @license GPLv3, http://www.gnu.org/copyleft/gpl.html
5
 * @copyright Aimeos (aimeos.org), 2016
6
 * @package TYPO3
7
 */
8
9
10
namespace Aimeos\Aimeos\Base;
11
12
13
/**
14
 * Aimeos bootstrap class
15
 *
16
 * @package TYPO3
17
 */
18
class Aimeos
19
{
20
    private static $aimeos;
21
22
23
    /**
24
     * Returns the Aimeos bootstrap object
25
     *
26
     * @return \Aimeos\Bootstrap Aimeos bootstrap object
27
     */
28
    public static function get() : \Aimeos\Bootstrap
29
    {
30
        if (self::$aimeos === null) {
31
            $extDirs = [];
32
33
            // Extension directories
34
            if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['extDirs'])) {
35
                ksort($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['extDirs']);
36
37
                foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['extDirs'] as $dir) {
38
                    $absPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($dir);
0 ignored issues
show
Bug introduced by
The type TYPO3\CMS\Core\Utility\GeneralUtility was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
39
40
                    if (!empty($absPath)) {
41
                        $extDirs[] = $absPath;
42
                    }
43
                }
44
            }
45
46
            self::$aimeos = new \Aimeos\Bootstrap($extDirs, false);
47
        }
48
49
        return self::$aimeos;
50
    }
51
}
52