Add snippets for php-mode (#205)

* Add snippets for php-mode

* Fix typo
This commit is contained in:
USAMI Kenta 2017-09-21 03:05:01 +09:00 committed by Andrea Crotti
parent 643d6a0e10
commit 1cb40233f8
22 changed files with 176 additions and 0 deletions

10
snippets/php-mode/__call Normal file
View File

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: __call()
# key: __call
# group: Magic Methods
# --
public function __call($name, $args)
{
$0
}

View File

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: __callStatic()
# key: __callStatic
# group: Magic Methods
# --
public function __callStatic($name, $args)
{
$0
}

View File

@ -0,0 +1,11 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc (multi-line)
# key: /**
# group: annotation
# --
/**
* ${1:Summary}
*
*$0
*/

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: Doc comment (one-line)
# key: *
# group: annotation
# --
/** ${1:Summary} */

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: foreach (array as $key => $value)
# key: foreach=>
# group : control structure
# --
foreach (${1:$expression} as \$${2:key} => \$${3:value}) {
$0
}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc @license
# key: *license
# group: annotation
# --
* @license ${1:https://www.gnu.org/licenses/gpl-3.0.html} ${2:GPL-3.0}${0:
*}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc @license Apache License
# key: *license-apache
# group: annotation
# --
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache-2.0${0:
*}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc @license GPLv2
# key: *license-gplv2
# group: annotation
# --
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPL-2.0${0:
*}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc @license MIT
# key: *license-mit
# group: annotation
# --
* @license https://opensource.org/licenses/MIT MIT${0:
*}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc @license MPL
# key: *license-mpl
# group: annotation
# --
* @license https://www.mozilla.org/en-US/MPL/2.0/ MPL-2.0${0:
*}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc @property
# key: *property
# group: annotation
# --
* @property ${1:type} ${2:$variable} ${3:description}${0:
*}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc @param
# key: *param
# group: annotation
# --
* @param ${1:type} ${2:$variable} ${3:description}${0:
*}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc @property
# key: *property
# group: annotation
# --
* @property ${1:type} ${2:$variable} ${3:description}${0:
*}

7
snippets/php-mode/psysh Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: psysh
# key: psysh
# group: generic
# --
eval(\Psy\sh());

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc @return
# key: *return
# group: annotation
# --
* @return ${1:type} ${2:description}${0:
*}

7
snippets/php-mode/stdout Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: fwrite(STDOUT)
# key: stdout
# group: generic
# --
fwrite(STDOUT, ${1:$var}${2: . PHP_EOL});

7
snippets/php-mode/ticks Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: declare(ticks=)
# key: ticks
# group: definitions
# --
declare(ticks=${1:1});

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc: var
# key: *var
# group: definitions
# --
* @var ${type}${0:
*}

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: PHPDoc: @var (one-line)
# key: @var
# group: definitions
# --
/** @var ${type} */

7
snippets/php-mode/vd Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: var_dump()
# key: vd
# group: generic
# --
var_dump(${1:$var});

7
snippets/php-mode/vde Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: var_dump() exit
# key: vde
# group: generic
# --
var_dump(${1:$var});exit(1);

7
snippets/php-mode/ve Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: USAMI Kenta <tadsan@zonu.me>
# name: var_export()
# key: ve
# group: generic
# --
var_export(${1:$var}${2:, true});