File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public function __serialize(): array
68
68
*/
69
69
final public function serialize (): string
70
70
{
71
- return serialize ( $ this -> __serialize () );
71
+ throw new \ BadMethodCallException ( ' Cannot serialize ' . __CLASS__ );
72
72
}
73
73
74
74
public function __unserialize (array $ data ): void
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ public function __serialize(): array
82
82
*/
83
83
final public function serialize (): string
84
84
{
85
- return serialize ( $ this -> __serialize () );
85
+ throw new \ BadMethodCallException ( ' Cannot serialize ' . __CLASS__ );
86
86
}
87
87
88
88
public function __unserialize (array $ data ): void
Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ public function testSerializeWhenCompiledWithClass()
299
299
*/
300
300
public function testSerializedRepresentationKeepsWorking ()
301
301
{
302
- $ serialized = 'C :31:"Symfony\Component\Routing\Route":936:{a:8:{ s:4:"path";s:13:"/prefix/{foo}";s:4:"host";s:20:"{locale}.example.net";s:8:"defaults";a:1:{s:3:"foo";s:7:"default";}s:12:"requirements";a:1:{s:3:"foo";s:3:"\d+";}s:7:"options";a:1:{s:14:"compiler_class";s:39:"Symfony\Component\Routing\RouteCompiler";}s:7:"schemes";a:0:{}s:7:"methods";a:0:{}s:8:"compiled";C :39:"Symfony\Component\Routing\CompiledRoute":571:{a: 8:{s:4:"vars";a:2:{i:0;s:6:"locale";i:1;s:3:"foo";}s:11:"path_prefix";s:7:"/prefix";s:10:"path_regex";s:31:"{^/prefix(?:/(?P<foo>\d+))?$}sD";s:11:"path_tokens";a:2:{i:0;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:3:"\d+";i:3;s:3:"foo";}i:1;a:2:{i:0;s:4:"text";i:1;s:7:"/prefix";}}s:9:"path_vars";a:1:{i:0;s:3:"foo";}s:10:"host_regex";s:40:"{^(?P<locale>[^\.]++)\.example\.net$}sDi";s:11:"host_tokens";a:2:{i:0;a:2:{i:0;s:4:"text";i:1;s:12:".example.net";}i:1;a:4:{i:0;s:8:"variable";i:1;s:0:"";i:2;s:7:"[^\.]++";i:3;s:6:"locale";}}s:9:"host_vars";a:1:{i:0;s:6:"locale";}} }}} ' ;
302
+ $ serialized = 'O :31:"Symfony\Component\Routing\Route":9:{ s:4:"path";s:13:"/prefix/{foo}";s:4:"host";s:20:"{locale}.example.net";s:8:"defaults";a:1:{s:3:"foo";s:7:"default";}s:12:"requirements";a:1:{s:3:"foo";s:3:"\d+";}s:7:"options";a:1:{s:14:"compiler_class";s:39:"Symfony\Component\Routing\RouteCompiler";}s:7:"schemes";a:0:{}s:7:"methods";a:0:{}s:9:"condition";s:0:"";s: 8:"compiled";O :39:"Symfony\Component\Routing\CompiledRoute":8:{s:4:"vars";a:2:{i:0;s:6:"locale";i:1;s:3:"foo";}s:11:"path_prefix";s:7:"/prefix";s:10:"path_regex";s:31:"{^/prefix(?:/(?P<foo>\d+))?$}sD";s:11:"path_tokens";a:2:{i:0;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:3:"\d+";i:3;s:3:"foo";}i:1;a:2:{i:0;s:4:"text";i:1;s:7:"/prefix";}}s:9:"path_vars";a:1:{i:0;s:3:"foo";}s:10:"host_regex";s:40:"{^(?P<locale>[^\.]++)\.example\.net$}sDi";s:11:"host_tokens";a:2:{i:0;a:2:{i:0;s:4:"text";i:1;s:12:".example.net";}i:1;a:4:{i:0;s:8:"variable";i:1;s:0:"";i:2;s:7:"[^\.]++";i:3;s:6:"locale";}}s:9:"host_vars";a:1:{i:0;s:6:"locale";}}} ' ;
303
303
$ unserialized = unserialize ($ serialized );
304
304
305
305
$ route = new Route ('/prefix/{foo} ' , ['foo ' => 'default ' ], ['foo ' => '\d+ ' ]);
You can’t perform that action at this time.
0 commit comments