Passed
Push — master ( 35cf85...32fc48 )
by Jesse
05:09 queued 02:14
created

LexemeEmitter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 2
b 0
f 0
dl 0
loc 17
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getLexemes() 0 2 1
A emit() 0 2 1
1
<?php
2
3
namespace donatj\Printf;
4
5
class LexemeEmitter implements Emitter {
6
7
	/** @var Lexeme[] */
8
	private $lexemes = [];
9
10
	/**
11
	 * @internal This is for use by the Parser
12
	 */
13 5
	public function emit( Lexeme $lexItem ) : void {
14 5
		$this->lexemes[] = $lexItem;
15 5
	}
16
17
	/**
18
	 * Return the Lexemes received by the emitter as an immutable LexemeCollection
19
	 */
20 5
	public function getLexemes() : LexemeCollection {
21 5
		return new LexemeCollection(...$this->lexemes);
22
	}
23
24
}
25