Skip to content

Instantly share code, notes, and snippets.

@Sitebase
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sitebase/5e38920e5c2375ee006b to your computer and use it in GitHub Desktop.
Save Sitebase/5e38920e5c2375ee006b to your computer and use it in GitHub Desktop.
Handy PHP snippets for creating getters and setters
<snippet>
  <content><![CDATA[
public function get${1:Property}() {
  return \$this->${2:$property};
}
]]></content>
  <tabTrigger>publicget</tabTrigger>
  <scope>source.php</scope>
</snippet>
<snippet>
  <content><![CDATA[
public function set${1:Property}(\$${2:$property}) {
  \$this->${2:$property} = \$${2:$property};
}
]]></content>
  <tabTrigger>publicset</tabTrigger>
  <scope>source.php</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment