You can copy the XML below and paste them into your live templates in PHPStorm to start using it :)
Last active
June 12, 2022 22:07
-
-
Save frankdejonge/1cd9d38c3bd4e6548f83c5977e3b2c69 to your computer and use it in GitHub Desktop.
PHP Wither template
This file contains 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
<template name="wither" value="public function with$WITHER_SUFFIX$($MEMBER_TYPE$ $$$WITHER_NAME$): static { $clone = clone $this; $clone->$WITHER_NAME$ = $$$WITHER_NAME$; return $clone; }" description="" toReformat="true" toShortenFQNames="true"> | |
<variable name="MEMBER_TYPE" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="WITHER_NAME" expression="" defaultValue=""parameter"" alwaysStopAt="true" /> | |
<variable name="WITHER_SUFFIX" expression="capitalize(WITHER_NAME)" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="PHP Class Member" value="true" /> | |
</context> | |
</template> |
This file contains 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
<template name="wither" value="public function with$WITHER_SUFFIX$($MEMBER_TYPE$ $$$WITHER_NAME$): $CLASS_NAME$ { $clone = clone $this; $clone->$WITHER_NAME$ = $$$WITHER_NAME$; return $clone; }" description="" toReformat="true" toShortenFQNames="true"> | |
<variable name="MEMBER_TYPE" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="WITHER_NAME" expression="" defaultValue=""parameter"" alwaysStopAt="true" /> | |
<variable name="WITHER_SUFFIX" expression="capitalize(WITHER_NAME)" defaultValue="" alwaysStopAt="false" /> | |
<variable name="CLASS_NAME" expression="phpClassName()" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="PHP Class Member" value="true" /> | |
</context> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment