order removed $options load from contruct

This commit is contained in:
Jacek Wysocki 2012-06-22 12:00:15 +02:00
parent 74bd536002
commit 41d50aff77

View File

@ -93,8 +93,30 @@ snippet var "var"
var_export(${1});${2} var_export(${1});${2}
endsnippet endsnippet
snippet getter "PHP Class Getter" !b
/*
* Getter for $1
*/
public function get${1/\w+\s*/\u$0/}()
{
return $this->$1;$2
}
$4
endsnippet
snippet gs "PHP ClassGetter Setter" !b snippet setter "PHP Class Setter" !b
/*
* Setter for $1
*/
public function set${1/\w+\s*/\u$0/}($$1)
{
$this->$1 = $$1;$3
return $this;
}
$4
endsnippet
snippet gs "PHP Class Getter Setter" !b
protected $$1 protected $$1
/* /*
@ -113,7 +135,7 @@ public function set${1/\w+\s*/\u$0/}($$1)
$this->$1 = $$1;$3 $this->$1 = $$1;$3
return $this; return $this;
} }
$0 $4
endsnippet endsnippet
snippet pub "Public function" !b snippet pub "Public function" !b
@ -126,7 +148,6 @@ endsnippet
snippet pro "Protected function" !b snippet pro "Protected function" !b
protected function ${1:name}(${2:$param}) protected function ${1:name}(${2:$param})
{ {
${3:return null;} ${3:return null;}
} }
endsnippet endsnippet
@ -169,7 +190,7 @@ endsnippet
snippet fore "Foreach loop" snippet fore "Foreach loop"
foreach ($${1:variable} as $${3:value}){ foreach ($${1:variable} as $${3:value}){
${4:// code...} ${4:// code...}
} }
endsnippet endsnippet
@ -181,26 +202,23 @@ endsnippet
snippet ife "if else" snippet ife "if else"
if (${1:/* condition */}) { if (${1:/* condition */}) {
${2:// code...} ${2:// code...}
} else { } else {
${3:// code...} ${3:// code...}
} }
endsnippet endsnippet
snippet class "Class declaration template" !b snippet class "Class declaration template" !b
/** /**
* @author Jacek Wysocki <jacek.wysocki@gmail.com> * Class ${1:`!p snip.rv=snip.fn.capitalize().split('.')[0]`}
* @author $2
*/ */
class ${1:`!p snip.rv=snip.fn.capitalize().split('.')[0]`} class $1
{ {
public function __construct(${2:$options=array()}) public function __construct(${3:$options=array()})
{ {
${3:if (is_array($options)) { ${4:// code}$5
foreach ($options as $k => $v) {
$this->$k = $v;
}
}}$4
} }
} }
endsnippet endsnippet