From 4816f95ca7c4351803e720b83d7e4aefa21cf1e4 Mon Sep 17 00:00:00 2001 From: Alex Standiford Date: Wed, 25 Aug 2021 17:19:49 -0600 Subject: [PATCH] Moves files into separate directories (#8) * Moves files into separate directories * Moves files into separate directories --- Script.php => lib/abstracts/Script.php | 2 +- .../factories/Enqueue_Admin_Script.php | 0 Enqueue_Script.php => lib/factories/Enqueue_Script.php | 0 .../factories/Script_Instance.php | 0 Scripts.php => lib/loaders/Scripts.php | 0 scripts.php | 10 +++++----- 6 files changed, 6 insertions(+), 6 deletions(-) rename Script.php => lib/abstracts/Script.php (98%) rename Enqueue_Admin_Script.php => lib/factories/Enqueue_Admin_Script.php (100%) rename Enqueue_Script.php => lib/factories/Enqueue_Script.php (100%) rename Script_Instance.php => lib/factories/Script_Instance.php (100%) rename Scripts.php => lib/loaders/Scripts.php (100%) diff --git a/Script.php b/lib/abstracts/Script.php similarity index 98% rename from Script.php rename to lib/abstracts/Script.php index d813d07..dae38c3 100644 --- a/Script.php +++ b/lib/abstracts/Script.php @@ -310,7 +310,7 @@ public function __get( $key ) { if ( isset( $this->$key ) ) { return $this->$key; } else { - return new WP_Error( 'batch_task_param_not_set', 'The batch task key ' . $key . ' could not be found.' ); + return new WP_Error( 'script_param_not_set', 'The script key ' . $key . ' could not be found.' ); } } diff --git a/Enqueue_Admin_Script.php b/lib/factories/Enqueue_Admin_Script.php similarity index 100% rename from Enqueue_Admin_Script.php rename to lib/factories/Enqueue_Admin_Script.php diff --git a/Enqueue_Script.php b/lib/factories/Enqueue_Script.php similarity index 100% rename from Enqueue_Script.php rename to lib/factories/Enqueue_Script.php diff --git a/Script_Instance.php b/lib/factories/Script_Instance.php similarity index 100% rename from Script_Instance.php rename to lib/factories/Script_Instance.php diff --git a/Scripts.php b/lib/loaders/Scripts.php similarity index 100% rename from Scripts.php rename to lib/loaders/Scripts.php diff --git a/scripts.php b/scripts.php index fc99d83..eaf51f2 100644 --- a/scripts.php +++ b/scripts.php @@ -5,11 +5,11 @@ // Add this loader. add_action( 'underpin/before_setup', function ( $file, $class ) { - require_once( plugin_dir_path( __FILE__ ) . 'Script.php' ); - require_once( plugin_dir_path( __FILE__ ) . 'Scripts.php' ); - require_once( plugin_dir_path( __FILE__ ) . 'Script_Instance.php' ); - require_once( plugin_dir_path( __FILE__ ) . 'Enqueue_Admin_Script.php' ); - require_once( plugin_dir_path( __FILE__ ) . 'Enqueue_Script.php' ); + require_once( plugin_dir_path( __FILE__ ) . 'lib/abstracts/Script.php' ); + require_once( plugin_dir_path( __FILE__ ) . 'lib/loaders/Scripts.php' ); + require_once( plugin_dir_path( __FILE__ ) . 'lib/factories/Script_Instance.php' ); + require_once( plugin_dir_path( __FILE__ ) . 'lib/factories/Enqueue_Admin_Script.php' ); + require_once( plugin_dir_path( __FILE__ ) . 'lib/factories/Enqueue_Script.php' ); Underpin\underpin()->get( $file, $class )->loaders()->add( 'scripts', [ 'registry' => 'Underpin_Scripts\Loaders\Scripts', ] );