Skip to content

Commit

Permalink
Construct php 8 (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
eerison authored Jun 17, 2024
1 parent 04cb5c7 commit 6821579
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions snippets/php/php.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,26 @@
"function __construct": {
"prefix": "con",
"body": [
"${1:public} function __construct(${2:${3:Type} \\$${4:var}${5: = ${6:null}}}) {",
"\t\\$this->${4:var} = \\$${4:var};$0",
"public function __construct(${1: priarg}) {",
"}"
]
],
"description": "Create __construct method using the last php syntax."
},
"Private argument": {
"prefix": "priarg",
"body": [
"${1:private} ${2:${3:Type} \\$${4:var}${5: = ${6:null}}}"
],
"description": "Private argument to use on __construct method."
},
"function __construct (php 7 or lower)": {
"prefix": "con7",
"body": [
"public function __construct(${1:${2:Type} \\$${3:var}${4: = ${5:null}}}) {",
"\t\\$this->${3:var} = \\$${3:var};$0",
"}"
],
"description": "Create a __construct method using syntax <= 7.4."
},
"PHPDoc property": {
"prefix": "doc_v",
Expand Down

0 comments on commit 6821579

Please sign in to comment.