dotfiles/config/neovim/lua/opdavies/snippets/ft/php.lua
Oliver Davies 80d9347a73 chore(nvim): remove drupalclass
This has been replaced by generation tools within Phpactor.
2023-10-03 18:19:01 +01:00

37 lines
720 B
Lua

local fmta = require("luasnip.extras.fmt").fmta
local ls = require "luasnip"
local c = ls.choice_node
local f = ls.function_node
local i = ls.insert_node
local t = ls.text_node
local M = {
func = fmta("function <>(<>)<> {\n <>\n}<>", { i(1), i(2), i(3), i(4), i(0) }),
met = fmta(
[[
<> function <>(<>)<> {
<>
}<>
]],
{ c(1, { t "public", t "protected", t "private" }), i(2), i(3), i(4), i(5), i(0) }
),
pest = fmta("<>('<>', function() {\n <>\n});", { c(1, { t "it", t "test" }), i(2), i(0) }),
test = fmta(
[[
/** @test */
public function <><>(): void {
<>
}<>
]],
{ c(1, { t "test", t "it", t "should" }), i(2), i(3), i(0) }
),
}
return M