From 7aa3a81205511af97b492866f741450054ca1abb Mon Sep 17 00:00:00 2001 From: Alex Standiford Date: Tue, 23 Nov 2021 08:22:02 -0600 Subject: [PATCH] Corrects composer.json --- bootstrap.php | 11 ++++++++++ composer.json | 6 +++++- lib/{abstracts => Abstracts}/Template.php | 2 +- .../Template_Instance.php | 4 ++-- lib/{loaders => Loaders}/Templates.php | 12 +++++------ templates.php | 20 ------------------- 6 files changed, 25 insertions(+), 30 deletions(-) create mode 100644 bootstrap.php rename lib/{abstracts => Abstracts}/Template.php (96%) rename lib/{factories => Factories}/Template_Instance.php (75%) rename lib/{loaders => Loaders}/Templates.php (84%) delete mode 100644 templates.php diff --git a/bootstrap.php b/bootstrap.php new file mode 100644 index 0000000..dd8a172 --- /dev/null +++ b/bootstrap.php @@ -0,0 +1,11 @@ + 'Underpin\Templates\Loaders\Templates' ] ) ); \ No newline at end of file diff --git a/composer.json b/composer.json index 5394cdf..3c07a3b 100644 --- a/composer.json +++ b/composer.json @@ -9,9 +9,13 @@ "email": "a@alexstandiford.com" } ], + "require": { + "underpin/underpin": "^2.0" + }, "autoload": { + "psr-4": {"Underpin\\Templates\\": "lib/"}, "files": [ - "templates.php" + "bootstrap.php" ] } } diff --git a/lib/abstracts/Template.php b/lib/Abstracts/Template.php similarity index 96% rename from lib/abstracts/Template.php rename to lib/Abstracts/Template.php index 9a02cb4..c1d06cb 100644 --- a/lib/abstracts/Template.php +++ b/lib/Abstracts/Template.php @@ -6,7 +6,7 @@ * @package */ -namespace Underpin_Templates\Abstracts; +namespace Underpin\Templates\Abstracts; use Underpin\Traits\Templates; use Underpin\Factories\Registry; diff --git a/lib/factories/Template_Instance.php b/lib/Factories/Template_Instance.php similarity index 75% rename from lib/factories/Template_Instance.php rename to lib/Factories/Template_Instance.php index 3e740e8..eb4e12e 100644 --- a/lib/factories/Template_Instance.php +++ b/lib/Factories/Template_Instance.php @@ -1,8 +1,8 @@ logger()->log_wp_error( 'error', $item ); + Logger::log_wp_error( 'error', $item ); return ''; } diff --git a/templates.php b/templates.php deleted file mode 100644 index 9761dcc..0000000 --- a/templates.php +++ /dev/null @@ -1,20 +0,0 @@ - function ( Underpin $plugin, $args ) { - require_once( plugin_dir_path( __FILE__ ) . 'lib/abstracts/Template.php' ); - require_once( plugin_dir_path( __FILE__ ) . 'lib/factories/Template_Instance.php' ); - require_once( plugin_dir_path( __FILE__ ) . 'lib/loaders/Templates.php' ); - - $plugin->loaders()->add( 'templates', [ - 'class' => 'Underpin_Templates\Loaders\Templates', - ] ); - }, -] ) ); \ No newline at end of file