8000 [Routing] initialize the Route properties · ludekstepan/symfony@e39b709 · GitHub
[go: up one dir, main page]

Skip to content

Commit e39b709

Browse files
committed
[Routing] initialize the Route properties
They should normally be initialized anyway in the constructor. But when extending the Route (like in CMF) and using an ORM/ODM to persist them in the DB, the constructor is not called. Then a new property that is not saved like hostnamePattern stays null which in turn makes the RouteCompiler fails as it expects '' instead of null.
1 parent 6e8115a commit e39b709

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Routing/Route.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class Route implements \Serializable
2323
/**
2424
* @var string
2525
*/
26-
private $pattern;
26+
private $pattern = '/';
2727

2828
/**
2929
* @var string
3030
*/
31-
private $hostnamePattern;
31+
private $hostnamePattern = '';
3232

3333
/**
3434
* @var array

0 commit comments

Comments
 (0)
0