├── .gitignore ├── CartExample.php ├── MyCartExample.php ├── README.md ├── composer.json ├── composer.lock └── src ├── Cart.php ├── CartItem.php ├── GameOfThronesCart.php ├── Helpers.php └── Storage ├── ArrayStore.php └── SessionStore.php /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Composer template 3 | composer.phar 4 | /vendor/ 5 | 6 | # Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file 7 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 8 | # composer.lock 9 | 10 | README.md 11 | -------------------------------------------------------------------------------- /CartExample.php: -------------------------------------------------------------------------------- 1 | add(new \Cart\CartItem(['name'=> '冰與火之歌第1季', 'quantity' => 1, 'price' => 100])); 10 | $cart->add(new \Cart\CartItem(['name'=> '冰與火之歌第2季', 'quantity' => 1, 'price' => 200])); 11 | $cart->add(new \Cart\CartItem(['name'=> '冰與火之歌第3季', 'quantity' => 1, 'price' => 300])); 12 | 13 | print_r($cart->toArray()['items']); 14 | echo "---------------------------" . PHP_EOL; 15 | print_r('一共 ' . $cart->total() . ' 元'); 16 | -------------------------------------------------------------------------------- /MyCartExample.php: -------------------------------------------------------------------------------- 1 | add(new \MyCart\CartItem(['name'=> '冰與火之歌第1季', 'quantity' => 1, 'price' => 100])); 10 | $cart->add(new \MyCart\CartItem(['name'=> '冰與火之歌第2季', 'quantity' => 1, 'price' => 200])); 11 | $cart->add(new \MyCart\CartItem(['name'=> '冰與火之歌第3季', 'quantity' => 1, 'price' => 300])); 12 | 13 | print_r(itemList($cart)); 14 | echo "---------------------------" . PHP_EOL; 15 | print_r('一共 ' . $cart->total() . ' 元'); 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Composer 新手入門教學 2 | 3 | ## 安裝 Composer 4 | 5 | * 官網安裝指南: 6 | - Linux / Unix / OSX 7 | - Windows: 8 | * 手動安裝下載位置: 9 | * From 官網,使用 PHP 執行環境安裝 (一行一個指令) 10 | ```bash 11 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 12 | php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" 13 | php composer-setup.php 14 | php -r "unlink('composer-setup.php');" 15 | ``` 16 | * 或直接下載 `.phar` 打包檔, 17 | * 執行 `php composer.phar`,出現以下資訊表示裝好了: 18 | 19 | ``` 20 | ______ 21 | / ____/___ ____ ___ ____ ____ ________ _____ 22 | / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ 23 | / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ / 24 | \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ 25 | /_/ 26 | Composer version 1.5.1 2017-08-09 16:07:22 27 | 28 | Usage: 29 | command [options] [arguments] 30 | 31 | Options: 32 | -h, --help Display this help message 33 | -q, --quiet Do not output any message 34 | -V, --version Display this application version 35 | --ansi Force ANSI output 36 | --no-ansi Disable ANSI output 37 | -n, --no-interaction Do not ask any interactive question 38 | --profile Display timing and memory usage information 39 | --no-plugins Whether to disable plugins. 40 | -d, --working-dir=WORKING-DIR If specified, use the given directory as working directory. 41 | -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug 42 | 43 | # 後略... 44 | ``` 45 | 46 | * 看到一般 github 上寫例如: `$ composer require mike182uk/cart` 47 | 就是要執行 `$ php composer.phar require mike182uk/cart` 48 | 再例如要你執行: `$ composer install` 49 | 就是要執行 `$ php composer.phar install` 50 | 51 | * 但一般來說,都會把 `composer.phar` 改名為 `composer` 變成一個可執行檔, 52 | 複製到系統 path 中可以讀得到的路徑上, 53 | 以 Mac 為例: `cp comopser.phar /usr/local/bin/composer` 54 | 這樣以後就只要執行 `composer` 不用再打一長串了。 55 | 56 | * Windows 的話應該會製成 `composer.bat` 檔,複製到系統 path 中可以讀得到的路徑上,內容會類似是 `php.exe composer.phar %1 %2 %3 %4 %5` 之類的。可參考我搜尋到的一個 gist: (沒試用過,有誰試過能用麻煩跟我說一聲,感謝!) 57 | 58 | * 附註:以前使用 curl 的安裝的方式在 mac 環境仍然能用, 59 | 我想應該是因為在 windows 上沒有 curl 這個工具,所以官網才改的。 60 | 下這行指令,效果也一樣會下載 `composer.phar` 檔: `curl -sS https://getcomposer.org/installer | php` 61 | 62 | 63 |
64 |
65 |
66 | 67 | ## Composer Require 安裝/引用 package(套件) 68 | 69 | ### 引用購物車 package,執行:`$ composer require mike182uk/cart` 70 | 71 | * 可搜尋有哪些套件,是 `composer require {name}` 時會搜的資料庫 72 | * 73 | * 74 | * `composer.json` 裡的 name 就是 require 套件時要用的 {name} 75 | * 相關源碼會下載到 vendor 資料夾 76 | 77 | ### 怎麼使用下載的套件? 78 | 79 | * 在 php 中加入: 80 | ```php 81 | 99 |
100 |
101 | 102 | ## Composer Install 安裝 package(套件) 103 | 104 | ### `composer.json` 設定檔,用來「限制」更新/安裝套件的版本 105 | 106 | * `composer.json` 是 Composer 重要設定檔,最重要的功能就是用來「限制」更新套件的版本。功能類似 `package.json`, `bower.json`。 107 | * 執行 `$ composer install` 時,如果找不到 `composer.lock` 檔,則依 `compsoer.json` 檔內容安裝套件。 108 | * 其他還有很多功能,這邊先不混淆大家,怎麼「限制」版本到後面 composer update 再聊。 109 | 110 | ### `composer.lock` 用來「鎖定」安裝的套件和套件版本 111 | 112 | * 用來「鎖定」安裝的套件及版本,在執行 `$ composer update` 或 `$ composer require` 時會改變其內容。 是 `$ composer install` 優先讀取的設定檔。 113 | * 執行 `$ composer install` 「不會」改變 `composer.lock` 檔的內容。 114 | 115 | 116 | ### 1. 要用 `composer install` 安裝套件,需要先有 `composer.json` 或 `composer.lock` 117 | 118 | 以空專案為例,先自己新增一個 `composer.json` 檔,或是從同事的 repo 得來等等,例如: 119 | ```json 120 | { 121 | "require": { 122 | "mike182uk/cart": "^3.0" 123 | } 124 | } 125 | ``` 126 | 127 | ### 2. 執行 `$ composer install` 128 | - 讀取 json 設定檔,會下載 `mike182uk/cart` 套件到 `vendor/` 資料夾 129 | - 在這 json 檔的例子裡,效果跟 `$ composer require mike182uk/cart` 結果一樣 130 | - 根據 `require` / `require-dev` 的設定限制安裝套件的版本 131 | - 版本限制一般是用 git repo 的 tag 132 | - 如果不想裝 `requrie-dev` 中的東西,可以改用 `$ composer install --no-dev` 133 | - 如果當時沒有 `composer.lock`,執行完會建立 `composer.lock`。 134 | 135 | * 來看個比較複雜的例子,拿這次用的 `mike182uk/cart` 套件裡的 `composer.json` 為例: 136 | 137 | ```json 138 | { 139 | "name": "mike182uk/cart", 140 | "description" : "A flexible and modern shopping cart package", 141 | "type": "library", 142 | "license": "MIT", 143 | "authors": [ 144 | { 145 | "name": "Michael David Barrett", 146 | "email": "mike182uk@gmail.com" 147 | } 148 | ], 149 | "require" : { 150 | "php": ">=5.6.0" 151 | }, 152 | "require-dev": { 153 | "phpunit/phpunit": "~5.0", 154 | "mockery/mockery": "~0.0", 155 | "friendsofphp/php-cs-fixer": "~2.0" 156 | }, 157 | "autoload": { 158 | "psr-4": { 159 | "Cart\\": "src" 160 | } 161 | }, 162 | "scripts": { 163 | "test": "phpunit --verbose --colors=always", 164 | "test-with-coverage": "phpunit --verbose --colors=always --coverage-clover coverage.clover", 165 | "lint": "php-cs-fixer fix --dry-run --verbose --ansi", 166 | "fix": "php-cs-fixer fix --ansi" 167 | } 168 | } 169 | ``` 170 | 171 | ## Composer Install 的重要觀念: 172 | 173 | * 執行 `$ composer install` 會讀 `composer.lock` 檔,依 lock 檔內容安裝套件「指定的版本」。這時候完全不會管你 `composer.json` 寫什麼,就算有 json 檔中有加入新的套件,也不會被裝進來。 174 | 175 | * 如果沒有 lock 檔,則直接讀 `composer.json`,依 json 檔設定的套件版本限制安裝套件。 176 | 177 | * 沒有 `composer.json` 的話無法執行 `$ composer install`,就算有 `composer.lock` 也不行。 (tested at composer v1.5.1 on 2017-09-11) 178 | 179 |
180 |
181 |
182 | 183 | ## 用 Composer Update 安裝/更新 package(套件) 184 | 185 | * 以安裝 PHPUnit 5.5 為例,`$ composer require --dev phpunit/phpunit "5.5.*"` 186 | * 裝完後,想看該套件的 Home `$ composer home phpunit/phpunit` 187 | * 或是看 github `$ composer browse phpunit/phpunit` 188 | * 移除套件 `$ composer remove phpunit/phpunit` 189 | 190 | ### 1. 要用 `composer update` 更新套件,需要先注意 `composer.json` 裡的版本限制 191 | 192 | 我們剛剛故意安裝 phpunit `5.5.*` 的版本。現在要來更新到 `~5.0`。所以把 `composer.json` 改成這樣: 193 | 194 | ```json 195 | { 196 | "require": { 197 | "mike182uk/cart": "^3.0" 198 | }, 199 | "require-dev": { 200 | "phpunit/phpunit": "~5.0" 201 | } 202 | } 203 | 204 | ``` 205 | 206 | * 關於版本的限制官網說明: 207 | * 測試你的版本設定: 208 | 209 | #### 版本限制重點整理版: 210 | 211 | | 常見限制條件 | 版本範圍(tag)/分支名稱(branch) | 212 | |----------------|----------------------------------------------| 213 | | 3.* | >= 3.0.0, < 4.0 | 214 | | 3.1.* | >= 3.1.0, < 3.2 | 215 | | ~3.1 | >= 3.1.0, < 4.0 (最常見) | 216 | | ~3.1.0 | >= 3.1.0, < 3.2 (注意) | 217 | | ^3.1.0 | >= 3.1.0, < 4.0 (注意) | 218 | | ^3.1 | >= 3.1.0, < 4.0 (注意) | 219 | | dev-master | master branch (需搭配 minimum-stability) | 220 | | dev-develop | develop branch (需搭配 minimum-stability) | 221 | | dev-my-feature | my-feature branch (需搭配 minimum-stability) | 222 | | 1.0 - 2.0 | >= 1.0.0, < 2.1 | 223 | | 1.0.0 - 2.1.0 | >= 1.1.0, <= 2.1.0 | 224 | 225 | > ref: https://blog.madewithlove.be/post/tilde-and-caret-constraints/ 226 | 227 | 228 | ### 2. 執行 `composer update` 會做什麼? 229 | ```json 230 | { 231 | "require": { 232 | "mike182uk/cart": "^3.0" 233 | }, 234 | "require-dev": { 235 | "phpunit/phpunit": "~5.0" 236 | } 237 | } 238 | ``` 239 | 240 | - 讀取 `composer.json` 檔中的版本限制設定 241 | - 下載套件到 `vendor` 資料夾,並更新 `composer.lock` 檔中鎖定的套件版本 242 | - 以上面這個例子,會更新 phpunit 到 `< 6.0` 的最新版,目前就是 5.7.21 243 | - 無法復原,除非把套件砍掉重裝 244 | 245 | 246 | ### 3. 來車拼 `$ composer install` vs `$ composer update` 247 | 248 | | | Composer install | Composer update | 249 | |------------------|----------------------------------------------|-----------------| 250 | | composer.json 檔 | 有 lock 檔先讀 lock 檔,
沒有才讀 json 檔 | 主要讀 json 檔 | 251 | | composer.lock 檔 | 不會更新,若沒有的話會建一個 | 會被更新 | 252 | 253 | > 註:若套件沒有新版本當然 `composer update` 就不會更新 lock 檔 254 | 255 | ## 用 Composer 幫你 autoload 各 class 檔 256 | 257 | * 這邊看影片跟著操作一次學比較快: (從 55:00 左右開始) 258 | 259 | ### 好處與重點: 260 | 261 | * 只要 require 一個 autoload.php 檔,不用再一個個類別檔案 require 262 | * 有 files, classmap, psr-4/0 等可以選擇 263 | * 只有 functions 的 php 檔,必須要用 files 的方式放進 composer.json 264 | 265 | 266 | 267 | 268 | 269 | 270 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twkdj/cart", 3 | "description": "A flexible and modern shopping cart package", 4 | "type": "library", 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Michael David Barrett", 9 | "email": "mike182uk@gmail.com" 10 | }], 11 | "require": 12 | { 13 | "mike182uk/cart": "^3.0" 14 | }, 15 | "require-dev": 16 | { 17 | "phpunit/phpunit": "~5.0" 18 | }, 19 | "autoload": 20 | { 21 | "files": [ 22 | "src/Helpers.php" 23 | ], 24 | "classmap": [], 25 | "psr-4": 26 | { 27 | "MyCart\\": "src/" 28 | } 29 | }, 30 | "minimum-stability": "stable", 31 | "scripts": 32 | { 33 | "test": "phpunit --verbose --colors=always", 34 | "test-with-coverage": "phpunit --verbose --colors=always --coverage-clover coverage.clover", 35 | "lint": "php-cs-fixer fix --dry-run --verbose --ansi", 36 | "fix": "php-cs-fixer fix --ansi" 37 | } 38 | } -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "7b74ef46787edc0c3c3ac8676cd6b4a1", 8 | "packages": [ 9 | { 10 | "name": "mike182uk/cart", 11 | "version": "v3.0.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/mike182uk/cart.git", 15 | "reference": "6243f5130971bf410374aeb844429a9fca5c7469" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/mike182uk/cart/zipball/6243f5130971bf410374aeb844429a9fca5c7469", 20 | "reference": "6243f5130971bf410374aeb844429a9fca5c7469", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=5.6.0" 25 | }, 26 | "require-dev": { 27 | "friendsofphp/php-cs-fixer": "~2.0", 28 | "mockery/mockery": "~0.0", 29 | "phpunit/phpunit": "~5.0" 30 | }, 31 | "type": "library", 32 | "autoload": { 33 | "psr-4": { 34 | "Cart\\": "src" 35 | } 36 | }, 37 | "notification-url": "https://packagist.org/downloads/", 38 | "license": [ 39 | "MIT" 40 | ], 41 | "authors": [ 42 | { 43 | "name": "Michael David Barrett", 44 | "email": "mike182uk@gmail.com" 45 | } 46 | ], 47 | "description": "A flexible and modern shopping cart package", 48 | "time": "2017-01-04T21:04:06+00:00" 49 | } 50 | ], 51 | "packages-dev": [ 52 | { 53 | "name": "doctrine/instantiator", 54 | "version": "1.1.0", 55 | "source": { 56 | "type": "git", 57 | "url": "https://github.com/doctrine/instantiator.git", 58 | "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" 59 | }, 60 | "dist": { 61 | "type": "zip", 62 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", 63 | "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", 64 | "shasum": "" 65 | }, 66 | "require": { 67 | "php": "^7.1" 68 | }, 69 | "require-dev": { 70 | "athletic/athletic": "~0.1.8", 71 | "ext-pdo": "*", 72 | "ext-phar": "*", 73 | "phpunit/phpunit": "^6.2.3", 74 | "squizlabs/php_codesniffer": "^3.0.2" 75 | }, 76 | "type": "library", 77 | "extra": { 78 | "branch-alias": { 79 | "dev-master": "1.2.x-dev" 80 | } 81 | }, 82 | "autoload": { 83 | "psr-4": { 84 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 85 | } 86 | }, 87 | "notification-url": "https://packagist.org/downloads/", 88 | "license": [ 89 | "MIT" 90 | ], 91 | "authors": [ 92 | { 93 | "name": "Marco Pivetta", 94 | "email": "ocramius@gmail.com", 95 | "homepage": "http://ocramius.github.com/" 96 | } 97 | ], 98 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 99 | "homepage": "https://github.com/doctrine/instantiator", 100 | "keywords": [ 101 | "constructor", 102 | "instantiate" 103 | ], 104 | "time": "2017-07-22T11:58:36+00:00" 105 | }, 106 | { 107 | "name": "myclabs/deep-copy", 108 | "version": "1.6.1", 109 | "source": { 110 | "type": "git", 111 | "url": "https://github.com/myclabs/DeepCopy.git", 112 | "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" 113 | }, 114 | "dist": { 115 | "type": "zip", 116 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", 117 | "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", 118 | "shasum": "" 119 | }, 120 | "require": { 121 | "php": ">=5.4.0" 122 | }, 123 | "require-dev": { 124 | "doctrine/collections": "1.*", 125 | "phpunit/phpunit": "~4.1" 126 | }, 127 | "type": "library", 128 | "autoload": { 129 | "psr-4": { 130 | "DeepCopy\\": "src/DeepCopy/" 131 | } 132 | }, 133 | "notification-url": "https://packagist.org/downloads/", 134 | "license": [ 135 | "MIT" 136 | ], 137 | "description": "Create deep copies (clones) of your objects", 138 | "homepage": "https://github.com/myclabs/DeepCopy", 139 | "keywords": [ 140 | "clone", 141 | "copy", 142 | "duplicate", 143 | "object", 144 | "object graph" 145 | ], 146 | "time": "2017-04-12T18:52:22+00:00" 147 | }, 148 | { 149 | "name": "phpdocumentor/reflection-common", 150 | "version": "1.0.1", 151 | "source": { 152 | "type": "git", 153 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git", 154 | "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" 155 | }, 156 | "dist": { 157 | "type": "zip", 158 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", 159 | "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", 160 | "shasum": "" 161 | }, 162 | "require": { 163 | "php": ">=5.5" 164 | }, 165 | "require-dev": { 166 | "phpunit/phpunit": "^4.6" 167 | }, 168 | "type": "library", 169 | "extra": { 170 | "branch-alias": { 171 | "dev-master": "1.0.x-dev" 172 | } 173 | }, 174 | "autoload": { 175 | "psr-4": { 176 | "phpDocumentor\\Reflection\\": [ 177 | "src" 178 | ] 179 | } 180 | }, 181 | "notification-url": "https://packagist.org/downloads/", 182 | "license": [ 183 | "MIT" 184 | ], 185 | "authors": [ 186 | { 187 | "name": "Jaap van Otterdijk", 188 | "email": "opensource@ijaap.nl" 189 | } 190 | ], 191 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure", 192 | "homepage": "http://www.phpdoc.org", 193 | "keywords": [ 194 | "FQSEN", 195 | "phpDocumentor", 196 | "phpdoc", 197 | "reflection", 198 | "static analysis" 199 | ], 200 | "time": "2017-09-11T18:02:19+00:00" 201 | }, 202 | { 203 | "name": "phpdocumentor/reflection-docblock", 204 | "version": "4.1.1", 205 | "source": { 206 | "type": "git", 207 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 208 | "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" 209 | }, 210 | "dist": { 211 | "type": "zip", 212 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", 213 | "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", 214 | "shasum": "" 215 | }, 216 | "require": { 217 | "php": "^7.0", 218 | "phpdocumentor/reflection-common": "^1.0@dev", 219 | "phpdocumentor/type-resolver": "^0.4.0", 220 | "webmozart/assert": "^1.0" 221 | }, 222 | "require-dev": { 223 | "mockery/mockery": "^0.9.4", 224 | "phpunit/phpunit": "^4.4" 225 | }, 226 | "type": "library", 227 | "autoload": { 228 | "psr-4": { 229 | "phpDocumentor\\Reflection\\": [ 230 | "src/" 231 | ] 232 | } 233 | }, 234 | "notification-url": "https://packagist.org/downloads/", 235 | "license": [ 236 | "MIT" 237 | ], 238 | "authors": [ 239 | { 240 | "name": "Mike van Riel", 241 | "email": "me@mikevanriel.com" 242 | } 243 | ], 244 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", 245 | "time": "2017-08-30T18:51:59+00:00" 246 | }, 247 | { 248 | "name": "phpdocumentor/type-resolver", 249 | "version": "0.4.0", 250 | "source": { 251 | "type": "git", 252 | "url": "https://github.com/phpDocumentor/TypeResolver.git", 253 | "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" 254 | }, 255 | "dist": { 256 | "type": "zip", 257 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", 258 | "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", 259 | "shasum": "" 260 | }, 261 | "require": { 262 | "php": "^5.5 || ^7.0", 263 | "phpdocumentor/reflection-common": "^1.0" 264 | }, 265 | "require-dev": { 266 | "mockery/mockery": "^0.9.4", 267 | "phpunit/phpunit": "^5.2||^4.8.24" 268 | }, 269 | "type": "library", 270 | "extra": { 271 | "branch-alias": { 272 | "dev-master": "1.0.x-dev" 273 | } 274 | }, 275 | "autoload": { 276 | "psr-4": { 277 | "phpDocumentor\\Reflection\\": [ 278 | "src/" 279 | ] 280 | } 281 | }, 282 | "notification-url": "https://packagist.org/downloads/", 283 | "license": [ 284 | "MIT" 285 | ], 286 | "authors": [ 287 | { 288 | "name": "Mike van Riel", 289 | "email": "me@mikevanriel.com" 290 | } 291 | ], 292 | "time": "2017-07-14T14:27:02+00:00" 293 | }, 294 | { 295 | "name": "phpspec/prophecy", 296 | "version": "v1.7.2", 297 | "source": { 298 | "type": "git", 299 | "url": "https://github.com/phpspec/prophecy.git", 300 | "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" 301 | }, 302 | "dist": { 303 | "type": "zip", 304 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", 305 | "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", 306 | "shasum": "" 307 | }, 308 | "require": { 309 | "doctrine/instantiator": "^1.0.2", 310 | "php": "^5.3|^7.0", 311 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", 312 | "sebastian/comparator": "^1.1|^2.0", 313 | "sebastian/recursion-context": "^1.0|^2.0|^3.0" 314 | }, 315 | "require-dev": { 316 | "phpspec/phpspec": "^2.5|^3.2", 317 | "phpunit/phpunit": "^4.8 || ^5.6.5" 318 | }, 319 | "type": "library", 320 | "extra": { 321 | "branch-alias": { 322 | "dev-master": "1.7.x-dev" 323 | } 324 | }, 325 | "autoload": { 326 | "psr-0": { 327 | "Prophecy\\": "src/" 328 | } 329 | }, 330 | "notification-url": "https://packagist.org/downloads/", 331 | "license": [ 332 | "MIT" 333 | ], 334 | "authors": [ 335 | { 336 | "name": "Konstantin Kudryashov", 337 | "email": "ever.zet@gmail.com", 338 | "homepage": "http://everzet.com" 339 | }, 340 | { 341 | "name": "Marcello Duarte", 342 | "email": "marcello.duarte@gmail.com" 343 | } 344 | ], 345 | "description": "Highly opinionated mocking framework for PHP 5.3+", 346 | "homepage": "https://github.com/phpspec/prophecy", 347 | "keywords": [ 348 | "Double", 349 | "Dummy", 350 | "fake", 351 | "mock", 352 | "spy", 353 | "stub" 354 | ], 355 | "time": "2017-09-04T11:05:03+00:00" 356 | }, 357 | { 358 | "name": "phpunit/php-code-coverage", 359 | "version": "4.0.8", 360 | "source": { 361 | "type": "git", 362 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 363 | "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" 364 | }, 365 | "dist": { 366 | "type": "zip", 367 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", 368 | "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", 369 | "shasum": "" 370 | }, 371 | "require": { 372 | "ext-dom": "*", 373 | "ext-xmlwriter": "*", 374 | "php": "^5.6 || ^7.0", 375 | "phpunit/php-file-iterator": "^1.3", 376 | "phpunit/php-text-template": "^1.2", 377 | "phpunit/php-token-stream": "^1.4.2 || ^2.0", 378 | "sebastian/code-unit-reverse-lookup": "^1.0", 379 | "sebastian/environment": "^1.3.2 || ^2.0", 380 | "sebastian/version": "^1.0 || ^2.0" 381 | }, 382 | "require-dev": { 383 | "ext-xdebug": "^2.1.4", 384 | "phpunit/phpunit": "^5.7" 385 | }, 386 | "suggest": { 387 | "ext-xdebug": "^2.5.1" 388 | }, 389 | "type": "library", 390 | "extra": { 391 | "branch-alias": { 392 | "dev-master": "4.0.x-dev" 393 | } 394 | }, 395 | "autoload": { 396 | "classmap": [ 397 | "src/" 398 | ] 399 | }, 400 | "notification-url": "https://packagist.org/downloads/", 401 | "license": [ 402 | "BSD-3-Clause" 403 | ], 404 | "authors": [ 405 | { 406 | "name": "Sebastian Bergmann", 407 | "email": "sb@sebastian-bergmann.de", 408 | "role": "lead" 409 | } 410 | ], 411 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 412 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 413 | "keywords": [ 414 | "coverage", 415 | "testing", 416 | "xunit" 417 | ], 418 | "time": "2017-04-02T07:44:40+00:00" 419 | }, 420 | { 421 | "name": "phpunit/php-file-iterator", 422 | "version": "1.4.2", 423 | "source": { 424 | "type": "git", 425 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 426 | "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" 427 | }, 428 | "dist": { 429 | "type": "zip", 430 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", 431 | "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", 432 | "shasum": "" 433 | }, 434 | "require": { 435 | "php": ">=5.3.3" 436 | }, 437 | "type": "library", 438 | "extra": { 439 | "branch-alias": { 440 | "dev-master": "1.4.x-dev" 441 | } 442 | }, 443 | "autoload": { 444 | "classmap": [ 445 | "src/" 446 | ] 447 | }, 448 | "notification-url": "https://packagist.org/downloads/", 449 | "license": [ 450 | "BSD-3-Clause" 451 | ], 452 | "authors": [ 453 | { 454 | "name": "Sebastian Bergmann", 455 | "email": "sb@sebastian-bergmann.de", 456 | "role": "lead" 457 | } 458 | ], 459 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 460 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 461 | "keywords": [ 462 | "filesystem", 463 | "iterator" 464 | ], 465 | "time": "2016-10-03T07:40:28+00:00" 466 | }, 467 | { 468 | "name": "phpunit/php-text-template", 469 | "version": "1.2.1", 470 | "source": { 471 | "type": "git", 472 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 473 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 474 | }, 475 | "dist": { 476 | "type": "zip", 477 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 478 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 479 | "shasum": "" 480 | }, 481 | "require": { 482 | "php": ">=5.3.3" 483 | }, 484 | "type": "library", 485 | "autoload": { 486 | "classmap": [ 487 | "src/" 488 | ] 489 | }, 490 | "notification-url": "https://packagist.org/downloads/", 491 | "license": [ 492 | "BSD-3-Clause" 493 | ], 494 | "authors": [ 495 | { 496 | "name": "Sebastian Bergmann", 497 | "email": "sebastian@phpunit.de", 498 | "role": "lead" 499 | } 500 | ], 501 | "description": "Simple template engine.", 502 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 503 | "keywords": [ 504 | "template" 505 | ], 506 | "time": "2015-06-21T13:50:34+00:00" 507 | }, 508 | { 509 | "name": "phpunit/php-timer", 510 | "version": "1.0.9", 511 | "source": { 512 | "type": "git", 513 | "url": "https://github.com/sebastianbergmann/php-timer.git", 514 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" 515 | }, 516 | "dist": { 517 | "type": "zip", 518 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 519 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 520 | "shasum": "" 521 | }, 522 | "require": { 523 | "php": "^5.3.3 || ^7.0" 524 | }, 525 | "require-dev": { 526 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" 527 | }, 528 | "type": "library", 529 | "extra": { 530 | "branch-alias": { 531 | "dev-master": "1.0-dev" 532 | } 533 | }, 534 | "autoload": { 535 | "classmap": [ 536 | "src/" 537 | ] 538 | }, 539 | "notification-url": "https://packagist.org/downloads/", 540 | "license": [ 541 | "BSD-3-Clause" 542 | ], 543 | "authors": [ 544 | { 545 | "name": "Sebastian Bergmann", 546 | "email": "sb@sebastian-bergmann.de", 547 | "role": "lead" 548 | } 549 | ], 550 | "description": "Utility class for timing", 551 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 552 | "keywords": [ 553 | "timer" 554 | ], 555 | "time": "2017-02-26T11:10:40+00:00" 556 | }, 557 | { 558 | "name": "phpunit/php-token-stream", 559 | "version": "2.0.1", 560 | "source": { 561 | "type": "git", 562 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 563 | "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" 564 | }, 565 | "dist": { 566 | "type": "zip", 567 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", 568 | "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", 569 | "shasum": "" 570 | }, 571 | "require": { 572 | "ext-tokenizer": "*", 573 | "php": "^7.0" 574 | }, 575 | "require-dev": { 576 | "phpunit/phpunit": "^6.2.4" 577 | }, 578 | "type": "library", 579 | "extra": { 580 | "branch-alias": { 581 | "dev-master": "2.0-dev" 582 | } 583 | }, 584 | "autoload": { 585 | "classmap": [ 586 | "src/" 587 | ] 588 | }, 589 | "notification-url": "https://packagist.org/downloads/", 590 | "license": [ 591 | "BSD-3-Clause" 592 | ], 593 | "authors": [ 594 | { 595 | "name": "Sebastian Bergmann", 596 | "email": "sebastian@phpunit.de" 597 | } 598 | ], 599 | "description": "Wrapper around PHP's tokenizer extension.", 600 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 601 | "keywords": [ 602 | "tokenizer" 603 | ], 604 | "time": "2017-08-20T05:47:52+00:00" 605 | }, 606 | { 607 | "name": "phpunit/phpunit", 608 | "version": "5.7.21", 609 | "source": { 610 | "type": "git", 611 | "url": "https://github.com/sebastianbergmann/phpunit.git", 612 | "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db" 613 | }, 614 | "dist": { 615 | "type": "zip", 616 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b91adfb64264ddec5a2dee9851f354aa66327db", 617 | "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db", 618 | "shasum": "" 619 | }, 620 | "require": { 621 | "ext-dom": "*", 622 | "ext-json": "*", 623 | "ext-libxml": "*", 624 | "ext-mbstring": "*", 625 | "ext-xml": "*", 626 | "myclabs/deep-copy": "~1.3", 627 | "php": "^5.6 || ^7.0", 628 | "phpspec/prophecy": "^1.6.2", 629 | "phpunit/php-code-coverage": "^4.0.4", 630 | "phpunit/php-file-iterator": "~1.4", 631 | "phpunit/php-text-template": "~1.2", 632 | "phpunit/php-timer": "^1.0.6", 633 | "phpunit/phpunit-mock-objects": "^3.2", 634 | "sebastian/comparator": "^1.2.4", 635 | "sebastian/diff": "^1.4.3", 636 | "sebastian/environment": "^1.3.4 || ^2.0", 637 | "sebastian/exporter": "~2.0", 638 | "sebastian/global-state": "^1.1", 639 | "sebastian/object-enumerator": "~2.0", 640 | "sebastian/resource-operations": "~1.0", 641 | "sebastian/version": "~1.0.3|~2.0", 642 | "symfony/yaml": "~2.1|~3.0" 643 | }, 644 | "conflict": { 645 | "phpdocumentor/reflection-docblock": "3.0.2" 646 | }, 647 | "require-dev": { 648 | "ext-pdo": "*" 649 | }, 650 | "suggest": { 651 | "ext-xdebug": "*", 652 | "phpunit/php-invoker": "~1.1" 653 | }, 654 | "bin": [ 655 | "phpunit" 656 | ], 657 | "type": "library", 658 | "extra": { 659 | "branch-alias": { 660 | "dev-master": "5.7.x-dev" 661 | } 662 | }, 663 | "autoload": { 664 | "classmap": [ 665 | "src/" 666 | ] 667 | }, 668 | "notification-url": "https://packagist.org/downloads/", 669 | "license": [ 670 | "BSD-3-Clause" 671 | ], 672 | "authors": [ 673 | { 674 | "name": "Sebastian Bergmann", 675 | "email": "sebastian@phpunit.de", 676 | "role": "lead" 677 | } 678 | ], 679 | "description": "The PHP Unit Testing framework.", 680 | "homepage": "https://phpunit.de/", 681 | "keywords": [ 682 | "phpunit", 683 | "testing", 684 | "xunit" 685 | ], 686 | "time": "2017-06-21T08:11:54+00:00" 687 | }, 688 | { 689 | "name": "phpunit/phpunit-mock-objects", 690 | "version": "3.4.4", 691 | "source": { 692 | "type": "git", 693 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 694 | "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" 695 | }, 696 | "dist": { 697 | "type": "zip", 698 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", 699 | "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", 700 | "shasum": "" 701 | }, 702 | "require": { 703 | "doctrine/instantiator": "^1.0.2", 704 | "php": "^5.6 || ^7.0", 705 | "phpunit/php-text-template": "^1.2", 706 | "sebastian/exporter": "^1.2 || ^2.0" 707 | }, 708 | "conflict": { 709 | "phpunit/phpunit": "<5.4.0" 710 | }, 711 | "require-dev": { 712 | "phpunit/phpunit": "^5.4" 713 | }, 714 | "suggest": { 715 | "ext-soap": "*" 716 | }, 717 | "type": "library", 718 | "extra": { 719 | "branch-alias": { 720 | "dev-master": "3.2.x-dev" 721 | } 722 | }, 723 | "autoload": { 724 | "classmap": [ 725 | "src/" 726 | ] 727 | }, 728 | "notification-url": "https://packagist.org/downloads/", 729 | "license": [ 730 | "BSD-3-Clause" 731 | ], 732 | "authors": [ 733 | { 734 | "name": "Sebastian Bergmann", 735 | "email": "sb@sebastian-bergmann.de", 736 | "role": "lead" 737 | } 738 | ], 739 | "description": "Mock Object library for PHPUnit", 740 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 741 | "keywords": [ 742 | "mock", 743 | "xunit" 744 | ], 745 | "time": "2017-06-30T09:13:00+00:00" 746 | }, 747 | { 748 | "name": "sebastian/code-unit-reverse-lookup", 749 | "version": "1.0.1", 750 | "source": { 751 | "type": "git", 752 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 753 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" 754 | }, 755 | "dist": { 756 | "type": "zip", 757 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", 758 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", 759 | "shasum": "" 760 | }, 761 | "require": { 762 | "php": "^5.6 || ^7.0" 763 | }, 764 | "require-dev": { 765 | "phpunit/phpunit": "^5.7 || ^6.0" 766 | }, 767 | "type": "library", 768 | "extra": { 769 | "branch-alias": { 770 | "dev-master": "1.0.x-dev" 771 | } 772 | }, 773 | "autoload": { 774 | "classmap": [ 775 | "src/" 776 | ] 777 | }, 778 | "notification-url": "https://packagist.org/downloads/", 779 | "license": [ 780 | "BSD-3-Clause" 781 | ], 782 | "authors": [ 783 | { 784 | "name": "Sebastian Bergmann", 785 | "email": "sebastian@phpunit.de" 786 | } 787 | ], 788 | "description": "Looks up which function or method a line of code belongs to", 789 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 790 | "time": "2017-03-04T06:30:41+00:00" 791 | }, 792 | { 793 | "name": "sebastian/comparator", 794 | "version": "1.2.4", 795 | "source": { 796 | "type": "git", 797 | "url": "https://github.com/sebastianbergmann/comparator.git", 798 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" 799 | }, 800 | "dist": { 801 | "type": "zip", 802 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", 803 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", 804 | "shasum": "" 805 | }, 806 | "require": { 807 | "php": ">=5.3.3", 808 | "sebastian/diff": "~1.2", 809 | "sebastian/exporter": "~1.2 || ~2.0" 810 | }, 811 | "require-dev": { 812 | "phpunit/phpunit": "~4.4" 813 | }, 814 | "type": "library", 815 | "extra": { 816 | "branch-alias": { 817 | "dev-master": "1.2.x-dev" 818 | } 819 | }, 820 | "autoload": { 821 | "classmap": [ 822 | "src/" 823 | ] 824 | }, 825 | "notification-url": "https://packagist.org/downloads/", 826 | "license": [ 827 | "BSD-3-Clause" 828 | ], 829 | "authors": [ 830 | { 831 | "name": "Jeff Welch", 832 | "email": "whatthejeff@gmail.com" 833 | }, 834 | { 835 | "name": "Volker Dusch", 836 | "email": "github@wallbash.com" 837 | }, 838 | { 839 | "name": "Bernhard Schussek", 840 | "email": "bschussek@2bepublished.at" 841 | }, 842 | { 843 | "name": "Sebastian Bergmann", 844 | "email": "sebastian@phpunit.de" 845 | } 846 | ], 847 | "description": "Provides the functionality to compare PHP values for equality", 848 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 849 | "keywords": [ 850 | "comparator", 851 | "compare", 852 | "equality" 853 | ], 854 | "time": "2017-01-29T09:50:25+00:00" 855 | }, 856 | { 857 | "name": "sebastian/diff", 858 | "version": "1.4.3", 859 | "source": { 860 | "type": "git", 861 | "url": "https://github.com/sebastianbergmann/diff.git", 862 | "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" 863 | }, 864 | "dist": { 865 | "type": "zip", 866 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", 867 | "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", 868 | "shasum": "" 869 | }, 870 | "require": { 871 | "php": "^5.3.3 || ^7.0" 872 | }, 873 | "require-dev": { 874 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" 875 | }, 876 | "type": "library", 877 | "extra": { 878 | "branch-alias": { 879 | "dev-master": "1.4-dev" 880 | } 881 | }, 882 | "autoload": { 883 | "classmap": [ 884 | "src/" 885 | ] 886 | }, 887 | "notification-url": "https://packagist.org/downloads/", 888 | "license": [ 889 | "BSD-3-Clause" 890 | ], 891 | "authors": [ 892 | { 893 | "name": "Kore Nordmann", 894 | "email": "mail@kore-nordmann.de" 895 | }, 896 | { 897 | "name": "Sebastian Bergmann", 898 | "email": "sebastian@phpunit.de" 899 | } 900 | ], 901 | "description": "Diff implementation", 902 | "homepage": "https://github.com/sebastianbergmann/diff", 903 | "keywords": [ 904 | "diff" 905 | ], 906 | "time": "2017-05-22T07:24:03+00:00" 907 | }, 908 | { 909 | "name": "sebastian/environment", 910 | "version": "2.0.0", 911 | "source": { 912 | "type": "git", 913 | "url": "https://github.com/sebastianbergmann/environment.git", 914 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" 915 | }, 916 | "dist": { 917 | "type": "zip", 918 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", 919 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", 920 | "shasum": "" 921 | }, 922 | "require": { 923 | "php": "^5.6 || ^7.0" 924 | }, 925 | "require-dev": { 926 | "phpunit/phpunit": "^5.0" 927 | }, 928 | "type": "library", 929 | "extra": { 930 | "branch-alias": { 931 | "dev-master": "2.0.x-dev" 932 | } 933 | }, 934 | "autoload": { 935 | "classmap": [ 936 | "src/" 937 | ] 938 | }, 939 | "notification-url": "https://packagist.org/downloads/", 940 | "license": [ 941 | "BSD-3-Clause" 942 | ], 943 | "authors": [ 944 | { 945 | "name": "Sebastian Bergmann", 946 | "email": "sebastian@phpunit.de" 947 | } 948 | ], 949 | "description": "Provides functionality to handle HHVM/PHP environments", 950 | "homepage": "http://www.github.com/sebastianbergmann/environment", 951 | "keywords": [ 952 | "Xdebug", 953 | "environment", 954 | "hhvm" 955 | ], 956 | "time": "2016-11-26T07:53:53+00:00" 957 | }, 958 | { 959 | "name": "sebastian/exporter", 960 | "version": "2.0.0", 961 | "source": { 962 | "type": "git", 963 | "url": "https://github.com/sebastianbergmann/exporter.git", 964 | "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" 965 | }, 966 | "dist": { 967 | "type": "zip", 968 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", 969 | "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", 970 | "shasum": "" 971 | }, 972 | "require": { 973 | "php": ">=5.3.3", 974 | "sebastian/recursion-context": "~2.0" 975 | }, 976 | "require-dev": { 977 | "ext-mbstring": "*", 978 | "phpunit/phpunit": "~4.4" 979 | }, 980 | "type": "library", 981 | "extra": { 982 | "branch-alias": { 983 | "dev-master": "2.0.x-dev" 984 | } 985 | }, 986 | "autoload": { 987 | "classmap": [ 988 | "src/" 989 | ] 990 | }, 991 | "notification-url": "https://packagist.org/downloads/", 992 | "license": [ 993 | "BSD-3-Clause" 994 | ], 995 | "authors": [ 996 | { 997 | "name": "Jeff Welch", 998 | "email": "whatthejeff@gmail.com" 999 | }, 1000 | { 1001 | "name": "Volker Dusch", 1002 | "email": "github@wallbash.com" 1003 | }, 1004 | { 1005 | "name": "Bernhard Schussek", 1006 | "email": "bschussek@2bepublished.at" 1007 | }, 1008 | { 1009 | "name": "Sebastian Bergmann", 1010 | "email": "sebastian@phpunit.de" 1011 | }, 1012 | { 1013 | "name": "Adam Harvey", 1014 | "email": "aharvey@php.net" 1015 | } 1016 | ], 1017 | "description": "Provides the functionality to export PHP variables for visualization", 1018 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1019 | "keywords": [ 1020 | "export", 1021 | "exporter" 1022 | ], 1023 | "time": "2016-11-19T08:54:04+00:00" 1024 | }, 1025 | { 1026 | "name": "sebastian/global-state", 1027 | "version": "1.1.1", 1028 | "source": { 1029 | "type": "git", 1030 | "url": "https://github.com/sebastianbergmann/global-state.git", 1031 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" 1032 | }, 1033 | "dist": { 1034 | "type": "zip", 1035 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", 1036 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", 1037 | "shasum": "" 1038 | }, 1039 | "require": { 1040 | "php": ">=5.3.3" 1041 | }, 1042 | "require-dev": { 1043 | "phpunit/phpunit": "~4.2" 1044 | }, 1045 | "suggest": { 1046 | "ext-uopz": "*" 1047 | }, 1048 | "type": "library", 1049 | "extra": { 1050 | "branch-alias": { 1051 | "dev-master": "1.0-dev" 1052 | } 1053 | }, 1054 | "autoload": { 1055 | "classmap": [ 1056 | "src/" 1057 | ] 1058 | }, 1059 | "notification-url": "https://packagist.org/downloads/", 1060 | "license": [ 1061 | "BSD-3-Clause" 1062 | ], 1063 | "authors": [ 1064 | { 1065 | "name": "Sebastian Bergmann", 1066 | "email": "sebastian@phpunit.de" 1067 | } 1068 | ], 1069 | "description": "Snapshotting of global state", 1070 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1071 | "keywords": [ 1072 | "global state" 1073 | ], 1074 | "time": "2015-10-12T03:26:01+00:00" 1075 | }, 1076 | { 1077 | "name": "sebastian/object-enumerator", 1078 | "version": "2.0.1", 1079 | "source": { 1080 | "type": "git", 1081 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1082 | "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" 1083 | }, 1084 | "dist": { 1085 | "type": "zip", 1086 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", 1087 | "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", 1088 | "shasum": "" 1089 | }, 1090 | "require": { 1091 | "php": ">=5.6", 1092 | "sebastian/recursion-context": "~2.0" 1093 | }, 1094 | "require-dev": { 1095 | "phpunit/phpunit": "~5" 1096 | }, 1097 | "type": "library", 1098 | "extra": { 1099 | "branch-alias": { 1100 | "dev-master": "2.0.x-dev" 1101 | } 1102 | }, 1103 | "autoload": { 1104 | "classmap": [ 1105 | "src/" 1106 | ] 1107 | }, 1108 | "notification-url": "https://packagist.org/downloads/", 1109 | "license": [ 1110 | "BSD-3-Clause" 1111 | ], 1112 | "authors": [ 1113 | { 1114 | "name": "Sebastian Bergmann", 1115 | "email": "sebastian@phpunit.de" 1116 | } 1117 | ], 1118 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1119 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1120 | "time": "2017-02-18T15:18:39+00:00" 1121 | }, 1122 | { 1123 | "name": "sebastian/recursion-context", 1124 | "version": "2.0.0", 1125 | "source": { 1126 | "type": "git", 1127 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1128 | "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" 1129 | }, 1130 | "dist": { 1131 | "type": "zip", 1132 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", 1133 | "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", 1134 | "shasum": "" 1135 | }, 1136 | "require": { 1137 | "php": ">=5.3.3" 1138 | }, 1139 | "require-dev": { 1140 | "phpunit/phpunit": "~4.4" 1141 | }, 1142 | "type": "library", 1143 | "extra": { 1144 | "branch-alias": { 1145 | "dev-master": "2.0.x-dev" 1146 | } 1147 | }, 1148 | "autoload": { 1149 | "classmap": [ 1150 | "src/" 1151 | ] 1152 | }, 1153 | "notification-url": "https://packagist.org/downloads/", 1154 | "license": [ 1155 | "BSD-3-Clause" 1156 | ], 1157 | "authors": [ 1158 | { 1159 | "name": "Jeff Welch", 1160 | "email": "whatthejeff@gmail.com" 1161 | }, 1162 | { 1163 | "name": "Sebastian Bergmann", 1164 | "email": "sebastian@phpunit.de" 1165 | }, 1166 | { 1167 | "name": "Adam Harvey", 1168 | "email": "aharvey@php.net" 1169 | } 1170 | ], 1171 | "description": "Provides functionality to recursively process PHP variables", 1172 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1173 | "time": "2016-11-19T07:33:16+00:00" 1174 | }, 1175 | { 1176 | "name": "sebastian/resource-operations", 1177 | "version": "1.0.0", 1178 | "source": { 1179 | "type": "git", 1180 | "url": "https://github.com/sebastianbergmann/resource-operations.git", 1181 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" 1182 | }, 1183 | "dist": { 1184 | "type": "zip", 1185 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1186 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1187 | "shasum": "" 1188 | }, 1189 | "require": { 1190 | "php": ">=5.6.0" 1191 | }, 1192 | "type": "library", 1193 | "extra": { 1194 | "branch-alias": { 1195 | "dev-master": "1.0.x-dev" 1196 | } 1197 | }, 1198 | "autoload": { 1199 | "classmap": [ 1200 | "src/" 1201 | ] 1202 | }, 1203 | "notification-url": "https://packagist.org/downloads/", 1204 | "license": [ 1205 | "BSD-3-Clause" 1206 | ], 1207 | "authors": [ 1208 | { 1209 | "name": "Sebastian Bergmann", 1210 | "email": "sebastian@phpunit.de" 1211 | } 1212 | ], 1213 | "description": "Provides a list of PHP built-in functions that operate on resources", 1214 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations", 1215 | "time": "2015-07-28T20:34:47+00:00" 1216 | }, 1217 | { 1218 | "name": "sebastian/version", 1219 | "version": "2.0.1", 1220 | "source": { 1221 | "type": "git", 1222 | "url": "https://github.com/sebastianbergmann/version.git", 1223 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" 1224 | }, 1225 | "dist": { 1226 | "type": "zip", 1227 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", 1228 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", 1229 | "shasum": "" 1230 | }, 1231 | "require": { 1232 | "php": ">=5.6" 1233 | }, 1234 | "type": "library", 1235 | "extra": { 1236 | "branch-alias": { 1237 | "dev-master": "2.0.x-dev" 1238 | } 1239 | }, 1240 | "autoload": { 1241 | "classmap": [ 1242 | "src/" 1243 | ] 1244 | }, 1245 | "notification-url": "https://packagist.org/downloads/", 1246 | "license": [ 1247 | "BSD-3-Clause" 1248 | ], 1249 | "authors": [ 1250 | { 1251 | "name": "Sebastian Bergmann", 1252 | "email": "sebastian@phpunit.de", 1253 | "role": "lead" 1254 | } 1255 | ], 1256 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1257 | "homepage": "https://github.com/sebastianbergmann/version", 1258 | "time": "2016-10-03T07:35:21+00:00" 1259 | }, 1260 | { 1261 | "name": "symfony/yaml", 1262 | "version": "v3.3.9", 1263 | "source": { 1264 | "type": "git", 1265 | "url": "https://github.com/symfony/yaml.git", 1266 | "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0" 1267 | }, 1268 | "dist": { 1269 | "type": "zip", 1270 | "url": "https://api.github.com/repos/symfony/yaml/zipball/1d8c2a99c80862bdc3af94c1781bf70f86bccac0", 1271 | "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0", 1272 | "shasum": "" 1273 | }, 1274 | "require": { 1275 | "php": "^5.5.9|>=7.0.8" 1276 | }, 1277 | "require-dev": { 1278 | "symfony/console": "~2.8|~3.0" 1279 | }, 1280 | "suggest": { 1281 | "symfony/console": "For validating YAML files using the lint command" 1282 | }, 1283 | "type": "library", 1284 | "extra": { 1285 | "branch-alias": { 1286 | "dev-master": "3.3-dev" 1287 | } 1288 | }, 1289 | "autoload": { 1290 | "psr-4": { 1291 | "Symfony\\Component\\Yaml\\": "" 1292 | }, 1293 | "exclude-from-classmap": [ 1294 | "/Tests/" 1295 | ] 1296 | }, 1297 | "notification-url": "https://packagist.org/downloads/", 1298 | "license": [ 1299 | "MIT" 1300 | ], 1301 | "authors": [ 1302 | { 1303 | "name": "Fabien Potencier", 1304 | "email": "fabien@symfony.com" 1305 | }, 1306 | { 1307 | "name": "Symfony Community", 1308 | "homepage": "https://symfony.com/contributors" 1309 | } 1310 | ], 1311 | "description": "Symfony Yaml Component", 1312 | "homepage": "https://symfony.com", 1313 | "time": "2017-07-29T21:54:42+00:00" 1314 | }, 1315 | { 1316 | "name": "webmozart/assert", 1317 | "version": "1.2.0", 1318 | "source": { 1319 | "type": "git", 1320 | "url": "https://github.com/webmozart/assert.git", 1321 | "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" 1322 | }, 1323 | "dist": { 1324 | "type": "zip", 1325 | "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", 1326 | "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", 1327 | "shasum": "" 1328 | }, 1329 | "require": { 1330 | "php": "^5.3.3 || ^7.0" 1331 | }, 1332 | "require-dev": { 1333 | "phpunit/phpunit": "^4.6", 1334 | "sebastian/version": "^1.0.1" 1335 | }, 1336 | "type": "library", 1337 | "extra": { 1338 | "branch-alias": { 1339 | "dev-master": "1.3-dev" 1340 | } 1341 | }, 1342 | "autoload": { 1343 | "psr-4": { 1344 | "Webmozart\\Assert\\": "src/" 1345 | } 1346 | }, 1347 | "notification-url": "https://packagist.org/downloads/", 1348 | "license": [ 1349 | "MIT" 1350 | ], 1351 | "authors": [ 1352 | { 1353 | "name": "Bernhard Schussek", 1354 | "email": "bschussek@gmail.com" 1355 | } 1356 | ], 1357 | "description": "Assertions to validate method input/output with nice error messages.", 1358 | "keywords": [ 1359 | "assert", 1360 | "check", 1361 | "validate" 1362 | ], 1363 | "time": "2016-11-23T20:04:58+00:00" 1364 | } 1365 | ], 1366 | "aliases": [], 1367 | "minimum-stability": "stable", 1368 | "stability-flags": [], 1369 | "prefer-stable": false, 1370 | "prefer-lowest": false, 1371 | "platform": [], 1372 | "platform-dev": [] 1373 | } 1374 | -------------------------------------------------------------------------------- /src/Cart.php: -------------------------------------------------------------------------------- 1 | 500) 27 | ? $total * 0.8 28 | : $total; 29 | } 30 | 31 | 32 | } -------------------------------------------------------------------------------- /src/Helpers.php: -------------------------------------------------------------------------------- 1 | toArray()['items'])) { 9 | throw new Exception("Something wrong"); 10 | } 11 | 12 | return $cart->toArray()['items']; 13 | } -------------------------------------------------------------------------------- /src/Storage/ArrayStore.php: -------------------------------------------------------------------------------- 1 |