使用 PHPStorm 的 Live Templates 封装常用代码

PHP Template Group

fore

1
2
3
foreach ($ITERABLE$ as $VAR_VALUE$) {
$END$
}

forek

1
2
3
foreach ($ITERABLE$ as $VAR_KEY$ => $VAR_VALUE$) {
$END$
}

prif

1
2
3
private function $NAME$($PARAMETERS$){
$END$
}

prisf

1
2
3
private static function $NAME$($PARAMETERS$){
$END$
}

prof

1
2
3
protected function $NAME$($PARAMETERS$){
$END$
}

prosf

1
2
3
protected static function $NAME$($PARAMETERS$){
$END$
}

pubf

1
2
3
public function $NAME$($PARAMETERS$){
$END$
}

pubsf

1
2
3
public static function $NAME$($PARAMETERS$){
$END$
}

thr

1
throw new $END$

tryc

1
2
3
4
5
try {
$ITERABLE$
} catch (\$Exception$ $e) {
$END$
}

##