1
1
snippet <?
2
2
<?php
3
3
4
- ${0}
4
+ ${0: ${VISUAL} }
5
5
snippet dst " declare(strict_types=1)"
6
6
declare(strict_types=${1: 1 } );
7
7
snippet ec
@@ -17,37 +17,38 @@ snippet ?
17
17
<?php ${0} ?>
18
18
snippet ?f
19
19
<?php foreach ($${1: vars } as $${2: $var } ): ?>
20
- ${0}
20
+ ${0: ${VISUAL} }
21
21
<?php endforeach ?>
22
22
snippet ?i
23
23
<?php if ($${1: var } ): ?>
24
- ${0}
24
+ ${0: ${VISUAL} }
25
25
<?php endif ?>
26
26
snippet ns
27
27
namespace ${1: Foo\B ar\B az } ;
28
- ${0}
28
+
29
+ ${0: ${VISUAL} }
29
30
snippet c
30
31
class ${1: `vim_snippets#Filename()` }
31
32
{
32
- ${0}
33
+ ${0: ${VISUAL} }
33
34
}
34
35
snippet i
35
36
interface ${1: `vim_snippets#Filename()` }
36
37
{
37
- ${0}
38
+ ${0: ${VISUAL} }
38
39
}
39
40
snippet t.
40
41
$this->
41
42
snippet f
42
43
function ${1} (${3} )
43
44
{
44
- ${0}
45
+ ${0: ${VISUAL} }
45
46
}
46
47
# method
47
48
snippet m
48
49
${1: protected } function ${2: foo } ()
49
50
{
50
- ${0}
51
+ ${0: ${VISUAL} }
51
52
}
52
53
snippet sm " PHP Class Setter"
53
54
/**
@@ -158,7 +159,7 @@ snippet doc_c
158
159
*/
159
160
${1: } class ${2: }
160
161
{
161
- ${0}
162
+ ${0: ${VISUAL} }
162
163
} // END $1 class $2
163
164
# Constant Definition - post doc
164
165
snippet doc_dp
@@ -232,7 +233,7 @@ snippet interface
232
233
*/
233
234
interface ${1: `vim_snippets#Filename()` }
234
235
{
235
- ${0}
236
+ ${0: ${VISUAL} }
236
237
}
237
238
# Trait
238
239
snippet trait
@@ -244,7 +245,7 @@ snippet trait
244
245
*/
245
246
trait ${1: `vim_snippets#Filename()` }
246
247
{
247
- ${0}
248
+ ${0: ${VISUAL} }
248
249
}
249
250
# class ...
250
251
snippet class
@@ -267,7 +268,7 @@ snippet nc
267
268
268
269
${2: abstract } class ${3: `vim_snippets#Filename()` }
269
270
{
270
- ${0}
271
+ ${0: ${VISUAL} }
271
272
}
272
273
# define(...)
273
274
snippet def " define('VARIABLE_NAME', 'definition')"
@@ -277,45 +278,43 @@ snippet def?
277
278
${1} defined('${2} ')
278
279
snippet wh " while (condition) { ... }"
279
280
while (${1: /* condition */ } ) {
280
- ${0}
281
+ ${0: ${VISUAL} }
281
282
}
282
283
snippet do " do { ... } while (condition)"
283
284
do {
284
- ${0}
285
+ ${0: ${VISUAL} }
285
286
} while (${1} );
286
287
snippet if " if (condition) { ... }"
287
288
if (${1} ) {
288
- ${0}
289
+ ${0: ${VISUAL} }
289
290
}
290
291
snippet ifn " if (!condition) { ... }"
291
292
if (!${1} ) {
292
- ${2 }
293
+ ${0 : ${VISUAL} }
293
294
}
294
295
snippet ifil " <?php if (condition): ?> ... <?php endif; ?>"
295
296
<?php if (${1} ): ?>
296
- ${0}
297
+ ${0: ${VISUAL} }
297
298
<?php endif; ?>
298
299
snippet ife " if (cond) { ... } else { ... }"
299
300
if (${1} ) {
300
- ${2 }
301
+ ${0 : ${VISUAL} }
301
302
} else {
302
- ${3 }
303
+ ${2 }
303
304
}
304
- ${0}
305
305
snippet ifeil " <?php if (condition): ?> ... <?php else: ?> ... <?php endif; ?>"
306
306
<?php if (${1} ): ?>
307
- ${2 }
307
+ ${0 : ${VISUAL} }
308
308
<?php else: ?>
309
- ${3 }
309
+ ${2 }
310
310
<?php endif; ?>
311
- ${0}
312
311
snippet el " else { ... }"
313
312
else {
314
- ${0}
313
+ ${0: ${VISUAL} }
315
314
}
316
315
snippet eif " elseif(condition) { ... }"
317
316
elseif (${1} ) {
318
- ${0}
317
+ ${0: ${VISUAL} }
319
318
}
320
319
snippet switch " switch($var) { case 'xyz': ... default: .... }"
321
320
switch ($${1: variable } ) {
@@ -329,23 +328,23 @@ snippet switch "switch($var) { case 'xyz': ... default: .... }"
329
328
}
330
329
snippet case " case 'value': ... break"
331
330
case '${1: value } ':
332
- ${2 }
331
+ ${0 : ${VISUAL} }
333
332
break;
334
333
snippet for " for ($i = 0; $i < $count; $i++) { ... }"
335
334
for ($${2: i } = 0; $$2 < ${1: count } ; $$2 ${3: ++ } ) {
336
- ${0}
335
+ ${0: ${VISUAL} }
337
336
}
338
337
snippet foreach " foreach ($var as $value) { .. }"
339
338
foreach ($${1: variable } as $${2: value } ) {
340
- ${0}
339
+ ${0: ${VISUAL} }
341
340
}
342
341
snippet foreachil " <?php foreach ($var as $value): ?> ... <?php endforeach; ?>"
343
342
<?php foreach ($${1: variable } as $${2: value } ): ?>
344
- ${0}
343
+ ${0: ${VISUAL} }
345
344
<?php endforeach; ?>
346
345
snippet foreachk " foreach ($var as $key => $value) { .. }"
347
346
foreach ($${1: variable } as $${2: key } => $${3: value } ) {
348
- ${0}
347
+ ${0: ${VISUAL} }
349
348
}
350
349
snippet foreachkil " <?php foreach ($var as $key => $value): ?> ... <?php endforeach; ?>"
351
350
<?php foreach ($${1: variable } as $${2: key } => $${3: value } ): ?>
@@ -355,7 +354,7 @@ snippet array "$... = ['' => ]"
355
354
$${1: arrayName } = ['${2} ' => ${3} ];
356
355
snippet try " try { ... } catch (Exception $e) { ... }"
357
356
try {
358
- ${0}
357
+ ${0: ${VISUAL} }
359
358
} catch (${1: Exception } $e) {
360
359
}
361
360
# lambda with closure
@@ -633,17 +632,17 @@ snippet asnnu "$this->assertNotNull($a)"
633
632
snippet test " public function testXYZ() { ... }"
634
633
public function test${1} ()
635
634
{
636
- ${0}
635
+ ${0: ${VISUAL} }
637
636
}
638
637
snippet setup " protected function setUp() { ... }"
639
638
protected function setUp()
640
639
{
641
- ${0}
640
+ ${0: ${VISUAL} }
642
641
}
643
642
snippet teardown " protected function tearDown() { ... }"
644
643
protected function tearDown()
645
644
{
646
- ${0}
645
+ ${0: ${VISUAL} }
647
646
}
648
647
snippet proph " $observer = $this->prophesize(SomeClass::class);"
649
648
$${1: observer } = $this->prophesize(${2: SomeClass } ::class);
0 commit comments