Skip to content

Commit 0a47ec4

Browse files
authored
Update readme.md
1 parent 30780a5 commit 0a47ec4

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

readme.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[link-downloads]: https://packagist.org/packages/timehunter/laravel-json-to-class-generator
1111
## Installation
1212

13-
Star me if you like it. ^.^
13+
Star me if you like it. ^.^ You can use this tool with PHPStorm to create nice classes.
1414

1515
Install the package in development dependencies:
1616

@@ -123,6 +123,27 @@ class Author
123123

124124
````
125125

126+
## PHPStorm
127+
128+
If you are using PHPStorm and you want to put `return $this` in each set function.
129+
130+
Open PhpStorm's Preferences and "File and Code Templates" menu, under the "Code" tab there's an option called "PHP Setter Method". Modify it to look like this:
131+
132+
````php
133+
/**
134+
* @param ${TYPE_HINT} $${PARAM_NAME}
135+
* @return ${CLASS_NAME}
136+
*/
137+
public ${STATIC} function set${NAME}($${PARAM_NAME})
138+
{
139+
#if (${STATIC} == "static")
140+
self::$${FIELD_NAME} = $${PARAM_NAME};
141+
#else
142+
$this->${FIELD_NAME} = $${PARAM_NAME};
143+
#end
144+
return $this;
145+
}
146+
````
126147

127148
## License
128149

0 commit comments

Comments
 (0)