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

Commit 9387667

Browse files
committed
adjust to routing refactoring
1 parent ac719e9 commit 9387667

File tree

10 files changed

+16
-19
lines changed

10 files changed

+16
-19
lines changed

AutoRoute/BuilderContext.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute;
44

5-
use Symfony\Cmf\Bundle\RoutingBundle\Document\Route;
6-
75
/**
86
* This class might better be called AutoRouteRequest.
97
* It holds all the RouteStack objects and the content document.
@@ -16,7 +14,9 @@
1614
*/
1715
class BuilderContext
1816
{
17+
/** @var RouteStack[] */
1918
protected $routeStacks = array();
19+
/** @var RouteStack */
2020
protected $stagedRouteStack;
2121
protected $content;
2222

@@ -47,7 +47,7 @@ public function stageRouteStack(RouteStack $routeStack)
4747
}
4848

4949
/**
50-
* As with above. This can probably be replaced with something
50+
* As with above. This can probably be replaced with something
5151
* simpler.
5252
*/
5353
public function commitRouteStack()

AutoRoute/PathActionInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute;
44

5-
use Symfony\Cmf\Bundle\RoutingBundle\Document\Route;
6-
75
/**
86
* The job of classes implementing this interface is to add
97
* a Route for each path element in the given RouteStack.

AutoRoute/PathProvider/ContentObjectProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\RouteStack;
99
use Symfony\Cmf\Bundle\CoreBundle\Slugifier\SlugifierInterface;
1010
use Doctrine\ODM\PHPCR\DocumentManager;
11-
use Symfony\Cmf\Bundle\RoutingBundle\Document\Route;
11+
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
1212
use Doctrine\Common\Collections\ArrayCollection;
1313

1414
/**
@@ -75,7 +75,7 @@ public function providePath(RouteStack $routeStack)
7575

7676
// Now check to see if there are any scheduled routes
7777
// I think this should be handled by the ODM ...
78-
78+
7979
$uow = $this->dm->getUnitOfWork();
8080
$scheduledInserts = $uow->getScheduledInserts();
8181
$scheduledRoutes = array_filter($scheduledInserts, $routeFilter);

AutoRoute/RouteMaker/RouteMaker.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
use Doctrine\ODM\PHPCR\DocumentManager;
77
use Doctrine\ODM\PHPCR\Document\Generic;
88
use Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\RouteStack;
9-
use Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\Exception\MissingOptionException;
10-
use Symfony\Cmf\Bundle\RoutingBundle\Document\Route;
9+
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
1110

1211
/**
1312
* This class will make the Route classes using

Document/AutoRoute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\Document;
44

5-
use Symfony\Cmf\Bundle\RoutingBundle\Document\Route;
5+
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
66

77
/**
88
* Sub class of Route to enable automatically generated routes

Tests/Resources/Document/Blog.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class Blog
1919

2020
/**
2121
* @PHPCR\Referrers(
22-
* referringDocument="Symfony\Cmf\Bundle\RoutingBundle\Document\Route",
23-
* referencedBy="routeContent"
22+
* referringDocument="Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route",
23+
* referencedBy="content"
2424
* )
2525
*/
2626
public $routes;

Tests/Resources/Document/Post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class Post
1919

2020
/**
2121
* @PHPCR\Referrers(
22-
* referringDocument="Symfony\Cmf\Bundle\RoutingBundle\Document\Route",
23-
* referencedBy="routeContent"
22+
* referringDocument="Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route",
23+
* referencedBy="content"
2424
* )
2525
*/
2626
public $routes;

Tests/Unit/AutoRoute/PathExists/AutoIncrementPathTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public function setUp()
2323
$this->builderContext = $this->getMock('Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\BuilderContext');
2424

2525
$this->aiPath = new AutoIncrementPath($this->dm, $this->routeMaker);
26-
$this->route1 = $this->getMockBuilder('Symfony\Cmf\Bundle\RoutingBundle\Document\Route')
26+
$this->route1 = $this->getMockBuilder('Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route')
2727
->disableOriginalConstructor()
2828
->getMock();
29-
$this->route2 = $this->getMockBuilder('Symfony\Cmf\Bundle\RoutingBundle\Document\Route')
29+
$this->route2 = $this->getMockBuilder('Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route')
3030
->disableOriginalConstructor()
3131
->getMock();
3232

Tests/Unit/AutoRoute/PathProvider/ContentObjectProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function setUp()
3535
->getMock();
3636

3737
$this->contentObject = new \stdClass;
38-
$this->route1 = $this->getMock('Symfony\Cmf\Bundle\RoutingBundle\Document\Route');
38+
$this->route1 = $this->getMock('Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route');
3939
$this->object = new ContentObjectTestClass($this->contentObject);
4040

4141

Tests/Unit/AutoRoute/RouteMaker/RouteMakerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class RouteMakerTest extends GenericMakerTest
88
{
9-
protected $routeClass = 'Symfony\Cmf\Bundle\RoutingBundle\Document\Route';
9+
protected $routeClass = 'Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route';
1010
protected $makerClass = 'Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\RouteMaker\RouteMaker';
1111

1212
public function testMake()
@@ -30,7 +30,7 @@ public function testMake()
3030
$expected = array('/test', '/test/foo');
3131

3232
$test->assertInstanceOf(
33-
'Symfony\Cmf\Bundle\RoutingBundle\Document\Route',
33+
$this->routeClass,
3434
$doc
3535
);
3636

0 commit comments

Comments
 (0)