Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
90.91% covered (success)
90.91%
10 / 11
CRAP
97.96% covered (success)
97.96%
48 / 49
LazyAttributes
0.00% covered (danger)
0.00%
0 / 1
90.91% covered (success)
90.91%
10 / 11
26
97.96% covered (success)
97.96%
48 / 49
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
 init
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
6 / 6
 offsetExists
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
3 / 3
 offsetGet
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
3 / 3
 offsetSet
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
6 / 6
 offsetUnset
0.00% covered (danger)
0.00%
0 / 1
2.03
80.00% covered (warning)
80.00%
4 / 5
 getValues
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
3 / 3
 getObjects
100.00% covered (success)
100.00%
1 / 1
4
100.00% covered (success)
100.00%
8 / 8
 count
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
3 / 3
 getIterator
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
3 / 3
 merge
100.00% covered (success)
100.00%
1 / 1
4
100.00% covered (success)
100.00%
6 / 6
<?php
namespace RemexHtml\Tokenizer;
/**
 * An Attributes implementation which defers interpretation of regex match
 * results until the caller requires them.
 *
 * This should not be directly instantiated outside of Tokenizer.
 */
class LazyAttributes implements Attributes {
    /** @var callable */
    private $interpreter;
    /** @var mixed */
    private $data;
    /** @var string[] */
    private $attributes;
    /** @var Attribute[] */
    private $attrObjects;
    public function __construct( $data, callable $interpreter ) {
        $this->interpreter = $interpreter;
        $this->data = $data;
    }
    /**
     * Initialize the attributes array
     */
    private function init() {
        if ( $this->attributes === null ) {