Overview

Namespaces

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

Classes

  • AbstractMatcher
  • CountableMatcher
  • EmptyMatcher
  • EqualMatcher
  • ExceptionMatcher
  • GreaterThanMatcher
  • GreaterThanOrEqualMatcher
  • InclusionMatcher
  • InstanceofMatcher
  • KeysMatcher
  • LengthMatcher
  • LessThanMatcher
  • LessThanOrEqualMatcher
  • Match
  • NullMatcher
  • PatternMatcher
  • PredicateMatcher
  • PropertyMatcher
  • RangeMatcher
  • SameMatcher
  • SubStringMatcher
  • TrueMatcher
  • TruthyMatcher
  • TypeMatcher

Interfaces

  • MatcherInterface
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace Peridot\Leo\Matcher;
 3: 
 4: use Peridot\Leo\Matcher\Template\ArrayTemplate;
 5: use Peridot\Leo\Matcher\Template\TemplateInterface;
 6: 
 7: /**
 8:  * NullMatcher determines if an actual value is null.
 9:  *
10:  * @package Peridot\Leo\Matcher
11:  */
12: class NullMatcher extends AbstractMatcher
13: {
14:     public function __construct()
15:     {
16: 
17:     }
18: 
19:     /**
20:      * Match if the actual value is null.
21:      *
22:      * @param $actual
23:      * @return mixed
24:      */
25:     protected function doMatch($actual)
26:     {
27:         return is_null($actual);
28:     }
29: 
30:     /**
31:      * {@inheritdoc}
32:      *
33:      * @return TemplateInterface
34:      */
35:     public function getDefaultTemplate()
36:     {
37:         return new ArrayTemplate([
38:             'default' => 'Expected {{actual}} to be null',
39:             'negated' => 'Expected {{actual}} not to be null'
40:         ]);
41:     }
42: }
43: 
Leo API documentation generated by ApiGen