diff --git a/php-mode/abstract-class b/php-mode/abstract-class index bfcadcbd..aae718b8 100644 --- a/php-mode/abstract-class +++ b/php-mode/abstract-class @@ -1,7 +1,7 @@ # -*- mode: snippet -*- # name: abstract class -# key: acl -# uuid: acl +# key: ab +# uuid: ab # -- abstract class ${1:Name}${2: extends ${3:Parent}} { diff --git a/php-mode/array b/php-mode/array index 5bec7257..0454b6ad 100644 --- a/php-mode/array +++ b/php-mode/array @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: array(...) -# key: arr -# uuid: arr +# key: ar +# uuid: ar # -- array(`%`$0) \ No newline at end of file diff --git a/php-mode/assignment b/php-mode/assignment index c9d76fc8..664c8729 100644 --- a/php-mode/assignment +++ b/php-mode/assignment @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: $var = value; -# key: = -# uuid: = +# key: va +# uuid: va # -- \$${1:var_name} = `%`$0; \ No newline at end of file diff --git a/php-mode/class-final b/php-mode/class-final new file mode 100644 index 00000000..e8635bdc --- /dev/null +++ b/php-mode/class-final @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: PHP class +# key: clf +# uuid: clf +# -- +final class ${1:Name}${2: extends ${3:Parent}} +{ + `%`$0 +} \ No newline at end of file diff --git a/php-mode/constructor b/php-mode/constructor new file mode 100644 index 00000000..28190ca8 --- /dev/null +++ b/php-mode/constructor @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: class construct +# key: ct +# uuid: ct +# -- +${1:public} function __construct(\$${1:property}) +{ + `%`$0 +} \ No newline at end of file diff --git a/php-mode/do-while b/php-mode/do-while new file mode 100644 index 00000000..6d3a3659 --- /dev/null +++ b/php-mode/do-while @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: do while loop +# key: do +# uuid: do +# -- +do { + $0 +} while (${1:condition}); diff --git a/php-mode/echo b/php-mode/echo index b1f8b7d1..b34727d2 100644 --- a/php-mode/echo +++ b/php-mode/echo @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: echo ...; -# key: e -# uuid: e +# key: ec +# uuid: ec # -- echo `%`$0; \ No newline at end of file diff --git a/php-mode/elseif b/php-mode/elseif index fad9752b..f3e24673 100644 --- a/php-mode/elseif +++ b/php-mode/elseif @@ -1,7 +1,7 @@ # -*- mode: snippet -*- # name: elseif (...) { ... } -# key: eli -# uuid: eli +# key: ei +# uuid: ei # -- elseif ($1) { `%`$0 diff --git a/php-mode/enumeration b/php-mode/enumeration new file mode 100644 index 00000000..b3fbb7d7 --- /dev/null +++ b/php-mode/enumeration @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: enumeration +# key: enu +# uuid: enu +# -- +enum ${1:Name} +{ + case ${2:name};$0 +} diff --git a/php-mode/fori b/php-mode/for-classic similarity index 100% rename from php-mode/fori rename to php-mode/for-classic diff --git a/php-mode/function-anonymous b/php-mode/function-anonymous new file mode 100644 index 00000000..69e0988a --- /dev/null +++ b/php-mode/function-anonymous @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: anonymous function +# key: fuan +# uuid: fuan +# -- +function ($${2:variable}) { + $0; +} \ No newline at end of file diff --git a/php-mode/function-arrow b/php-mode/function-arrow new file mode 100644 index 00000000..4bdf7307 --- /dev/null +++ b/php-mode/function-arrow @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: arrow function +# key: fuar +# uuid: fuar +# -- +fn(\$${1:variable}) => $0; diff --git a/php-mode/match b/php-mode/match new file mode 100644 index 00000000..30b19da6 --- /dev/null +++ b/php-mode/match @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: match expression +# key: match +# uuid: match +# -- +match (\$${1:subject_expression}) { + ${2:conditional_expression} => ${3:return_expression}, +}; \ No newline at end of file diff --git a/php-mode/method b/php-mode/method index 80183eac..99ae41fc 100644 --- a/php-mode/method +++ b/php-mode/method @@ -3,7 +3,7 @@ # key: met # uuid: met # -- -${1:public} function ${2:name}($3) +${1:public} function ${2:name}($3)${4::} ${5:type} { `%`$0 } \ No newline at end of file diff --git a/php-mode/namespace b/php-mode/namespace new file mode 100644 index 00000000..b00aab34 --- /dev/null +++ b/php-mode/namespace @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: namespace +# key: name +# uuid: name +# -- +namespace ${1:name}; \ No newline at end of file diff --git a/php-mode/object-accessor b/php-mode/object-accessor deleted file mode 100644 index d7783d5b..00000000 --- a/php-mode/object-accessor +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: $o->... -# key: -> -# uuid: -> -# -- -\$${1:obj_name}->${2:var} \ No newline at end of file diff --git a/php-mode/object-property b/php-mode/object-property new file mode 100644 index 00000000..b16f315a --- /dev/null +++ b/php-mode/object-property @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: $object->prop +# key: op +# uuid: op +# -- +\$${1:object}->${2:property}; \ No newline at end of file diff --git a/php-mode/php b/php-mode/php index f5f8352e..c3949cd5 100644 --- a/php-mode/php +++ b/php-mode/php @@ -3,4 +3,4 @@ # key: php # uuid: php # -- - \ No newline at end of file +} \ No newline at end of file diff --git a/php-mode/phpdoc b/php-mode/phpdoc index bddb7eb6..434c0a60 100644 --- a/php-mode/phpdoc +++ b/php-mode/phpdoc @@ -1,7 +1,7 @@ # -*- mode: snippet -*- -# name: /** ... */ -# key: /** -# uuid: /** +# name: docblock summary +# key: doc +# uuid: doc # -- /** * ${0:`(if % (s-replace "\n" "\n * " %))`} diff --git a/php-mode/phpdoc-tag b/php-mode/phpdoc-tag new file mode 100644 index 00000000..d929fa2d --- /dev/null +++ b/php-mode/phpdoc-tag @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: docblock tag +# key: dot +# uuid: dot +# -- +/** + * @${1:tag} ${2:type} ${0:optional} + */ \ No newline at end of file diff --git a/php-mode/shebang b/php-mode/shebang index a2789047..0d2ffe2f 100644 --- a/php-mode/shebang +++ b/php-mode/shebang @@ -1,9 +1,9 @@ # -*- mode: snippet -*- -# name: #!/usr/bin/env php +# name: php shebang # key: #! # uuid: #! # -- #!/usr/bin/env php -$0 \ No newline at end of file +\$this->$0; \ No newline at end of file diff --git a/php-mode/try-catch b/php-mode/try-catch new file mode 100644 index 00000000..6a589fdd --- /dev/null +++ b/php-mode/try-catch @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: try-catch +# key: try +# uuid: try +# -- +try { + ${1:statement} +} catch (${2:Exception} \$${3:variable}) { + $0 +} diff --git a/php-mode/variable b/php-mode/variable new file mode 100644 index 00000000..8f4581cc --- /dev/null +++ b/php-mode/variable @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: variable +# key: va +# uuid: va +# -- +\$${1:name} = ${value}; \ No newline at end of file diff --git a/php-mode/while b/php-mode/while index 7bdf9dcb..1d2581de 100644 --- a/php-mode/while +++ b/php-mode/while @@ -1,5 +1,7 @@ # -*- mode: snippet -*- # name: while loop +# key: whi +# uuid: whi # -- while (${1:condition}) { `%`$0