Skip to content

Instantly share code, notes, and snippets.

@devster
Last active August 29, 2015 13:55
Show Gist options
  • Save devster/8689643 to your computer and use it in GitHub Desktop.
Save devster/8689643 to your computer and use it in GitHub Desktop.
PHP setter/getter snippet for sublime text
<snippet>
<content><![CDATA[
/**
* Set ${1:property}
*
* @param ${2:type} \$$1
*
* @return ${3:Type}
*/
public function set${1/^([a-z])/\u$1/g}(\$$1)
{
\$this->$1 = \$$1;
return \$this;
}
/**
* Get $1
*
* @return $2
*/
public function get${1/^([a-z])/\u$1/g}()
{
return \$this->$1;
}
]]></content>
<tabTrigger>setget</tabTrigger>
<scope>source.php</scope>
<description>Setter/Getter for php class</description>
</snippet>
@tristanbes
Copy link

There is only one space after the @param tag

@devster
Copy link
Author

devster commented Jan 29, 2014

Thanks dude!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment