AbstractPass   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 26
ccs 0
cts 4
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A optimize() 0 5 1
optimizeStream() 0 1 ?
1
<?php
2
3
/**
4
* @package   s9e\SourceOptimizer
5
* @copyright Copyright (c) 2014-2018 The s9e Authors
6
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
7
*/
8
namespace s9e\SourceOptimizer\Passes;
9
10
use s9e\SourceOptimizer\TokenStream;
11
12
abstract class AbstractPass
13
{
14
	/**
15
	* @var TokenStream Token stream of the source being processed
16
	*/
17
	protected $stream;
18
19
	/**
20
	* Optimize a given list of tokens
21
	*
22
	* @param  TokenStream $stream
23
	* @return void
24
	*/
25
	public function optimize(TokenStream $stream)
26
	{
27
		$this->stream = $stream;
28
		$this->optimizeStream();
29
	}
30
31
	/**
32
	* Optimize the stored token stream
33
	*
34
	* @return void
35
	*/
36
	abstract protected function optimizeStream();
37
}