Skip to content

Commit

Permalink
Merge pull request #87 from oliverklee/task/drop-9lts
Browse files Browse the repository at this point in the history
[TASK] Drop support for TYPO3 9LTS
  • Loading branch information
sascha-egerer authored Oct 18, 2022
2 parents 5cc4890 + f45b797 commit 2ec248e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 45 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,6 @@ jobs:
fail-fast: false
matrix:
include:
- typo3-version: "^9.5"
php-version: "7.2"
composer-flags: ""
- typo3-version: "^9.5"
php-version: "7.2"
composer-flags: " --prefer-lowest"
- typo3-version: "^9.5"
php-version: "7.3"
composer-flags: ""
- typo3-version: "^9.5"
php-version: "7.3"
composer-flags: " --prefer-lowest"
- typo3-version: "^9.5"
php-version: "7.4"
composer-flags: ""
- typo3-version: "^9.5"
php-version: "7.4"
composer-flags: " --prefer-lowest"
- typo3-version: "^10.4"
php-version: "7.2"
composer-flags: ""
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.8.9",
"nikic/php-parser": "^4.15.1",
"typo3/cms-core": "^9.5 || ^10.4 || ^11.5",
"typo3/cms-extbase": "^9.5 || ^10.4 || ^11.5"
"typo3/cms-core": "^10.4 || ^11.5",
"typo3/cms-extbase": "^10.4 || ^11.5"
},
"require-dev": {
"consistence-community/coding-standard": "^3.10.1",
Expand Down
20 changes: 1 addition & 19 deletions src/Service/ValidatorClassNameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use PHPStan\Type\Constant\ConstantStringType;
use PHPStan\Type\Type;
use ReflectionMethod;
use TYPO3\CMS\Extbase\Validation\ValidatorResolver;

final class ValidatorClassNameResolver
{
Expand All @@ -16,23 +14,7 @@ public function resolve(Type $type): ?string
return null;
}

if (class_exists(\TYPO3\CMS\Extbase\Validation\ValidatorClassNameResolver::class)) {
return \TYPO3\CMS\Extbase\Validation\ValidatorClassNameResolver::resolve($type->getValue());
}

if (!class_exists(ValidatorResolver::class)) {
return null;
}

// This is for older TYPO3 Versions where the class ValidatorClassNameResolver does not exist yet =< 9.5
try {
$reflectionMethod = new ReflectionMethod(ValidatorResolver::class, 'resolveValidatorObjectName');
$reflectionMethod->setAccessible(true);

return $reflectionMethod->invokeArgs(new ValidatorResolver(), [$type->getValue()]);
} catch (\ReflectionException $exception) {
return null;
}
return \TYPO3\CMS\Extbase\Validation\ValidatorClassNameResolver::resolve($type->getValue());
}

}
4 changes: 1 addition & 3 deletions tests/Unit/Type/data/context-get-aspect-return-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ class MyContext

public function getAspectTests(Context $context): void
{
if (class_exists(TypoScriptAspect::class)) {
assertType(TypoScriptAspect::class, $context->getAspect('typoscript'));
}
assertType(TypoScriptAspect::class, $context->getAspect('typoscript'));
assertType(DateTimeAspect::class, $context->getAspect('date'));
assertType(VisibilityAspect::class, $context->getAspect('visibility'));
assertType(UserAspect::class, $context->getAspect('backend.user'));
Expand Down
4 changes: 1 addition & 3 deletions tests/Unit/Type/data/request-get-attribute-return-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ class MyRequest

public function getAttributeTests(ServerRequestInterface $request): void
{
if (class_exists(\TYPO3\CMS\Core\Routing\SiteRouteResult::class) && class_exists(\TYPO3\CMS\Core\Routing\PageArguments::class)) {
assertType(\TYPO3\CMS\Core\Routing\PageArguments::class . '|' . \TYPO3\CMS\Core\Routing\SiteRouteResult::class . '|null', $request->getAttribute('routing'));
}
assertType(\TYPO3\CMS\Core\Routing\PageArguments::class . '|' . \TYPO3\CMS\Core\Routing\SiteRouteResult::class . '|null', $request->getAttribute('routing'));
assertType(SiteLanguage::class . '|null', $request->getAttribute('language'));
assertType(Site::class . '|null', $request->getAttribute('site'));
assertType(NormalizedParams::class . '|null', $request->getAttribute('normalizedParams'));
Expand Down

0 comments on commit 2ec248e

Please sign in to comment.