Overview

Namespaces

  • None
  • Peridot
    • Leo
      • Formatter
      • Interfaces
        • Assert
      • Matcher
        • Template
      • ObjectPath
      • Responder
  • PHP

Classes

  • ArrayTemplate

Interfaces

  • TemplateInterface
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace Peridot\Leo\Matcher\Template;
 3: 
 4: /**
 5:  * Interface TemplateInterface specifices templates
 6:  * for default and negated messages when formatting match
 7:  * results.
 8:  *
 9:  * Template variables are wrapped in curly braces: {{expected}}, {{actual}}.
10:  *
11:  * Available variables are:
12:  *
13:  * {{expected}}
14:  * {{actual}}
15:  *
16:  * @code
17:  * $this->setDefaultTemplate("Expected {{expected}}, got {{actual}}");
18:  * @endcode
19:  *
20:  * @package Peridot\Leo\Matcher\Template
21:  */
22: interface TemplateInterface
23: {
24:     /**
25:      * Return the template variables assigned to the template.
26:      *
27:      * @return array
28:      */
29:     public function getTemplateVars();
30: 
31:     /**
32:      * Set the template vars assigned to the template.
33:      *
34:      * @param array $vars
35:      * @return mixed
36:      */
37:     public function setTemplateVars(array $vars);
38: 
39:     /**
40:      * Set the default template, that is the template for a failed match without
41:      * negation.
42:      *
43:      * @return string
44:      */
45:     public function getDefaultTemplate();
46: 
47:     /**
48:      * Set the default template that is used when negation is not specified.
49:      *
50:      * @param string $template
51:      * @return mixed
52:      */
53:     public function setDefaultTemplate($template);
54: 
55:     /**
56:      * Return the template used for a failed negated match.
57:      *
58:      * @return string
59:      */
60:     public function getNegatedTemplate();
61: 
62:     /**
63:      * Set the template used for a failed negated match.
64:      *
65:      * @param string $template
66:      * @return mixed
67:      */
68:     public function setNegatedTemplate($template);
69: }
70: 
Leo API documentation generated by ApiGen