aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.config/nvim/after/ftplugin/php.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/.config/nvim/after/ftplugin/php.lua b/.config/nvim/after/ftplugin/php.lua
index d6dbf6b..31d85aa 100644
--- a/.config/nvim/after/ftplugin/php.lua
+++ b/.config/nvim/after/ftplugin/php.lua
@@ -45,6 +45,16 @@ vimrc.after_ftplugin('php', function(conf)
psr4_namespace = k
psr4_dir = v
end
+ if type(psr4_dir) == 'table' then
+ if #psr4_dir == 1 then
+ psr4_dir = psr4_dir[1]
+ else
+ return nil -- psr-4 section is ambiguous
+ end
+ end
+ if type(psr4_namespace) ~= 'string' or type(psr4_dir) ~= 'string' then
+ return nil -- psr-4 section is invalid
+ end
if psr4_namespace:sub(-1, -1) == '\\' then
psr4_namespace = psr4_namespace:sub(0, -2)
end