Last active
August 29, 2015 14:04
-
-
Save tristanlins/31289d3ce68a66421c07 to your computer and use it in GitHub Desktop.
PHP Storm - File and Code Templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if (${TYPE_HINT} == "string" || ${TYPE_HINT} == "int" || ${TYPE_HINT} == "float" || ${TYPE_HINT} == "double" || ${TYPE_HINT} == "bool") | |
| #set ($CAST = "(${TYPE_HINT}) ") | |
| #set ($PARAM_HINT = "") | |
| #else | |
| #set ($CAST = "") | |
| #set ($PARAM_HINT = "${TYPE_HINT} ") | |
| #end | |
| /** | |
| * @param ${TYPE_HINT} $${PARAM_NAME} | |
| * | |
| * @return static | |
| */ | |
| public ${STATIC} function set${NAME}(${PARAM_HINT} $${PARAM_NAME}) | |
| { | |
| #if (${STATIC} == "static") | |
| self::$${FIELD_NAME} = ${CAST}$${PARAM_NAME}; | |
| #else | |
| $this->${FIELD_NAME} = ${CAST}$${PARAM_NAME}; | |
| #end | |
| return $this; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment