Browse Source

Use compact instead of defining arrays

Yves P 9 years ago
parent
commit
4f9dbfa54c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/View/Helper/BreadcrumbsHelper.php

+ 2 - 2
src/View/Helper/BreadcrumbsHelper.php

@@ -104,7 +104,7 @@ class BreadcrumbsHelper extends Helper
      */
     public function prepend($title, $url = null, array $options = [])
     {
-        array_unshift($this->crumbs, ['title' => $title, 'url' => $url, 'options' => $options]);
+        array_unshift($this->crumbs, compact('title', 'url', 'options'));
 
         return $this;
     }
@@ -128,7 +128,7 @@ class BreadcrumbsHelper extends Helper
      */
     public function insertAt($index, $title, $url = null, array $options = [])
     {
-        array_splice($this->crumbs, $index, 0, [['title' => $title, 'url' => $url, 'options' => $options]]);
+        array_splice($this->crumbs, $index, 0, [compact('title', 'url', 'options')]);
 
         return $this;
     }