Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

Commit

Permalink
Refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
sorinsarca committed Mar 27, 2018
1 parent debabb7 commit f8f8c33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/EventTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ public function __construct(RouteCollection $collection = null)
*/
public function handle(string $event, callable $callback, int $priority = 0): Route
{
$handler = new Route($event, $callback);
$this->collection->addRoute($handler);
return $handler->set('priority', $priority);
return $this->collection->createRoute($event, $callback)->set('priority', $priority);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RouteCollection extends BaseRouteCollection
{
public function __construct()
{
parent::__construct(new Builder([
parent::__construct(null, new Builder([
Builder::SEGMENT_DELIMITER => '.',
Builder::CAPTURE_MODE => (Builder::CAPTURE_LEFT | Builder::CAPTURE_TRAIL),
]), 'priority');
Expand Down

0 comments on commit f8f8c33

Please sign in to comment.