Completed
Push — typo3v9 ( efc308...b63611 )
by Tomas Norre
06:24
created

getExtensionConfiguration()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 5.1971

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 0
dl 0
loc 11
ccs 3
cts 8
cp 0.375
crap 5.1971
rs 9.9
c 0
b 0
f 0
1
<?php
2
namespace AOE\Crawler\Configuration;
3
4
/***************************************************************
5
 *  Copyright notice
6
 *
7
 *  (c) 2019 AOE GmbH <[email protected]>
8
 *
9
 *  All rights reserved
10
 *
11
 *  This script is part of the TYPO3 project. The TYPO3 project is
12
 *  free software; you can redistribute it and/or modify
13
 *  it under the terms of the GNU General Public License as published by
14
 *  the Free Software Foundation; either version 3 of the License, or
15
 *  (at your option) any later version.
16
 *
17
 *  The GNU General Public License can be found at
18
 *  http://www.gnu.org/copyleft/gpl.html.
19
 *
20
 *  This script is distributed in the hope that it will be useful,
21
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 *  GNU General Public License for more details.
24
 *
25
 *  This copyright notice MUST APPEAR in all copies of the script!
26
 ***************************************************************/
27
28
use Psr\Log\LoggerAwareInterface;
29
use Psr\Log\LoggerAwareTrait;
30
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
31
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;
32
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
33
use TYPO3\CMS\Core\Utility\GeneralUtility;
34
35
class ExtensionConfigurationProvider implements LoggerAwareInterface
36
{
37
    use LoggerAwareTrait;
38
39
    /**
40
     * Return full extension configuration array.
41
     *
42
     * @return array $extensionConfiguration
43
     */
44 43
    public function getExtensionConfiguration()
45
    {
46
        try {
47 43
            $extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('crawler');
48 43
            return $extensionConfiguration;
49
        } catch (ExtensionConfigurationExtensionNotConfiguredException $e) {
0 ignored issues
show
Bug introduced by
The class TYPO3\CMS\Core\Configura...nNotConfiguredException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
50
            $this->logger->error($e->getMessage());
51
        } catch (ExtensionConfigurationPathDoesNotExistException $e) {
0 ignored issues
show
Bug introduced by
The class TYPO3\CMS\Core\Configura...thDoesNotExistException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
52
            $this->logger->error($e->getMessage());
53
        }
54
    }
55
}
56