| 1 |
<?php |
| 2 |
namespace UninstallerForm; |
| 3 |
|
| 4 |
use ReflectionMethod; |
| 5 |
|
| 6 |
/** |
| 7 |
* UninstallerForm class for the uninstaller form. |
| 8 |
* |
| 9 |
* @since 1.0.0 |
| 10 |
* |
| 11 |
* @package UNINSTALLER_FORM |
| 12 |
*/ |
| 13 |
class UninstallerForm { |
| 14 |
/** |
| 15 |
* UninstallerForm initiaization. |
| 16 |
* |
| 17 |
* @param string $plugin_name The name of the plugin. |
| 18 |
* @param string $plugin_slug The slug of the plugin. |
| 19 |
* @param string $plugin_file The path to the plugin file. |
| 20 |
* @param string $plugin_text_domain The text domain of the plugin. |
| 21 |
* @param string $script_handler The handle of the script to enqueue. |
| 22 |
* |
| 23 |
* @since 1.0.0 |
| 24 |
*/ |
| 25 |
public static function init($plugin_name, $plugin_slug, $plugin_file,$plugin_text_domain, $script_handler,$webhook='') { |
| 26 |
$reflection = new ReflectionMethod(HookRegistrar::class, '__construct'); |
| 27 |
$totalParams = $reflection->getNumberOfParameters(); |
| 28 |
|
| 29 |
if( $totalParams === 6){ |
| 30 |
$hook_registrar = new HookRegistrar($plugin_name, $plugin_slug, $plugin_file,$plugin_text_domain, $script_handler,$webhook); |
| 31 |
$hook_registrar->register(); |
| 32 |
} |
| 33 |
} |
| 34 |
} |
| 35 |
|