Project

General

Profile

Actions

Task #96267

open

Add dedicated error for class construction without dependencies

Added by Mathias Brodala about 3 years ago. Updated about 3 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2021-12-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Right now if GeneralUtility::makeInstance() is used to construct a class which uses constructor dependency injection and has not being marked as public, a low-level \ArgumentCountError is thrown by PHP.

This should be improved by catching this case and replacing the error with a custom one (e.g. MissingDependenciesError). Either that custom error already hints at possible solutions or its dedicated error code is used to link to the docs with more details. The docs could then suggest to mark the class as public or manually pass the dependencies as arguments.

Actions #1

Updated by Mathias Brodala about 3 years ago

  • Description updated (diff)
Actions

Also available in: Atom PDF