Skip to content

Instantly share code, notes, and snippets.

@miseeger
Created December 18, 2019 14:15
Show Gist options
  • Save miseeger/58726e0794d8b8b421d548801d16b710 to your computer and use it in GitHub Desktop.
Save miseeger/58726e0794d8b8b421d548801d16b710 to your computer and use it in GitHub Desktop.
PHP Property Snippet for VSCode
"Property": {
"prefix": "p.prop",
"body": [
"private ${1:Type} \\$${2:propName};",
"",
"public function get${2/([\\w\\-]+)/${1:/capitalize}/}(): $1 ",
"{",
" return \\$this->$2;",
"}",
"",
"public function set${2/([\\w\\-]+)/${1:/capitalize}/}($1 \\$value): void ",
"{",
" \\$this->$2 = \\$value;",
"}"
],
"description": "Property"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment