Created
November 9, 2014 00:21
-
-
Save codedokode/cd2f41c8dcf1237fde4b to your computer and use it in GitHub Desktop.
Сниппет для создания геттеров/сеттеров в Sublime Text 3. Вызывается через gs [tab]
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[ | |
public function get${1/(?:^|_)(\w)/\U$1$2/g$1}() | |
{ | |
return \$this->$1; | |
} | |
/** | |
* @return self | |
*/ | |
public function set${1/(?:^|_)(\w)/\U$1$2/g$1}(\$${1/_(\w)/\U$1/g$1}) | |
{ | |
\$this->$1 = \$${1/_(\w)/\U$1/g$1}; | |
return \$this; | |
} | |
]]></content> | |
<!-- Optional: Tab trigger to activate the snippet --> | |
<tabTrigger>gs</tabTrigger> | |
<!-- Optional: Scope the tab trigger will be active in --> | |
<scope>source.php</scope> | |
<!-- Optional: Description to show in the menu --> | |
<description>Create getter and setter methods</description> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment