Skip to content

Commit b9b6e1a

Browse files
committed
cosmetics
1 parent 132532d commit b9b6e1a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Doctrine/Phpcr/RouteProvider.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ protected function getCandidates($url)
119119
*/
120120
public function getRouteByName($name, $parameters = array())
121121
{
122-
123122
// $name is the route document path
124123
if ('' === $this->idPrefix || 0 === strpos($name, $this->idPrefix)) {
125124
$route = $this->getObjectManager()->find($this->className, $name);
@@ -141,18 +140,15 @@ public function getRouteByName($name, $parameters = array())
141140
*/
142141
public function getRoutesByNames($names, $parameters = array())
143142
{
144-
$routes = array();
145-
if ('' === $this->idPrefix) {
146-
$routes = $names;
147-
} else {
148-
foreach ($names as $name) {
149-
if (0 === strpos($name, $this->idPrefix)) {
150-
$routes[] = $name;
143+
if ('' !== $this->idPrefix) {
144+
foreach ($names as $key => $name) {
145+
if (0 !== strpos($name, $this->idPrefix)) {
146+
unset($names[$key]);
151147
}
152148
}
153149
}
154150

155-
$collection = $this->getObjectManager()->findMany($this->className, $routes);
151+
$collection = $this->getObjectManager()->findMany($this->className, $names);
156152
foreach ($collection as $key => $document) {
157153
if (!$document instanceof SymfonyRoute) {
158154
// we follow the logic of DocumentManager::findMany and do not throw an exception

0 commit comments

Comments
 (0)