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

requirements & hook fixes

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