Skip to content
Snippets Groups Projects
Commit cb587803 authored by dyszczo's avatar dyszczo
Browse files

requirements & hook fixes

parent 7eaadb64
No related branches found
No related tags found
1 merge request!1alpha version of builder
......@@ -7,7 +7,8 @@
}
],
"require": {
"php": ">=5.5"
"php": ">=5.5",
"wpdesk/wp-basic-requirements": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "<7",
......
......@@ -4,12 +4,7 @@ namespace WPDesk\PluginBuilder\Builder;
use WPDesk\PluginBuilder\Plugin\AbstractPlugin;
class AbstractBuilder
{
const FILTER_PLUGIN_CLASS = 'wpdesk_plugin_class';
const HOOK_BEFORE_PLUGIN_INIT = 'wpdesk_before_plugin_init';
const HOOK_AFTER_PLUGIN_INIT = 'wpdesk_before_afterinit';
class AbstractBuilder {
protected static $instances = [];
/**
......
......@@ -4,19 +4,20 @@ namespace WPDesk\PluginBuilder\Builder;
use WPDesk\PluginBuilder\Plugin\AbstractPlugin;
class InfoBuilder extends AbstractBuilder
{
const FILTER_PLUGIN_CLASS = 'wpdesk_plugin_class';
const HOOK_BEFORE_PLUGIN_INIT = 'wpdesk_before_plugin_init';
const HOOK_AFTER_PLUGIN_INIT = 'wpdesk_before_afterinit';
class InfoBuilder extends AbstractBuilder {
const FILTER_PLUGIN_CLASS = 'wp_builder_plugin_class';
const HOOK_BEFORE_PLUGIN_INIT = 'wp_builder_before_plugin_init';
const HOOK_AFTER_PLUGIN_INIT = 'wp_builder_before_init';
/**
* Builds instance of plugin
*
* @param \WPDesk_Plugin_Info $info
* @return AbstractPlugin
*
* @return AbstractPlugin
*/
public function build_from_info(\WPDesk_Plugin_Info $info)
{
public function build_from_info( \WPDesk_Plugin_Info $info ) {
$class_name = apply_filters( self::FILTER_PLUGIN_CLASS, $info->get_class_name() );
/** @var AbstractPlugin $plugin */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment