diff --git a/UltiSnips/php.snippets b/UltiSnips/php.snippets index 85a1b3a..01cd0ae 100644 --- a/UltiSnips/php.snippets +++ b/UltiSnips/php.snippets @@ -97,7 +97,7 @@ snippet getter "PHP Class Getter" !b /* * Getter for $1 */ -public function get${1/\w+\s*/\u$0/}() +public function get${1/\w+\s*/\u$0/}() { return $this->$1;$2 } @@ -117,22 +117,20 @@ $0 endsnippet snippet gs "PHP Class Getter Setter" !b -protected $$1 - /* - * Getter for $1 + * Getter for ${1/(\w+)\s*;/$1/} */ -public function get${1/\w+\s*/\u$0/}() +public function get${1/(\w+)\s*;/\u$1/}() { - return $this->$1;$2 + return $this->${1/(\w+)\s*;/$1/};$2 } /* - * Setter for $1 + * Setter for ${1/(\w+)\s*;/$1/} */ -public function set${1/\w+\s*/\u$0/}($$1) +public function set${1/(\w+)\s*;/\u$1/}($${1/(\w+)\s*;/$1/}) { - $this->$1 = $$1;$3 + $this->${1/(\w+)\s*;/$1/} = $${1/(\w+)\s*;/$1/};$3 ${4:return $this;} } $0 @@ -187,7 +185,7 @@ $0 endsnippet snippet fu "Function snip" !b -function ${1:name}(${2:$param}) +function ${1:name}(${2:$param}) { ${VISUAL}${3:return null;} } @@ -217,7 +215,7 @@ endsnippet snippet class "Class declaration template" !b /** - * Class ${1:`!p snip.rv=snip.fn.split('.')[0]`} + * Class ${1:`!p snip.rv=snip.fn.split('.')[0]`} * @author $2 */ class $1 @@ -261,4 +259,3 @@ public function $1Action($2) endsnippet # :vim:ft=snippets: -