Last active
July 19, 2021 07:46
-
-
Save tuanpht/0b2df968c628feee97c72e0ee760b227 to your computer and use it in GitHub Desktop.
VS Code PHP snippet insert namespace, class, constructor
This file contains hidden or 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
Show hidden characters
{ | |
"Insert namespace": { | |
"prefix": "name", | |
"body": ["namespace $1${TM_DIRECTORY/[\\/]/\\\\/g};", "$2"] | |
}, | |
"Construct": { | |
"prefix": "cons", | |
"body": ["${1:public} function __construct()", "{$2\n}$0"] | |
}, | |
"Class": { | |
"prefix": "cl", | |
"body": [ | |
"class ${TM_FILENAME/\\.php$//} ${2:extends ${3:AnotherClass}} ${4:implements ${5:SomeInterface}}", | |
"{", | |
"\t// $0", | |
"}" | |
] | |
}, | |
"Magento error_log": { | |
"prefix": "mage_err", | |
"body": [ | |
"error_log(time() . ' - ' . print_r(${1:yourVariable}, true) . PHP_EOL, 3, BP . '${2:/var/log/dev.debug.log}');" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment