From db3b240783cbc5858dceee6b864fb37758062dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20L=C3=B3pez=20P=C3=A9rez?= Date: Wed, 19 Mar 2014 14:43:08 +0100 Subject: [PATCH] Fix PHP getter and setter UltiSnips snippet Was broken due to complex regular expressions applied to $1, which made UltiSnips to complain about not knowing it. Simplified the snippet using the already working getter and setter snippets. --- UltiSnips/php.snippets | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/UltiSnips/php.snippets b/UltiSnips/php.snippets index 24f6cc5..84003a7 100644 --- a/UltiSnips/php.snippets +++ b/UltiSnips/php.snippets @@ -120,19 +120,19 @@ endsnippet snippet gs "PHP Class Getter Setter" b /* - * Getter for ${1/(\w+)\s*;/$1/} + * Getter for $1 */ -public function get${1/(\w+)\s*;/\u$1/}() +public function get${1/\w+\s*/\u$0/}() { - return $this->${1/(\w+)\s*;/$1/};$2 + return $this->$1;$2 } /* - * Setter for ${1/(\w+)\s*;/$1/} + * Setter for $1 */ -public function set${1/(\w+)\s*;/\u$1/}($${1/(\w+)\s*;/$1/}) +public function set${1/\w+\s*/\u$0/}($$1) { - $this->${1/(\w+)\s*;/$1/} = $${1/(\w+)\s*;/$1/};$3 + $this->$1 = $$1;$3 ${4:return $this;} } $0