TYPO3  7.6
Granularity.php
Go to the documentation of this file.
1 <?php
2 
19 namespace cogpowered\FineDiff\Granularity;
20 
24 abstract class Granularity implements GranularityInterface, \ArrayAccess, \Countable
25 {
29  protected $delimiters = array();
30 
34  public function offsetExists($offset)
35  {
36  return isset($this->delimiters[$offset]);
37  }
38 
42  public function offsetGet($offset)
43  {
44  return isset($this->delimiters[$offset]) ? $this->delimiters[$offset] : null;
45  }
46 
50  public function offsetSet($offset, $value)
51  {
52  if (is_null($offset)) {
53  $this->delimiters[] = $value;
54  } else {
55  $this->delimiters[$offset] = $value;
56  }
57  }
58 
62  public function offsetUnset($offset)
63  {
64  unset($this->delimiters[$offset]);
65  }
66 
72  public function count()
73  {
74  return count($this->delimiters);
75  }
76 
80  public function getDelimiters()
81  {
82  return $this->delimiters;
83  }
84 
88  public function setDelimiters(array $delimiters)
89  {
90  $this->delimiters = $delimiters;
91  }
92 }