Created
August 15, 2019 14:20
-
-
Save channaveer/e54442c26a792ed242a0a9b784695930 to your computer and use it in GitHub Desktop.
VSCODE PHP Snippets
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
{ | |
"Custom For Loop": { | |
"prefix": "feach", | |
"body": [ | |
"foreach ($1 as $2) {", | |
"\t$3", | |
"}" | |
], | |
"description": "Custom For Loop" | |
}, | |
"Custom If Condition": { | |
"prefix": "if", | |
"body": [ | |
"if ($1) {", | |
"\t$2", | |
"}" | |
], | |
"description": "Custom If Condition" | |
}, | |
"Custom ElseIf Condition": { | |
"prefix": "ife", | |
"body": [ | |
"if ($1) {", | |
"\t$2", | |
"} else {", | |
"\t$3", | |
"}" | |
], | |
"description": "Custom ElseIf Condition" | |
}, | |
"Custom Public Function": { | |
"prefix": "func", | |
"body": [ | |
"public function $1() {", | |
"\t$2", | |
"}" | |
], | |
"description": "Custom Public Function" | |
}, | |
"Custom Private Function": { | |
"prefix": "pfunc", | |
"body": [ | |
"private function $1() {", | |
"\t$2", | |
"}" | |
], | |
"description": "Custom Private Function" | |
}, | |
"Custom Protected Function": { | |
"prefix": "profunc", | |
"body": [ | |
"protected function $1() {", | |
"\t$2", | |
"}" | |
], | |
"description": "Custom Protected Function" | |
}, | |
"Custom Test Function": { | |
"prefix": "tfunc", | |
"body": [ | |
"/**", | |
" * @test", | |
"*/", | |
"public function $1() {", | |
"\t$2", | |
"}" | |
], | |
"description": "Custom PHPUnit Public Test Function" | |
}, | |
"Test With DataProvider Function": { | |
"prefix": "tpfunc", | |
"body": [ | |
"/**", | |
" * @test", | |
" * @dataProvider $1", | |
"*/", | |
"public function $2() {", | |
"\t$3", | |
"}" | |
], | |
"description": "Custom PHPUnit DataProvider Test Function" | |
}, | |
"Test With Depends Function": { | |
"prefix": "tdfunc", | |
"body": [ | |
"/**", | |
" * @test", | |
" * @depends $1", | |
"*/", | |
"public function $2() {", | |
"\t$3", | |
"}" | |
], | |
"description": "Custom PHPUnit Depends Test Function" | |
}, | |
"Test With DataProvider & Depends Function": { | |
"prefix": "tpdfunc", | |
"body": [ | |
"/**", | |
" * @test", | |
" * @dataProvider $1", | |
" * @depends $2", | |
"*/", | |
"public function $3() {", | |
"\t$4", | |
"}" | |
], | |
"description": "Custom PHPUnit DataProvider & Depends Test Function" | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, guys, I would like to share my VS CODE snippets for PHP. Use can use them by looking into the prefix. Hope to add few more in the future.
Eg:
func
will expand to