TYPO3  7.6
Copy.php
Go to the documentation of this file.
1 <?php
2 
19 namespace cogpowered\FineDiff\Parser\Operations;
20 
24 class Copy implements OperationInterface
25 {
31  public function __construct($len)
32  {
33  $this->len = $len;
34  }
35 
39  public function getFromLen()
40  {
41  return $this->len;
42  }
43 
47  public function getToLen()
48  {
49  return $this->len;
50  }
51 
55  public function getOpcode()
56  {
57  if ($this->len === 1) {
58  return 'c';
59  }
60 
61  return "c{$this->len}";
62  }
63 
70  public function increase($size)
71  {
72  return $this->len += $size;
73  }
74 }