diff --git a/Classes/Domain/Renderer/Command.php b/Classes/Domain/Renderer/Command.php index 00161cf..e4480e7 100644 --- a/Classes/Domain/Renderer/Command.php +++ b/Classes/Domain/Renderer/Command.php @@ -7,7 +7,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; class Command implements RendererInterface { - public function getHtmlFromMjml($mjml) + public function getHtmlFromMjml($mjml): string { $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mjml']); @@ -36,7 +36,7 @@ class Command implements RendererInterface * @param string $args * @return string */ - protected function getEscapedCommand(string $cmd, string $args) + protected function getEscapedCommand(string $cmd, string $args): string { $escapedCmd = escapeshellcmd($cmd); diff --git a/Classes/Domain/Renderer/RendererInterface.php b/Classes/Domain/Renderer/RendererInterface.php index 5cef1b2..a7b2673 100644 --- a/Classes/Domain/Renderer/RendererInterface.php +++ b/Classes/Domain/Renderer/RendererInterface.php @@ -12,5 +12,5 @@ interface RendererInterface * @param string $mjml * @return string */ - public function getHtmlFromMjml($mjml); + public function getHtmlFromMjml($mjml): string; } diff --git a/Classes/View/MjmlBasedView.php b/Classes/View/MjmlBasedView.php index 116d33d..c8b2d45 100644 --- a/Classes/View/MjmlBasedView.php +++ b/Classes/View/MjmlBasedView.php @@ -7,10 +7,7 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; class MjmlBasedView extends StandaloneView { - /** - * @var RendererInterface - */ - protected $renderer; + protected RendererInterface $renderer; public function __construct(ContentObjectRenderer $contentObject = null, RendererInterface $renderer = null) { @@ -22,7 +19,7 @@ class MjmlBasedView extends StandaloneView } } - public function render($actionName = null) + public function render($actionName = null): string { return $this->renderer->getHtmlFromMjml(parent::render($actionName)); } diff --git a/Tests/Unit/AbstractUnitTestCase.php b/Tests/Unit/AbstractUnitTestCase.php index 814e944..4a4948a 100644 --- a/Tests/Unit/AbstractUnitTestCase.php +++ b/Tests/Unit/AbstractUnitTestCase.php @@ -8,7 +8,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; abstract class AbstractUnitTestCase extends UnitTestCase { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/Tests/Unit/Domain/Renderer/CommandTest.php b/Tests/Unit/Domain/Renderer/CommandTest.php index 0e0b794..5417195 100644 --- a/Tests/Unit/Domain/Renderer/CommandTest.php +++ b/Tests/Unit/Domain/Renderer/CommandTest.php @@ -11,12 +11,9 @@ use TYPO3\CMS\Extbase\Object\ObjectManager; class CommandTest extends AbstractUnitTestCase { - /** - * @var ObjectManager - */ - protected $objectManager; + protected ObjectManager $objectManager; - public function setUp() + public function setUp(): void { parent::setUp(); $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); @@ -25,7 +22,7 @@ class CommandTest extends AbstractUnitTestCase /** * @test */ - public function htmlIsReturnedForMjml() + public function htmlIsReturnedForMjml(): void { // Mock extension to be active, to enable path fetching to call node binary. $packageMock = $this->getMockBuilder(Package::class) diff --git a/Tests/Unit/View/MjmlBasedViewTest.php b/Tests/Unit/View/MjmlBasedViewTest.php index 6d6b747..c5ba60b 100644 --- a/Tests/Unit/View/MjmlBasedViewTest.php +++ b/Tests/Unit/View/MjmlBasedViewTest.php @@ -31,7 +31,7 @@ class MjmlBasedViewTest extends AbstractUnitTestCase /** * @test */ - public function viewCallsRendererAndReturnsRenderedHtml() + public function viewCallsRendererAndReturnsRenderedHtml(): void { $expectedHtml = '