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 #1

Updated by Gerrit Code Review almost 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73177

Actions #2

Updated by Gerrit Code Review almost 3 years ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73162

Actions #3

Updated by Stephan Großberndt almost 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF