Skip to content

Commit e2122f2

Browse files
committed
Merge pull request #156 from symfony-cmf/deprecation-notices
Trigger deprecation notice
2 parents 8c41a43 + 252e87e commit e2122f2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

DynamicRouter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,13 @@ public function supports($name)
210210
* request method is not allowed
211211
*
212212
* @deprecated Use matchRequest exclusively to avoid problems. This method will be removed in version 2.0
213+
*
213214
* @api
214215
*/
215216
public function match($pathinfo)
216217
{
218+
@trigger_error(__CLASS__.'::'.__METHOD__.'() is deprecated since version 1.3 and will be removed in 2.0. Use matchRequest() instead.', E_USER_DEPRECATED);
219+
217220
$request = Request::create($pathinfo);
218221
if ($this->eventDispatcher) {
219222
$event = new RouterMatchEvent();

Tests/Routing/DynamicRouterTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ public function testGetMatcher()
136136
$this->assertSame($this->matcher, $matcher);
137137
}
138138

139+
/**
140+
* @group legacy
141+
*/
139142
public function testMatchUrl()
140143
{
141144
$routeDefaults = array('foo' => 'bar');
@@ -207,6 +210,7 @@ public function testMatchRequest()
207210

208211
/**
209212
* @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException
213+
* @group legacy
210214
*/
211215
public function testMatchFilter()
212216
{
@@ -247,6 +251,7 @@ public function testMatchRequestFilter()
247251

248252
/**
249253
* @expectedException \InvalidArgumentException
254+
* @group legacy
250255
*/
251256
public function testMatchUrlWithRequestMatcher()
252257
{
@@ -282,6 +287,9 @@ public function testRouteDebugMessageNonversatile()
282287
$this->assertInternalType('string', $router->getRouteDebugMessage('test'));
283288
}
284289

290+
/**
291+
* @group legacy
292+
*/
285293
public function testEventHandler()
286294
{
287295
$eventDispatcher = $this->buildMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');

0 commit comments

Comments
 (0)