Skip to content

Commit 42508d7

Browse files
author
Chirs Warner
committed
Fixed Code Style errors.
1 parent 0662698 commit 42508d7

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

Doctrine/Phpcr/RouteProvider.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function setPrefix($prefix)
6060
*/
6161
public function getRouteCollectionForRequest(Request $request)
6262
{
63-
$url = $request->getPathInfo();
63+
$url = $request->getPathInfo();
6464
$candidates = $this->getCandidates($url);
6565

6666
$collection = new RouteCollection();
@@ -78,7 +78,7 @@ public function getRouteCollectionForRequest(Request $request)
7878
}
7979
}
8080
}
81-
catch (RepositoryException $e) {
81+
} catch (RepositoryException $e) {
8282
// TODO: how to determine whether this is a relevant exception or not?
8383
// https://github.com/symfony-cmf/RoutingBundle/issues/143
8484
// for example, getting /my//test (note the double /) is just an invalid path
@@ -96,17 +96,17 @@ public function getRouteCollectionForRequest(Request $request)
9696
*/
9797
protected function getCandidates($url)
9898
{
99-
$candidates = array ();
99+
$candidates = array();
100100
if ('/' !== $url) {
101101
if (preg_match('/(.+)\.[a-z]+$/i', $url, $matches)) {
102102
$candidates[] = $this->idPrefix . $url;
103-
$url = $matches[1];
103+
$url = $matches[1];
104104
}
105105

106106
$part = $url;
107107
while (false !== ($pos = strrpos($part, '/'))) {
108108
$candidates[] = $this->idPrefix . $part;
109-
$part = substr($url, 0, $pos);
109+
$part = substr($url, 0, $pos);
110110
}
111111
}
112112

@@ -118,11 +118,11 @@ protected function getCandidates($url)
118118
/**
119119
* {@inheritDoc}
120120
*/
121-
public function getRouteByName($name, $parameters = array ())
121+
public function getRouteByName($name, $parameters = array())
122122
{
123123

124124
// $name is the route document path
125-
if ('' === $this->idPrefix || 0 === strpos($name, $this->idPrefix)) {
125+
if ( '' === $this->idPrefix || 0 === strpos($name, $this->idPrefix) ) {
126126
$route = $this->getObjectManager()->find($this->className, $name);
127127
}
128128

@@ -140,12 +140,12 @@ public function getRouteByName($name, $parameters = array ())
140140
/**
141141
* {@inheritDoc}
142142
*/
143-
public function getRoutesByNames($names, $parameters = array ())
143+
public function getRoutesByNames($names, $parameters = array())
144144
{
145-
$routes = array ();
145+
$routes = array();
146146
if ('' === $this->idPrefix) {
147147
foreach ($names as $name) {
148-
if (0 === strpos($name, $this->idPrefix)) {
148+
if ('' === $this->idPrefix || 0 === strpos($name, $this->idPrefix)) {
149149
$routes[] = $name;
150150
}
151151
}
@@ -164,4 +164,5 @@ public function getRoutesByNames($names, $parameters = array ())
164164

165165
return $collection;
166166
}
167+
167168
}

0 commit comments

Comments
 (0)