-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update the DI logic for the plugin * Dependency Injection in the theme * Rephrase the namespace * Remove function prefix as we are already namespaced * Remove function prefix because namespacing * Use the same container for theme & plugin * fix tests * Fix theme namespacing * pass the tests * Remove QM debugging
- Loading branch information
Showing
48 changed files
with
321 additions
and
395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/** | ||
* Silence is golden. | ||
* | ||
* @package lhpbpp | ||
* @package lhpbp\plugin | ||
*/ | ||
|
||
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
/** | ||
* This file contains the abstract component class. | ||
* It is used to define the basic structure of a component, which we use to | ||
* extend the plugin and the accompanying theme. A component is a class that | ||
* contains all the logic for a specific feature of the plugin or theme. It combines | ||
* actions and filters, the logic and helper functions. | ||
* | ||
* @package lhpbp\plugin | ||
*/ | ||
|
||
namespace WpMunich\lhpbp\plugin\Abstracts; | ||
|
||
use function WpMunich\lhpbp\plugin\plugin_container; | ||
|
||
/** | ||
* Abstract class for a component. | ||
*/ | ||
abstract class Component { | ||
/** | ||
* Constructor. | ||
* Used to initialize the component and add the needed actions and filters. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() { | ||
$this->add_actions(); | ||
$this->add_filters(); | ||
} | ||
|
||
/** | ||
* Add the needed WordPress actions for the component. | ||
* | ||
* @see https://codex.wordpress.org/Plugin_API/Action_Reference | ||
*/ | ||
abstract protected function add_actions(); | ||
|
||
/** | ||
* Add the needed WordPress filters for the component. | ||
* | ||
* @see https://codex.wordpress.org/Plugin_API/Filter_Reference | ||
*/ | ||
abstract protected function add_filters(); | ||
|
||
/** | ||
* Get the parent class. | ||
* | ||
* @return Object The parent class. | ||
*/ | ||
public function get_parent() { | ||
return get_parent_class( $this ); | ||
} | ||
|
||
/** | ||
* Get the DI container. | ||
* | ||
* @return \DI\Container The DI container. | ||
*/ | ||
protected function container() { | ||
return plugin_container(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.