TYPO3
7.6
Users
bogdan
Projects
Kapeli
Resources
Dash
Docsets
TYPO3
src
vendor
cogpowered
finediff
src
cogpowered
FineDiff
Parser
Opcodes.php
Go to the documentation of this file.
1
<?php
2
19
namespace
cogpowered\FineDiff\Parser
;
20
21
use
cogpowered\FineDiff\Exceptions\OperationException
;
22
26
class
Opcodes
implements
OpcodesInterface
27
{
31
protected
$opcodes
= array();
32
36
public
function
getOpcodes
()
37
{
38
return
$this->opcodes
;
39
}
40
44
public
function
setOpcodes
(array
$opcodes
)
45
{
46
$this->opcodes = array();
47
48
// Ensure that all elements of the array
49
// are of the correct type
50
foreach
($opcodes as $opcode) {
51
if
(!is_a($opcode,
'cogpowered\FineDiff\Parser\Operations\OperationInterface'
)) {
52
throw
new
OperationException
(
'Invalid opcode object'
);
53
}
54
55
$this->opcodes[] = $opcode->getOpcode();
56
}
57
}
58
62
public
function
generate
()
63
{
64
return
implode(
''
, $this->opcodes);
65
}
66
70
public
function
__toString
()
71
{
72
return
$this->
generate
();
73
}
74
}
Generated on Wed Nov 11 2015 01:52:00 for TYPO3 by
1.8.3