Skip to content

Commit

Permalink
Add insert().
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Mar 3, 2017
1 parent cb9a336 commit 873cbb7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions framework/Refactor/lib/Horde/Refactor/Tokens.php
Expand Up @@ -375,6 +375,18 @@ public function splice($offset, $length = null, $replacement = array())
return new self($copy);
}

/**
* Inserts tokens at the current position.
*
* @param array $tokens The tokens to insert.
*
* @return self A new iterator with the tokens inserted.
*/
public function insert(array $tokens)
{
return $this->splice($this->key(), 0, $tokens);
}

/**
* Returns the file code in its current state.
*
Expand Down

0 comments on commit 873cbb7

Please sign in to comment.