From 664c055495a2f0947b70aee63d0fbc05d3713e79 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sat, 1 Nov 2025 16:14:39 +0100 Subject: [PATCH] refactor: add class for crosstalk between Vegvisir and Reflect --- src/Scaffold.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Scaffold.php b/src/Scaffold.php index 9258e39..510425e 100644 --- a/src/Scaffold.php +++ b/src/Scaffold.php @@ -5,17 +5,19 @@ use VV; use Reflect\Path; - /** - * Include a source file from either Vegvisir or Reflect - * - * @param string $pathname Relative path from project root to a source file - */ - function load(string $pathname): void { - // Load the Vegvisir VV clas from Reflect - if (!class_exists("VV")) { - require_once Path::root("vegvisir/src/kernel/Init.php"); - require_once Path::root("vegvisir/src/request/VV.php"); - } + class Scaffold { + /** + * Include a source file + * + * @param string $pathname Relative path from project root to a source file + */ + public static function load(string $pathname): void { + // Load the Vegvisir VV class from Reflect + if (!class_exists("VV")) { + require_once Path::root("vegvisir/src/kernel/Init.php"); + require_once Path::root("vegvisir/src/request/VV.php"); + } - require_once VV::root($pathname); + require_once VV::root($pathname); + } }