-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTemplateInterface.php
45 lines (41 loc) · 1.39 KB
/
TemplateInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
declare(strict_types=1);
namespace Dhii\Output\Template;
use ArrayAccess;
use Dhii\Output\Exception\RendererExceptionInterface;
use Dhii\Output\Exception\TemplateRenderExceptionInterface;
use Dhii\Output\RendererInterface;
use Exception;
use Stringable;
use InvalidArgumentException;
use Psr\Container\ContainerInterface;
/**
* Something that can render output based on a context.
*
* Context renderers are not required to have access to
* all the data necessary for rendering at the time of
* rendering.
*
* @since 0.4
* @psalm-type Context = array<scalar|Stringable>|ArrayAccess|ContainerInterface
*/
interface TemplateInterface extends RendererInterface
{
/**
* Produce output based on context.
*
* @since 0.4
*
* @param Context|null The context. Something that can provide more
* information on how to perform rendering.
*
* @throws TemplateRenderExceptionInterface If cannot render.
* @throws RendererExceptionInterface Any other problem related to the renderer.
* @throws InvalidArgumentException If context is invalid.
* @throws Exception Any other problem.
*
* @return string|Stringable The output.
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint
*/
public function render($context = null);
}