Created
April 1, 2016 14:47
-
-
Save jabranr/40514627594610d6eda0f17f0fc94dc5 to your computer and use it in GitHub Desktop.
Autogenerate PHP getters setters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
/** | |
* Get ${1/(.*)/\u$1/:[ Prop name ]} | |
* ${4:[description]} | |
* | |
* @return ${3:[type]} | |
*/ | |
public function get${1/(.*)/\u$1/:[ Prop name ]}() { | |
return \$this->${1:[ Prop name ]}; | |
} | |
/** | |
* Set ${1/(.*)/\u$1/:[ Prop name ]} | |
* ${5/(.*)/\u$1/:[description]} | |
* | |
* @param ${3/(.*)/\u$1/:[type]} \$${1:[ Prop name ]} | |
*/ | |
public function set${1/(.*)/\u$1/:[ Prop name ]}(\$${1/(.*)/$1/:[ Prop name ]}) { | |
\$this->${1:[Prop name ]} = \$${1/(.*)/$1/:[ Prop name ]}; | |
return \$this; | |
} | |
${6} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>getset</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.php</scope> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment