From 6de07d9333dba92e6929f96cae3cd1e65ea75fd1 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 3 Oct 2023 18:19:01 +0100 Subject: [PATCH] chore(nvim): remove `drupalclass` This has been replaced by generation tools within Phpactor. --- lua/opdavies/snippets/ft/php.lua | 53 -------------------------------- 1 file changed, 53 deletions(-) diff --git a/lua/opdavies/snippets/ft/php.lua b/lua/opdavies/snippets/ft/php.lua index 8fb0aa7..12835e0 100644 --- a/lua/opdavies/snippets/ft/php.lua +++ b/lua/opdavies/snippets/ft/php.lua @@ -8,59 +8,6 @@ local t = ls.text_node local M = { - drupalclass = fmta( - [[ - <; - - final class <> { - - <> - - }]], - { - f(function() - local filepath = vim.fn.expand "%:h" - local filepath_parts = vim.fn.split(filepath, "/") - - if not vim.tbl_contains(filepath_parts, "src") then - return "" - end - - local namespace_parts = { "Drupal" } - - local is_test_file = vim.tbl_contains(filepath_parts, "tests") - if is_test_file then - table.insert(namespace_parts, "Tests") - end - - -- Find and add the module name. - for k, v in ipairs(filepath_parts) do - if v == "src" then - if is_test_file then - table.insert(namespace_parts, filepath_parts[k - 2]) - else - table.insert(namespace_parts, filepath_parts[k - 1]) - end - end - end - - -- Add the rest of the namespace. - local namespace = vim.split(filepath, "src/") - local final_part = (namespace[2] or ""):gsub("/", "\\") - table.insert(namespace_parts, final_part) - - return table.concat(namespace_parts, "\\") - end), - f(function() - return vim.fn.expand "%:t:r" - end), - i(0), - } - ), func = fmta("function <>(<>)<> {\n <>\n}<>", { i(1), i(2), i(3), i(4), i(0) }),