This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathlanguage-php.cson
159 lines (159 loc) · 5.51 KB
/
language-php.cson
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
'.source.php':
'$GLOBALS[\'…\']':
'prefix': 'globals'
'body': '$GLOBALS[\'${1:variable}\']${2: = }${3:something}${4:;}$0'
'<?php … ?>':
'prefix': 'php'
'body': 'php $0 ?>'
'shorthand echo':
'prefix': '<?'
'body': '<?= $0 ?>'
'function __construct':
'prefix': 'con'
'body': '${1:public }function __construct(${2:${3:Type }$${4:foo} ${5:= ${6:null}}})\n{\n\t${2:$this->${4:foo} = $${4:foo};}$0\n}'
'Heredoc':
'prefix': '<<<'
'body': '<<<${1:HTML}\n${2:content here}\n$1;\n'
'Class Variable':
'prefix': 'doc_v'
'body': '/**\n * ${3:undocumented class variable}\n *\n * @var ${4:string}\n */\n${1:var} $$2;$0'
'PHPDoc function …':
'prefix': 'doc_f'
'body': '/**\n * ${6:undocumented function summary}\n *\n * ${7:Undocumented function long description}\n *\n * @param ${8:type} ${9:var} ${10:Description}\n * @return ${11:return type}\n */\n${1:public }function ${2:FunctionName}(${3:$${4:value}${5:=\'\'}})\n{\n\t${0:# code...}\n}'
'Start Docblock':
'prefix': '/**'
'body': '/**\n * $0\n */'
'class …':
'prefix': 'class'
'body': '/**\n * $1\n */\nclass ${2:ClassName} ${3:extends ${4:AnotherClass}}\n{\n\t$5\n\tfunction ${6:__construct}(${7:argument})\n\t{\n\t\t${0:# code...}\n\t}\n}\n'
'trait …':
'prefix': 'trait'
'body': '/**\n * $1\n */\ntrait ${2:TraitName}\n{\n\tfunction ${3:functionName}(${4:argument})\n\t{\n\t\t${5:# code...}\n\t}\n}\n'
'define(…, …)':
'prefix': 'def'
'body': 'define(\'$1\', ${2:\'$3\'});\n$0'
'defined(…)':
'prefix': 'def?'
'body': '$1defined(\'$2\')$0'
'do … while …':
'prefix': 'do'
'body': 'do {\n\t${0:# code...}\n} while (${1:$a <= 10});'
'echo "…"':
'prefix': 'echo'
'body': 'echo "${1:string}";$0'
'else …':
'prefix': 'else'
'body': 'else {\n\t${0:# code...}\n}'
'elseif …':
'prefix': 'elseif'
'body': 'elseif (${1:condition}) {\n\t${0:# code...}\n}'
'for …':
'prefix': 'for'
'body': 'for ($${1:i}=${2:0}; $${1:i} < $3; $${1:i}++) { \n\t${0:# code...}\n}'
'foreach …':
'prefix': 'foreach'
'body': 'foreach ($${1:variable} as $${2:key} ${3:=> $${4:value}}) {\n\t${0:# code...}\n}'
'function …':
'prefix': 'fun'
'body': '${1:public }function ${2:FunctionName}(${3:$${4:value}${5:=\'\'}})\n{\n\t${0:# code...}\n}'
'if … else …':
'prefix': 'ifelse'
'body': 'if (${1:condition}) {\n\t${2:# code...}\n} else {\n\t${3:# code...}\n}\n$0'
'if …':
'prefix': 'if'
'body': 'if (${1:condition}) {\n\t${0:# code...}\n}'
'$… = ( … ) ? … : …':
'prefix': 'if?'
'body': '$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b} ;'
'include …':
'prefix': 'incl'
'body': 'include \'${1:file}\';$0'
'include_once …':
'prefix': 'incl1'
'body': 'include_once \'${1:file}\';$0'
'$… = array (…)':
'prefix': 'array'
'body': '$${1:arrayName} = array(\'$2\' => $3${4:,} $0);'
'$… = […]':
'prefix': 'shorray'
'body': '$${1:arrayName} = [\'$2\' => $3${4:,} $0];'
'… => …':
'prefix': 'keyval'
'body': '\'$1\' => $2${3:,} $0'
'require …':
'prefix': 'req'
'body': 'require \'${1:file}\';$0'
'require_once …':
'prefix': 'req1'
'body': 'require_once \'${1:file}\';$0'
'return':
'prefix': 'ret'
'body': 'return$1;$0'
'return false':
'prefix': 'ret0'
'body': 'return false;$0'
'return true':
'prefix': 'ret1'
'body': 'return true;$0'
'switch …':
'prefix': 'switch'
'body': 'switch (${1:variable}) {\n\tcase \'${2:value}\':\n\t\t${3:# code...}\n\t\tbreak;\n\t$0\n\tdefault:\n\t\t${4:# code...}\n\t\tbreak;\n}'
'case …':
'prefix': 'case'
'body': 'case \'${1:variable}\':\n\t${0:# code...}\n\tbreak;'
'$this->…':
'prefix': 'this'
'body': '$this->$0'
'echo $this->…':
'prefix': 'ethis'
'body': 'echo $this->$0'
'Throw Exception':
'prefix': 'throw'
'body': 'throw new $1Exception(${2:"${3:Error Processing Request}"}${4:, ${5:1}});\n$0'
'try …':
'prefix': 'try'
'body': 'try {\n\t$0\n} catch (${1:Exception $e}) {\n\t$2\n}\n'
'while …':
'prefix': 'while'
'body': 'while (${1:$a <= 10}) {\n\t${0:# code...}\n}'
'var_dump("…")':
'prefix': 'dump'
'body': 'var_dump($1);$0'
'.text.html.php:not(.source)':
'<?php $this->… ?>':
'prefix': 'this'
'body': '<?php $this->$0 ?>'
'<?php echo $this->… ?>':
'prefix': 'ethis'
'body': '<?php echo $this->$0 ?>'
'.text.html.php':
'<?php … ?>':
'prefix': 'php'
'body': '<?php $0 ?>'
'<?php echo … ?>':
'prefix': 'echo'
'body': '<?php echo ${1:$var} ?>$0'
'<?php echo htmlentities(…) ?>':
'prefix': 'echoh'
'body': '<?php echo htmlentities(${1:$var}, ENT_QUOTES, \'utf-8\'); ?>$0'
'<?php else: ?>':
'prefix': 'else'
'body': '<?php else: ?>'
'<?php foreach (…) … <?php endforeach ?>':
'prefix': 'foreach'
'body': '<?php foreach ($${1:variable} as $${2:key}${3: => $${4:value}}): ?>\n\t${0}\n<?php endforeach; ?>'
'<?php if (…) ?> … <?php else ?> … <?php endif ?>':
'prefix': 'ifelse'
'body': '<?php if (${1:condition}): ?>\n\t$2\n<?php else: ?>\n\t$0\n<?php endif; ?>'
'<?php if (…) ?> … <?php endif ?>':
'prefix': 'if'
'body': '<?php if (${1:condition}): ?>\n\t$0\n<?php endif; ?>'
'$_POST …':
'prefix': '_POST[""]'
'body': '_POST["${0:INPUT NAME}"];'
'$_GET …':
'prefix': '_GET[""]'
'body': '_GET["${0:INPUT NAME}"];'
'$_REQUEST …':
'prefix': '_REQUEST[""]'
'body': '_REQUEST["${0:INPUT NAME}"];'