Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
3 / 3
HookTrait
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
3 / 3
 getHook
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 setHook
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
<?php
declare(strict_types=1);
namespace Korobochkin\WPKit\Cron\Traits;
/**
 * Trait HookTrait
 * @package Korobochkin\WPKit\Cron\Traits
 */
trait HookTrait
{
    /**
     * @var string
     */
    protected $hook = 'execute';
    /**
     * Returns the hook (function) which WordPress will call.
     *
     * @return callable The hook that WordPress will call.
     */
    public function getHook()
    {
        return $this->hook;
    }
    /**
     * Sets the hook (function) which WordPress will call.
     *
     * @param $hook callable The hook that WordPress will call.
     *
     * @return $this For chain calls.
     */
    public function setHook($hook)
    {
        $this->hook = $hook;
        return $this;
    }
}