Skip to content

Commit

Permalink
[TASK] Avoid Fluid compile trait
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Dec 9, 2024
1 parent 8610fcd commit e2eb596
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 15 deletions.
8 changes: 5 additions & 3 deletions Classes/ViewHelpers/Content/GetViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;

/**
* Gets all child content of a record based on area.
Expand Down Expand Up @@ -55,8 +54,6 @@
*/
class GetViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;

/**
* @var boolean
*/
Expand Down Expand Up @@ -88,6 +85,11 @@ public function initializeArguments(): void
$this->registerArgument('hideUntranslated', 'boolean', 'Exclude untranslated records', false, false);
}

public function render()

Check failure on line 88 in Classes/ViewHelpers/Content/GetViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.2 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Content\GetViewHelper::render() has no return type specified.

Check failure on line 88 in Classes/ViewHelpers/Content/GetViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.3 TYPO3 ^12.4

Method FluidTYPO3\Flux\ViewHelpers\Content\GetViewHelper::render() has no return type specified.

Check failure on line 88 in Classes/ViewHelpers/Content/GetViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.2 TYPO3 ^12.4

Method FluidTYPO3\Flux\ViewHelpers\Content\GetViewHelper::render() has no return type specified.

Check failure on line 88 in Classes/ViewHelpers/Content/GetViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 7.4 TYPO3 ^10.4

Method FluidTYPO3\Flux\ViewHelpers\Content\GetViewHelper::render() has no return type specified.

Check failure on line 88 in Classes/ViewHelpers/Content/GetViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.1 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Content\GetViewHelper::render() has no return type specified.

Check failure on line 88 in Classes/ViewHelpers/Content/GetViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.0 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Content\GetViewHelper::render() has no return type specified.
{
return self::renderStatic($this->arguments, $this->buildRenderChildrenClosure(), $this->renderingContext);
}

/**
* @return string|array|null
*/
Expand Down
8 changes: 5 additions & 3 deletions Classes/ViewHelpers/Form/DataViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;

/**
* Converts raw flexform xml into an associative array, and applies any
Expand Down Expand Up @@ -47,8 +46,6 @@
*/
class DataViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;

/**
* @var boolean
*/
Expand All @@ -67,6 +64,11 @@ public function initializeArguments(): void
$this->registerArgument('as', 'string', 'Optional name of variable to assign in tag content rendering');
}

public function render()

Check failure on line 67 in Classes/ViewHelpers/Form/DataViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.2 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\DataViewHelper::render() has no return type specified.

Check failure on line 67 in Classes/ViewHelpers/Form/DataViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.3 TYPO3 ^12.4

Method FluidTYPO3\Flux\ViewHelpers\Form\DataViewHelper::render() has no return type specified.

Check failure on line 67 in Classes/ViewHelpers/Form/DataViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.2 TYPO3 ^12.4

Method FluidTYPO3\Flux\ViewHelpers\Form\DataViewHelper::render() has no return type specified.

Check failure on line 67 in Classes/ViewHelpers/Form/DataViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 7.4 TYPO3 ^10.4

Method FluidTYPO3\Flux\ViewHelpers\Form\DataViewHelper::render() has no return type specified.

Check failure on line 67 in Classes/ViewHelpers/Form/DataViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.1 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\DataViewHelper::render() has no return type specified.

Check failure on line 67 in Classes/ViewHelpers/Form/DataViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.0 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\DataViewHelper::render() has no return type specified.
{
return self::renderStatic($this->arguments, $this->buildRenderChildrenClosure(), $this->renderingContext);
}

/**
* @return mixed
*/
Expand Down
13 changes: 10 additions & 3 deletions Classes/ViewHelpers/Form/OptionViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@
use FluidTYPO3\Flux\Form\OptionCarryingInterface;
use FluidTYPO3\Flux\ViewHelpers\AbstractFormViewHelper;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;

/**
* Form option ViewHelper
*/
class OptionViewHelper extends AbstractFormViewHelper
{
use CompileWithContentArgumentAndRenderStatic;

public static string $option = '';

public function initializeArguments(): void
Expand All @@ -29,6 +26,11 @@ public function initializeArguments(): void
$this->registerArgument('name', 'string', 'Name of the option to be set', true);
}

public function render()

Check failure on line 29 in Classes/ViewHelpers/Form/OptionViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.2 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\OptionViewHelper::render() has no return type specified.

Check failure on line 29 in Classes/ViewHelpers/Form/OptionViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.3 TYPO3 ^12.4

Method FluidTYPO3\Flux\ViewHelpers\Form\OptionViewHelper::render() has no return type specified.

Check failure on line 29 in Classes/ViewHelpers/Form/OptionViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.2 TYPO3 ^12.4

Method FluidTYPO3\Flux\ViewHelpers\Form\OptionViewHelper::render() has no return type specified.

Check failure on line 29 in Classes/ViewHelpers/Form/OptionViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 7.4 TYPO3 ^10.4

Method FluidTYPO3\Flux\ViewHelpers\Form\OptionViewHelper::render() has no return type specified.

Check failure on line 29 in Classes/ViewHelpers/Form/OptionViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.1 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\OptionViewHelper::render() has no return type specified.

Check failure on line 29 in Classes/ViewHelpers/Form/OptionViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.0 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\OptionViewHelper::render() has no return type specified.
{
return self::renderStatic($this->arguments, $this->buildRenderChildrenClosure(), $this->renderingContext);
}

public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
Expand All @@ -54,4 +56,9 @@ public static function renderStatic(
1602693000
);
}

public function getContentArgumentName(): ?string
{
return 'value';
}
}
8 changes: 5 additions & 3 deletions Classes/ViewHelpers/Form/RenderViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;

/**
* ## Main form rendering ViewHelper
Expand All @@ -24,8 +23,6 @@
*/
class RenderViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;

/**
* @var boolean
*/
Expand All @@ -36,6 +33,11 @@ public function initializeArguments(): void
$this->registerArgument('form', Form::class, 'Form instance to render as HTML', true);
}

public function render()

Check failure on line 36 in Classes/ViewHelpers/Form/RenderViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.2 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\RenderViewHelper::render() has no return type specified.

Check failure on line 36 in Classes/ViewHelpers/Form/RenderViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.3 TYPO3 ^12.4

Method FluidTYPO3\Flux\ViewHelpers\Form\RenderViewHelper::render() has no return type specified.

Check failure on line 36 in Classes/ViewHelpers/Form/RenderViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.2 TYPO3 ^12.4

Method FluidTYPO3\Flux\ViewHelpers\Form\RenderViewHelper::render() has no return type specified.

Check failure on line 36 in Classes/ViewHelpers/Form/RenderViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 7.4 TYPO3 ^10.4

Method FluidTYPO3\Flux\ViewHelpers\Form\RenderViewHelper::render() has no return type specified.

Check failure on line 36 in Classes/ViewHelpers/Form/RenderViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.1 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\RenderViewHelper::render() has no return type specified.

Check failure on line 36 in Classes/ViewHelpers/Form/RenderViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.0 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\RenderViewHelper::render() has no return type specified.
{
return self::renderStatic($this->arguments, $this->buildRenderChildrenClosure(), $this->renderingContext);
}

public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
Expand Down
13 changes: 10 additions & 3 deletions Classes/ViewHelpers/Form/VariableViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@

use FluidTYPO3\Flux\ViewHelpers\AbstractFormViewHelper;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;

/**
* Sets an option in the Form instance
*/
class VariableViewHelper extends AbstractFormViewHelper
{
use CompileWithContentArgumentAndRenderStatic;

public function initializeArguments(): void
{
$this->registerArgument('value', 'mixed', 'Value of the option');
Expand All @@ -32,6 +29,11 @@ public function initializeArguments(): void
);
}

public function render()

Check failure on line 32 in Classes/ViewHelpers/Form/VariableViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.2 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\VariableViewHelper::render() has no return type specified.

Check failure on line 32 in Classes/ViewHelpers/Form/VariableViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.3 TYPO3 ^12.4

Method FluidTYPO3\Flux\ViewHelpers\Form\VariableViewHelper::render() has no return type specified.

Check failure on line 32 in Classes/ViewHelpers/Form/VariableViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.2 TYPO3 ^12.4

Method FluidTYPO3\Flux\ViewHelpers\Form\VariableViewHelper::render() has no return type specified.

Check failure on line 32 in Classes/ViewHelpers/Form/VariableViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 7.4 TYPO3 ^10.4

Method FluidTYPO3\Flux\ViewHelpers\Form\VariableViewHelper::render() has no return type specified.

Check failure on line 32 in Classes/ViewHelpers/Form/VariableViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.1 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\VariableViewHelper::render() has no return type specified.

Check failure on line 32 in Classes/ViewHelpers/Form/VariableViewHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan, PHP 8.0 TYPO3 ^11.5

Method FluidTYPO3\Flux\ViewHelpers\Form\VariableViewHelper::render() has no return type specified.
{
return self::renderStatic($this->arguments, $this->buildRenderChildrenClosure(), $this->renderingContext);
}

public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
Expand All @@ -43,4 +45,9 @@ public static function renderStatic(
->setVariable($variableName, $renderChildrenClosure());
return '';
}

public function getContentArgumentName(): ?string
{
return 'value';
}
}

0 comments on commit e2eb596

Please sign in to comment.