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%
4 / 4
AlertBox
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
4 / 4
 register
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 alertBox
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
<?php
namespace Bone\View\Extension\Plates;
use Bone\View\Helper\AlertBox as AlertBoxHelper;
use League\Plates\Engine;
use League\Plates\Extension\ExtensionInterface;
class AlertBox implements ExtensionInterface
{
    /**
     * @param Engine $engine
     */
    public function register(Engine $engine)
    {
        $engine->registerFunction('alert', [$this, 'alertBox']);
    }
    /**
     * @param array $message
     * @return string
     */
    public function alertBox(array $message) : string
    {
        $box = new AlertBoxHelper();
        return $box->alertBox($message);
    }
}