Merge pull request #514 from jdeniau/patch-1

Php: Update PHP getter setter
This commit is contained in:
Holger Rapp 2015-01-30 21:55:11 +01:00
commit 80adcd3418

View File

@ -102,44 +102,54 @@ var_export(${1});${2}
endsnippet endsnippet
snippet getter "PHP Class Getter" b snippet getter "PHP Class Getter" b
/* /**
* Getter for $1 * Getter for $1
*
* ${2:return string}
*/ */
public function get${1/\w+\s*/\u$0/}() public function get${1/\w+\s*/\u$0/}()
{ {
return $this->$1;$2 return $this->$1;$3
} }
$4 $0
endsnippet endsnippet
snippet setter "PHP Class Setter" b snippet setter "PHP Class Setter" b
/* /**
* Setter for $1 * Setter for $1
*
* @param ${2:string} $$1
* @return ${3:`!p snip.rv=snip.basename`}
*/ */
public function set${1/\w+\s*/\u$0/}($$1) public function set${1/\w+\s*/\u$0/}(${4:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1)
{ {
$this->$1 = $$1;$3 $this->$1 = $$1;$5
${4:return $this;} ${6:return $this;}
} }
$0 $0
endsnippet endsnippet
snippet gs "PHP Class Getter Setter" b snippet gs "PHP Class Getter Setter" b
/* /**
* Getter for $1 * Getter for $1
*
* return ${2:string}
*/ */
public function get${1/\w+\s*/\u$0/}() public function get${1/\w+\s*/\u$0/}()
{ {
return $this->$1;$2 return $this->$1;$3
} }
/* /**
* Setter for $1 * Setter for $1
*
* @param $2 $$1
* @return ${4:`!p snip.rv=snip.basename`}
*/ */
public function set${1/\w+\s*/\u$0/}($$1) public function set${1/\w+\s*/\u$0/}(${5:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1)
{ {
$this->$1 = $$1;$3 $this->$1 = $$1;$6
${4:return $this;} ${7:return $this;}
} }
$0 $0
endsnippet endsnippet