Browse Source

Making unwrap public, because "Coding Standards"

Jose Lorenzo Rodriguez 11 years ago
parent
commit
d19485bd97
2 changed files with 13 additions and 2 deletions
  1. 1 1
      src/Collection/CollectionInterface.php
  2. 12 1
      src/Collection/CollectionTrait.php

+ 1 - 1
src/Collection/CollectionInterface.php

@@ -855,5 +855,5 @@ interface CollectionInterface extends Iterator, JsonSerializable
      *
      * @return \Iterator
      */
-    public function _unwrap();
+    public function unwrap();
 }

+ 12 - 1
src/Collection/CollectionTrait.php

@@ -544,7 +544,7 @@ trait CollectionTrait
      * {@inheritDoc}
      *
      */
-    public function _unwrap()
+    public function unwrap()
     {
         $iterator = $this;
         while (get_class($iterator) === 'Cake\Collection\Collection') {
@@ -552,4 +552,15 @@ trait CollectionTrait
         }
         return $iterator;
     }
+
+    /**
+     * Backwards compatible wrapper for unwrap()
+     *
+     * @return \Iterator
+     * @deprecated
+     */
+    public function _unwrap()
+    {
+        return $this->unwrap();
+    }
 }