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

Commit 806a33c

Browse files
committed
Renamed all instances of Url to Uri
1 parent eb9466b commit 806a33c

File tree

20 files changed

+48
-48
lines changed

20 files changed

+48
-48
lines changed

Adapter/PhpcrOdmAdapter.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Doctrine\Common\Util\ClassUtils;
1818
use PHPCR\InvalidItemStateException;
1919
use Symfony\Cmf\Component\RoutingAuto\Model\AutoRouteInterface;
20-
use Symfony\Cmf\Component\RoutingAuto\UrlContext;
20+
use Symfony\Cmf\Component\RoutingAuto\UriContext;
2121
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute;
2222
use Symfony\Cmf\Component\RoutingAuto\AdapterInterface;
2323
use Symfony\Cmf\Bundle\RoutingAutoBundle\Model\AutoRedirectRoute;
@@ -79,9 +79,9 @@ public function translateObject($contentDocument, $locale)
7979
/**
8080
* {@inheritDoc}
8181
*/
82-
public function generateAutoRouteTag(UrlContext $urlContext)
82+
public function generateAutoRouteTag(UriContext $uriContext)
8383
{
84-
return $urlContext->getLocale() ? : self::TAG_NO_MULTILANG;
84+
return $uriContext->getLocale() ? : self::TAG_NO_MULTILANG;
8585
}
8686

8787
/**
@@ -114,11 +114,11 @@ public function removeAutoRoute(AutoRouteInterface $autoRoute)
114114
/**
115115
* {@inheritDoc}
116116
*/
117-
public function createAutoRoute($url, $contentDocument, $autoRouteTag)
117+
public function createAutoRoute($uri, $contentDocument, $autoRouteTag)
118118
{
119119
$path = $this->baseRoutePath;
120120
$parentDocument = $this->dm->find(null, $path);
121-
$segments = preg_split('#/#', $url, null, PREG_SPLIT_NO_EMPTY);
121+
$segments = preg_split('#/#', $uri, null, PREG_SPLIT_NO_EMPTY);
122122
$headName = array_pop($segments);
123123
foreach ($segments as $segment) {
124124
$path .= '/' . $segment;
@@ -183,15 +183,15 @@ public function getReferringAutoRoutes($contentDocument)
183183
/**
184184
* {@inheritDoc}
185185
*/
186-
public function findRouteForUrl($url)
186+
public function findRouteForUri($uri)
187187
{
188-
$path = $this->getPathFromUrl($url);
188+
$path = $this->getPathFromUri($uri);
189189

190190
return $this->dm->find(null, $path);
191191
}
192192

193-
private function getPathFromUrl($url)
193+
private function getPathFromUri($uri)
194194
{
195-
return $this->baseRoutePath . $url;
195+
return $this->baseRoutePath . $uri;
196196
}
197197
}

Command/RefreshCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Symfony\Component\Console\Output\OutputInterface;
1818
use Symfony\Component\Console\Input\InputOption;
1919
use Doctrine\Bundle\PHPCRBundle\Command\DoctrineCommandHelper;
20-
use Symfony\Cmf\Component\RoutingAuto\UrlContextCollection;
20+
use Symfony\Cmf\Component\RoutingAuto\UriContextCollection;
2121

2222
class RefreshCommand extends ContainerAwareCommand
2323
{
@@ -94,11 +94,11 @@ public function execute(InputInterface $input, OutputInterface $output)
9494
$id = $uow->getDocumentId($autoRouteableDocument);
9595
$output->writeln(' <info>Refreshing: </info>'.$id);
9696

97-
$urlContextCollection = new UrlContextCollection($autoRouteableDocument);
98-
$arm->buildUrlContextCollection($urlContextCollection);
97+
$uriContextCollection = new UriContextCollection($autoRouteableDocument);
98+
$arm->buildUriContextCollection($uriContextCollection);
9999

100-
foreach ($urlContextCollection->getUrlContexts() as $urlContext) {
101-
$autoRoute = $urlContext->getAutoRoute();
100+
foreach ($uriContextCollection->getUriContexts() as $uriContext) {
101+
$autoRoute = $uriContext->getAutoRoute();
102102
$dm->persist($autoRoute);
103103
$autoRouteId = $uow->getDocumentId($autoRoute);
104104

Doctrine/Phpcr/AutoRouteListener.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Symfony\Component\DependencyInjection\ContainerInterface;
1818
use Symfony\Cmf\Bundle\RoutingAutoBundle\Model\AutoRoute;
1919
use Doctrine\Common\Util\ClassUtils;
20-
use Symfony\Cmf\Component\RoutingAuto\UrlContextCollection;
20+
use Symfony\Cmf\Component\RoutingAuto\UriContextCollection;
2121
use Symfony\Cmf\Component\RoutingAuto\Mapping\Exception\ClassNotMappedException;
2222

2323
/**
@@ -64,12 +64,12 @@ public function onFlush(ManagerEventArgs $args)
6464
foreach ($updates as $document) {
6565
if ($this->isAutoRouteable($document)) {
6666

67-
$urlContextCollection = new UrlContextCollection($document);
68-
$arm->buildUrlContextCollection($urlContextCollection);
67+
$uriContextCollection = new UriContextCollection($document);
68+
$arm->buildUriContextCollection($uriContextCollection);
6969

7070
// refactor this.
71-
foreach ($urlContextCollection->getUrlContexts() as $urlContext) {
72-
$autoRoute = $urlContext->getAutoRoute();
71+
foreach ($uriContextCollection->getUriContexts() as $uriContext) {
72+
$autoRoute = $uriContext->getAutoRoute();
7373
$dm->persist($autoRoute);
7474
$uow->computeChangeSets();
7575
}

Resources/config/auto_route.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parameter key="cmf_routing_auto.auto_route_manager.class">Symfony\Cmf\Component\RoutingAuto\AutoRouteManager</parameter>
1010
<parameter key="cmf_routing_auto.service_registry.class">Symfony\Cmf\Component\RoutingAuto\ServiceRegistry</parameter>
1111
<parameter key="cmf_routing_auto.adapter.phpcr_odm.class">Symfony\Cmf\Bundle\RoutingAutoBundle\Adapter\PhpcrOdmAdapter</parameter>
12-
<parameter key="cmf_routing_auto.url_generator.class">Symfony\Cmf\Component\RoutingAuto\UrlGenerator</parameter>
12+
<parameter key="cmf_routing_auto.uri_generator.class">Symfony\Cmf\Component\RoutingAuto\UriGenerator</parameter>
1313

1414
<parameter key="cmf_routing_auto.metadata.loader.yaml.class">Symfony\Cmf\Component\RoutingAuto\Mapping\Loader\YmlFileLoader</parameter>
1515
<parameter key="cmf_routing_auto.metadata.loader.xml.class">Symfony\Cmf\Component\RoutingAuto\Mapping\Loader\XmlFileLoader</parameter>
@@ -36,12 +36,12 @@
3636
class="Symfony\Cmf\Component\RoutingAuto\AutoRouteManager"
3737
>
3838
<argument type="service" id="cmf_routing_auto.adapter.phpcr_odm"/>
39-
<argument type="service" id="cmf_routing_auto.url_generator" />
39+
<argument type="service" id="cmf_routing_auto.uri_generator" />
4040
<argument type="service" id="cmf_routing_auto.defunct_route_handler.delegating" />
4141
</service>
4242

4343
<!-- URL Generator -->
44-
<service id="cmf_routing_auto.url_generator" class="%cmf_routing_auto.url_generator.class%">
44+
<service id="cmf_routing_auto.uri_generator" class="%cmf_routing_auto.uri_generator.class%">
4545
<argument type="service" id="cmf_routing_auto.metadata.factory" />
4646
<argument type="service" id="cmf_routing_auto.adapter.phpcr_odm" />
4747
<argument type="service" id="cmf_routing_auto.service_registry" />

Tests/Functional/EventListener/AutoRouteListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ public function testConflictResolverAutoIncrement()
468468
}
469469

470470
/**
471-
* @expectedException Symfony\Cmf\Component\RoutingAuto\ConflictResolver\Exception\ExistingUrlException
471+
* @expectedException Symfony\Cmf\Component\RoutingAuto\ConflictResolver\Exception\ExistingUriException
472472
*/
473473
public function testConflictResolverDefaultThrowException()
474474
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" ?>
22
<auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
33
<mapping class="NotExistingClass"
4-
url-schema="/cmf/blog"
4+
uri-schema="/cmf/blog"
55
/>
66
</auto-mapping>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
NotExistingClass:
2-
url_schema: /cmf/blog
2+
uri_schema: /cmf/blog
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
stdClass:
2-
url_schema: /forum/{category}/{post_title}
2+
uri_schema: /forum/{category}/{post_title}
33
token_providers:
44
category: [foo]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" ?>
22
<auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
33
<mapping class="stdClass"
4-
url-schema="/cmf/blog" />
4+
uri-schema="/cmf/blog" />
55
</auto-mapping>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
stdClass:
2-
url_schema: /cmf/blog
2+
uri_schema: /cmf/blog

0 commit comments

Comments
 (0)