Project

General

Profile

Actions

Bug #96657

closed

ExtensionConfigurationExtensionNotConfiguredException and ExtensionConfigurationPathDoesNotExistException are marked as @internal

Added by Stephan Großberndt almost 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-01-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

ExtensionConfigurationExtensionNotConfiguredException and ExtensionConfigurationPathDoesNotExistException are marked as @internal

But if you want to fetch the extension configuration you have to use GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('my_ext') - e.g. like this:

use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;

class Foo {
    public function __construct() {
        try {
            $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('my_ext');
        } catch (ExtensionConfigurationExtensionNotConfiguredException|ExtensionConfigurationPathDoesNotExistException $e) {
            // show an error message on how to configure the extension
        }
    }
}

where ->get() may fail with the mentioned exceptions. So the extension authors have to handle them in their code (and PHPStorm complains because they are @internal).

The classes are marked as @internal because they should not be constructed outside of TYPO3 core, but with the current @internal mark their "use" statement for catching is reported as well.

Actions

Also available in: Atom PDF