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

[FEATURE] Add support for TYPO3 v13.4 LTS #67

Merged
merged 1 commit into from
Nov 14, 2024
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 .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
fail-fast: false
matrix:
php-version: ["8.1", "8.2", "8.3", "8.4"]
typo3-version: ["11.5", "12.4", "13.0"]
typo3-version: ["11.5", "12.4", "13.4"]
dependencies: ["highest", "lowest"]
exclude:
- php-version: "8.1"
typo3-version: "13.0"
typo3-version: "13.4"
- php-version: "8.4"
typo3-version: "11.5"
env:
Expand Down
18 changes: 9 additions & 9 deletions Classes/ViewHelpers/DateIntervalViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,14 @@
*/
final class DateIntervalViewHelper extends Fluid\Core\ViewHelper\AbstractViewHelper
{
use Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;

public function initializeArguments(): void
{
$this->registerArgument('date', \DateTimeInterface::class, 'The date for which to create an interval');
$this->registerArgument('date', \DateTimeInterface::class, 'The date for which to create an interval', true);
}

public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
Fluid\Core\Rendering\RenderingContextInterface $renderingContext,
): ?int {
$date = $renderChildrenClosure();
public function render(): ?int
{
$date = $this->renderChildren();
/** @var int $now */
$now = Core\Utility\GeneralUtility::makeInstance(Core\Context\Context::class)->getPropertyFromAspect('date', 'timestamp');

Expand All @@ -56,4 +51,9 @@ public static function renderStatic(

return $now - $date->getTimestamp();
}

public function getContentArgumentName(): string
{
return 'date';
}
}
17 changes: 9 additions & 8 deletions Classes/ViewHelpers/Format/HumanDateViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,16 @@
*/
final class HumanDateViewHelper extends Fluid\Core\ViewHelper\AbstractViewHelper
{
use Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;
use Traits\TranslatableTrait;

public function initializeArguments(): void
{
$this->registerArgument('date', \DateTimeInterface::class, 'The date to format');
$this->registerArgument('date', \DateTimeInterface::class, 'The date to format', true);
}

public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
Fluid\Core\Rendering\RenderingContextInterface $renderingContext,
): ?string {
$date = $renderChildrenClosure();
public function render(): ?string
{
$date = $this->renderChildren();

if (!($date instanceof \DateTimeInterface)) {
return null;
Expand All @@ -60,6 +56,11 @@ public static function renderStatic(
return self::renderHumanDateInterval($date, $delta, $interval);
}

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

private static function renderHumanDateInterval(\DateTimeInterface $date, int $delta, \DateInterval $interval): string
{
if ($delta <= 30) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ console commands to list and flush the mail queue.
* Improved queueable file transport with failure metadata
* Backend module to list mails in queue
* Console command to list queue and flush mails
* Compatible with TYPO3 11.5 LTS, 12.4 LTS and 13.0
* Compatible with TYPO3 11.5 LTS, 12.4 LTS and 13.4 LTS

## 🔥 Installation

Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"symfony/console": "^5.4 || ^6.4 || ^7.0",
"symfony/mailer": "^5.4 || ^6.4 || ^7.0",
"symfony/mime": "^5.4 || ^6.4 || ^7.0",
"typo3/cms-backend": "~11.5.0 || ~12.4.0 || ~13.0.0",
"typo3/cms-core": "~11.5.0 || ~12.4.0 || ~13.0.0",
"typo3/cms-fluid": "~11.5.0 || ~12.4.0 || ~13.0.0",
"typo3fluid/fluid": "^2.7"
"typo3/cms-backend": "~11.5.0 || ~12.4.0 || ~13.4.0",
"typo3/cms-core": "~11.5.0 || ~12.4.0 || ~13.4.0",
"typo3/cms-fluid": "~11.5.0 || ~12.4.0 || ~13.4.0",
"typo3fluid/fluid": "^2.15 || ^4.0"
},
"require-dev": {
"armin/editorconfig-cli": "^1.8 || ^2.0",
Expand All @@ -34,9 +34,9 @@
"phpunit/phpcov": "^9.0 || ^10.0",
"saschaegerer/phpstan-typo3": "^1.10",
"ssch/typo3-rector": "^2.0",
"typo3/cms-lowlevel": "~11.5.0 || ~12.4.0 || ~13.0.0",
"typo3/cms-lowlevel": "~11.5.0 || ~12.4.0 || ~13.4.0",
"typo3/coding-standards": "^0.7.0 || ^0.8.0",
"typo3/testing-framework": "^7.0.2 || ^8.0.9"
"typo3/testing-framework": "^7.0.2 || ^8.0.9 || ^9.0.1"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'author_company' => 'coding. powerful. systems. CPS GmbH',
'constraints' => [
'depends' => [
'typo3' => '11.5.0-13.0.99',
'typo3' => '11.5.0-13.4.99',
'php' => '8.1.0-8.4.99',
],
],
Expand Down