user3776663
user3776663

Reputation: 73

How can I change the phpstorm custom constructor template?

I'm using phpstorm code > Generate... > constructor to get:

function __construct()
{
}

But I want:

public function __construct()
{
}

How can I change the template? Can't find anything and I don't want to use live templates instead (I like the generate function).

Upvotes: 6

Views: 1268

Answers (2)

LazyOne
LazyOne

Reputation: 165188

How can I change the template?

You cannot. There is no template for constructor unfortunately.

http://youtrack.jetbrains.com/issue/WI-16548 -- follow this ticket (star/vote/comment) to get notified on progress.

EDIT: This has been implemented since v9.0 (released in 2015) and the default template can be found and altered at "Settings/Preferences | Editor | File and Code Templates"

enter image description here

Upvotes: 6

JoeriV
JoeriV

Reputation: 357

You can do this by opening the preferences window. In there you'll find "File and Code Templates". On the code tab you can adjust all templates.

enter image description here

Upvotes: 2

Related Questions