Restore preexisting php snippets (#182929)

That shouldn't have been deleted in #174889
And also bring back one constructor snippet
This commit is contained in:
Rob Lourens 2023-05-18 17:17:56 -07:00 committed by GitHub
parent 33164f0d85
commit 047b9cd0f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,6 +68,14 @@
],
"description": "Class definition"
},
"class __construct": {
"prefix": "construct",
"body": [
"${1|public,private,protected|} function __construct(${2:${3:Type} $${4:var}${5: = ${6:null}}}$7) {",
"\t\\$this->${4:var} = $${4:var};$0",
"}"
]
},
"class function …": {
"prefix": "class_fun",
"body": [
@ -108,6 +116,24 @@
],
"description": "Do-While loop"
},
"else …": {
"prefix": "else",
"body": [
"else {",
"\t${0:# code...}",
"}"
],
"description": "Else block"
},
"elseif …": {
"prefix": "elseif",
"body": [
"elseif (${1:condition}) {",
"\t${0:# code...}",
"}"
],
"description": "Elseif block"
},
"for …": {
"prefix": "for",
"body": [
@ -276,6 +302,19 @@
],
"description": "Switch block"
},
"$this->…": {
"prefix": "this",
"body": "\\$this->$0;",
"description": "$this->..."
},
"Throw Exception": {
"prefix": "throw",
"body": [
"throw new $1Exception(${2:\"${3:Error Processing Request}\"}${4:, ${5:1}});",
"$0"
],
"description": "Throw exception"
},
"trait …": {
"prefix": "trait",
"body": [