refactor: private instead of protected where nothing relies on it, constructor promotion
Members (properties, methods, constants) become private when they are declared in the class itself, no parent class or interface declares them, no ancestor in packages/ uses them and the class has no subclass in packages/: 115 members in 36 files. Extbase domain objects keep protected properties, AbstractDomainObject sets them from the parent class. With the properties private, Rector's constructor promotion now also applies to the controllers and services that still assigned their dependencies by hand (26 files). Checked locally: frontend crawl (~1,900 URLs) and the backchannel APIs render the same as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
b51fa4ddad
commit
9347112d6b
38 files changed
+140
-462
No files matched your search
@@ -74,7 +74,7 @@ class SliderProcessor implements DataProcessorInterface
|
||||
/**
|
||||
* @return null|int
|
||||
*/
|
||||
protected function getParentPageWithSlides()
|
||||
private function getParentPageWithSlides()
|
||||
{
|
||||
$rootlineUtility = new RootlineUtility($GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.page.information')->getId());
|
||||
$rootline = $rootlineUtility->get();
|
||||
|
||||
@@ -53,7 +53,7 @@ class OpenGraphMetaTagManager extends \TYPO3\CMS\Seo\MetaTag\OpenGraphMetaTagMan
|
||||
/**
|
||||
* @return null|int
|
||||
*/
|
||||
protected function getPageWithImage()
|
||||
private function getPageWithImage()
|
||||
{
|
||||
// The manager is also asked to render in the backend, where there is no frontend page
|
||||
$pageInformation = $GLOBALS['TYPO3_REQUEST']?->getAttribute('frontend.page.information');
|
||||
|
||||
@@ -25,7 +25,7 @@ class ContentPreviewRenderer extends StandardContentPreviewRenderer
|
||||
/**
|
||||
* CType => [field holding the related uid, related table, template variable]
|
||||
*/
|
||||
protected const RELATED_RECORDS = [
|
||||
private const array RELATED_RECORDS = [
|
||||
'teaser_country' => ['tx_eptheme_context_country', 'tx_epproducts_domain_model_country', 'country'],
|
||||
'teaser_region' => ['tx_eptheme_context_region', 'tx_epproducts_domain_model_region', 'region'],
|
||||
'teaser_city' => ['tx_eptheme_context_city', 'tx_epproducts_domain_model_city', 'city'],
|
||||
@@ -63,7 +63,7 @@ class ContentPreviewRenderer extends StandardContentPreviewRenderer
|
||||
return $view->render();
|
||||
}
|
||||
|
||||
protected function getAssignmentsForTemplate(string $cType, array $row): array
|
||||
private function getAssignmentsForTemplate(string $cType, array $row): array
|
||||
{
|
||||
if (isset(self::RELATED_RECORDS[$cType])) {
|
||||
[$field, $table, $name] = self::RELATED_RECORDS[$cType];
|
||||
@@ -110,7 +110,7 @@ class ContentPreviewRenderer extends StandardContentPreviewRenderer
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function getImages(int $uid, string $table, string $field): array
|
||||
private function getImages(int $uid, string $table, string $field): array
|
||||
{
|
||||
if ($uid <= 0) {
|
||||
return [];
|
||||
|
||||
@@ -10,7 +10,7 @@ class ContainerViewHelper extends AbstractViewHelper
|
||||
/**
|
||||
* @var int[]
|
||||
*/
|
||||
protected static $scale = [
|
||||
private static $scale = [
|
||||
'default' => 0,
|
||||
'small' => 8,
|
||||
'large' => 16,
|
||||
@@ -25,7 +25,7 @@ class ContainerViewHelper extends AbstractViewHelper
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $columnsWithoutContainers = [ 0, 1, 3 ];
|
||||
private static $columnsWithoutContainers = [ 0, 1, 3 ];
|
||||
|
||||
public function initializeArguments()
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ class IconViewHelper extends AbstractTagBasedViewHelper
|
||||
return $this->tag->render();
|
||||
}
|
||||
|
||||
protected static function getImageService()
|
||||
private static function getImageService()
|
||||
{
|
||||
return GeneralUtility::makeInstance(ImageService::class);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user