forked from aubm/jetbrains-live-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Custom PHP.xml
128 lines (127 loc) · 7.22 KB
/
Custom PHP.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="Custom PHP">
<template name="dd" value="var_dump($VAR$); die();$END$" description="var_dump(); die" toReformat="true" toShortenFQNames="true">
<variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="construct" value="public function __construct($ARGS$) { $END$ }" description="class constructor" toReformat="true" toShortenFQNames="true">
<variable name="ARGS" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="cls" value="class $NAME$ { $END$ }" description="class" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="if" value="if ($COND$) { $END$ }" description="if () {}" toReformat="true" toShortenFQNames="true">
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="else" value="if ($COND$) { $INSTRS$ } else { $END$ }" description="if () { } else { }" toReformat="true" toShortenFQNames="true">
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="INSTRS" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="elseif" value="if ($COND$) { $INST$ } elseif ($ELSECOND$) { $INSTELSEIF$ } else { $END$ }" description="if ($cond) {} elseif ($cond) else {}" toReformat="true" toShortenFQNames="true">
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="INST" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="ELSECOND" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="INSTELSEIF" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="switch" value="switch ($VAR$) { case $VAL$: $INST$ break; default: $DEFAUILT$ break; } $END$" description="switch ($var) {}" toReformat="true" toShortenFQNames="true">
<variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="VAL" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="INST" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="DEFAUILT" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="fori" value="for ($_i = 0; $_i < $LIMIT$; $_i++) { $END$ }" description="for ($_i...) {}" toReformat="true" toShortenFQNames="true">
<variable name="LIMIT" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="for" value="for ($ITERATOR$; $COND$; $INCR$) { $END$ }" description="for (...) {}" toReformat="true" toShortenFQNames="true">
<variable name="ITERATOR" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="INCR" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="aif" value="<?php if ($COND$): ?> $END$ <?php endif; ?>" description="alternative if syntax" toReformat="true" toShortenFQNames="true">
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
</context>
</template>
<template name="aelse" value="<?php if ($COND$): ?> $END$ <?php else: ?> <?php endif; ?>" description="alternative if else syntax" toReformat="true" toShortenFQNames="true">
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
</context>
</template>
<template name="aelseif" value="<?php if ($COND$): ?> <?php elseif ($ELSEIFCOND$): ?> <?php else: ?> <?php endif; ?>" description="alternative if elseif else syntax" toReformat="false" toShortenFQNames="true">
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="ELSEIFCOND" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
</context>
</template>
<template name="afore" value="<?php foreach ($ARRAY$ as $VAL$): ?> $END$ <?php endforeach; ?>" description="alternative foreach syntax" toReformat="true" toShortenFQNames="true">
<variable name="ARRAY" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="VAL" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
</context>
</template>
<template name="aforek" value="<?php foreach ($ARRAY$ as $KEY$ => $VAL$): ?> $END$ <?php endforeach; ?>" description="alternative foreach key syntax" toReformat="true" toShortenFQNames="true">
<variable name="ARRAY" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="KEY" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="VAL" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
</context>
</template>
<template name="d" value="var_dump($VAR$);$END$" description="var_dump();" toReformat="true" toShortenFQNames="true">
<variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="t" value="$this->$END$" description="$this->" toReformat="true" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="try" value="try { $END$ } catch (\Exception $e) { }" description="try {...} catch ($CLASS$ $e) { ... }" toReformat="true" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="ifset" value="if (isset($VAR$)) { $END$ }" description="if (isset($VAR$)) { ... }" toReformat="true" toShortenFQNames="true">
<variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
</templateSet>