Overview

Namespaces

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

Classes

  • Formatter

Interfaces

  • FormatterInterface
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace Peridot\Leo\Formatter;
 3: 
 4: use Peridot\Leo\Matcher\Match;
 5: use Peridot\Leo\Matcher\Template\TemplateInterface;
 6: 
 7: /**
 8:  * FormatterInterface defines an interface for formatting match results.
 9:  *
10:  * @package Peridot\Leo\Formatter
11:  */
12: interface FormatterInterface
13: {
14:     /**
15:      * Return the match being formatted.
16:      *
17:      * @return Match
18:      */
19:     public function getMatch();
20: 
21:     /**
22:      * Set the match to format results for.
23:      *
24:      * @param Match $match
25:      */
26:     public function setMatch(Match $match);
27: 
28:     /**
29:      * Applies the match to the given TemplateInterface
30:      * and return a formatted string.
31:      *
32:      * @param TemplateInterface $template
33:      * @return mixed|string
34:      */
35:     public function getMessage(TemplateInterface $template);
36: 
37:     /**
38:      * Should return a string representation for any
39:      * PHP type.
40:      *
41:      * @param mixed $obj
42:      * @return string
43:      */
44:     public function objectToString($obj);
45: }
46: 
Leo API documentation generated by ApiGen