Skip to content

Commit

Permalink
Corrects composer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstandiford committed Nov 23, 2021
1 parent ee74c35 commit 7aa3a81
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 30 deletions.
11 changes: 11 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

use Underpin\Abstracts\Underpin;
use Underpin\Factories\Observers\Loader;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

// Add this loader.
Underpin::attach( 'setup', new Loader('templates', [ 'class' => 'Underpin\Templates\Loaders\Templates' ] ) );
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
"email": "[email protected]"
}
],
"require": {
"underpin/underpin": "^2.0"
},
"autoload": {
"psr-4": {"Underpin\\Templates\\": "lib/"},
"files": [
"templates.php"
"bootstrap.php"
]
}
}
2 changes: 1 addition & 1 deletion lib/abstracts/Template.php → lib/Abstracts/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @package
*/

namespace Underpin_Templates\Abstracts;
namespace Underpin\Templates\Abstracts;

use Underpin\Traits\Templates;
use Underpin\Factories\Registry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Underpin_Templates\Factories;
namespace Underpin\Templates\Factories;

use Underpin_Templates\Abstracts\Template;
use Underpin\Templates\Abstracts\Template;
use Underpin\Traits\Instance_Setter;

if ( ! defined( 'ABSPATH' ) ) {
Expand Down
12 changes: 6 additions & 6 deletions lib/loaders/Templates.php → lib/Loaders/Templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* @package
*/

namespace Underpin_Templates\Loaders;
namespace Underpin\Templates\Loaders;

use Underpin_Templates\Abstracts\Template;
use Underpin\Loaders\Logger;
use Underpin\Templates\Abstracts\Template;
use Underpin\Abstracts\Registries\Object_Registry;
use function Underpin\underpin;

if ( ! defined( 'ABSPATH' ) ) {
exit;
Expand All @@ -33,9 +33,9 @@ class Templates extends Object_Registry {
* @since 1.0.0
* @var string The name of the abstract class this service locator uses.
*/
protected $abstraction_class = 'Underpin_Templates\Abstracts\Template';
protected $abstraction_class = 'Underpin\Templates\Abstracts\Template';

protected $default_factory = 'Underpin_Templates\Factories\Template_Instance';
protected $default_factory = 'Underpin\Templates\Factories\Template_Instance';

protected function set_default_items() {}

Expand Down Expand Up @@ -66,7 +66,7 @@ public function get_template( $key, $template, $params = [] ) {

// Validate the item didn't return a result.
if ( is_wp_error( $item ) ) {
underpin()->logger()->log_wp_error( 'error', $item );
Logger::log_wp_error( 'error', $item );

return '';
}
Expand Down
20 changes: 0 additions & 20 deletions templates.php

This file was deleted.

0 comments on commit 7aa3a81

Please sign in to comment.