From 375403fff8d45f850e68391cebba20fd77d92e15 Mon Sep 17 00:00:00 2001 From: Oxbian Date: Thu, 6 Jun 2024 12:38:37 +0200 Subject: ADD: C, C++, PHP snippets --- snippets/php.json | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 snippets/php.json (limited to 'snippets/php.json') diff --git a/snippets/php.json b/snippets/php.json new file mode 100644 index 0000000..bb3b932 --- /dev/null +++ b/snippets/php.json @@ -0,0 +1,50 @@ +{ + "Class":{ + "scope": "php", + "prefix": "class", + "body": [ + "class $1", + "{", + " ${2:// Attributes}", + "", + " public function __construct($3)", + " {", + " ${4:// Attributes construction}", + " }", + "", + " public function __destruct($5)", + " {", + " ${6:// Attributes destruction}", + " }", + "", + " public function info()", + " {", + " ${7:// Showing attributes data}", + " }", + "}" + ], + "description": "Class with constructor, destructor, info" + }, + "Class Get":{ + "scope":"php", + "prefix":"get", + "body": [ + "public function get_$1()", + "{", + " return \\$this->${2:$1};", + "}" + ], + "description": "Class get function for an attribute" + }, + "Class Set":{ + "scope":"php", + "prefix":"set", + "body": [ + "public function set_$1($2)", + "{", + " \\$this->$1 = $2;", + "}" + ], + "description": "Class set function for an attribute" + } +} \ No newline at end of file -- cgit v1.2.3