Boykodev
Boykodev

Reputation: 930

PhpStorm fluent setters by default

Every time I use "code generate" functionality for setters I need to check "Fluent setters" checkbox. Is it possible to make that checkbox enabled by default? enter image description here

Upvotes: 0

Views: 1460

Answers (3)

Guy
Guy

Reputation: 1332

I'm using PHPStorm 2019.1.3 (Mac) and pressing option+return opens a popup menu allowing me to create fluent setter.

Upvotes: 1

dominic
dominic

Reputation: 377

If in fact you always prefer this behaviour, you can replace the code for a normal setter with the code for a fluent setter.

If you want to sometimes have a non fluent setter you could also switch the codes. And then check the fluent setter box to insert normal setters.

Admitted, a hacky solution, but this solved the issue for me.

You can find the code here

Upvotes: 3

Dmitrii
Dmitrii

Reputation: 3567

Not possible yet: https://youtrack.jetbrains.com/issue/WI-38880 - feel free to vote/comment for it in order to increase its priority and get notified about updates.

Upvotes: 2

Related Questions