Completed
Push — master ( fef961...cb7bad )
by Thomas
01:47
created

BaseFormatter::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
namespace gossi\formatter\formatters;
3
4
use gossi\code\profiles\Profile;
5
use gossi\formatter\parser\Context;
6
use gossi\formatter\parser\Parser;
7
use gossi\formatter\parser\TokenMatcher;
8
use gossi\formatter\utils\Writer;
9
use phootwork\tokenizer\Token;
10
use phootwork\tokenizer\TokenVisitorInterface;
11
12
13
class BaseFormatter implements TokenVisitorInterface {
14
15
	/** @var Parser */
16
	protected $parser;
17
	/** @var Profile */
18
	protected $config;
19
	/** @var Writer */
20
	protected $writer;
21
	/** @var Context */
22
	protected $context;
23
	/** @var TokenMatcher */
24
	protected $matcher;
25
26
	protected $nextToken;
27
	protected $prevToken;
28
29 2
	public function __construct(Parser $parser, Profile $profile, Writer $writer) {
30 2
		$this->config = $profile;
31 2
		$this->writer = $writer;
32 2
		$this->parser = $parser;
33 2
		$this->context = $parser->getContext();
34 2
		$this->matcher = $parser->getMatcher();
35
36 2
		$this->init();
37 2
	}
38
39 2
	public function visitToken(Token $token) {
40 2
		$this->nextToken = $this->parser->getTracker()->getNextToken();
41 2
		$this->prevToken = $this->parser->getTracker()->getPrevToken();
42
43 2
		$this->doVisitToken($token);
44 2
	}
45
46 2
	protected function doVisitToken(Token $token) {
47
48 2
	}
49
50 2
	protected function init() {
51
52 2
	}
53
54
}
55