ソースを参照

Extracting the collection function into a new file inside Collection

Jose Lorenzo Rodriguez 11 年 前
コミット
3c41eb734d
3 ファイル変更6 行追加16 行削除
  1. 4 1
      composer.json
  2. 2 1
      src/Collection/composer.json
  3. 0 14
      src/basics.php

+ 4 - 1
composer.json

@@ -34,7 +34,10 @@
 		"psr-4": {
 			"Cake\\": "src"
 		},
-		"files": ["src/Core/functions.php"]
+		"files": [
+			"src/Core/functions.php",
+			"src/Collection/functions.php"
+		]
 	},
 	"autoload-dev": {
 		"psr-4": {

+ 2 - 1
src/Collection/composer.json

@@ -11,7 +11,8 @@
 	"autoload": {
 		"psr-4": {
 			"Cake\\Collection\\": "."
-		}
+		},
+		"files": ["functions.php"]
 	},
 	"minimum-stability": "beta"
 }

+ 0 - 14
src/basics.php

@@ -244,17 +244,3 @@ if (!function_exists('__x')) {
 	}
 
 }
-
-if (!function_exists('collection')) {
-
-/**
- * Returns a new Cake\Collection\Collection object wrapping the passed argument
- *
- * @param \Traversable|array $items The items from which the collection will be built
- * @return \Cake\Collection\Collection
- */
-	function collection($items) {
-		return new Collection($items);
-	}
-
-}