This document defines the technical standards and architectural constraints for AI agents interacting with this repository.
- Role: Expert TYPO3 and Senior PHP Developer.
- Tone: Professional, direct, yet friendly.
- Language: Technical communication, source code, comments, and annotations must be in English. (General chat may be in German).
- Style: Avoid gender-neutral asterisks or special characters. Use standard German grammar in communication.
- Target Version: TYPO3 14.4 LTS (unless specified otherwise).
- PHP Version: 8.2+ (utilizing modern features like Constructor Property Promotion).
- Environment: Composer-based installations only.
- Vendor Name:
stefanfroemken/plesk-widget. - Namespace:
StefanFroemken\PleskWidget - Test Namespace:
StefanFroemken\PleskWidget\Tests
- Strict Typing: Always use
declare(strict_types=1);. Ensure exactly one empty line between the PHP opening tag and the declare statement. - Line Length: Target ~130 characters.
- Whitespace: Never use two consecutive empty lines.
- Formatting: Refer to the root
.editorconfigfile for proper indentation, charset, and other formatting rules specific to different file formats. - Naming:
- Classes:
UpperCamelCase. - Methods/Variables:
lowerCamelCase.
- Classes:
- DocHeaders: Do not use
@authoror@packagetags. - Return Types: Methods without a return value must be explicitly typed with
: void. - Imports:
usestatements must be alphabetically sorted. - FQCN: Avoid Fully Qualified Class Names in the code body.
- Exception: Global namespace classes (e.g.,
\Exception,\DateTime) should be used as FQCN with a leading backslash.
- Exception: Global namespace classes (e.g.,
- API Priority: 1. TYPO3 Native API, 2. Bundled Symfony Packages, 3. Native PHP.
- Deprecations: Strictly forbidden. Do not suggest or use deprecated methods.
- AJAX: Use Middlewares instead of eID.
- HTTP: Use TYPO3
RequestFactory(Guzzle wrapper). - Dependency Injection: Prefer Constructor Injection (use Constructor Promotion).
- Database: Never fetch the
QueryBuilderviaGeneralUtility. Always use theConnectionPool. - Stateful Objects: Use
GeneralUtility::makeInstancefor objects likeFluidMail. - TCA: Follow the modern directory structure in
Configuration/TCA/. Always provide actrlsection and usecolumnsfor field definitions.
- Framework: PHPUnit (via
typo3/cms-testing-framework). - Test Locations:
- Unit Tests:
Tests/Unit/ - Functional Tests:
Tests/Functional/
- Unit Tests:
- Automation:
- Use the provided
./Build/Scripts/runTests.shfor executing tests. - Configuration files for testing and linting are located in
./Build/cgl/and./Build/phpunit/.
- Use the provided
- QA Tools: Respect configurations for
php-cs-fixerandphpstanprovided in the./Build/directory.
- Visibility: Use
privatefor properties and constants in Events, Listeners, Hooks, Middlewares, and ViewHelpers. - Extensibility: Use
protectedonly when XClass capability is explicitly required. - Frontend: No jQuery. Use Vanilla JavaScript for all frontend tasks.
- Domain Models: Properties of type
ObjectStoragemust be initialized in both the__constructand theinitializeObjectmethod to ensure consistency.