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

Commit

Permalink
Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
msarca committed Mar 27, 2018
1 parent ffabe50 commit 62a294b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,19 @@ public function unserialize($serialized)
*/
protected function getSerialize()
{
$factory = $this->factory;

if ($factory instanceof \Closure) {
$factory = SerializableClosure::from($factory);
}

return [
'builder' => $this->builder,
'routes' => $this->routes,
'namedRoutes' => $this->namedRoutes,
'regex' => $this->getRegexPatterns(),
'dirty' => $this->dirty,
'factory' => $factory,
];
}

Expand All @@ -237,6 +244,11 @@ protected function setUnserialize($object)
$this->namedRoutes = $object['namedRoutes'];
$this->regex = $object['regex'];
$this->dirty = $object['dirty'];
$this->factory = $object['factory'];

if ($this->factory instanceof SerializableClosure) {
$this->factory = $this->factory->getClosure();
}
}

/**
Expand Down

0 comments on commit 62a294b

Please sign in to comment.