cedricziel / idea-php-typo3-plugin

TYPO3 CMS Plugins for IntelliJ IDEA / PhpStorm
MIT License
97 stars 8 forks source link

Extbase method injection replacer for @inject not working anymore #329

Open sevenflip opened 4 years ago

sevenflip commented 4 years ago

For PhpStorm 2020.2.1 (Build #PS-202.6948.87, built on August 27, 2020)

When using the "Refactor to method injection" function on a property like this will result in a weird result:

/**
 * @var \MyNamespace\MyExtension\Domain\Repository\PageRepository
 * @inject
 */
protected $pageRepository;

Result:

public function injectPageRepository(#M#C\TYPO3\CMS\Extbase\Object\ObjectManagerInterface.get|#M#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance.get|#M#ȅ#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance%#K#C\TYPO3\CMS\Extbase\Object\ObjectManager.class.get|#M#π#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance≥\TYPO3\CMS\Extbase\Object\ObjectManager.get|#M#π#P#C\MyNamespace\MyExtension\Controller\SeoController.objectManager≥ø.get|#ȕ#M#C\TYPO3\CMS\Extbase\Object\ObjectManagerInterface.get|#M#π#P#C\MyNamespace\MyExtension\Controller\SeoController.objectManager≥ø.get|#M#π#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance≥\TYPO3\CMS\Extbase\Object\ObjectManager.get|#M#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance.get|#M#ȅ#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance%#K#C\TYPO3\CMS\Extbase\Object\ObjectManager.class.get%#K#C\MyNamespace\MyExtension\Domain\Repository\PageRepository.class|#Ɩ#M#C\TYPO3\CMS\Extbase\Object\ObjectManagerInterface.get|#M#π#P#C\MyNamespace\MyExtension\Controller\SeoController.objectManager≥ø.get|#M#π#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance≥\TYPO3\CMS\Extbase\Object\ObjectManager.get|#M#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance.get|#M#ȅ#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance%#K#C\TYPO3\CMS\Extbase\Object\ObjectManager.class.getƕ0ƀ#K#C\MyNamespace\MyExtension\Domain\Repository\PageRepository.class|\MyNamespace\MyExtension\Domain\Repository\PageRepository|? $pageRepository) {
        $this
vertexvaar commented 3 years ago

Hint: You can use https://github.com/sabbelasichon/typo3-rector as an alternative to refactor your code until this is fixed :wink: