Skip to content

Commit

Permalink
Merge pull request #82 from oliverklee/feature/typo3-12
Browse files Browse the repository at this point in the history
[FEATURE] Add support for TYPO3 12
  • Loading branch information
sascha-egerer authored Oct 18, 2022
2 parents 2ec248e + ba0f18f commit 8e532dd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ jobs:
- typo3-version: "^11.5"
php-version: "8.2"
composer-flags: " --prefer-lowest"
- typo3-version: "^12.0"
php-version: "8.1"
composer-flags: ""
- typo3-version: "^12.0"
php-version: "8.1"
composer-flags: " --prefer-lowest"
- typo3-version: "^12.0"
php-version: "8.2"
composer-flags: ""
- typo3-version: "^12.0"
php-version: "8.2"
composer-flags: " --prefer-lowest"

steps:
- name: "Checkout"
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": "^10.4 || ^11.5",
"typo3/cms-extbase": "^10.4 || ^11.5"
"typo3/cms-core": "^10.4 || ^11.5 || ^12.0",
"typo3/cms-extbase": "^10.4 || ^11.5 || ^12.0"
},
"require-dev": {
"consistence-community/coding-standard": "^3.10.1",
Expand Down
9 changes: 7 additions & 2 deletions src/Type/ObjectManagerDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,24 @@
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;

/**
* @deprecated This class will be dropped once support for TYPO3 <= 10 is dropped.
*/
class ObjectManagerDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension
{

public function getClass(): string
{
return \TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class;
return interface_exists(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class)
? \TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class : '';
}

public function isMethodSupported(
MethodReflection $methodReflection
): bool
{
return $methodReflection->getName() === 'get';
return interface_exists(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class)
&& $methodReflection->getName() === 'get';
}

public function getTypeFromMethodCall(
Expand Down

0 comments on commit 8e532dd

Please sign in to comment.