Do not use constants TYPO3_MODE and TYPO3_REQUESTTYPE in ext_localconf.php or ext_tables.php
if (TYPO3_MODE === 'BE') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][$packageKey] = \Prefix\MyExtension\PageRendererHooks::class . '->renderPreProcess';
}
❌
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][$packageKey] = \Prefix\MyExtension\PageRendererHooks::class . '->renderPreProcess';
👍
Do not use declare statements in ext_localconf.php or ext_tables.php
declare(strict_types=1)
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][$packageKey] = \Prefix\MyExtension\PageRendererHooks::class . '->renderPreProcess';
❌
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][$packageKey] = \Prefix\MyExtension\PageRendererHooks::class . '->renderPreProcess';
👍
Do not use $_EXTKEY and $_EXTCONF in ext_localconf.php or ext_tables.php
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][$_EXTKEY] = \Prefix\MyExtension\PageRendererHooks::class . '->renderPreProcess';
❌
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess']['my_extension_key'] = \Prefix\MyExtension\PageRendererHooks::class . '->renderPreProcess';
👍
Do not use nullable constructor arguments for classes. Use Symfony Dependency Injection Configuration properly.
public function __construct(?MyService $myService = null)
❌
public function __construct(MyService $myService)
👍
Do not use statements but FQN in ext_localconf.php or ext_tables.php
use \Prefix\MyExtension\PageRendererHooks;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][$packageKey] = PageRendererHooks::class . '->renderPreProcess';
❌
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][$packageKey] = \Prefix\MyExtension\PageRendererHooks::class . '->renderPreProcess';
👍
Missing default value for property "property" in class "MissingDefaultValueForTypedProperty"
final class MissingDefaultValueForTypedProperty extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
protected string $property;
}
❌
final class MissingDefaultValueForTypedProperty extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
protected string $property = '';
}
👍
Missing var annotation for property "property" in class "MissingDocblock"
final class MissingDocblock extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
protected ?string $property = null;
}
❌
final class MissingDocblock extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* @var string|null
*/
protected ?string $property = null;
}
👍