├── .gitignore ├── LICENSE ├── README.md ├── composer.json ├── composer.lock ├── phpunit.xml.dist ├── src ├── AutoHugger.php ├── CanGroupHug.php ├── GroupHuggable.php ├── HugTerminationStrategy.php ├── Huggable.php └── Hugger.php ├── tdd.sh └── tests └── HuggerTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Dave Hulbert 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP FIG PSR-8 Implementation 2 | 3 | Implementation of PSR-8 that conforms to the [spec](https://github.com/php-fig/fig-standards/blob/master/proposed/psr-8-hug/psr-8-hug.md). 4 | 5 | ## Usage 6 | 7 | Setup 8 | 9 | composer install 10 | 11 | Running tests 12 | 13 | ./vendor/bin/phpunit 14 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dave1010/psr-8", 3 | "description": "PHP FIG PSR-8 implementation", 4 | "license": "MIT", 5 | "type": "project", 6 | "authors": [ 7 | { 8 | "name": "Dave Hulbert", 9 | "email": "dave1010@gmail.com" 10 | } 11 | ], 12 | "autoload": { 13 | "classmap": ["src/"], 14 | "psr-4": { 15 | "Psr\\Hug\\" : "src/", 16 | "Dave1010\\Hug\\" : "src/" 17 | } 18 | }, 19 | "require": { 20 | }, 21 | "require-dev": { 22 | "phpunit/phpunit": "~4.6" 23 | }, 24 | "config": { 25 | "preferred-install": "dist" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /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 | "hash": "03b184c243421f97e2e72eb18ee45259", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "behat/behat", 12 | "version": "v3.0.15", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/Behat/Behat.git", 16 | "reference": "b35ae3d45332d80c532af69cc36f780a9397a996" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/Behat/Behat/zipball/b35ae3d45332d80c532af69cc36f780a9397a996", 21 | "reference": "b35ae3d45332d80c532af69cc36f780a9397a996", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "behat/gherkin": "~4.3", 26 | "behat/transliterator": "~1.0", 27 | "ext-mbstring": "*", 28 | "php": ">=5.3.3", 29 | "symfony/class-loader": "~2.1", 30 | "symfony/config": "~2.3", 31 | "symfony/console": "~2.1", 32 | "symfony/dependency-injection": "~2.1", 33 | "symfony/event-dispatcher": "~2.1", 34 | "symfony/translation": "~2.3", 35 | "symfony/yaml": "~2.1" 36 | }, 37 | "require-dev": { 38 | "phpspec/prophecy-phpunit": "~1.0", 39 | "phpunit/phpunit": "~4.0", 40 | "symfony/process": "~2.1" 41 | }, 42 | "suggest": { 43 | "behat/mink-extension": "for integration with Mink testing framework", 44 | "behat/symfony2-extension": "for integration with Symfony2 web framework", 45 | "behat/yii-extension": "for integration with Yii web framework" 46 | }, 47 | "bin": [ 48 | "bin/behat" 49 | ], 50 | "type": "library", 51 | "extra": { 52 | "branch-alias": { 53 | "dev-master": "3.0.x-dev" 54 | } 55 | }, 56 | "autoload": { 57 | "psr-0": { 58 | "Behat\\Behat": "src/", 59 | "Behat\\Testwork": "src/" 60 | } 61 | }, 62 | "notification-url": "https://packagist.org/downloads/", 63 | "license": [ 64 | "MIT" 65 | ], 66 | "authors": [ 67 | { 68 | "name": "Konstantin Kudryashov", 69 | "email": "ever.zet@gmail.com", 70 | "homepage": "http://everzet.com" 71 | } 72 | ], 73 | "description": "Scenario-oriented BDD framework for PHP 5.3", 74 | "homepage": "http://behat.org/", 75 | "keywords": [ 76 | "Agile", 77 | "BDD", 78 | "ScenarioBDD", 79 | "Scrum", 80 | "StoryBDD", 81 | "User story", 82 | "business", 83 | "development", 84 | "documentation", 85 | "examples", 86 | "symfony", 87 | "testing" 88 | ], 89 | "time": "2015-02-22 14:10:33" 90 | }, 91 | { 92 | "name": "behat/gherkin", 93 | "version": "v4.3.0", 94 | "source": { 95 | "type": "git", 96 | "url": "https://github.com/Behat/Gherkin.git", 97 | "reference": "43777c51058b77bcd84a8775b7a6ad05e986b5db" 98 | }, 99 | "dist": { 100 | "type": "zip", 101 | "url": "https://api.github.com/repos/Behat/Gherkin/zipball/43777c51058b77bcd84a8775b7a6ad05e986b5db", 102 | "reference": "43777c51058b77bcd84a8775b7a6ad05e986b5db", 103 | "shasum": "" 104 | }, 105 | "require": { 106 | "php": ">=5.3.1" 107 | }, 108 | "require-dev": { 109 | "phpunit/phpunit": "~4.0", 110 | "symfony/yaml": "~2.1" 111 | }, 112 | "suggest": { 113 | "symfony/yaml": "If you want to parse features, represented in YAML files" 114 | }, 115 | "type": "library", 116 | "extra": { 117 | "branch-alias": { 118 | "dev-master": "4.2-dev" 119 | } 120 | }, 121 | "autoload": { 122 | "psr-0": { 123 | "Behat\\Gherkin": "src/" 124 | } 125 | }, 126 | "notification-url": "https://packagist.org/downloads/", 127 | "license": [ 128 | "MIT" 129 | ], 130 | "authors": [ 131 | { 132 | "name": "Konstantin Kudryashov", 133 | "email": "ever.zet@gmail.com", 134 | "homepage": "http://everzet.com" 135 | } 136 | ], 137 | "description": "Gherkin DSL parser for PHP 5.3", 138 | "homepage": "http://behat.org/", 139 | "keywords": [ 140 | "BDD", 141 | "Behat", 142 | "Cucumber", 143 | "DSL", 144 | "gherkin", 145 | "parser" 146 | ], 147 | "time": "2014-06-06 01:24:32" 148 | }, 149 | { 150 | "name": "behat/transliterator", 151 | "version": "v1.0.1", 152 | "source": { 153 | "type": "git", 154 | "url": "https://github.com/Behat/Transliterator.git", 155 | "reference": "c93521d3462a554332d1ef5bb0e9b5b8ca4106c4" 156 | }, 157 | "dist": { 158 | "type": "zip", 159 | "url": "https://api.github.com/repos/Behat/Transliterator/zipball/c93521d3462a554332d1ef5bb0e9b5b8ca4106c4", 160 | "reference": "c93521d3462a554332d1ef5bb0e9b5b8ca4106c4", 161 | "shasum": "" 162 | }, 163 | "require": { 164 | "php": ">=5.3.3" 165 | }, 166 | "type": "library", 167 | "extra": { 168 | "branch-alias": { 169 | "dev-master": "1.0-dev" 170 | } 171 | }, 172 | "autoload": { 173 | "psr-0": { 174 | "Behat\\Transliterator": "src/" 175 | } 176 | }, 177 | "notification-url": "https://packagist.org/downloads/", 178 | "license": [ 179 | "Artistic-1.0" 180 | ], 181 | "description": "String transliterator", 182 | "keywords": [ 183 | "i18n", 184 | "slug", 185 | "transliterator" 186 | ], 187 | "time": "2014-05-15 22:08:22" 188 | }, 189 | { 190 | "name": "doctrine/instantiator", 191 | "version": "1.0.4", 192 | "source": { 193 | "type": "git", 194 | "url": "https://github.com/doctrine/instantiator.git", 195 | "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" 196 | }, 197 | "dist": { 198 | "type": "zip", 199 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", 200 | "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", 201 | "shasum": "" 202 | }, 203 | "require": { 204 | "php": ">=5.3,<8.0-DEV" 205 | }, 206 | "require-dev": { 207 | "athletic/athletic": "~0.1.8", 208 | "ext-pdo": "*", 209 | "ext-phar": "*", 210 | "phpunit/phpunit": "~4.0", 211 | "squizlabs/php_codesniffer": "2.0.*@ALPHA" 212 | }, 213 | "type": "library", 214 | "extra": { 215 | "branch-alias": { 216 | "dev-master": "1.0.x-dev" 217 | } 218 | }, 219 | "autoload": { 220 | "psr-0": { 221 | "Doctrine\\Instantiator\\": "src" 222 | } 223 | }, 224 | "notification-url": "https://packagist.org/downloads/", 225 | "license": [ 226 | "MIT" 227 | ], 228 | "authors": [ 229 | { 230 | "name": "Marco Pivetta", 231 | "email": "ocramius@gmail.com", 232 | "homepage": "http://ocramius.github.com/" 233 | } 234 | ], 235 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 236 | "homepage": "https://github.com/doctrine/instantiator", 237 | "keywords": [ 238 | "constructor", 239 | "instantiate" 240 | ], 241 | "time": "2014-10-13 12:58:55" 242 | }, 243 | { 244 | "name": "phpdocumentor/reflection-docblock", 245 | "version": "2.0.4", 246 | "source": { 247 | "type": "git", 248 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 249 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" 250 | }, 251 | "dist": { 252 | "type": "zip", 253 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", 254 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", 255 | "shasum": "" 256 | }, 257 | "require": { 258 | "php": ">=5.3.3" 259 | }, 260 | "require-dev": { 261 | "phpunit/phpunit": "~4.0" 262 | }, 263 | "suggest": { 264 | "dflydev/markdown": "~1.0", 265 | "erusev/parsedown": "~1.0" 266 | }, 267 | "type": "library", 268 | "extra": { 269 | "branch-alias": { 270 | "dev-master": "2.0.x-dev" 271 | } 272 | }, 273 | "autoload": { 274 | "psr-0": { 275 | "phpDocumentor": [ 276 | "src/" 277 | ] 278 | } 279 | }, 280 | "notification-url": "https://packagist.org/downloads/", 281 | "license": [ 282 | "MIT" 283 | ], 284 | "authors": [ 285 | { 286 | "name": "Mike van Riel", 287 | "email": "mike.vanriel@naenius.com" 288 | } 289 | ], 290 | "time": "2015-02-03 12:10:50" 291 | }, 292 | { 293 | "name": "phpspec/php-diff", 294 | "version": "v1.0.2", 295 | "source": { 296 | "type": "git", 297 | "url": "https://github.com/phpspec/php-diff.git", 298 | "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a" 299 | }, 300 | "dist": { 301 | "type": "zip", 302 | "url": "https://api.github.com/repos/phpspec/php-diff/zipball/30e103d19519fe678ae64a60d77884ef3d71b28a", 303 | "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a", 304 | "shasum": "" 305 | }, 306 | "type": "library", 307 | "autoload": { 308 | "psr-0": { 309 | "Diff": "lib/" 310 | } 311 | }, 312 | "notification-url": "https://packagist.org/downloads/", 313 | "license": [ 314 | "BSD-3-Clause" 315 | ], 316 | "authors": [ 317 | { 318 | "name": "Chris Boulton", 319 | "homepage": "http://github.com/chrisboulton", 320 | "role": "Original developer" 321 | } 322 | ], 323 | "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", 324 | "time": "2013-11-01 13:02:21" 325 | }, 326 | { 327 | "name": "phpspec/phpspec", 328 | "version": "2.1.1", 329 | "source": { 330 | "type": "git", 331 | "url": "https://github.com/phpspec/phpspec.git", 332 | "reference": "66a1df93099282b1514e9e001fcf6e9393f7783d" 333 | }, 334 | "dist": { 335 | "type": "zip", 336 | "url": "https://api.github.com/repos/phpspec/phpspec/zipball/66a1df93099282b1514e9e001fcf6e9393f7783d", 337 | "reference": "66a1df93099282b1514e9e001fcf6e9393f7783d", 338 | "shasum": "" 339 | }, 340 | "require": { 341 | "doctrine/instantiator": "~1.0,>=1.0.1", 342 | "php": ">=5.3.3", 343 | "phpspec/php-diff": "~1.0.0", 344 | "phpspec/prophecy": "~1.1", 345 | "sebastian/exporter": "~1.0", 346 | "symfony/console": "~2.3", 347 | "symfony/event-dispatcher": "~2.1", 348 | "symfony/finder": "~2.1", 349 | "symfony/process": "~2.1", 350 | "symfony/yaml": "~2.1" 351 | }, 352 | "require-dev": { 353 | "behat/behat": "~3.0,>=3.0.11", 354 | "bossa/phpspec2-expect": "~1.0", 355 | "symfony/filesystem": "~2.1" 356 | }, 357 | "suggest": { 358 | "phpspec/nyan-formatters": "~1.0 – Adds Nyan formatters" 359 | }, 360 | "bin": [ 361 | "bin/phpspec" 362 | ], 363 | "type": "library", 364 | "extra": { 365 | "branch-alias": { 366 | "dev-master": "2.1.x-dev" 367 | } 368 | }, 369 | "autoload": { 370 | "psr-0": { 371 | "PhpSpec": "src/" 372 | } 373 | }, 374 | "notification-url": "https://packagist.org/downloads/", 375 | "license": [ 376 | "MIT" 377 | ], 378 | "authors": [ 379 | { 380 | "name": "Konstantin Kudryashov", 381 | "email": "ever.zet@gmail.com", 382 | "homepage": "http://everzet.com" 383 | }, 384 | { 385 | "name": "Marcello Duarte", 386 | "homepage": "http://marcelloduarte.net/" 387 | } 388 | ], 389 | "description": "Specification-oriented BDD framework for PHP 5.3+", 390 | "homepage": "http://phpspec.net/", 391 | "keywords": [ 392 | "BDD", 393 | "SpecBDD", 394 | "TDD", 395 | "spec", 396 | "specification", 397 | "testing", 398 | "tests" 399 | ], 400 | "time": "2015-01-09 13:21:45" 401 | }, 402 | { 403 | "name": "phpspec/prophecy", 404 | "version": "1.4.0", 405 | "source": { 406 | "type": "git", 407 | "url": "https://github.com/phpspec/prophecy.git", 408 | "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5" 409 | }, 410 | "dist": { 411 | "type": "zip", 412 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5", 413 | "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5", 414 | "shasum": "" 415 | }, 416 | "require": { 417 | "doctrine/instantiator": "^1.0.2", 418 | "phpdocumentor/reflection-docblock": "~2.0", 419 | "sebastian/comparator": "~1.1" 420 | }, 421 | "require-dev": { 422 | "phpspec/phpspec": "~2.0" 423 | }, 424 | "type": "library", 425 | "extra": { 426 | "branch-alias": { 427 | "dev-master": "1.4.x-dev" 428 | } 429 | }, 430 | "autoload": { 431 | "psr-0": { 432 | "Prophecy\\": "src/" 433 | } 434 | }, 435 | "notification-url": "https://packagist.org/downloads/", 436 | "license": [ 437 | "MIT" 438 | ], 439 | "authors": [ 440 | { 441 | "name": "Konstantin Kudryashov", 442 | "email": "ever.zet@gmail.com", 443 | "homepage": "http://everzet.com" 444 | }, 445 | { 446 | "name": "Marcello Duarte", 447 | "email": "marcello.duarte@gmail.com" 448 | } 449 | ], 450 | "description": "Highly opinionated mocking framework for PHP 5.3+", 451 | "homepage": "https://github.com/phpspec/prophecy", 452 | "keywords": [ 453 | "Double", 454 | "Dummy", 455 | "fake", 456 | "mock", 457 | "spy", 458 | "stub" 459 | ], 460 | "time": "2015-03-27 19:31:25" 461 | }, 462 | { 463 | "name": "phpunit/php-code-coverage", 464 | "version": "2.0.16", 465 | "source": { 466 | "type": "git", 467 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 468 | "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c" 469 | }, 470 | "dist": { 471 | "type": "zip", 472 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/934fd03eb6840508231a7f73eb8940cf32c3b66c", 473 | "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c", 474 | "shasum": "" 475 | }, 476 | "require": { 477 | "php": ">=5.3.3", 478 | "phpunit/php-file-iterator": "~1.3", 479 | "phpunit/php-text-template": "~1.2", 480 | "phpunit/php-token-stream": "~1.3", 481 | "sebastian/environment": "~1.0", 482 | "sebastian/version": "~1.0" 483 | }, 484 | "require-dev": { 485 | "ext-xdebug": ">=2.1.4", 486 | "phpunit/phpunit": "~4" 487 | }, 488 | "suggest": { 489 | "ext-dom": "*", 490 | "ext-xdebug": ">=2.2.1", 491 | "ext-xmlwriter": "*" 492 | }, 493 | "type": "library", 494 | "extra": { 495 | "branch-alias": { 496 | "dev-master": "2.0.x-dev" 497 | } 498 | }, 499 | "autoload": { 500 | "classmap": [ 501 | "src/" 502 | ] 503 | }, 504 | "notification-url": "https://packagist.org/downloads/", 505 | "license": [ 506 | "BSD-3-Clause" 507 | ], 508 | "authors": [ 509 | { 510 | "name": "Sebastian Bergmann", 511 | "email": "sb@sebastian-bergmann.de", 512 | "role": "lead" 513 | } 514 | ], 515 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 516 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 517 | "keywords": [ 518 | "coverage", 519 | "testing", 520 | "xunit" 521 | ], 522 | "time": "2015-04-11 04:35:00" 523 | }, 524 | { 525 | "name": "phpunit/php-file-iterator", 526 | "version": "1.4.0", 527 | "source": { 528 | "type": "git", 529 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 530 | "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" 531 | }, 532 | "dist": { 533 | "type": "zip", 534 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", 535 | "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", 536 | "shasum": "" 537 | }, 538 | "require": { 539 | "php": ">=5.3.3" 540 | }, 541 | "type": "library", 542 | "extra": { 543 | "branch-alias": { 544 | "dev-master": "1.4.x-dev" 545 | } 546 | }, 547 | "autoload": { 548 | "classmap": [ 549 | "src/" 550 | ] 551 | }, 552 | "notification-url": "https://packagist.org/downloads/", 553 | "license": [ 554 | "BSD-3-Clause" 555 | ], 556 | "authors": [ 557 | { 558 | "name": "Sebastian Bergmann", 559 | "email": "sb@sebastian-bergmann.de", 560 | "role": "lead" 561 | } 562 | ], 563 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 564 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 565 | "keywords": [ 566 | "filesystem", 567 | "iterator" 568 | ], 569 | "time": "2015-04-02 05:19:05" 570 | }, 571 | { 572 | "name": "phpunit/php-text-template", 573 | "version": "1.2.0", 574 | "source": { 575 | "type": "git", 576 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 577 | "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" 578 | }, 579 | "dist": { 580 | "type": "zip", 581 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", 582 | "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", 583 | "shasum": "" 584 | }, 585 | "require": { 586 | "php": ">=5.3.3" 587 | }, 588 | "type": "library", 589 | "autoload": { 590 | "classmap": [ 591 | "Text/" 592 | ] 593 | }, 594 | "notification-url": "https://packagist.org/downloads/", 595 | "include-path": [ 596 | "" 597 | ], 598 | "license": [ 599 | "BSD-3-Clause" 600 | ], 601 | "authors": [ 602 | { 603 | "name": "Sebastian Bergmann", 604 | "email": "sb@sebastian-bergmann.de", 605 | "role": "lead" 606 | } 607 | ], 608 | "description": "Simple template engine.", 609 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 610 | "keywords": [ 611 | "template" 612 | ], 613 | "time": "2014-01-30 17:20:04" 614 | }, 615 | { 616 | "name": "phpunit/php-timer", 617 | "version": "1.0.5", 618 | "source": { 619 | "type": "git", 620 | "url": "https://github.com/sebastianbergmann/php-timer.git", 621 | "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" 622 | }, 623 | "dist": { 624 | "type": "zip", 625 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", 626 | "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", 627 | "shasum": "" 628 | }, 629 | "require": { 630 | "php": ">=5.3.3" 631 | }, 632 | "type": "library", 633 | "autoload": { 634 | "classmap": [ 635 | "PHP/" 636 | ] 637 | }, 638 | "notification-url": "https://packagist.org/downloads/", 639 | "include-path": [ 640 | "" 641 | ], 642 | "license": [ 643 | "BSD-3-Clause" 644 | ], 645 | "authors": [ 646 | { 647 | "name": "Sebastian Bergmann", 648 | "email": "sb@sebastian-bergmann.de", 649 | "role": "lead" 650 | } 651 | ], 652 | "description": "Utility class for timing", 653 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 654 | "keywords": [ 655 | "timer" 656 | ], 657 | "time": "2013-08-02 07:42:54" 658 | }, 659 | { 660 | "name": "phpunit/php-token-stream", 661 | "version": "1.4.1", 662 | "source": { 663 | "type": "git", 664 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 665 | "reference": "eab81d02569310739373308137284e0158424330" 666 | }, 667 | "dist": { 668 | "type": "zip", 669 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/eab81d02569310739373308137284e0158424330", 670 | "reference": "eab81d02569310739373308137284e0158424330", 671 | "shasum": "" 672 | }, 673 | "require": { 674 | "ext-tokenizer": "*", 675 | "php": ">=5.3.3" 676 | }, 677 | "require-dev": { 678 | "phpunit/phpunit": "~4.2" 679 | }, 680 | "type": "library", 681 | "extra": { 682 | "branch-alias": { 683 | "dev-master": "1.4-dev" 684 | } 685 | }, 686 | "autoload": { 687 | "classmap": [ 688 | "src/" 689 | ] 690 | }, 691 | "notification-url": "https://packagist.org/downloads/", 692 | "license": [ 693 | "BSD-3-Clause" 694 | ], 695 | "authors": [ 696 | { 697 | "name": "Sebastian Bergmann", 698 | "email": "sebastian@phpunit.de" 699 | } 700 | ], 701 | "description": "Wrapper around PHP's tokenizer extension.", 702 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 703 | "keywords": [ 704 | "tokenizer" 705 | ], 706 | "time": "2015-04-08 04:46:07" 707 | }, 708 | { 709 | "name": "phpunit/phpunit", 710 | "version": "4.6.4", 711 | "source": { 712 | "type": "git", 713 | "url": "https://github.com/sebastianbergmann/phpunit.git", 714 | "reference": "163232991e652e6efed2f8470326fffa61e848e2" 715 | }, 716 | "dist": { 717 | "type": "zip", 718 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/163232991e652e6efed2f8470326fffa61e848e2", 719 | "reference": "163232991e652e6efed2f8470326fffa61e848e2", 720 | "shasum": "" 721 | }, 722 | "require": { 723 | "ext-dom": "*", 724 | "ext-json": "*", 725 | "ext-pcre": "*", 726 | "ext-reflection": "*", 727 | "ext-spl": "*", 728 | "php": ">=5.3.3", 729 | "phpspec/prophecy": "~1.3,>=1.3.1", 730 | "phpunit/php-code-coverage": "~2.0,>=2.0.11", 731 | "phpunit/php-file-iterator": "~1.4", 732 | "phpunit/php-text-template": "~1.2", 733 | "phpunit/php-timer": "~1.0", 734 | "phpunit/phpunit-mock-objects": "~2.3", 735 | "sebastian/comparator": "~1.1", 736 | "sebastian/diff": "~1.2", 737 | "sebastian/environment": "~1.2", 738 | "sebastian/exporter": "~1.2", 739 | "sebastian/global-state": "~1.0", 740 | "sebastian/version": "~1.0", 741 | "symfony/yaml": "~2.1|~3.0" 742 | }, 743 | "suggest": { 744 | "phpunit/php-invoker": "~1.1" 745 | }, 746 | "bin": [ 747 | "phpunit" 748 | ], 749 | "type": "library", 750 | "extra": { 751 | "branch-alias": { 752 | "dev-master": "4.6.x-dev" 753 | } 754 | }, 755 | "autoload": { 756 | "classmap": [ 757 | "src/" 758 | ] 759 | }, 760 | "notification-url": "https://packagist.org/downloads/", 761 | "license": [ 762 | "BSD-3-Clause" 763 | ], 764 | "authors": [ 765 | { 766 | "name": "Sebastian Bergmann", 767 | "email": "sebastian@phpunit.de", 768 | "role": "lead" 769 | } 770 | ], 771 | "description": "The PHP Unit Testing framework.", 772 | "homepage": "https://phpunit.de/", 773 | "keywords": [ 774 | "phpunit", 775 | "testing", 776 | "xunit" 777 | ], 778 | "time": "2015-04-11 05:23:21" 779 | }, 780 | { 781 | "name": "phpunit/phpunit-mock-objects", 782 | "version": "2.3.1", 783 | "source": { 784 | "type": "git", 785 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 786 | "reference": "74ffb87f527f24616f72460e54b595f508dccb5c" 787 | }, 788 | "dist": { 789 | "type": "zip", 790 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/74ffb87f527f24616f72460e54b595f508dccb5c", 791 | "reference": "74ffb87f527f24616f72460e54b595f508dccb5c", 792 | "shasum": "" 793 | }, 794 | "require": { 795 | "doctrine/instantiator": "~1.0,>=1.0.2", 796 | "php": ">=5.3.3", 797 | "phpunit/php-text-template": "~1.2" 798 | }, 799 | "require-dev": { 800 | "phpunit/phpunit": "~4.4" 801 | }, 802 | "suggest": { 803 | "ext-soap": "*" 804 | }, 805 | "type": "library", 806 | "extra": { 807 | "branch-alias": { 808 | "dev-master": "2.3.x-dev" 809 | } 810 | }, 811 | "autoload": { 812 | "classmap": [ 813 | "src/" 814 | ] 815 | }, 816 | "notification-url": "https://packagist.org/downloads/", 817 | "license": [ 818 | "BSD-3-Clause" 819 | ], 820 | "authors": [ 821 | { 822 | "name": "Sebastian Bergmann", 823 | "email": "sb@sebastian-bergmann.de", 824 | "role": "lead" 825 | } 826 | ], 827 | "description": "Mock Object library for PHPUnit", 828 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 829 | "keywords": [ 830 | "mock", 831 | "xunit" 832 | ], 833 | "time": "2015-04-02 05:36:41" 834 | }, 835 | { 836 | "name": "sebastian/comparator", 837 | "version": "1.1.1", 838 | "source": { 839 | "type": "git", 840 | "url": "https://github.com/sebastianbergmann/comparator.git", 841 | "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" 842 | }, 843 | "dist": { 844 | "type": "zip", 845 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", 846 | "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", 847 | "shasum": "" 848 | }, 849 | "require": { 850 | "php": ">=5.3.3", 851 | "sebastian/diff": "~1.2", 852 | "sebastian/exporter": "~1.2" 853 | }, 854 | "require-dev": { 855 | "phpunit/phpunit": "~4.4" 856 | }, 857 | "type": "library", 858 | "extra": { 859 | "branch-alias": { 860 | "dev-master": "1.1.x-dev" 861 | } 862 | }, 863 | "autoload": { 864 | "classmap": [ 865 | "src/" 866 | ] 867 | }, 868 | "notification-url": "https://packagist.org/downloads/", 869 | "license": [ 870 | "BSD-3-Clause" 871 | ], 872 | "authors": [ 873 | { 874 | "name": "Jeff Welch", 875 | "email": "whatthejeff@gmail.com" 876 | }, 877 | { 878 | "name": "Volker Dusch", 879 | "email": "github@wallbash.com" 880 | }, 881 | { 882 | "name": "Bernhard Schussek", 883 | "email": "bschussek@2bepublished.at" 884 | }, 885 | { 886 | "name": "Sebastian Bergmann", 887 | "email": "sebastian@phpunit.de" 888 | } 889 | ], 890 | "description": "Provides the functionality to compare PHP values for equality", 891 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 892 | "keywords": [ 893 | "comparator", 894 | "compare", 895 | "equality" 896 | ], 897 | "time": "2015-01-29 16:28:08" 898 | }, 899 | { 900 | "name": "sebastian/diff", 901 | "version": "1.3.0", 902 | "source": { 903 | "type": "git", 904 | "url": "https://github.com/sebastianbergmann/diff.git", 905 | "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" 906 | }, 907 | "dist": { 908 | "type": "zip", 909 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", 910 | "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", 911 | "shasum": "" 912 | }, 913 | "require": { 914 | "php": ">=5.3.3" 915 | }, 916 | "require-dev": { 917 | "phpunit/phpunit": "~4.2" 918 | }, 919 | "type": "library", 920 | "extra": { 921 | "branch-alias": { 922 | "dev-master": "1.3-dev" 923 | } 924 | }, 925 | "autoload": { 926 | "classmap": [ 927 | "src/" 928 | ] 929 | }, 930 | "notification-url": "https://packagist.org/downloads/", 931 | "license": [ 932 | "BSD-3-Clause" 933 | ], 934 | "authors": [ 935 | { 936 | "name": "Kore Nordmann", 937 | "email": "mail@kore-nordmann.de" 938 | }, 939 | { 940 | "name": "Sebastian Bergmann", 941 | "email": "sebastian@phpunit.de" 942 | } 943 | ], 944 | "description": "Diff implementation", 945 | "homepage": "http://www.github.com/sebastianbergmann/diff", 946 | "keywords": [ 947 | "diff" 948 | ], 949 | "time": "2015-02-22 15:13:53" 950 | }, 951 | { 952 | "name": "sebastian/environment", 953 | "version": "1.2.2", 954 | "source": { 955 | "type": "git", 956 | "url": "https://github.com/sebastianbergmann/environment.git", 957 | "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" 958 | }, 959 | "dist": { 960 | "type": "zip", 961 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", 962 | "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", 963 | "shasum": "" 964 | }, 965 | "require": { 966 | "php": ">=5.3.3" 967 | }, 968 | "require-dev": { 969 | "phpunit/phpunit": "~4.4" 970 | }, 971 | "type": "library", 972 | "extra": { 973 | "branch-alias": { 974 | "dev-master": "1.3.x-dev" 975 | } 976 | }, 977 | "autoload": { 978 | "classmap": [ 979 | "src/" 980 | ] 981 | }, 982 | "notification-url": "https://packagist.org/downloads/", 983 | "license": [ 984 | "BSD-3-Clause" 985 | ], 986 | "authors": [ 987 | { 988 | "name": "Sebastian Bergmann", 989 | "email": "sebastian@phpunit.de" 990 | } 991 | ], 992 | "description": "Provides functionality to handle HHVM/PHP environments", 993 | "homepage": "http://www.github.com/sebastianbergmann/environment", 994 | "keywords": [ 995 | "Xdebug", 996 | "environment", 997 | "hhvm" 998 | ], 999 | "time": "2015-01-01 10:01:08" 1000 | }, 1001 | { 1002 | "name": "sebastian/exporter", 1003 | "version": "1.2.0", 1004 | "source": { 1005 | "type": "git", 1006 | "url": "https://github.com/sebastianbergmann/exporter.git", 1007 | "reference": "84839970d05254c73cde183a721c7af13aede943" 1008 | }, 1009 | "dist": { 1010 | "type": "zip", 1011 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", 1012 | "reference": "84839970d05254c73cde183a721c7af13aede943", 1013 | "shasum": "" 1014 | }, 1015 | "require": { 1016 | "php": ">=5.3.3", 1017 | "sebastian/recursion-context": "~1.0" 1018 | }, 1019 | "require-dev": { 1020 | "phpunit/phpunit": "~4.4" 1021 | }, 1022 | "type": "library", 1023 | "extra": { 1024 | "branch-alias": { 1025 | "dev-master": "1.2.x-dev" 1026 | } 1027 | }, 1028 | "autoload": { 1029 | "classmap": [ 1030 | "src/" 1031 | ] 1032 | }, 1033 | "notification-url": "https://packagist.org/downloads/", 1034 | "license": [ 1035 | "BSD-3-Clause" 1036 | ], 1037 | "authors": [ 1038 | { 1039 | "name": "Jeff Welch", 1040 | "email": "whatthejeff@gmail.com" 1041 | }, 1042 | { 1043 | "name": "Volker Dusch", 1044 | "email": "github@wallbash.com" 1045 | }, 1046 | { 1047 | "name": "Bernhard Schussek", 1048 | "email": "bschussek@2bepublished.at" 1049 | }, 1050 | { 1051 | "name": "Sebastian Bergmann", 1052 | "email": "sebastian@phpunit.de" 1053 | }, 1054 | { 1055 | "name": "Adam Harvey", 1056 | "email": "aharvey@php.net" 1057 | } 1058 | ], 1059 | "description": "Provides the functionality to export PHP variables for visualization", 1060 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1061 | "keywords": [ 1062 | "export", 1063 | "exporter" 1064 | ], 1065 | "time": "2015-01-27 07:23:06" 1066 | }, 1067 | { 1068 | "name": "sebastian/global-state", 1069 | "version": "1.0.0", 1070 | "source": { 1071 | "type": "git", 1072 | "url": "https://github.com/sebastianbergmann/global-state.git", 1073 | "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" 1074 | }, 1075 | "dist": { 1076 | "type": "zip", 1077 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", 1078 | "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", 1079 | "shasum": "" 1080 | }, 1081 | "require": { 1082 | "php": ">=5.3.3" 1083 | }, 1084 | "require-dev": { 1085 | "phpunit/phpunit": "~4.2" 1086 | }, 1087 | "suggest": { 1088 | "ext-uopz": "*" 1089 | }, 1090 | "type": "library", 1091 | "extra": { 1092 | "branch-alias": { 1093 | "dev-master": "1.0-dev" 1094 | } 1095 | }, 1096 | "autoload": { 1097 | "classmap": [ 1098 | "src/" 1099 | ] 1100 | }, 1101 | "notification-url": "https://packagist.org/downloads/", 1102 | "license": [ 1103 | "BSD-3-Clause" 1104 | ], 1105 | "authors": [ 1106 | { 1107 | "name": "Sebastian Bergmann", 1108 | "email": "sebastian@phpunit.de" 1109 | } 1110 | ], 1111 | "description": "Snapshotting of global state", 1112 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1113 | "keywords": [ 1114 | "global state" 1115 | ], 1116 | "time": "2014-10-06 09:23:50" 1117 | }, 1118 | { 1119 | "name": "sebastian/recursion-context", 1120 | "version": "1.0.0", 1121 | "source": { 1122 | "type": "git", 1123 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1124 | "reference": "3989662bbb30a29d20d9faa04a846af79b276252" 1125 | }, 1126 | "dist": { 1127 | "type": "zip", 1128 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", 1129 | "reference": "3989662bbb30a29d20d9faa04a846af79b276252", 1130 | "shasum": "" 1131 | }, 1132 | "require": { 1133 | "php": ">=5.3.3" 1134 | }, 1135 | "require-dev": { 1136 | "phpunit/phpunit": "~4.4" 1137 | }, 1138 | "type": "library", 1139 | "extra": { 1140 | "branch-alias": { 1141 | "dev-master": "1.0.x-dev" 1142 | } 1143 | }, 1144 | "autoload": { 1145 | "classmap": [ 1146 | "src/" 1147 | ] 1148 | }, 1149 | "notification-url": "https://packagist.org/downloads/", 1150 | "license": [ 1151 | "BSD-3-Clause" 1152 | ], 1153 | "authors": [ 1154 | { 1155 | "name": "Jeff Welch", 1156 | "email": "whatthejeff@gmail.com" 1157 | }, 1158 | { 1159 | "name": "Sebastian Bergmann", 1160 | "email": "sebastian@phpunit.de" 1161 | }, 1162 | { 1163 | "name": "Adam Harvey", 1164 | "email": "aharvey@php.net" 1165 | } 1166 | ], 1167 | "description": "Provides functionality to recursively process PHP variables", 1168 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1169 | "time": "2015-01-24 09:48:32" 1170 | }, 1171 | { 1172 | "name": "sebastian/version", 1173 | "version": "1.0.5", 1174 | "source": { 1175 | "type": "git", 1176 | "url": "https://github.com/sebastianbergmann/version.git", 1177 | "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4" 1178 | }, 1179 | "dist": { 1180 | "type": "zip", 1181 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", 1182 | "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", 1183 | "shasum": "" 1184 | }, 1185 | "type": "library", 1186 | "autoload": { 1187 | "classmap": [ 1188 | "src/" 1189 | ] 1190 | }, 1191 | "notification-url": "https://packagist.org/downloads/", 1192 | "license": [ 1193 | "BSD-3-Clause" 1194 | ], 1195 | "authors": [ 1196 | { 1197 | "name": "Sebastian Bergmann", 1198 | "email": "sebastian@phpunit.de", 1199 | "role": "lead" 1200 | } 1201 | ], 1202 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1203 | "homepage": "https://github.com/sebastianbergmann/version", 1204 | "time": "2015-02-24 06:35:25" 1205 | }, 1206 | { 1207 | "name": "symfony/class-loader", 1208 | "version": "v2.6.6", 1209 | "target-dir": "Symfony/Component/ClassLoader", 1210 | "source": { 1211 | "type": "git", 1212 | "url": "https://github.com/symfony/ClassLoader.git", 1213 | "reference": "861765b3e5f32979de5bd19ad2577cbb830a29d5" 1214 | }, 1215 | "dist": { 1216 | "type": "zip", 1217 | "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/861765b3e5f32979de5bd19ad2577cbb830a29d5", 1218 | "reference": "861765b3e5f32979de5bd19ad2577cbb830a29d5", 1219 | "shasum": "" 1220 | }, 1221 | "require": { 1222 | "php": ">=5.3.3" 1223 | }, 1224 | "require-dev": { 1225 | "symfony/finder": "~2.0,>=2.0.5", 1226 | "symfony/phpunit-bridge": "~2.7" 1227 | }, 1228 | "type": "library", 1229 | "extra": { 1230 | "branch-alias": { 1231 | "dev-master": "2.6-dev" 1232 | } 1233 | }, 1234 | "autoload": { 1235 | "psr-0": { 1236 | "Symfony\\Component\\ClassLoader\\": "" 1237 | } 1238 | }, 1239 | "notification-url": "https://packagist.org/downloads/", 1240 | "license": [ 1241 | "MIT" 1242 | ], 1243 | "authors": [ 1244 | { 1245 | "name": "Symfony Community", 1246 | "homepage": "http://symfony.com/contributors" 1247 | }, 1248 | { 1249 | "name": "Fabien Potencier", 1250 | "email": "fabien@symfony.com" 1251 | } 1252 | ], 1253 | "description": "Symfony ClassLoader Component", 1254 | "homepage": "http://symfony.com", 1255 | "time": "2015-03-27 10:19:51" 1256 | }, 1257 | { 1258 | "name": "symfony/config", 1259 | "version": "v2.6.6", 1260 | "target-dir": "Symfony/Component/Config", 1261 | "source": { 1262 | "type": "git", 1263 | "url": "https://github.com/symfony/Config.git", 1264 | "reference": "d91be01336605db8da21b79bc771e46a7276d1bc" 1265 | }, 1266 | "dist": { 1267 | "type": "zip", 1268 | "url": "https://api.github.com/repos/symfony/Config/zipball/d91be01336605db8da21b79bc771e46a7276d1bc", 1269 | "reference": "d91be01336605db8da21b79bc771e46a7276d1bc", 1270 | "shasum": "" 1271 | }, 1272 | "require": { 1273 | "php": ">=5.3.3", 1274 | "symfony/filesystem": "~2.3" 1275 | }, 1276 | "require-dev": { 1277 | "symfony/phpunit-bridge": "~2.7" 1278 | }, 1279 | "type": "library", 1280 | "extra": { 1281 | "branch-alias": { 1282 | "dev-master": "2.6-dev" 1283 | } 1284 | }, 1285 | "autoload": { 1286 | "psr-0": { 1287 | "Symfony\\Component\\Config\\": "" 1288 | } 1289 | }, 1290 | "notification-url": "https://packagist.org/downloads/", 1291 | "license": [ 1292 | "MIT" 1293 | ], 1294 | "authors": [ 1295 | { 1296 | "name": "Symfony Community", 1297 | "homepage": "http://symfony.com/contributors" 1298 | }, 1299 | { 1300 | "name": "Fabien Potencier", 1301 | "email": "fabien@symfony.com" 1302 | } 1303 | ], 1304 | "description": "Symfony Config Component", 1305 | "homepage": "http://symfony.com", 1306 | "time": "2015-03-30 15:54:10" 1307 | }, 1308 | { 1309 | "name": "symfony/console", 1310 | "version": "v2.6.6", 1311 | "target-dir": "Symfony/Component/Console", 1312 | "source": { 1313 | "type": "git", 1314 | "url": "https://github.com/symfony/Console.git", 1315 | "reference": "5b91dc4ed5eb08553f57f6df04c4730a73992667" 1316 | }, 1317 | "dist": { 1318 | "type": "zip", 1319 | "url": "https://api.github.com/repos/symfony/Console/zipball/5b91dc4ed5eb08553f57f6df04c4730a73992667", 1320 | "reference": "5b91dc4ed5eb08553f57f6df04c4730a73992667", 1321 | "shasum": "" 1322 | }, 1323 | "require": { 1324 | "php": ">=5.3.3" 1325 | }, 1326 | "require-dev": { 1327 | "psr/log": "~1.0", 1328 | "symfony/event-dispatcher": "~2.1", 1329 | "symfony/phpunit-bridge": "~2.7", 1330 | "symfony/process": "~2.1" 1331 | }, 1332 | "suggest": { 1333 | "psr/log": "For using the console logger", 1334 | "symfony/event-dispatcher": "", 1335 | "symfony/process": "" 1336 | }, 1337 | "type": "library", 1338 | "extra": { 1339 | "branch-alias": { 1340 | "dev-master": "2.6-dev" 1341 | } 1342 | }, 1343 | "autoload": { 1344 | "psr-0": { 1345 | "Symfony\\Component\\Console\\": "" 1346 | } 1347 | }, 1348 | "notification-url": "https://packagist.org/downloads/", 1349 | "license": [ 1350 | "MIT" 1351 | ], 1352 | "authors": [ 1353 | { 1354 | "name": "Symfony Community", 1355 | "homepage": "http://symfony.com/contributors" 1356 | }, 1357 | { 1358 | "name": "Fabien Potencier", 1359 | "email": "fabien@symfony.com" 1360 | } 1361 | ], 1362 | "description": "Symfony Console Component", 1363 | "homepage": "http://symfony.com", 1364 | "time": "2015-03-30 15:54:10" 1365 | }, 1366 | { 1367 | "name": "symfony/dependency-injection", 1368 | "version": "v2.6.6", 1369 | "target-dir": "Symfony/Component/DependencyInjection", 1370 | "source": { 1371 | "type": "git", 1372 | "url": "https://github.com/symfony/DependencyInjection.git", 1373 | "reference": "8e9007012226b4bd41f8afed855c452cf5edc3a6" 1374 | }, 1375 | "dist": { 1376 | "type": "zip", 1377 | "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/8e9007012226b4bd41f8afed855c452cf5edc3a6", 1378 | "reference": "8e9007012226b4bd41f8afed855c452cf5edc3a6", 1379 | "shasum": "" 1380 | }, 1381 | "require": { 1382 | "php": ">=5.3.3" 1383 | }, 1384 | "conflict": { 1385 | "symfony/expression-language": "<2.6" 1386 | }, 1387 | "require-dev": { 1388 | "symfony/config": "~2.2", 1389 | "symfony/expression-language": "~2.6", 1390 | "symfony/phpunit-bridge": "~2.7", 1391 | "symfony/yaml": "~2.1" 1392 | }, 1393 | "suggest": { 1394 | "symfony/config": "", 1395 | "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", 1396 | "symfony/yaml": "" 1397 | }, 1398 | "type": "library", 1399 | "extra": { 1400 | "branch-alias": { 1401 | "dev-master": "2.6-dev" 1402 | } 1403 | }, 1404 | "autoload": { 1405 | "psr-0": { 1406 | "Symfony\\Component\\DependencyInjection\\": "" 1407 | } 1408 | }, 1409 | "notification-url": "https://packagist.org/downloads/", 1410 | "license": [ 1411 | "MIT" 1412 | ], 1413 | "authors": [ 1414 | { 1415 | "name": "Symfony Community", 1416 | "homepage": "http://symfony.com/contributors" 1417 | }, 1418 | { 1419 | "name": "Fabien Potencier", 1420 | "email": "fabien@symfony.com" 1421 | } 1422 | ], 1423 | "description": "Symfony DependencyInjection Component", 1424 | "homepage": "http://symfony.com", 1425 | "time": "2015-03-30 15:54:10" 1426 | }, 1427 | { 1428 | "name": "symfony/event-dispatcher", 1429 | "version": "v2.6.6", 1430 | "target-dir": "Symfony/Component/EventDispatcher", 1431 | "source": { 1432 | "type": "git", 1433 | "url": "https://github.com/symfony/EventDispatcher.git", 1434 | "reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284" 1435 | }, 1436 | "dist": { 1437 | "type": "zip", 1438 | "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/70f7c8478739ad21e3deef0d977b38c77f1fb284", 1439 | "reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284", 1440 | "shasum": "" 1441 | }, 1442 | "require": { 1443 | "php": ">=5.3.3" 1444 | }, 1445 | "require-dev": { 1446 | "psr/log": "~1.0", 1447 | "symfony/config": "~2.0,>=2.0.5", 1448 | "symfony/dependency-injection": "~2.6", 1449 | "symfony/expression-language": "~2.6", 1450 | "symfony/phpunit-bridge": "~2.7", 1451 | "symfony/stopwatch": "~2.3" 1452 | }, 1453 | "suggest": { 1454 | "symfony/dependency-injection": "", 1455 | "symfony/http-kernel": "" 1456 | }, 1457 | "type": "library", 1458 | "extra": { 1459 | "branch-alias": { 1460 | "dev-master": "2.6-dev" 1461 | } 1462 | }, 1463 | "autoload": { 1464 | "psr-0": { 1465 | "Symfony\\Component\\EventDispatcher\\": "" 1466 | } 1467 | }, 1468 | "notification-url": "https://packagist.org/downloads/", 1469 | "license": [ 1470 | "MIT" 1471 | ], 1472 | "authors": [ 1473 | { 1474 | "name": "Symfony Community", 1475 | "homepage": "http://symfony.com/contributors" 1476 | }, 1477 | { 1478 | "name": "Fabien Potencier", 1479 | "email": "fabien@symfony.com" 1480 | } 1481 | ], 1482 | "description": "Symfony EventDispatcher Component", 1483 | "homepage": "http://symfony.com", 1484 | "time": "2015-03-13 17:37:22" 1485 | }, 1486 | { 1487 | "name": "symfony/filesystem", 1488 | "version": "v2.6.6", 1489 | "target-dir": "Symfony/Component/Filesystem", 1490 | "source": { 1491 | "type": "git", 1492 | "url": "https://github.com/symfony/Filesystem.git", 1493 | "reference": "4983964b3693e4f13449cb3800c64a9112c301b4" 1494 | }, 1495 | "dist": { 1496 | "type": "zip", 1497 | "url": "https://api.github.com/repos/symfony/Filesystem/zipball/4983964b3693e4f13449cb3800c64a9112c301b4", 1498 | "reference": "4983964b3693e4f13449cb3800c64a9112c301b4", 1499 | "shasum": "" 1500 | }, 1501 | "require": { 1502 | "php": ">=5.3.3" 1503 | }, 1504 | "require-dev": { 1505 | "symfony/phpunit-bridge": "~2.7" 1506 | }, 1507 | "type": "library", 1508 | "extra": { 1509 | "branch-alias": { 1510 | "dev-master": "2.6-dev" 1511 | } 1512 | }, 1513 | "autoload": { 1514 | "psr-0": { 1515 | "Symfony\\Component\\Filesystem\\": "" 1516 | } 1517 | }, 1518 | "notification-url": "https://packagist.org/downloads/", 1519 | "license": [ 1520 | "MIT" 1521 | ], 1522 | "authors": [ 1523 | { 1524 | "name": "Symfony Community", 1525 | "homepage": "http://symfony.com/contributors" 1526 | }, 1527 | { 1528 | "name": "Fabien Potencier", 1529 | "email": "fabien@symfony.com" 1530 | } 1531 | ], 1532 | "description": "Symfony Filesystem Component", 1533 | "homepage": "http://symfony.com", 1534 | "time": "2015-03-22 16:55:57" 1535 | }, 1536 | { 1537 | "name": "symfony/finder", 1538 | "version": "v2.6.6", 1539 | "target-dir": "Symfony/Component/Finder", 1540 | "source": { 1541 | "type": "git", 1542 | "url": "https://github.com/symfony/Finder.git", 1543 | "reference": "5dbe2e73a580618f5b4880fda93406eed25de251" 1544 | }, 1545 | "dist": { 1546 | "type": "zip", 1547 | "url": "https://api.github.com/repos/symfony/Finder/zipball/5dbe2e73a580618f5b4880fda93406eed25de251", 1548 | "reference": "5dbe2e73a580618f5b4880fda93406eed25de251", 1549 | "shasum": "" 1550 | }, 1551 | "require": { 1552 | "php": ">=5.3.3" 1553 | }, 1554 | "require-dev": { 1555 | "symfony/phpunit-bridge": "~2.7" 1556 | }, 1557 | "type": "library", 1558 | "extra": { 1559 | "branch-alias": { 1560 | "dev-master": "2.6-dev" 1561 | } 1562 | }, 1563 | "autoload": { 1564 | "psr-0": { 1565 | "Symfony\\Component\\Finder\\": "" 1566 | } 1567 | }, 1568 | "notification-url": "https://packagist.org/downloads/", 1569 | "license": [ 1570 | "MIT" 1571 | ], 1572 | "authors": [ 1573 | { 1574 | "name": "Symfony Community", 1575 | "homepage": "http://symfony.com/contributors" 1576 | }, 1577 | { 1578 | "name": "Fabien Potencier", 1579 | "email": "fabien@symfony.com" 1580 | } 1581 | ], 1582 | "description": "Symfony Finder Component", 1583 | "homepage": "http://symfony.com", 1584 | "time": "2015-03-30 15:54:10" 1585 | }, 1586 | { 1587 | "name": "symfony/process", 1588 | "version": "v2.6.6", 1589 | "target-dir": "Symfony/Component/Process", 1590 | "source": { 1591 | "type": "git", 1592 | "url": "https://github.com/symfony/Process.git", 1593 | "reference": "a8bebaec1a9dc6cde53e0250e32917579b0be552" 1594 | }, 1595 | "dist": { 1596 | "type": "zip", 1597 | "url": "https://api.github.com/repos/symfony/Process/zipball/a8bebaec1a9dc6cde53e0250e32917579b0be552", 1598 | "reference": "a8bebaec1a9dc6cde53e0250e32917579b0be552", 1599 | "shasum": "" 1600 | }, 1601 | "require": { 1602 | "php": ">=5.3.3" 1603 | }, 1604 | "require-dev": { 1605 | "symfony/phpunit-bridge": "~2.7" 1606 | }, 1607 | "type": "library", 1608 | "extra": { 1609 | "branch-alias": { 1610 | "dev-master": "2.6-dev" 1611 | } 1612 | }, 1613 | "autoload": { 1614 | "psr-0": { 1615 | "Symfony\\Component\\Process\\": "" 1616 | } 1617 | }, 1618 | "notification-url": "https://packagist.org/downloads/", 1619 | "license": [ 1620 | "MIT" 1621 | ], 1622 | "authors": [ 1623 | { 1624 | "name": "Symfony Community", 1625 | "homepage": "http://symfony.com/contributors" 1626 | }, 1627 | { 1628 | "name": "Fabien Potencier", 1629 | "email": "fabien@symfony.com" 1630 | } 1631 | ], 1632 | "description": "Symfony Process Component", 1633 | "homepage": "http://symfony.com", 1634 | "time": "2015-03-30 15:54:10" 1635 | }, 1636 | { 1637 | "name": "symfony/translation", 1638 | "version": "v2.6.6", 1639 | "target-dir": "Symfony/Component/Translation", 1640 | "source": { 1641 | "type": "git", 1642 | "url": "https://github.com/symfony/Translation.git", 1643 | "reference": "bd939f05cdaca128f4ddbae1b447d6f0203b60af" 1644 | }, 1645 | "dist": { 1646 | "type": "zip", 1647 | "url": "https://api.github.com/repos/symfony/Translation/zipball/bd939f05cdaca128f4ddbae1b447d6f0203b60af", 1648 | "reference": "bd939f05cdaca128f4ddbae1b447d6f0203b60af", 1649 | "shasum": "" 1650 | }, 1651 | "require": { 1652 | "php": ">=5.3.3" 1653 | }, 1654 | "require-dev": { 1655 | "psr/log": "~1.0", 1656 | "symfony/config": "~2.3,>=2.3.12", 1657 | "symfony/intl": "~2.3", 1658 | "symfony/phpunit-bridge": "~2.7", 1659 | "symfony/yaml": "~2.2" 1660 | }, 1661 | "suggest": { 1662 | "psr/log": "To use logging capability in translator", 1663 | "symfony/config": "", 1664 | "symfony/yaml": "" 1665 | }, 1666 | "type": "library", 1667 | "extra": { 1668 | "branch-alias": { 1669 | "dev-master": "2.6-dev" 1670 | } 1671 | }, 1672 | "autoload": { 1673 | "psr-0": { 1674 | "Symfony\\Component\\Translation\\": "" 1675 | } 1676 | }, 1677 | "notification-url": "https://packagist.org/downloads/", 1678 | "license": [ 1679 | "MIT" 1680 | ], 1681 | "authors": [ 1682 | { 1683 | "name": "Symfony Community", 1684 | "homepage": "http://symfony.com/contributors" 1685 | }, 1686 | { 1687 | "name": "Fabien Potencier", 1688 | "email": "fabien@symfony.com" 1689 | } 1690 | ], 1691 | "description": "Symfony Translation Component", 1692 | "homepage": "http://symfony.com", 1693 | "time": "2015-03-30 15:54:10" 1694 | }, 1695 | { 1696 | "name": "symfony/yaml", 1697 | "version": "v2.6.6", 1698 | "target-dir": "Symfony/Component/Yaml", 1699 | "source": { 1700 | "type": "git", 1701 | "url": "https://github.com/symfony/Yaml.git", 1702 | "reference": "174f009ed36379a801109955fc5a71a49fe62dd4" 1703 | }, 1704 | "dist": { 1705 | "type": "zip", 1706 | "url": "https://api.github.com/repos/symfony/Yaml/zipball/174f009ed36379a801109955fc5a71a49fe62dd4", 1707 | "reference": "174f009ed36379a801109955fc5a71a49fe62dd4", 1708 | "shasum": "" 1709 | }, 1710 | "require": { 1711 | "php": ">=5.3.3" 1712 | }, 1713 | "require-dev": { 1714 | "symfony/phpunit-bridge": "~2.7" 1715 | }, 1716 | "type": "library", 1717 | "extra": { 1718 | "branch-alias": { 1719 | "dev-master": "2.6-dev" 1720 | } 1721 | }, 1722 | "autoload": { 1723 | "psr-0": { 1724 | "Symfony\\Component\\Yaml\\": "" 1725 | } 1726 | }, 1727 | "notification-url": "https://packagist.org/downloads/", 1728 | "license": [ 1729 | "MIT" 1730 | ], 1731 | "authors": [ 1732 | { 1733 | "name": "Symfony Community", 1734 | "homepage": "http://symfony.com/contributors" 1735 | }, 1736 | { 1737 | "name": "Fabien Potencier", 1738 | "email": "fabien@symfony.com" 1739 | } 1740 | ], 1741 | "description": "Symfony Yaml Component", 1742 | "homepage": "http://symfony.com", 1743 | "time": "2015-03-30 15:54:10" 1744 | } 1745 | ], 1746 | "aliases": [], 1747 | "minimum-stability": "stable", 1748 | "stability-flags": [], 1749 | "prefer-stable": false, 1750 | "prefer-lowest": false, 1751 | "platform": [], 1752 | "platform-dev": [] 1753 | } 1754 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | tests 9 | 10 | 11 | 12 | 13 | 14 | src 15 | 16 | 17 | 18 | 19 | 20 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/AutoHugger.php: -------------------------------------------------------------------------------- 1 | hug($friend); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/CanGroupHug.php: -------------------------------------------------------------------------------- 1 | groupHugInitiated) { 28 | /** 29 | * We're mid way through a group hug. Don't initiate a new group hug with the same group 30 | */ 31 | return; 32 | } 33 | 34 | $this->groupHugInitiated = true; 35 | 36 | $huggablesAndSelf = array_merge($huggables, [$this]); 37 | 38 | foreach ($huggables as $huggable) { 39 | if (!$huggable instanceof Huggable) { 40 | throw new \InvalidArgumentException("Can only hug Huggables"); 41 | } 42 | 43 | if ($huggable instanceof GroupHuggable) { 44 | /** 45 | * Instruct $huggable to join in the whole group hug, instead of just us. 46 | */ 47 | $huggable->groupHug(array_filter($huggablesAndSelf, function($h) use ($huggable) { 48 | // don't get $huggable to hug itself 49 | return $h !== $huggable; 50 | })); 51 | } else { 52 | /** 53 | * We have the ability to group hug but $huggable does not. 54 | */ 55 | $this->hug($huggable); 56 | } 57 | } 58 | 59 | $this->groupHugInitiated = false; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/GroupHuggable.php: -------------------------------------------------------------------------------- 1 | currentlyHuggingFriendList = new \SplObjectStorage(); 24 | $this->minHugsRequired = $minHugsRequired; 25 | } 26 | 27 | /** 28 | * Hugs this object. 29 | * 30 | * All hugs are mutual. An object that is hugged MUST in turn hug the other 31 | * object back by calling hug() on the first parameter. All objects MUST 32 | * implement a mechanism to prevent an infinite loop of hugging. 33 | * 34 | * @param Huggable $friend 35 | * The object that is hugging this object. 36 | */ 37 | public function hug(Huggable $friend) 38 | { 39 | if ($friend === $this) { 40 | // weird 41 | throw new \Exception('Should not attempt to hug self'); 42 | } 43 | 44 | if ($this->currentlyHuggingFriendList->contains($friend)) { 45 | // we're already trying to hug $friend 46 | // don't initiate another hug loop 47 | return; 48 | } 49 | 50 | $this->currentlyHuggingFriendList->attach($friend); 51 | 52 | $hugBacksExpected = $this->minHugsRequired; 53 | while ($hugBacksExpected--) { 54 | $friend->hug($this); 55 | } 56 | 57 | $this->currentlyHuggingFriendList->detach($friend); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /tdd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | while true; do inotifywait -r src/ tests/; clear; composer dumpautoload; ./vendor/bin/phpunit; date; done 4 | -------------------------------------------------------------------------------- /tests/HuggerTest.php: -------------------------------------------------------------------------------- 1 | prophesize(Huggable::class); 14 | $mock->hug($hugger)->shouldBeCalled(); 15 | 16 | $hugger->hug($mock->reveal()); 17 | } 18 | 19 | public function testTerminatesHugging() 20 | { 21 | $hugger1 = new Hugger(); 22 | $hugger2 = new Hugger(); 23 | 24 | $hugger1->hug($hugger2); 25 | 26 | // passing this test in less than infinite time means it's successful 27 | $this->assertTrue(true); 28 | } 29 | 30 | /** 31 | * @expectedException \Exception 32 | */ 33 | public function testDoesNotHugSelf() 34 | { 35 | $hugger = new Hugger(); 36 | $hugger->hug($hugger); 37 | } 38 | 39 | public function testAllFriendsAreHuggedBack() 40 | { 41 | $hugger = new Hugger(); 42 | 43 | $mock1 = $this->prophesize(Huggable::class); 44 | $mock1->hug($hugger)->shouldBeCalled(); 45 | 46 | $mock2 = $this->prophesize(Huggable::class); 47 | $mock2->hug($hugger)->shouldBeCalled(); 48 | 49 | $hugger->hug($mock1->reveal()); 50 | $hugger->hug($mock2->reveal()); 51 | } 52 | 53 | public function testGroupHug() 54 | { 55 | $hugger = new Hugger(); 56 | 57 | $mock1 = $this->prophesize(Huggable::class); 58 | $mock1->hug($hugger)->shouldBeCalled(); 59 | 60 | $mock2 = $this->prophesize(Huggable::class); 61 | $mock2->hug($hugger)->shouldBeCalled(); 62 | 63 | $friends = [$mock1->reveal(), $mock2->reveal()]; 64 | 65 | $hugger->groupHug($friends); 66 | } 67 | 68 | public function testEpicGroupHug() 69 | { 70 | $hugger1 = new Hugger(10); 71 | $hugger2 = new Hugger(10); 72 | $hugger3 = new Hugger(10); 73 | $hugger4 = new Hugger(10); 74 | $hugger5 = new Hugger(10); 75 | 76 | $hugger1->groupHug([$hugger2, $hugger3, $hugger4, $hugger5]); 77 | 78 | $this->assertTrue(true); 79 | } 80 | } 81 | --------------------------------------------------------------------------------