public function after($value) { $char = new MutateableChar($value, -1, $this->parent); $char->prev($this); $char->next($this->next(), true); if ($this->next()) { $this->next()->prev($char); } $this->next($char); $this->parent->rebuild(); return $char; }
protected function parse() { $this->chars = array(); for ($i = 0; $i < $this->length(); $i++) { $char = new MutateableChar($this->value[$i], $i, $this); if ($prev = $this->offsetGet($i - 1)) { $char->prev($prev); $prev->next($char); } $this->chars[] = $char; } }