Skip to content

Commit

Permalink
+ Allow method chaining (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
tetreum authored Mar 10, 2023
1 parent 2d7b7c0 commit 7515b33
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ public function loadBuiltinListeners()
/**
* Register a new listener.
*
* @return void
* @return Lexer
*/
public function registerListener(Listener $listener)
{
$this->listeners[$listener->type()][$listener->priority()][get_class($listener)] = $listener;
return $this;
}

/**
Expand All @@ -188,11 +189,12 @@ public function registerListener(Listener $listener)
* @param Listener $new The new listener object
* @see https://github.com/nadar/quill-delta-parser/issues/55
* @since 2.8.0
* @return void
* @return Lexer
*/
public function overwriteListener(Listener $listener, Listener $new)
{
$this->listeners[$listener->type()][$listener->priority()][get_class($listener)] = $new;
return $this;
}

/**
Expand Down Expand Up @@ -339,7 +341,7 @@ protected function removeLastNewline($insert)
}

/**
* Process all listeneres for a given type
* Process all listeners for a given type
*
* @param int $type
* @return void
Expand Down

0 comments on commit 7515b33

Please sign in to comment.