From 06ea9a5ff9d3009d3df87dcd22776102d99d59cd Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 17 Jan 2024 22:05:41 +0000 Subject: [PATCH] Add snippets for `__invoke()` and `__construct()` --- config/neovim/lua/opdavies/snippets/ft/php.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config/neovim/lua/opdavies/snippets/ft/php.lua b/config/neovim/lua/opdavies/snippets/ft/php.lua index 0321559..75e4e53 100644 --- a/config/neovim/lua/opdavies/snippets/ft/php.lua +++ b/config/neovim/lua/opdavies/snippets/ft/php.lua @@ -7,6 +7,24 @@ local i = ls.insert_node local t = ls.text_node local M = { + __construct = fmta( + [[ + public function __construct(<>) { + <> + } + ]], + { i(1), i(0) } + ), + + __invoke = fmta( + [[ + public function __invoke(<>) { + <> + } + ]], + { i(1), i(0) } + ), + func = fmta("function <>(<>)<> {\n <>\n}<>", { i(1), i(2), i(3), i(4), i(0) }), met = fmta(