[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.
This commit is contained in:
parent
6e8115a276
commit
e39b70949e
@ -23,12 +23,12 @@ class Route implements \Serializable
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $pattern;
|
||||
private $pattern = '/';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $hostnamePattern;
|
||||
private $hostnamePattern = '';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
Reference in New Issue
Block a user