Issues (138)

Configuration/ExtensionConfigurationProvider.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AOE\Crawler\Configuration;
6
7
 /*
8
 * (c) 2020 AOE GmbH <[email protected]>
9
 *
10
 * This file is part of the TYPO3 Crawler Extension.
11
 *
12
 * It is free software; you can redistribute it and/or modify it under
13
 * the terms of the GNU General Public License, either version 2
14
 * of the License, or any later version.
15
 *
16
 * For the full copyright and license information, please read the
17
 * LICENSE.txt file that was distributed with this source code.
18
 *
19
 * The TYPO3 project - inspiring people to share!
20
 */
21
22
use Psr\Log\LoggerAwareInterface;
23
use Psr\Log\LoggerAwareTrait;
24
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
25
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;
26
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
27
use TYPO3\CMS\Core\Utility\GeneralUtility;
28
29
/**
30
 * @internal since v9.2.5
31
 */
32
class ExtensionConfigurationProvider implements LoggerAwareInterface
33
{
34
    use LoggerAwareTrait;
35
36
    /**
37
     * Return full extension configuration array.
38
     * @return mixed|array
39
     */
40 139
    public function getExtensionConfiguration()
41
    {
42
        try {
43 139
            return GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('crawler');
44
        } catch (ExtensionConfigurationExtensionNotConfiguredException $e) {
45
            $this->logger->error($e->getMessage());
0 ignored issues
show
The method error() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
            $this->logger->/** @scrutinizer ignore-call */ 
46
                           error($e->getMessage());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
46
        } catch (ExtensionConfigurationPathDoesNotExistException $e) {
47
            $this->logger->error($e->getMessage());
48
        }
49
    }
50
}
51