dotfiles/system/.config/phpstorm/config/templates/PHP.xml
Severin Kaderli f7a21144b8
Add code templates
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
2019-07-30 13:15:44 +02:00

61 lines
No EOL
4.2 KiB
XML

<templateSet group="PHP">
<template name="fore" value="foreach ($ITERABLE$ as $VAR_VALUE$) {&#10; $END$&#10;}" description="foreach(iterable_expr as $value) {...}" toReformat="true" toShortenFQNames="true">
<variable name="ITERABLE" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="VAR_VALUE" expression="phpSuggestVariableName()" defaultValue="&quot;$item&quot;" alwaysStopAt="true" />
<context />
</template>
<template name="forek" value="foreach ($ITERABLE$ as $VAR_KEY$ =&gt; $VAR_VALUE$) {&#10; $END$&#10;}" description="foreach(iterable_expr as $key =&gt; $value) {...}" toReformat="true" toShortenFQNames="true">
<variable name="ITERABLE" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="VAR_KEY" expression="phpSuggestVariableName()" defaultValue="&quot;$index&quot;" alwaysStopAt="true" />
<variable name="VAR_VALUE" expression="phpSuggestVariableName()" defaultValue="&quot;$item&quot;" alwaysStopAt="true" />
<context />
</template>
<template name="thr" value="throw new $END$" description="throw new" toReformat="true" toShortenFQNames="true">
<context />
</template>
<template name="eco" value="echo &quot;$END$&quot;;" description="'echo' statement" toReformat="true" toShortenFQNames="true">
<context />
</template>
<template name="rqr" value="require &quot;$END$&quot;;" description="'require' statement" toReformat="true" toShortenFQNames="true">
<context />
</template>
<template name="rqro" value="require_once &quot;$END$&quot;;" description="'require_once' statement" toReformat="true" toShortenFQNames="true">
<context />
</template>
<template name="inc" value="include &quot;$END$&quot;;" description="'include' statement" toReformat="true" toShortenFQNames="true">
<context />
</template>
<template name="inco" value="include_once &quot;$END$&quot;;" description="'include_once' statement" toReformat="true" toShortenFQNames="true">
<context />
</template>
<template name="pubf" value="public function $NAME$($PARAMETERS$){&#10; $END$&#10;}" description="public function" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMETERS" expression="phpVar" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="pubsf" value="public static function $NAME$($PARAMETERS$){&#10; $END$&#10;}" description="public static function" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMETERS" expression="phpVar" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="prof" value="protected function $NAME$($PARAMETERS$){&#10; $END$&#10;}" description="protected function" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMETERS" expression="phpVar" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="prosf" value="protected static function $NAME$($PARAMETERS$){&#10; $END$&#10;}" description="protected static function" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMETERS" expression="phpVar" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="prif" value="private function $NAME$($PARAMETERS$){&#10; $END$&#10;}" description="private function" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMETERS" expression="phpVar" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="prisf" value="private static function $NAME$($PARAMETERS$){&#10; $END$&#10;}" description="private static function" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMETERS" expression="phpVar" defaultValue="" alwaysStopAt="true" />
<context />
</template>
</templateSet>