Skip to content

Instantly share code, notes, and snippets.

@tristanlins
Last active August 29, 2015 14:04
Show Gist options
  • Save tristanlins/31289d3ce68a66421c07 to your computer and use it in GitHub Desktop.
Save tristanlins/31289d3ce68a66421c07 to your computer and use it in GitHub Desktop.
PHP Storm - File and Code Templates
#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