Improved getset snippet

- Reuse getter @return type for type hinting in the setter
  - Separate property and method names to compensate for case
    differences
This commit is contained in:
Darrell Hamilton 2012-12-02 15:14:30 -08:00
parent a6a10c8150
commit 8cc31cd9d0

View File

@ -326,9 +326,9 @@ snippet getset
/** /**
* Gets the value of ${1:} * Gets the value of ${1:}
* *
* @return ${2} * @return ${2:type}
*/ */
public function get$1() public function get${3:}()
{ {
return $this->$1; return $this->$1;
} }
@ -336,9 +336,11 @@ snippet getset
/** /**
* Sets the value of $1 * Sets the value of $1
* *
* @param mixed $$1 ${3} * @param $2 $$1 ${4}
*
* @return ${5:`Filename()`}
*/ */
public function set$1($$1) public function set$3(${6:$2} $$1)
{ {
$this->$1 = $$1; $this->$1 = $$1;
return $this; return $this;