Skip to content

Instantly share code, notes, and snippets.

@irnnr irnnr/README.md
Last active Oct 2, 2015

Embed
What would you like to do?
TYPO3 Dynamic Return Type code completion
{
"methodCalls": [
{
"class": "\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility",
"method": "makeInstance",
"position": 0
},
{
"class": "\\TYPO3\\CMS\\Extbase\\Object\\ObjectManager",
"method": "get",
"position": 0
},
{
"class": "\\TYPO3\\CMS\\Extbase\\Object\\ObjectManager",
"method": "create",
"position": 0
}
]
}
@etobi

This comment has been minimized.

Copy link

commented Sep 12, 2014

Looks almost like mine. Additionally, I've added ObjectManagerInterface, too.

        {
            "class": "\\TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface",
            "method": "get",
            "position": 0
        }
@fedir

This comment has been minimized.

Copy link

commented Sep 12, 2014

For those, who have deal with 4.5, following snippet could be quite useful :

{
    "class": "t3lib_div",
    "method": "makeInstance",
    "position": 0
},

I will add some explication of the DynamicReturnType plugin :

$view = t3lib_div::makeInstance('Tx_Fluid_View_StandaloneView');

Using the DynamicReturnTypePlugin, PHPStorm will know that '$view' is of type 'Tx_Fluid_View_StandaloneView' and will be able to autosuggest all of the functions available to an object of that type, as well as do code-inspection to pick up any obvious type errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.