Skip to content

Commit 1cb4023

Browse files
zonuexeAndreaCrotti
authored andcommitted
Add snippets for php-mode (AndreaCrotti#205)
* Add snippets for php-mode * Fix typo
1 parent 643d6a0 commit 1cb4023

22 files changed

+176
-0
lines changed

snippets/php-mode/__call

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: __call()
4+
# key: __call
5+
# group: Magic Methods
6+
# --
7+
public function __call($name, $args)
8+
{
9+
$0
10+
}

snippets/php-mode/__callStatic

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: __callStatic()
4+
# key: __callStatic
5+
# group: Magic Methods
6+
# --
7+
public function __callStatic($name, $args)
8+
{
9+
$0
10+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc (multi-line)
4+
# key: /**
5+
# group: annotation
6+
# --
7+
/**
8+
* ${1:Summary}
9+
*
10+
*$0
11+
*/

snippets/php-mode/doc-comment-oneline

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: Doc comment (one-line)
4+
# key: *
5+
# group: annotation
6+
# --
7+
/** ${1:Summary} */

snippets/php-mode/foreach=>

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: foreach (array as $key => $value)
4+
# key: foreach=>
5+
# group : control structure
6+
# --
7+
foreach (${1:$expression} as \$${2:key} => \$${3:value}) {
8+
$0
9+
}

snippets/php-mode/license-doc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc @license
4+
# key: *license
5+
# group: annotation
6+
# --
7+
* @license ${1:https://www.gnu.org/licenses/gpl-3.0.html} ${2:GPL-3.0}${0:
8+
*}

snippets/php-mode/license-doc-apache

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc @license Apache License
4+
# key: *license-apache
5+
# group: annotation
6+
# --
7+
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache-2.0${0:
8+
*}

snippets/php-mode/license-doc-gplv2

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc @license GPLv2
4+
# key: *license-gplv2
5+
# group: annotation
6+
# --
7+
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPL-2.0${0:
8+
*}

snippets/php-mode/license-doc-mit

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc @license MIT
4+
# key: *license-mit
5+
# group: annotation
6+
# --
7+
* @license https://opensource.org/licenses/MIT MIT${0:
8+
*}

snippets/php-mode/license-doc-mpl

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc @license MPL
4+
# key: *license-mpl
5+
# group: annotation
6+
# --
7+
* @license https://www.mozilla.org/en-US/MPL/2.0/ MPL-2.0${0:
8+
*}

snippets/php-mode/method-doc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc @property
4+
# key: *property
5+
# group: annotation
6+
# --
7+
* @property ${1:type} ${2:$variable} ${3:description}${0:
8+
*}

snippets/php-mode/param-doc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc @param
4+
# key: *param
5+
# group: annotation
6+
# --
7+
* @param ${1:type} ${2:$variable} ${3:description}${0:
8+
*}

snippets/php-mode/property-doc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc @property
4+
# key: *property
5+
# group: annotation
6+
# --
7+
* @property ${1:type} ${2:$variable} ${3:description}${0:
8+
*}

snippets/php-mode/psysh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: psysh
4+
# key: psysh
5+
# group: generic
6+
# --
7+
eval(\Psy\sh());

snippets/php-mode/return-doc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc @return
4+
# key: *return
5+
# group: annotation
6+
# --
7+
* @return ${1:type} ${2:description}${0:
8+
*}

snippets/php-mode/stdout

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: fwrite(STDOUT)
4+
# key: stdout
5+
# group: generic
6+
# --
7+
fwrite(STDOUT, ${1:$var}${2: . PHP_EOL});

snippets/php-mode/ticks

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: declare(ticks=)
4+
# key: ticks
5+
# group: definitions
6+
# --
7+
declare(ticks=${1:1});

snippets/php-mode/var-doc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc: var
4+
# key: *var
5+
# group: definitions
6+
# --
7+
* @var ${type}${0:
8+
*}

snippets/php-mode/var-oneline

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: PHPDoc: @var (one-line)
4+
# key: @var
5+
# group: definitions
6+
# --
7+
/** @var ${type} */

snippets/php-mode/vd

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: var_dump()
4+
# key: vd
5+
# group: generic
6+
# --
7+
var_dump(${1:$var});

snippets/php-mode/vde

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: var_dump() exit
4+
# key: vde
5+
# group: generic
6+
# --
7+
var_dump(${1:$var});exit(1);

snippets/php-mode/ve

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- mode: snippet -*-
2+
# contributor: USAMI Kenta <[email protected]>
3+
# name: var_export()
4+
# key: ve
5+
# group: generic
6+
# --
7+
var_export(${1:$var}${2:, true});

0 commit comments

Comments
 (0)