Overview

Namespaces

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

Classes

  • ArrayTemplate

Interfaces

  • TemplateInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class ArrayTemplate

ArrayTemplate uses an array to specify default and negated templates. An ArrayTemplate is constructed with array keys.

Peridot\Leo\Matcher\Template\ArrayTemplate implements Peridot\Leo\Matcher\Template\TemplateInterface
Namespace: Peridot\Leo\Matcher\Template
Package: Peridot\Leo\Matcher\Template
Code:

$template = new ArrayTemplate([ 'default' => "Expected {{actual}} to be {{expected}}", 'negated' => "Expected {{actual}} not to be {{expected}} ]);


Endcode
Located at Matcher/Template/ArrayTemplate.php
Methods summary
public
# __construct( array $templates )

Parameters

$templates
public string
# getDefaultTemplate( )

Set the default template, that is the template for a failed match without negation.

Set the default template, that is the template for a failed match without negation.

Returns

string

Implementation of

Peridot\Leo\Matcher\Template\TemplateInterface::getDefaultTemplate()
public mixed
# setDefaultTemplate( string $default )

Set the default template that is used when negation is not specified.

Set the default template that is used when negation is not specified.

Parameters

$default

Returns

mixed

Implementation of

Peridot\Leo\Matcher\Template\TemplateInterface::setDefaultTemplate()
public string
# getNegatedTemplate( )

Return the template used for a failed negated match.

Return the template used for a failed negated match.

Returns

string

Implementation of

Peridot\Leo\Matcher\Template\TemplateInterface::getNegatedTemplate()
public mixed
# setNegatedTemplate( string $negated )

Set the template used for a failed negated match.

Set the template used for a failed negated match.

Parameters

$negated

Returns

mixed

Implementation of

Peridot\Leo\Matcher\Template\TemplateInterface::setNegatedTemplate()
public array
# getTemplateVars( )

Return the template variables assigned to the template.

Return the template variables assigned to the template.

Returns

array

Implementation of

Peridot\Leo\Matcher\Template\TemplateInterface::getTemplateVars()
public mixed
# setTemplateVars( array $vars )

Set the template vars assigned to the template.

Set the template vars assigned to the template.

Parameters

$vars

Returns

mixed
$this

Implementation of

Peridot\Leo\Matcher\Template\TemplateInterface::setTemplateVars()
Properties summary
protected string $default
# ''
protected string $negated
# ''
protected array $vars
# []
Leo API documentation generated by ApiGen