Key | Value |
---|---|
Plugin Url | http://plugins.jetbrains.com/plugin?pr=&pluginId=8133 |
ID | de.espend.idea.php.toolbox |
Doc x | http://phpstorm.espend.de/php-toolbox |
// Strips several non common variable names of type hint completion; like "interface"
function foo(FooInterface $<caret>)
function foo(FooAbstract $<caret>)
function foo(FooExtension $<caret>)
class Bar
{
public function foo()
{
[$this, 'foo<caret>']
[$foo, 'foo<caret>']
}
}
$foo = new Bar();
foo('\\DateTime');
foo('\\DateTime:format');
foo('\\DateTime::format');
'DateTime::format';
'date';
All files in project named .ide-toolbox.metadata.json
or application folder with pattern /php-toolbox/*-toolbox.metadata.json
. Find your application "Settings > Languages & Framework > PHP Toolbox"
{
"registrar":[
{
"signature":[
"Behat\\Behat\\Context\\Environment\\ContextEnvironment:hasContextClass",
"Behat\\Behat\\Context\\Environment\\InitializedContextEnvironment:getContext"
],
"provider":"behat_context_classes",
"language":"php"
}
],
"providers": [
{
"name": "behat_context_classes",
"source": {
"contributor": "sub_classes",
"parameter": "Behat\\Behat\\Context\\Context"
}
}
]
}
{
"provider":"date_format",
"language":"php",
"signatures":[
{
"class": "DateTime",
"method": "format"
},
{
"class": "PHPUnit_Framework_TestCase",
"method": "getMock",
"type": "type"
},
{
"class": "Symfony\\Component\\HttpFoundation\\Response",
"method": "__construct",
"type": "array_key",
"index": 2
},
{
"class": "Symfony\\Component\\HttpFoundation\\Response",
"method": "__construct",
"index": 2,
"array": "Content-Type"
}
]
}
foo('<caret>')
{
"function": "foo"
}
foo('', '<caret>')
{
"function": "foo",
"index": 1
}
/** @var $f \\FooClass */
$f->foo('<caret>')
{
"class": "FooClass",
"method": "foo"
}
/** @var $f \\FooClass */
$f->foo('', '<caret>')
{
"class": "FooClass",
"method": "foo",
"index": 1
}
/** @var $f \\FooClass */
$f->foo('date_time')->format<caret>
$f->foo(DateTime::class)->format<caret>
$f->foo(new DateTime())->format<caret>
$f->bar('', 'date_time')->format<caret>
{
"registrar":[
{
"provider":"date",
"language":"php",
"signatures":[
{
"class": "FooClass",
"method": "foo",
"type": "type"
},
{
"class": "FooClass",
"method": "bar",
"index": 1,
"type": "type"
}
]
}
],
"providers": [
{
"name": "date",
"items":[
{
"lookup_string": "date_time",
"type": "DateTime"
}
]
}
]
}
(new \Foo\Car())->foo('<caret>');
foo('<caret>');
Class Car
{
/**
* @param string $foo my Var #Class
* @param string $bar my car #<ProviderName> foo bar
*/
public function foo($foo, $bar) {}
}
/**
* @param string $foo my Var #Class
*/
function foo($foo) {}
foo(['<caret>'])
{
"function": "foo",
"type": "array_key"
}
foo(['foo' => '<caret>'])
{
"function": "foo",
"array": "foo"
}
{
"provider":"class_interface",
"language":"php",
"signature":[
"ReflectionProperty:__construct",
"class_exists",
"is_subclass_of:1" // ":1" means 2nd argument (arguments indexing starts from 0)
]
}
{{ foo('<caret>') }}
{% if foo('<caret>') %}
{% set bar = foo('<caret>') %}
{{ 'bar'|foo('<caret>') }}
{
"provider":"date_format",
"language":"twig",
"signatures":[
{
"function": "foo"
}
]
}
{
"name": "date_format",
"items":[
{
"lookup_string": "d",
"type_text": "Day of month (01..31)",
"icon": "com.jetbrains.php.PhpIcons.METHOD",
"presentable_text": "foo",
"tail_text": "foo",
"type": "DateTime",
"target": "DateTime",
"target": "Ns\\Time::format",
"target": "DateTime:format",
"target": "file://foo/foo.html.twig",
}
]
}
{
"name": "date_format",
"lookup_strings": ["car", "apple"]
}
{
"name": "date_format",
"defaults": {
"icon":"com.jetbrains.php.PhpIcons.METHOD",
},
"items": [
{
"lookup_string":"d",
}
]
}
class SecurityExtension implements Twig_ExtensionInterface
{
public function getName()
{
return 'security'
}
}
class WebProfilerExtension extends Twig_ExtensionInterface
{
public function getName()
{
return 'profiler'
}
}
{
"name": "twig_extensions",
"source": {
"contributor": "return",
"parameter": "Twig_ExtensionInterface::getName"
}
}
class UserAdmin implements AdminInterface
{
public function getExportFormats()
{
return ['json', 'xml']
}
}
class TopicAdmin extends AdminInterface
{
public function getExportFormats()
{
return ['csv', 'xls']
}
}
{
"name": "sonata_admin_export_formats",
"source": {
"contributor": "return_array",
"parameter": "Sonata\\AdminBundle\\Admin\\AdminInterface:getExportFormats"
}
}
class Foo implements BehatContext {}
class Foo extends BehatContext {}
{
"name": "behat_context_classes",
"source": {
"contributor": "sub_classes",
"parameter": "BehatContext"
}
}
{
"provider": "trait",
"language": "php"
}