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

Commit 62a294b

Browse files
committed
Fixed
1 parent ffabe50 commit 62a294b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/RouteCollection.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,19 @@ public function unserialize($serialized)
218218
*/
219219
protected function getSerialize()
220220
{
221+
$factory = $this->factory;
222+
223+
if ($factory instanceof \Closure) {
224+
$factory = SerializableClosure::from($factory);
225+
}
226+
221227
return [
222228
'builder' => $this->builder,
223229
'routes' => $this->routes,
224230
'namedRoutes' => $this->namedRoutes,
225231
'regex' => $this->getRegexPatterns(),
226232
'dirty' => $this->dirty,
233+
'factory' => $factory,
227234
];
228235
}
229236

@@ -237,6 +244,11 @@ protected function setUnserialize($object)
237244
$this->namedRoutes = $object['namedRoutes'];
238245
$this->regex = $object['regex'];
239246
$this->dirty = $object['dirty'];
247+
$this->factory = $object['factory'];
248+
249+
if ($this->factory instanceof SerializableClosure) {
250+
$this->factory = $this->factory->getClosure();
251+
}
240252
}
241253

242254
/**

0 commit comments

Comments
 (0)