aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2015-04-20 00:10:24 +0900
committermattn <mattn.jp@gmail.com>2015-04-20 00:10:24 +0900
commitb7fcf86759361752f669721742b308dc60c1f96e (patch)
tree05a4db29c61a303a52fe0c48059ff61ac6b37e1a
parentdb6317ac646ea2f4a92ab456fcd4acdec95ad0de (diff)
parent543f7a017966af2305e6051606d2617053d3d7fb (diff)
downloadvim-sonictemplate-b7fcf86759361752f669721742b308dc60c1f96e.tar.gz
vim-sonictemplate-b7fcf86759361752f669721742b308dc60c1f96e.tar.bz2
vim-sonictemplate-b7fcf86759361752f669721742b308dc60c1f96e.zip
Merge pull request #18 from baopham/fix-php-templates
Fix PHP templates
-rw-r--r--template/php/snip-getter-setter.php18
-rw-r--r--template/php/snip-getter.php9
2 files changed, 15 insertions, 12 deletions
diff --git a/template/php/snip-getter-setter.php b/template/php/snip-getter-setter.php
index a3ab7c4..0881fd6 100644
--- a/template/php/snip-getter-setter.php
+++ b/template/php/snip-getter-setter.php
@@ -1,15 +1,17 @@
/**
- * get {{_input_:name}}
- * @return {{_var_:name}}
+ * Get {{_input_:property}}
+ *
+ * @return {{_input_:type}}
*/
-public {{_var_:name}} get{{_expr_:substitute('{{_var_:name}}', '\w\+', '\u\0', '')}}() {
- return {{_var_:name}};
+public function get{{_expr_:substitute('{{_var_:property}}', '\w\+', '\u\0', '')}}() {
+ return $this->{{_var_:property}};
}
/**
- * set {{_var_:name}}
- * @param {{_var_:name}}
+ * Set {{_var_:property}}
+ *
+ * @param {{_var_:type}} {{_var_:property}}
*/
-public void set{{_expr_:substitute('{{_var_:name}}', '\w\+', '\u\0', '')}}({{_var_:name}} {{_var_:name}}) {
- this.{{_var_:name}} = {{_var_:name}};
+public function set{{_expr_:substitute('{{_var_:property}}', '\w\+', '\u\0', '')}}(${{_var_:property}}) {
+ $this->{{_var_:property}} = ${{_var_:property}};
}
diff --git a/template/php/snip-getter.php b/template/php/snip-getter.php
index b27b2ea..1b5c924 100644
--- a/template/php/snip-getter.php
+++ b/template/php/snip-getter.php
@@ -1,7 +1,8 @@
/**
- * get {{_input_:name}}
- * @return {{_var_:name}}
+ * Get {{_input_:property}}
+ *
+ * @return {{_input_:type}}
*/
-public {{_input_:type}} get{{_expr_:substitute('{{_var_:name}}', '\w\+', '\u\0', '')}}() {
- return {{_var_:name}};
+public function get{{_expr_:substitute('{{_var_:property}}', '\w\+', '\u\0', '')}}() {
+ return $this->{{_var_:property}};
}