Browse Source

Merge pull request #2659 from afurculita/patch-3

Remove duplicate code from Admin
Christian Gripp 9 years ago
parent
commit
d7d796503d
1 changed files with 13 additions and 13 deletions
  1. 13 13
      Admin/Admin.php

+ 13 - 13
Admin/Admin.php

@@ -2223,21 +2223,21 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
             );
 
             return $childAdmin->buildBreadcrumbs($action, $menu);
-        } elseif ($this->isChild()) {
-            if ($action == 'list') {
-                $menu->setUri(false);
-            } elseif ($action != 'create' && $this->hasSubject()) {
-                $menu = $menu->addChild($this->toString($this->getSubject()));
-            } else {
-                $menu = $menu->addChild(
-                    $this->trans($this->getLabelTranslatorStrategy()->getLabel(sprintf('%s_%s', $this->getClassnameLabel(), $action), 'breadcrumb', 'link'))
-                );
-            }
-        } elseif ($action != 'list' && $this->hasSubject()) {
+        }
+
+        if ($action === 'list' && $this->isChild()) {
+            $menu->setUri(false);
+        } elseif ($action !== 'create' && $this->hasSubject()) {
             $menu = $menu->addChild($this->toString($this->getSubject()));
-        } elseif ($action != 'list') {
+        } else {
             $menu = $menu->addChild(
-                $this->trans($this->getLabelTranslatorStrategy()->getLabel(sprintf('%s_%s', $this->getClassnameLabel(), $action), 'breadcrumb', 'link'))
+                $this->trans(
+                    $this->getLabelTranslatorStrategy()->getLabel(
+                        sprintf('%s_%s', $this->getClassnameLabel(), $action),
+                        'breadcrumb',
+                        'link'
+                    )
+                )
             );
         }