Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[!!!][TASK] Drop Interface suffix from interfaces #391

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Classes/Cache/CacheInterface.php → Classes/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
namespace Fr\Typo3Handlebars\Cache;

/**
* CacheInterface
* Cache
*
* @author Elias Häußler <e.haeussler@familie-redlich.de>
* @license GPL-2.0-or-later
*/
interface CacheInterface
interface Cache
{
public function get(string $template): ?string;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Cache/HandlebarsCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @license GPL-2.0-or-later
*/
#[AsAlias('handlebars.cache')]
class HandlebarsCache implements CacheInterface
class HandlebarsCache implements Cache
{
public function __construct(
#[Autowire('@cache.handlebars')]
Expand Down
2 changes: 1 addition & 1 deletion Classes/Cache/NullCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @author Elias Häußler <e.haeussler@familie-redlich.de>
* @license GPL-2.0-or-later
*/
final class NullCache implements CacheInterface
final class NullCache implements Cache
{
public function get(string $template): ?string
{
Expand Down
4 changes: 2 additions & 2 deletions Classes/Compatibility/View/ExtbaseViewAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace Fr\Typo3Handlebars\Compatibility\View;

use Fr\Typo3Handlebars\DataProcessing\DataProcessorInterface;
use Fr\Typo3Handlebars\DataProcessing\DataProcessor;
use TYPO3\CMS\Extbase\Mvc\Request;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
use TYPO3\CMS\Fluid\View\AbstractTemplateView;
Expand All @@ -42,7 +42,7 @@ class ExtbaseViewAdapter extends AbstractTemplateView
protected array $renderData = [];

public function __construct(
protected readonly DataProcessorInterface $processor,
protected readonly DataProcessor $processor,
) {
parent::__construct();
}
Expand Down
8 changes: 4 additions & 4 deletions Classes/Compatibility/View/HandlebarsViewResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace Fr\Typo3Handlebars\Compatibility\View;

use Fr\Typo3Handlebars\DataProcessing\DataProcessorInterface;
use Fr\Typo3Handlebars\DataProcessing\DataProcessor;
use Psr\Http\Message\ServerRequestInterface;
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand All @@ -40,7 +40,7 @@
class HandlebarsViewResolver extends GenericViewResolver
{
/**
* @var array<class-string, array<string, DataProcessorInterface>>
* @var array<class-string, array<string, DataProcessor>>
*/
protected array $processorMap = [];

Expand All @@ -65,7 +65,7 @@ protected function hasProcessor(string $controllerClassName, string $actionName)
return $this->getProcessor($controllerClassName, $actionName) !== null;
}

protected function getProcessor(string $controllerClassName, string $actionName): ?DataProcessorInterface
protected function getProcessor(string $controllerClassName, string $actionName): ?DataProcessor
{
if (!\array_key_exists($controllerClassName, $this->processorMap)) {
return null;
Expand All @@ -87,7 +87,7 @@ protected function getProcessor(string $controllerClassName, string $actionName)
}

/**
* @param array<class-string, array<string, DataProcessorInterface>> $processorMap
* @param array<class-string, array<string, DataProcessor>> $processorMap
*/
public function setProcessorMap(array $processorMap): self
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;

/**
* ContentObjectRendererAwareInterface
* ContentObjectRendererAware
*
* @author Elias Häußler <e.haeussler@familie-redlich.de>
* @license GPL-2.0-or-later
*/
interface ContentObjectRendererAwareInterface
interface ContentObjectRendererAware
{
public function setContentObjectRenderer(ContentObjectRenderer $contentObjectRenderer): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@

namespace Fr\Typo3Handlebars\Data;

use Fr\Typo3Handlebars\Data\Response\ProviderResponseInterface;
use Fr\Typo3Handlebars\Data\Response\ProviderResponse;

/**
* DataProviderInterface
* DataProvider
*
* @author Elias Häußler <e.haeussler@familie-redlich.de>
* @license GPL-2.0-or-later
*/
interface DataProviderInterface
interface DataProvider
{
/**
* @param array<string, mixed> $data
*/
public function get(array $data): ProviderResponseInterface;
public function get(array $data): ProviderResponse;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
namespace Fr\Typo3Handlebars\Data\Response;

/**
* ProviderResponseInterface
* ProviderResponse
*
* @author Elias Häußler <e.haeussler@familie-redlich.de>
* @license GPL-2.0-or-later
*/
interface ProviderResponseInterface
interface ProviderResponse
{
/**
* @return array<string, mixed>
Expand Down
2 changes: 1 addition & 1 deletion Classes/Data/Response/SimpleProviderResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
* @implements \ArrayAccess<string, mixed>
*/
class SimpleProviderResponse implements ProviderResponseInterface, \ArrayAccess
class SimpleProviderResponse implements ProviderResponse, \ArrayAccess
{
/**
* @param array<string, mixed> $data
Expand Down
14 changes: 7 additions & 7 deletions Classes/DataProcessing/AbstractDataProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

namespace Fr\Typo3Handlebars\DataProcessing;

use Fr\Typo3Handlebars\Data\DataProviderInterface;
use Fr\Typo3Handlebars\Data\DataProvider;
use Fr\Typo3Handlebars\Exception\UnableToPresentException;
use Fr\Typo3Handlebars\Presenter\PresenterInterface;
use Fr\Typo3Handlebars\Presenter\Presenter;
use Fr\Typo3Handlebars\Traits\ErrorHandlingTrait;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
Expand All @@ -39,15 +39,15 @@
* @author Elias Häußler <e.haeussler@familie-redlich.de>
* @license GPL-2.0-or-later
*/
abstract class AbstractDataProcessor implements DataProcessorInterface, LoggerAwareInterface
abstract class AbstractDataProcessor implements DataProcessor, LoggerAwareInterface
{
use ErrorHandlingTrait;
use LoggerAwareTrait;

protected ?ConfigurationManagerInterface $configurationManager = null;
protected ?ContentObjectRenderer $contentObjectRenderer = null;
protected ?PresenterInterface $presenter = null;
protected ?DataProviderInterface $provider = null;
protected ?Presenter $presenter = null;
protected ?DataProvider $provider = null;
protected string $content = '';

/**
Expand Down Expand Up @@ -79,7 +79,7 @@ public function process(string $content, array $configuration): string
/**
* @required
*/
public function setPresenter(PresenterInterface $presenter): DataProcessorInterface
public function setPresenter(Presenter $presenter): DataProcessor
{
$this->presenter = $presenter;
return $this;
Expand All @@ -88,7 +88,7 @@ public function setPresenter(PresenterInterface $presenter): DataProcessorInterf
/**
* @required
*/
public function setProvider(DataProviderInterface $provider): DataProcessorInterface
public function setProvider(DataProvider $provider): DataProcessor
{
$this->provider = $provider;
return $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
namespace Fr\Typo3Handlebars\DataProcessing;

/**
* DataProcessorInterface
* DataProcessor
*
* @author Elias Häußler <e.haeussler@familie-redlich.de>
* @license GPL-2.0-or-later
*/
interface DataProcessorInterface
interface DataProcessor
{
/**
* @param array<string|int, mixed> $configuration
Expand Down
6 changes: 3 additions & 3 deletions Classes/DataProcessing/SimpleProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace Fr\Typo3Handlebars\DataProcessing;

use Fr\Typo3Handlebars\Exception\InvalidTemplateFileException;
use Fr\Typo3Handlebars\Renderer\RendererInterface;
use Fr\Typo3Handlebars\Renderer\Renderer;
use Fr\Typo3Handlebars\Traits\ErrorHandlingTrait;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
Expand All @@ -37,15 +37,15 @@
* @license GPL-2.0-or-later
*/
#[Autoconfigure(public: true)]
class SimpleProcessor implements DataProcessorInterface
class SimpleProcessor implements DataProcessor
{
use ErrorHandlingTrait;

protected ?ContentObjectRenderer $contentObjectRenderer = null;

public function __construct(
protected readonly LoggerInterface $logger,
protected readonly RendererInterface $renderer,
protected readonly Renderer $renderer,
) {}

public function process(string $content, array $configuration): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
namespace Fr\Typo3Handlebars\DependencyInjection\Compatibility;

/**
* CompatibilityLayerInterface
* CompatibilityLayer
*
* @author Elias Häußler <e.haeussler@familie-redlich.de>
* @license GPL-2.0-or-later
* @internal
*/
interface CompatibilityLayerInterface
interface CompatibilityLayer
{
/**
* @param array<string, mixed> $configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace Fr\Typo3Handlebars\DependencyInjection\Compatibility;

use Fr\Typo3Handlebars\Compatibility\View\HandlebarsViewResolver;
use Fr\Typo3Handlebars\DataProcessing\DataProcessorInterface;
use Fr\Typo3Handlebars\DataProcessing\DataProcessor;
use Fr\Typo3Handlebars\Exception\InvalidClassException;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
Expand All @@ -39,7 +39,7 @@
* @license GPL-2.0-or-later
* @internal
*/
final readonly class ExtbaseControllerCompatibilityLayer implements CompatibilityLayerInterface
final readonly class ExtbaseControllerCompatibilityLayer implements CompatibilityLayer
{
public const TYPE = 'extbase_controller';

Expand Down Expand Up @@ -84,7 +84,7 @@ public function provide(string $processorServiceId, array $configuration): bool
/**
* @param class-string $controllerClassName
* @param array<string, Reference> $actionMap
* @return array<string, array<string, DataProcessorInterface>>
* @return array<string, array<string, DataProcessor>>
*/
private function buildProcessorMap(string $controllerClassName, array $actionMap): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function provideCompatibility(): void
/**
* @throws UnsupportedTypeException
*/
private function buildLayerForType(string $type): CompatibilityLayerInterface
private function buildLayerForType(string $type): CompatibilityLayer
{
return match ($type) {
ExtbaseControllerCompatibilityLayer::TYPE => new ExtbaseControllerCompatibilityLayer($this->container),
Expand Down
4 changes: 2 additions & 2 deletions Classes/DependencyInjection/DataProcessorPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace Fr\Typo3Handlebars\DependencyInjection;

use Fr\Typo3Handlebars\DataProcessing\DataProcessorInterface;
use Fr\Typo3Handlebars\DataProcessing\DataProcessor;
use Fr\Typo3Handlebars\DependencyInjection\Compatibility\ProcessorCompatibility;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -45,7 +45,7 @@ public function __construct(

public function process(ContainerBuilder $container): void
{
$container->registerForAutoconfiguration(DataProcessorInterface::class)->addTag($this->processorTagName);
$container->registerForAutoconfiguration(DataProcessor::class)->addTag($this->processorTagName);

foreach ($container->findTaggedServiceIds($this->processorTagName) as $id => $tags) {
$service = $container->findDefinition($id);
Expand Down
2 changes: 1 addition & 1 deletion Classes/DependencyInjection/FeatureRegistrationPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function process(DependencyInjection\ContainerBuilder $container): void
}

/**
* @param class-string<Renderer\Helper\HelperInterface> $className
* @param class-string<Renderer\Helper\Helper> $className
*/
private function activateHelper(string $name, string $className): void
{
Expand Down
4 changes: 2 additions & 2 deletions Classes/Event/AfterRenderingEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AfterRenderingEvent
public function __construct(
private readonly string $templatePath,
private string $content,
private readonly Renderer\RendererInterface $renderer,
private readonly Renderer\Renderer $renderer,
) {}

public function getTemplatePath(): string
Expand All @@ -55,7 +55,7 @@ public function setContent(string $content): self
return $this;
}

public function getRenderer(): Renderer\RendererInterface
public function getRenderer(): Renderer\Renderer
{
return $this->renderer;
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Event/BeforeRenderingEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BeforeRenderingEvent
public function __construct(
private readonly string $templatePath,
private array $variables,
private readonly Renderer\RendererInterface $renderer,
private readonly Renderer\Renderer $renderer,
) {}

public function getTemplatePath(): string
Expand Down Expand Up @@ -76,7 +76,7 @@ public function removeVariable(string $name): self
return $this;
}

public function getRenderer(): Renderer\RendererInterface
public function getRenderer(): Renderer\Renderer
{
return $this->renderer;
}
Expand Down
6 changes: 3 additions & 3 deletions Classes/Presenter/AbstractPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@

namespace Fr\Typo3Handlebars\Presenter;

use Fr\Typo3Handlebars\Renderer\RendererInterface;
use Fr\Typo3Handlebars\Renderer\Renderer;

/**
* AbstractPresenter
*
* @author Elias Häußler <e.haeussler@familie-redlich.de>
* @license GPL-2.0-or-later
*/
abstract class AbstractPresenter implements PresenterInterface
abstract class AbstractPresenter implements Presenter
{
public function __construct(
protected readonly RendererInterface $renderer,
protected readonly Renderer $renderer,
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

namespace Fr\Typo3Handlebars\Presenter;

use Fr\Typo3Handlebars\Data\Response\ProviderResponseInterface;
use Fr\Typo3Handlebars\Data\Response\ProviderResponse;

/**
* PresenterInterface
* Presenter
*
* @author Elias Häußler <e.haeussler@familie-redlich.de>
* @license GPL-2.0-or-later
*/
interface PresenterInterface
interface Presenter
{
public function present(ProviderResponseInterface $data): string;
public function present(ProviderResponse $data): string;
}
Loading
Loading