From a44b5b092f909a79c6b35db7cc1c3481d2022048 Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.uk>
Date: Wed, 12 Jan 2022 07:43:19 +0000
Subject: [PATCH] feat(nvim): add `drupalclass` snip

---
 .../files/lua/opdavies/snippets/ft/php.lua    | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/roles/neovim/files/lua/opdavies/snippets/ft/php.lua b/roles/neovim/files/lua/opdavies/snippets/ft/php.lua
index a49e622d..e17221c8 100644
--- a/roles/neovim/files/lua/opdavies/snippets/ft/php.lua
+++ b/roles/neovim/files/lua/opdavies/snippets/ft/php.lua
@@ -7,6 +7,27 @@ local s = luasnip.snippet
 local t = luasnip.text_node
 
 return {
+  -- TODO: only load if within a Drupal project?
+  s(
+    "drupalclass",
+    fmta(
+      [[
+      <<?php
+
+      declare(strict_types=1);
+
+      namespace Drupal\<>;
+
+      <>class <> {
+
+        <>
+
+      }
+      ]],
+      { i(1), c(2, { t '', t 'final ' }), i(3), i(0) }
+    )
+  ),
+
   s(
     "test",
     fmta(