src/View/Engine/NullEngine.php
<?php declare(strict_types=1);
/**
* Bright Nucleus View Component.
*
* @package BrightNucleus\View
* @author Alain Schlesser <alain.schlesser@gmail.com>
* @license MIT
* @link http://www.brightnucleus.com/
* @copyright 2016-2017 Alain Schlesser, Bright Nucleus
*/
namespace BrightNucleus\View\Engine;
use BrightNucleus\View\Support\NullFindable;
/**
* Class NullEngine.
*
* @since 0.1.0
*
* @package BrightNucleus\View\Engine
* @author Alain Schlesser <alain.schlesser@gmail.com>
*/
class NullEngine implements Engine, NullFindable
{
/**
* Check whether the Findable can handle an individual criterion.
*
* @since 0.1.0
*
* @param mixed $criterion Criterion to check.
*
* @return bool Whether the Findable can handle the criterion.
*/
public function canHandle($criterion): bool
{
return true;
}
/**
* Get the rendering callback for a given URI.
*
* @since 0.1.0
*
* @param string $uri URI to render.
* @param array $context Context in which to render.
*
* @return callable Rendering callback.
*/
public function getRenderCallback(string $uri, array $context = []): callable
{
return function () { return ''; };
}
}