refactor: remove dead code via Rector

rector.php gets the deadCode set: @param/@return/@var tags that only
repeat native types, === true comparisons, three unused constructor
dependencies (DateService, ProductDataService, AjaxWatchlistController),
the unused reseller lookup in ContextProcessor and an always-false check
in AbstractMappedFinisher (trimExplode with removeEmpty never yields an
empty remote name).

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:
frommeandClaude Opus 5.5 committed 2026-10-26 11:10:20 +01:00
1 parent 9347112d6b
commit f4556ee75c
62 files changed
+14 -534

No files matched your search

@@ -2,7 +2,6 @@
namespace EP\EpTheme\DataProcessing;
use EP\EpProducts\Service\ResellerDataService;
use EP\EpProducts\Traits\DbConnectionTrait;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
@@ -13,10 +12,6 @@ class ContextProcessor implements DataProcessorInterface
use DbConnectionTrait;
/**
* @param ContentObjectRenderer $cObj
* @param array $contentObjectConfiguration
* @param array $processorConfiguration
* @param array $processedData
* @return array
* @throws \Doctrine\DBAL\DBALException
*/
@@ -45,17 +40,6 @@ class ContextProcessor implements DataProcessorInterface
return $processedData;
}
/**
* @return array|bool
* @throws \Doctrine\DBAL\DBALException
*/
private function getResellerData()
{
/** @var ResellerDataService $resellerService */
$resellerService = GeneralUtility::makeInstance(ResellerDataService::class);
return $resellerService->getResellerForCurrentDomain();
}
/**
* @return string
*/
@@ -11,10 +11,6 @@ class FlexFormProcessor implements DataProcessorInterface
{
/**
* @param ContentObjectRenderer $cObj
* @param array $contentObjectConfiguration
* @param array $processorConfiguration
* @param array $processedData
*
* @return array
*/
@@ -14,10 +14,6 @@ class SliderProcessor implements DataProcessorInterface
use DbConnectionTrait;
/**
* @param ContentObjectRenderer $cObj
* @param array $contentObjectConfiguration
* @param array $processorConfiguration
* @param array $processedData
* @return array
* @throws \Doctrine\DBAL\DBALException
*/
@@ -11,10 +11,6 @@ class TeaserImageProcessor implements DataProcessorInterface
{
/**
* @param ContentObjectRenderer $cObj
* @param array $contentObjectConfiguration
* @param array $processorConfiguration
* @param array $processedData
*
* @return array
*/
@@ -20,10 +20,6 @@ class TeaserProcessor implements DataProcessorInterface
{
/**
* @param ContentObjectRenderer $cObj
* @param array $contentObjectConfiguration
* @param array $processorConfiguration
* @param array $processedData
*
* @return array
*/
@@ -6,15 +6,9 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
class Page extends AbstractEntity
{
/**
* @var int
*/
#[\Override]
protected ?int $uid = null;
/**
* @var int
*/
#[\Override]
protected ?int $pid = null;
@@ -24,7 +24,7 @@ abstract class AbstractMappedFinisher extends AbstractFinisher
}
[$remote, $local] = $parts;
if ('' === $remote || '' === $local) {
if ('' === $local) {
continue;
}
@@ -81,7 +81,7 @@ abstract class AbstractMappedFinisher extends AbstractFinisher
$collected = [];
foreach ($elements as $identifier => $element) {
if (true === in_array($identifier, $skip, true) || false === array_key_exists($identifier, $formValues)) {
if (in_array($identifier, $skip, true) || false === array_key_exists($identifier, $formValues)) {
continue;
}
@@ -94,7 +94,7 @@ abstract class AbstractMappedFinisher extends AbstractFinisher
if ('' === $label) {
$label = $identifier;
}
if (true === array_key_exists($label, $collected)) {
if (array_key_exists($label, $collected)) {
$label .= ' (' . $identifier . ')';
}
@@ -111,7 +111,7 @@ abstract class AbstractMappedFinisher extends AbstractFinisher
*/
protected function normalizeValue($value, string $identifier)
{
if (true === is_array($value)) {
if (is_array($value)) {
$normalized = [];
foreach ($value as $item) {
$item = $this->normalizeValue($item, $identifier);
@@ -133,7 +133,7 @@ abstract class AbstractMappedFinisher extends AbstractFinisher
return $resource?->getName();
}
if (true === is_object($value)) {
if (is_object($value)) {
$this->logWarning('Form value skipped while collecting labeled values: unsupported type.', [
'element' => $identifier,
'class' => $value::class,
@@ -13,7 +13,6 @@ class MyEpUrlViewHelper extends AbstractViewHelper
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public function render(): string
{
@@ -27,9 +27,6 @@ class PriceViewHelper extends AbstractViewHelper
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(