for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Abstract class, used as the core for the plugin development.
*
* PHP version 7.4
* @category Facades
* @package Chaospelt\Kernel\Facades
* @author Stf Kolev <[email protected]>
* @license BSD-3-Clause https://opensource.org/licenses/BSD-3-Clause
* @link https://github.com/stfkolev/chaospelt
*/
namespace Chaospelt\Kernel;
use Chaospelt\Kernel\Traits\Registerable;
abstract class Plugin
{
use Registerable;
Chaospelt\Kernel\Traits\Registerable
$name
Chaospelt\Kernel\Plugin
* Registers activation and deactivation hook for the called class.
* @param $pluginFile - Plugin File Path. Used for proper Wordpress hooking.
-
0
* @return Plugin object
public function __construct($pluginFile)
$calledClass = get_called_class();
register_activation_hook($pluginFile, $calledClass, 'activate');
register_activation_hook
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
register_deactivation_hook($pluginFile, $calledClass, 'deactivate');
register_deactivation_hook
}
* Used for the activation hook in Wordpress.
* @return void
abstract protected static function activate();
* Used for the deactivation hook in Wordpress.
abstract protected static function deactivate();