├── .gitignore ├── .scrutinizer.yml ├── .sonarcloud.properties ├── .travis.yml ├── CHANGELOG.md ├── README.md ├── composer.json ├── composer.lock ├── phpunit.xml ├── src ├── ArrayTrait.php ├── HydratableTrait.php ├── PropertyTrait.php └── ReflectionTrait.php └── tests ├── ArrayTraitTest.php ├── HydratableTraitTest.php ├── PropertyTraitTest.php ├── ReflectionTraitTest.php └── stubs ├── ArrayTraitClass.php ├── EmptyHydratable.php └── HydratableTraitStub.php /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | /logs/ 3 | -------------------------------------------------------------------------------- /.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | build: 2 | environment: 3 | php: 4 | version: 5.6 5 | ini: 6 | 'date.timezone': 'Europe/amsterdam' -------------------------------------------------------------------------------- /.sonarcloud.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | sudo: false 3 | before_install: 4 | - if [[ "$TRAVIS_PHP_VERSION" != "5.6" ]]; then phpenv config-rm xdebug.ini; fi 5 | - composer self-update 6 | install: 7 | - composer update $COMPOSER_FLAGS 8 | matrix: 9 | include: 10 | - php: 5.6 11 | script: vendor/bin/phpunit --coverage-clover build/logs/clover.xml 12 | before_script: 13 | - mkdir -p build/logs 14 | after_script: 15 | - travis_retry php vendor/bin/coveralls -v 16 | - php: 7.0 17 | fast_finish: true 18 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | This project adheres to [Semantic Versioning](http://semver.org/). 4 | 5 | ## v1.0.0 6 | ### Added 7 | - HydratableTrait trait `Pbxg33k\Traits\HydratableTrait` 8 | - ReflectionTrait trait `Pbxg33k\Traits\ReflectionTrait` 9 | - PropertyTrait trait `Pbxg33k\Traits\PropertyTrait` -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Latest Stable Version](https://poser.pugx.org/pbxg33k/pbxg33k-traits/v/stable)](https://packagist.org/packages/pbxg33k/pbxg33k-traits) [![Total Downloads](https://poser.pugx.org/pbxg33k/pbxg33k-traits/downloads)](https://packagist.org/packages/pbxg33k/pbxg33k-traits) [![Latest Unstable Version](https://poser.pugx.org/pbxg33k/pbxg33k-traits/v/unstable)](https://packagist.org/packages/pbxg33k/pbxg33k-traits) [![License](https://poser.pugx.org/pbxg33k/pbxg33k-traits/license)](https://packagist.org/packages/pbxg33k/pbxg33k-traits) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/PBXg33k/php-traits/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PBXg33k/php-traits/?branch=master) [![Coverage Status](https://coveralls.io/repos/github/PBXg33k/php-traits/badge.svg)](https://coveralls.io/github/PBXg33k/php-traits) 2 | 3 | # PBXg33k's PHP Traits 4 | 5 | This repository is a collection of traits to make life with PHP easier 6 | 7 | ## Installation 8 | 9 | Add the package-skeleton package to your `composer.json` file. 10 | 11 | ``` json 12 | { 13 | "require": { 14 | "pbxg33k/pbxg33k-traits": "1.0.*" 15 | } 16 | } 17 | ``` 18 | 19 | Or via the command line in the root of your project's installation. 20 | 21 | ``` bash 22 | $ composer require "pbxg33k/pbxg33k-traits*" 23 | ``` 24 | 25 | ## Traits 26 | 27 | 28 | - **HydratableTrait** Allows you to easily hydrate classes from arrays. An example is importing data from external APIs 29 | - **ReflectionTrait** Allows you to do extra things with Reflection (ie: get property class from @var block) 30 | - **PropertyTrait** Set property values without worrying about property visibility or setters 31 | 32 | ## Usage 33 | Click [here](http://php.net/manual/en/language.oop5.traits.php) to read about using traits on PHP's own manual. 34 | 35 | ### HydratableTrait ### 36 | ```php 37 | class Foo 38 | { 39 | use Pbxg33k\Traits\HydratableTrait; 40 | // Rest of your class 41 | 42 | // Example property, imagine it has proper getter/setter 43 | protected $randomProperty; 44 | } 45 | 46 | // Somewhere else in code 47 | $foo = new Foo(); 48 | $foo->hydrateClass(['randomProperty' => 'value']); 49 | 50 | var_dump($foo->getRandomProperty()); // "value" 51 | ``` 52 | 53 | HydratableTrait trait allows you to hydrate your class properties easily by passing an array to hydrateClass(). 54 | This trait will automagically assign matching keys to properties and instantiate supported classes. 55 | 56 | 57 | ### ReflectionTrait ### 58 | 59 | ## Contributing 60 | 61 | 1. Fork it! 62 | 2. Create your feature branch: `git checkout -b my-new-feature` 63 | 3. Commit your changes: `git commit -am 'Add some feature'` 64 | 4. Push to the branch: `git push origin my-new-feature` 65 | 5. Submit a pull request 66 | 67 | ## Changelog 68 | 69 | Please see [CHANGELOG.md](CHANGELOG.md) 70 | 71 | 72 | ## License 73 | 74 | The MIT License (MIT) 75 | Copyright (c) 2016 Oguzhan Uysal. 76 | 77 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 78 | 79 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 80 | 81 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 82 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pbxg33k/pbxg33k-traits", 3 | "description": "A collection of traits to make life with PHP easier", 4 | "type": "library", 5 | "require-dev": { 6 | "phpunit/phpunit": "^5.3", 7 | "crada/php-apidoc": "^1.3", 8 | "phpmd/phpmd": "^2.4", 9 | "satooshi/php-coveralls": "<1.0" 10 | }, 11 | "license": "MIT", 12 | "authors": [ 13 | { 14 | "name": "Oguzhan Uysal", 15 | "email": "development@oguzhanuysal.eu" 16 | } 17 | ], 18 | "autoload": { 19 | "psr-4": { 20 | "Pbxg33k\\Traits\\": "src/" 21 | } 22 | }, 23 | "require": {} 24 | } 25 | -------------------------------------------------------------------------------- /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": "9467b59863e607713a7cfb1ea843c17b", 8 | "content-hash": "c0186e4195aac660a5f9ae70a52d209a", 9 | "packages": [], 10 | "packages-dev": [ 11 | { 12 | "name": "crada/php-apidoc", 13 | "version": "1.3.5", 14 | "target-dir": "Crada/Apidoc", 15 | "source": { 16 | "type": "git", 17 | "url": "https://github.com/calinrada/php-apidoc.git", 18 | "reference": "e41e4884ac625009bfbb80544d433faaf1a2549a" 19 | }, 20 | "dist": { 21 | "type": "zip", 22 | "url": "https://api.github.com/repos/calinrada/php-apidoc/zipball/e41e4884ac625009bfbb80544d433faaf1a2549a", 23 | "reference": "e41e4884ac625009bfbb80544d433faaf1a2549a", 24 | "shasum": "" 25 | }, 26 | "require": { 27 | "php": ">=5.3.2" 28 | }, 29 | "type": "library", 30 | "extra": { 31 | "branch-alias": { 32 | "dev-master": "1.3-dev" 33 | } 34 | }, 35 | "autoload": { 36 | "psr-0": { 37 | "Crada": "" 38 | } 39 | }, 40 | "notification-url": "https://packagist.org/downloads/", 41 | "license": [ 42 | "MIT" 43 | ], 44 | "authors": [ 45 | { 46 | "name": "Calin Rada", 47 | "email": "rada.calin@gmail.com" 48 | }, 49 | { 50 | "name": "Borja Santos-Diez", 51 | "email": "borja@santosdiez.es" 52 | }, 53 | { 54 | "name": "Kevin Saliou", 55 | "email": "kevin@saliou.name" 56 | } 57 | ], 58 | "description": "Generate documentation for php API based application. No dependency. No framework required.", 59 | "homepage": "https://github.com/calinrada/php-apidoc", 60 | "keywords": [ 61 | "api", 62 | "documentation", 63 | "generator", 64 | "php" 65 | ], 66 | "time": "2015-02-03 17:14:45" 67 | }, 68 | { 69 | "name": "doctrine/instantiator", 70 | "version": "1.0.5", 71 | "source": { 72 | "type": "git", 73 | "url": "https://github.com/doctrine/instantiator.git", 74 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" 75 | }, 76 | "dist": { 77 | "type": "zip", 78 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", 79 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", 80 | "shasum": "" 81 | }, 82 | "require": { 83 | "php": ">=5.3,<8.0-DEV" 84 | }, 85 | "require-dev": { 86 | "athletic/athletic": "~0.1.8", 87 | "ext-pdo": "*", 88 | "ext-phar": "*", 89 | "phpunit/phpunit": "~4.0", 90 | "squizlabs/php_codesniffer": "~2.0" 91 | }, 92 | "type": "library", 93 | "extra": { 94 | "branch-alias": { 95 | "dev-master": "1.0.x-dev" 96 | } 97 | }, 98 | "autoload": { 99 | "psr-4": { 100 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 101 | } 102 | }, 103 | "notification-url": "https://packagist.org/downloads/", 104 | "license": [ 105 | "MIT" 106 | ], 107 | "authors": [ 108 | { 109 | "name": "Marco Pivetta", 110 | "email": "ocramius@gmail.com", 111 | "homepage": "http://ocramius.github.com/" 112 | } 113 | ], 114 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 115 | "homepage": "https://github.com/doctrine/instantiator", 116 | "keywords": [ 117 | "constructor", 118 | "instantiate" 119 | ], 120 | "time": "2015-06-14 21:17:01" 121 | }, 122 | { 123 | "name": "guzzle/guzzle", 124 | "version": "v3.9.3", 125 | "source": { 126 | "type": "git", 127 | "url": "https://github.com/guzzle/guzzle3.git", 128 | "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" 129 | }, 130 | "dist": { 131 | "type": "zip", 132 | "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", 133 | "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", 134 | "shasum": "" 135 | }, 136 | "require": { 137 | "ext-curl": "*", 138 | "php": ">=5.3.3", 139 | "symfony/event-dispatcher": "~2.1" 140 | }, 141 | "replace": { 142 | "guzzle/batch": "self.version", 143 | "guzzle/cache": "self.version", 144 | "guzzle/common": "self.version", 145 | "guzzle/http": "self.version", 146 | "guzzle/inflection": "self.version", 147 | "guzzle/iterator": "self.version", 148 | "guzzle/log": "self.version", 149 | "guzzle/parser": "self.version", 150 | "guzzle/plugin": "self.version", 151 | "guzzle/plugin-async": "self.version", 152 | "guzzle/plugin-backoff": "self.version", 153 | "guzzle/plugin-cache": "self.version", 154 | "guzzle/plugin-cookie": "self.version", 155 | "guzzle/plugin-curlauth": "self.version", 156 | "guzzle/plugin-error-response": "self.version", 157 | "guzzle/plugin-history": "self.version", 158 | "guzzle/plugin-log": "self.version", 159 | "guzzle/plugin-md5": "self.version", 160 | "guzzle/plugin-mock": "self.version", 161 | "guzzle/plugin-oauth": "self.version", 162 | "guzzle/service": "self.version", 163 | "guzzle/stream": "self.version" 164 | }, 165 | "require-dev": { 166 | "doctrine/cache": "~1.3", 167 | "monolog/monolog": "~1.0", 168 | "phpunit/phpunit": "3.7.*", 169 | "psr/log": "~1.0", 170 | "symfony/class-loader": "~2.1", 171 | "zendframework/zend-cache": "2.*,<2.3", 172 | "zendframework/zend-log": "2.*,<2.3" 173 | }, 174 | "suggest": { 175 | "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." 176 | }, 177 | "type": "library", 178 | "extra": { 179 | "branch-alias": { 180 | "dev-master": "3.9-dev" 181 | } 182 | }, 183 | "autoload": { 184 | "psr-0": { 185 | "Guzzle": "src/", 186 | "Guzzle\\Tests": "tests/" 187 | } 188 | }, 189 | "notification-url": "https://packagist.org/downloads/", 190 | "license": [ 191 | "MIT" 192 | ], 193 | "authors": [ 194 | { 195 | "name": "Michael Dowling", 196 | "email": "mtdowling@gmail.com", 197 | "homepage": "https://github.com/mtdowling" 198 | }, 199 | { 200 | "name": "Guzzle Community", 201 | "homepage": "https://github.com/guzzle/guzzle/contributors" 202 | } 203 | ], 204 | "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", 205 | "homepage": "http://guzzlephp.org/", 206 | "keywords": [ 207 | "client", 208 | "curl", 209 | "framework", 210 | "http", 211 | "http client", 212 | "rest", 213 | "web service" 214 | ], 215 | "abandoned": "guzzlehttp/guzzle", 216 | "time": "2015-03-18 18:23:50" 217 | }, 218 | { 219 | "name": "myclabs/deep-copy", 220 | "version": "1.6.0", 221 | "source": { 222 | "type": "git", 223 | "url": "https://github.com/myclabs/DeepCopy.git", 224 | "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" 225 | }, 226 | "dist": { 227 | "type": "zip", 228 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", 229 | "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", 230 | "shasum": "" 231 | }, 232 | "require": { 233 | "php": ">=5.4.0" 234 | }, 235 | "require-dev": { 236 | "doctrine/collections": "1.*", 237 | "phpunit/phpunit": "~4.1" 238 | }, 239 | "type": "library", 240 | "autoload": { 241 | "psr-4": { 242 | "DeepCopy\\": "src/DeepCopy/" 243 | } 244 | }, 245 | "notification-url": "https://packagist.org/downloads/", 246 | "license": [ 247 | "MIT" 248 | ], 249 | "description": "Create deep copies (clones) of your objects", 250 | "homepage": "https://github.com/myclabs/DeepCopy", 251 | "keywords": [ 252 | "clone", 253 | "copy", 254 | "duplicate", 255 | "object", 256 | "object graph" 257 | ], 258 | "time": "2017-01-26 22:05:40" 259 | }, 260 | { 261 | "name": "pdepend/pdepend", 262 | "version": "2.5.0", 263 | "source": { 264 | "type": "git", 265 | "url": "https://github.com/pdepend/pdepend.git", 266 | "reference": "0c50874333149c0dad5a2877801aed148f2767ff" 267 | }, 268 | "dist": { 269 | "type": "zip", 270 | "url": "https://api.github.com/repos/pdepend/pdepend/zipball/0c50874333149c0dad5a2877801aed148f2767ff", 271 | "reference": "0c50874333149c0dad5a2877801aed148f2767ff", 272 | "shasum": "" 273 | }, 274 | "require": { 275 | "php": ">=5.3.7", 276 | "symfony/config": "^2.3.0|^3", 277 | "symfony/dependency-injection": "^2.3.0|^3", 278 | "symfony/filesystem": "^2.3.0|^3" 279 | }, 280 | "require-dev": { 281 | "phpunit/phpunit": "^4.4.0,<4.8", 282 | "squizlabs/php_codesniffer": "^2.0.0" 283 | }, 284 | "bin": [ 285 | "src/bin/pdepend" 286 | ], 287 | "type": "library", 288 | "autoload": { 289 | "psr-4": { 290 | "PDepend\\": "src/main/php/PDepend" 291 | } 292 | }, 293 | "notification-url": "https://packagist.org/downloads/", 294 | "license": [ 295 | "BSD-3-Clause" 296 | ], 297 | "description": "Official version of pdepend to be handled with Composer", 298 | "time": "2017-01-19 14:23:36" 299 | }, 300 | { 301 | "name": "phpdocumentor/reflection-common", 302 | "version": "1.0", 303 | "source": { 304 | "type": "git", 305 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git", 306 | "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" 307 | }, 308 | "dist": { 309 | "type": "zip", 310 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", 311 | "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", 312 | "shasum": "" 313 | }, 314 | "require": { 315 | "php": ">=5.5" 316 | }, 317 | "require-dev": { 318 | "phpunit/phpunit": "^4.6" 319 | }, 320 | "type": "library", 321 | "extra": { 322 | "branch-alias": { 323 | "dev-master": "1.0.x-dev" 324 | } 325 | }, 326 | "autoload": { 327 | "psr-4": { 328 | "phpDocumentor\\Reflection\\": [ 329 | "src" 330 | ] 331 | } 332 | }, 333 | "notification-url": "https://packagist.org/downloads/", 334 | "license": [ 335 | "MIT" 336 | ], 337 | "authors": [ 338 | { 339 | "name": "Jaap van Otterdijk", 340 | "email": "opensource@ijaap.nl" 341 | } 342 | ], 343 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure", 344 | "homepage": "http://www.phpdoc.org", 345 | "keywords": [ 346 | "FQSEN", 347 | "phpDocumentor", 348 | "phpdoc", 349 | "reflection", 350 | "static analysis" 351 | ], 352 | "time": "2015-12-27 11:43:31" 353 | }, 354 | { 355 | "name": "phpdocumentor/reflection-docblock", 356 | "version": "3.1.1", 357 | "source": { 358 | "type": "git", 359 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 360 | "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" 361 | }, 362 | "dist": { 363 | "type": "zip", 364 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", 365 | "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", 366 | "shasum": "" 367 | }, 368 | "require": { 369 | "php": ">=5.5", 370 | "phpdocumentor/reflection-common": "^1.0@dev", 371 | "phpdocumentor/type-resolver": "^0.2.0", 372 | "webmozart/assert": "^1.0" 373 | }, 374 | "require-dev": { 375 | "mockery/mockery": "^0.9.4", 376 | "phpunit/phpunit": "^4.4" 377 | }, 378 | "type": "library", 379 | "autoload": { 380 | "psr-4": { 381 | "phpDocumentor\\Reflection\\": [ 382 | "src/" 383 | ] 384 | } 385 | }, 386 | "notification-url": "https://packagist.org/downloads/", 387 | "license": [ 388 | "MIT" 389 | ], 390 | "authors": [ 391 | { 392 | "name": "Mike van Riel", 393 | "email": "me@mikevanriel.com" 394 | } 395 | ], 396 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", 397 | "time": "2016-09-30 07:12:33" 398 | }, 399 | { 400 | "name": "phpdocumentor/type-resolver", 401 | "version": "0.2.1", 402 | "source": { 403 | "type": "git", 404 | "url": "https://github.com/phpDocumentor/TypeResolver.git", 405 | "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" 406 | }, 407 | "dist": { 408 | "type": "zip", 409 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", 410 | "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", 411 | "shasum": "" 412 | }, 413 | "require": { 414 | "php": ">=5.5", 415 | "phpdocumentor/reflection-common": "^1.0" 416 | }, 417 | "require-dev": { 418 | "mockery/mockery": "^0.9.4", 419 | "phpunit/phpunit": "^5.2||^4.8.24" 420 | }, 421 | "type": "library", 422 | "extra": { 423 | "branch-alias": { 424 | "dev-master": "1.0.x-dev" 425 | } 426 | }, 427 | "autoload": { 428 | "psr-4": { 429 | "phpDocumentor\\Reflection\\": [ 430 | "src/" 431 | ] 432 | } 433 | }, 434 | "notification-url": "https://packagist.org/downloads/", 435 | "license": [ 436 | "MIT" 437 | ], 438 | "authors": [ 439 | { 440 | "name": "Mike van Riel", 441 | "email": "me@mikevanriel.com" 442 | } 443 | ], 444 | "time": "2016-11-25 06:54:22" 445 | }, 446 | { 447 | "name": "phpmd/phpmd", 448 | "version": "2.6.0", 449 | "source": { 450 | "type": "git", 451 | "url": "https://github.com/phpmd/phpmd.git", 452 | "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374" 453 | }, 454 | "dist": { 455 | "type": "zip", 456 | "url": "https://api.github.com/repos/phpmd/phpmd/zipball/4e9924b2c157a3eb64395460fcf56b31badc8374", 457 | "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374", 458 | "shasum": "" 459 | }, 460 | "require": { 461 | "ext-xml": "*", 462 | "pdepend/pdepend": "^2.5", 463 | "php": ">=5.3.9" 464 | }, 465 | "require-dev": { 466 | "phpunit/phpunit": "^4.0", 467 | "squizlabs/php_codesniffer": "^2.0" 468 | }, 469 | "bin": [ 470 | "src/bin/phpmd" 471 | ], 472 | "type": "project", 473 | "autoload": { 474 | "psr-0": { 475 | "PHPMD\\": "src/main/php" 476 | } 477 | }, 478 | "notification-url": "https://packagist.org/downloads/", 479 | "license": [ 480 | "BSD-3-Clause" 481 | ], 482 | "authors": [ 483 | { 484 | "name": "Manuel Pichler", 485 | "email": "github@manuel-pichler.de", 486 | "homepage": "https://github.com/manuelpichler", 487 | "role": "Project Founder" 488 | }, 489 | { 490 | "name": "Other contributors", 491 | "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", 492 | "role": "Contributors" 493 | }, 494 | { 495 | "name": "Marc Würth", 496 | "email": "ravage@bluewin.ch", 497 | "homepage": "https://github.com/ravage84", 498 | "role": "Project Maintainer" 499 | } 500 | ], 501 | "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", 502 | "homepage": "http://phpmd.org/", 503 | "keywords": [ 504 | "mess detection", 505 | "mess detector", 506 | "pdepend", 507 | "phpmd", 508 | "pmd" 509 | ], 510 | "time": "2017-01-20 14:41:10" 511 | }, 512 | { 513 | "name": "phpspec/prophecy", 514 | "version": "v1.6.2", 515 | "source": { 516 | "type": "git", 517 | "url": "https://github.com/phpspec/prophecy.git", 518 | "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" 519 | }, 520 | "dist": { 521 | "type": "zip", 522 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", 523 | "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", 524 | "shasum": "" 525 | }, 526 | "require": { 527 | "doctrine/instantiator": "^1.0.2", 528 | "php": "^5.3|^7.0", 529 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", 530 | "sebastian/comparator": "^1.1", 531 | "sebastian/recursion-context": "^1.0|^2.0" 532 | }, 533 | "require-dev": { 534 | "phpspec/phpspec": "^2.0", 535 | "phpunit/phpunit": "^4.8 || ^5.6.5" 536 | }, 537 | "type": "library", 538 | "extra": { 539 | "branch-alias": { 540 | "dev-master": "1.6.x-dev" 541 | } 542 | }, 543 | "autoload": { 544 | "psr-0": { 545 | "Prophecy\\": "src/" 546 | } 547 | }, 548 | "notification-url": "https://packagist.org/downloads/", 549 | "license": [ 550 | "MIT" 551 | ], 552 | "authors": [ 553 | { 554 | "name": "Konstantin Kudryashov", 555 | "email": "ever.zet@gmail.com", 556 | "homepage": "http://everzet.com" 557 | }, 558 | { 559 | "name": "Marcello Duarte", 560 | "email": "marcello.duarte@gmail.com" 561 | } 562 | ], 563 | "description": "Highly opinionated mocking framework for PHP 5.3+", 564 | "homepage": "https://github.com/phpspec/prophecy", 565 | "keywords": [ 566 | "Double", 567 | "Dummy", 568 | "fake", 569 | "mock", 570 | "spy", 571 | "stub" 572 | ], 573 | "time": "2016-11-21 14:58:47" 574 | }, 575 | { 576 | "name": "phpunit/php-code-coverage", 577 | "version": "4.0.5", 578 | "source": { 579 | "type": "git", 580 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 581 | "reference": "c19cfc7cbb0e9338d8c469c7eedecc2a428b0971" 582 | }, 583 | "dist": { 584 | "type": "zip", 585 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c19cfc7cbb0e9338d8c469c7eedecc2a428b0971", 586 | "reference": "c19cfc7cbb0e9338d8c469c7eedecc2a428b0971", 587 | "shasum": "" 588 | }, 589 | "require": { 590 | "php": "^5.6 || ^7.0", 591 | "phpunit/php-file-iterator": "~1.3", 592 | "phpunit/php-text-template": "~1.2", 593 | "phpunit/php-token-stream": "^1.4.2", 594 | "sebastian/code-unit-reverse-lookup": "~1.0", 595 | "sebastian/environment": "^1.3.2 || ^2.0", 596 | "sebastian/version": "~1.0|~2.0" 597 | }, 598 | "require-dev": { 599 | "ext-xdebug": ">=2.1.4", 600 | "phpunit/phpunit": "^5.4" 601 | }, 602 | "suggest": { 603 | "ext-dom": "*", 604 | "ext-xdebug": ">=2.4.0", 605 | "ext-xmlwriter": "*" 606 | }, 607 | "type": "library", 608 | "extra": { 609 | "branch-alias": { 610 | "dev-master": "4.0.x-dev" 611 | } 612 | }, 613 | "autoload": { 614 | "classmap": [ 615 | "src/" 616 | ] 617 | }, 618 | "notification-url": "https://packagist.org/downloads/", 619 | "license": [ 620 | "BSD-3-Clause" 621 | ], 622 | "authors": [ 623 | { 624 | "name": "Sebastian Bergmann", 625 | "email": "sb@sebastian-bergmann.de", 626 | "role": "lead" 627 | } 628 | ], 629 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 630 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 631 | "keywords": [ 632 | "coverage", 633 | "testing", 634 | "xunit" 635 | ], 636 | "time": "2017-01-20 15:06:43" 637 | }, 638 | { 639 | "name": "phpunit/php-file-iterator", 640 | "version": "1.4.2", 641 | "source": { 642 | "type": "git", 643 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 644 | "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" 645 | }, 646 | "dist": { 647 | "type": "zip", 648 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", 649 | "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", 650 | "shasum": "" 651 | }, 652 | "require": { 653 | "php": ">=5.3.3" 654 | }, 655 | "type": "library", 656 | "extra": { 657 | "branch-alias": { 658 | "dev-master": "1.4.x-dev" 659 | } 660 | }, 661 | "autoload": { 662 | "classmap": [ 663 | "src/" 664 | ] 665 | }, 666 | "notification-url": "https://packagist.org/downloads/", 667 | "license": [ 668 | "BSD-3-Clause" 669 | ], 670 | "authors": [ 671 | { 672 | "name": "Sebastian Bergmann", 673 | "email": "sb@sebastian-bergmann.de", 674 | "role": "lead" 675 | } 676 | ], 677 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 678 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 679 | "keywords": [ 680 | "filesystem", 681 | "iterator" 682 | ], 683 | "time": "2016-10-03 07:40:28" 684 | }, 685 | { 686 | "name": "phpunit/php-text-template", 687 | "version": "1.2.1", 688 | "source": { 689 | "type": "git", 690 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 691 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 692 | }, 693 | "dist": { 694 | "type": "zip", 695 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 696 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 697 | "shasum": "" 698 | }, 699 | "require": { 700 | "php": ">=5.3.3" 701 | }, 702 | "type": "library", 703 | "autoload": { 704 | "classmap": [ 705 | "src/" 706 | ] 707 | }, 708 | "notification-url": "https://packagist.org/downloads/", 709 | "license": [ 710 | "BSD-3-Clause" 711 | ], 712 | "authors": [ 713 | { 714 | "name": "Sebastian Bergmann", 715 | "email": "sebastian@phpunit.de", 716 | "role": "lead" 717 | } 718 | ], 719 | "description": "Simple template engine.", 720 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 721 | "keywords": [ 722 | "template" 723 | ], 724 | "time": "2015-06-21 13:50:34" 725 | }, 726 | { 727 | "name": "phpunit/php-timer", 728 | "version": "1.0.8", 729 | "source": { 730 | "type": "git", 731 | "url": "https://github.com/sebastianbergmann/php-timer.git", 732 | "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" 733 | }, 734 | "dist": { 735 | "type": "zip", 736 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", 737 | "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", 738 | "shasum": "" 739 | }, 740 | "require": { 741 | "php": ">=5.3.3" 742 | }, 743 | "require-dev": { 744 | "phpunit/phpunit": "~4|~5" 745 | }, 746 | "type": "library", 747 | "autoload": { 748 | "classmap": [ 749 | "src/" 750 | ] 751 | }, 752 | "notification-url": "https://packagist.org/downloads/", 753 | "license": [ 754 | "BSD-3-Clause" 755 | ], 756 | "authors": [ 757 | { 758 | "name": "Sebastian Bergmann", 759 | "email": "sb@sebastian-bergmann.de", 760 | "role": "lead" 761 | } 762 | ], 763 | "description": "Utility class for timing", 764 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 765 | "keywords": [ 766 | "timer" 767 | ], 768 | "time": "2016-05-12 18:03:57" 769 | }, 770 | { 771 | "name": "phpunit/php-token-stream", 772 | "version": "1.4.9", 773 | "source": { 774 | "type": "git", 775 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 776 | "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" 777 | }, 778 | "dist": { 779 | "type": "zip", 780 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", 781 | "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", 782 | "shasum": "" 783 | }, 784 | "require": { 785 | "ext-tokenizer": "*", 786 | "php": ">=5.3.3" 787 | }, 788 | "require-dev": { 789 | "phpunit/phpunit": "~4.2" 790 | }, 791 | "type": "library", 792 | "extra": { 793 | "branch-alias": { 794 | "dev-master": "1.4-dev" 795 | } 796 | }, 797 | "autoload": { 798 | "classmap": [ 799 | "src/" 800 | ] 801 | }, 802 | "notification-url": "https://packagist.org/downloads/", 803 | "license": [ 804 | "BSD-3-Clause" 805 | ], 806 | "authors": [ 807 | { 808 | "name": "Sebastian Bergmann", 809 | "email": "sebastian@phpunit.de" 810 | } 811 | ], 812 | "description": "Wrapper around PHP's tokenizer extension.", 813 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 814 | "keywords": [ 815 | "tokenizer" 816 | ], 817 | "time": "2016-11-15 14:06:22" 818 | }, 819 | { 820 | "name": "phpunit/phpunit", 821 | "version": "5.7.9", 822 | "source": { 823 | "type": "git", 824 | "url": "https://github.com/sebastianbergmann/phpunit.git", 825 | "reference": "69f832b87c731d5cacad7f91948778fe98335fdd" 826 | }, 827 | "dist": { 828 | "type": "zip", 829 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/69f832b87c731d5cacad7f91948778fe98335fdd", 830 | "reference": "69f832b87c731d5cacad7f91948778fe98335fdd", 831 | "shasum": "" 832 | }, 833 | "require": { 834 | "ext-dom": "*", 835 | "ext-json": "*", 836 | "ext-libxml": "*", 837 | "ext-mbstring": "*", 838 | "ext-xml": "*", 839 | "myclabs/deep-copy": "~1.3", 840 | "php": "^5.6 || ^7.0", 841 | "phpspec/prophecy": "^1.6.2", 842 | "phpunit/php-code-coverage": "^4.0.4", 843 | "phpunit/php-file-iterator": "~1.4", 844 | "phpunit/php-text-template": "~1.2", 845 | "phpunit/php-timer": "^1.0.6", 846 | "phpunit/phpunit-mock-objects": "^3.2", 847 | "sebastian/comparator": "~1.2.2", 848 | "sebastian/diff": "~1.2", 849 | "sebastian/environment": "^1.3.4 || ^2.0", 850 | "sebastian/exporter": "~2.0", 851 | "sebastian/global-state": "^1.0 || ^2.0", 852 | "sebastian/object-enumerator": "~2.0", 853 | "sebastian/resource-operations": "~1.0", 854 | "sebastian/version": "~1.0|~2.0", 855 | "symfony/yaml": "~2.1|~3.0" 856 | }, 857 | "conflict": { 858 | "phpdocumentor/reflection-docblock": "3.0.2" 859 | }, 860 | "require-dev": { 861 | "ext-pdo": "*" 862 | }, 863 | "suggest": { 864 | "ext-xdebug": "*", 865 | "phpunit/php-invoker": "~1.1" 866 | }, 867 | "bin": [ 868 | "phpunit" 869 | ], 870 | "type": "library", 871 | "extra": { 872 | "branch-alias": { 873 | "dev-master": "5.7.x-dev" 874 | } 875 | }, 876 | "autoload": { 877 | "classmap": [ 878 | "src/" 879 | ] 880 | }, 881 | "notification-url": "https://packagist.org/downloads/", 882 | "license": [ 883 | "BSD-3-Clause" 884 | ], 885 | "authors": [ 886 | { 887 | "name": "Sebastian Bergmann", 888 | "email": "sebastian@phpunit.de", 889 | "role": "lead" 890 | } 891 | ], 892 | "description": "The PHP Unit Testing framework.", 893 | "homepage": "https://phpunit.de/", 894 | "keywords": [ 895 | "phpunit", 896 | "testing", 897 | "xunit" 898 | ], 899 | "time": "2017-01-28 06:14:33" 900 | }, 901 | { 902 | "name": "phpunit/phpunit-mock-objects", 903 | "version": "3.4.3", 904 | "source": { 905 | "type": "git", 906 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 907 | "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" 908 | }, 909 | "dist": { 910 | "type": "zip", 911 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", 912 | "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", 913 | "shasum": "" 914 | }, 915 | "require": { 916 | "doctrine/instantiator": "^1.0.2", 917 | "php": "^5.6 || ^7.0", 918 | "phpunit/php-text-template": "^1.2", 919 | "sebastian/exporter": "^1.2 || ^2.0" 920 | }, 921 | "conflict": { 922 | "phpunit/phpunit": "<5.4.0" 923 | }, 924 | "require-dev": { 925 | "phpunit/phpunit": "^5.4" 926 | }, 927 | "suggest": { 928 | "ext-soap": "*" 929 | }, 930 | "type": "library", 931 | "extra": { 932 | "branch-alias": { 933 | "dev-master": "3.2.x-dev" 934 | } 935 | }, 936 | "autoload": { 937 | "classmap": [ 938 | "src/" 939 | ] 940 | }, 941 | "notification-url": "https://packagist.org/downloads/", 942 | "license": [ 943 | "BSD-3-Clause" 944 | ], 945 | "authors": [ 946 | { 947 | "name": "Sebastian Bergmann", 948 | "email": "sb@sebastian-bergmann.de", 949 | "role": "lead" 950 | } 951 | ], 952 | "description": "Mock Object library for PHPUnit", 953 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 954 | "keywords": [ 955 | "mock", 956 | "xunit" 957 | ], 958 | "time": "2016-12-08 20:27:08" 959 | }, 960 | { 961 | "name": "psr/log", 962 | "version": "1.0.2", 963 | "source": { 964 | "type": "git", 965 | "url": "https://github.com/php-fig/log.git", 966 | "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" 967 | }, 968 | "dist": { 969 | "type": "zip", 970 | "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", 971 | "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", 972 | "shasum": "" 973 | }, 974 | "require": { 975 | "php": ">=5.3.0" 976 | }, 977 | "type": "library", 978 | "extra": { 979 | "branch-alias": { 980 | "dev-master": "1.0.x-dev" 981 | } 982 | }, 983 | "autoload": { 984 | "psr-4": { 985 | "Psr\\Log\\": "Psr/Log/" 986 | } 987 | }, 988 | "notification-url": "https://packagist.org/downloads/", 989 | "license": [ 990 | "MIT" 991 | ], 992 | "authors": [ 993 | { 994 | "name": "PHP-FIG", 995 | "homepage": "http://www.php-fig.org/" 996 | } 997 | ], 998 | "description": "Common interface for logging libraries", 999 | "homepage": "https://github.com/php-fig/log", 1000 | "keywords": [ 1001 | "log", 1002 | "psr", 1003 | "psr-3" 1004 | ], 1005 | "time": "2016-10-10 12:19:37" 1006 | }, 1007 | { 1008 | "name": "satooshi/php-coveralls", 1009 | "version": "v0.7.1", 1010 | "source": { 1011 | "type": "git", 1012 | "url": "https://github.com/satooshi/php-coveralls.git", 1013 | "reference": "01793ce60f1e259592ac3cb7c3fc183209800127" 1014 | }, 1015 | "dist": { 1016 | "type": "zip", 1017 | "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/01793ce60f1e259592ac3cb7c3fc183209800127", 1018 | "reference": "01793ce60f1e259592ac3cb7c3fc183209800127", 1019 | "shasum": "" 1020 | }, 1021 | "require": { 1022 | "ext-json": "*", 1023 | "ext-simplexml": "*", 1024 | "guzzle/guzzle": "^2.8|^3.0", 1025 | "php": ">=5.3.3", 1026 | "psr/log": "^1.0", 1027 | "symfony/config": "^2.4|^3.0", 1028 | "symfony/console": "^2.1|^3.0", 1029 | "symfony/stopwatch": "^2.2|^3.0", 1030 | "symfony/yaml": "^2.1|^3.0" 1031 | }, 1032 | "suggest": { 1033 | "symfony/http-kernel": "Allows Symfony integration" 1034 | }, 1035 | "bin": [ 1036 | "bin/coveralls" 1037 | ], 1038 | "type": "library", 1039 | "extra": { 1040 | "branch-alias": { 1041 | "dev-master": "0.8-dev" 1042 | } 1043 | }, 1044 | "autoload": { 1045 | "psr-4": { 1046 | "Satooshi\\": "src/Satooshi/" 1047 | } 1048 | }, 1049 | "notification-url": "https://packagist.org/downloads/", 1050 | "license": [ 1051 | "MIT" 1052 | ], 1053 | "authors": [ 1054 | { 1055 | "name": "Kitamura Satoshi", 1056 | "email": "with.no.parachute@gmail.com", 1057 | "homepage": "https://www.facebook.com/satooshi.jp" 1058 | } 1059 | ], 1060 | "description": "PHP client library for Coveralls API", 1061 | "homepage": "https://github.com/satooshi/php-coveralls", 1062 | "keywords": [ 1063 | "ci", 1064 | "coverage", 1065 | "github", 1066 | "test" 1067 | ], 1068 | "time": "2015-12-17 18:04:18" 1069 | }, 1070 | { 1071 | "name": "sebastian/code-unit-reverse-lookup", 1072 | "version": "1.0.0", 1073 | "source": { 1074 | "type": "git", 1075 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 1076 | "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" 1077 | }, 1078 | "dist": { 1079 | "type": "zip", 1080 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", 1081 | "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", 1082 | "shasum": "" 1083 | }, 1084 | "require": { 1085 | "php": ">=5.6" 1086 | }, 1087 | "require-dev": { 1088 | "phpunit/phpunit": "~5" 1089 | }, 1090 | "type": "library", 1091 | "extra": { 1092 | "branch-alias": { 1093 | "dev-master": "1.0.x-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": "Looks up which function or method a line of code belongs to", 1112 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 1113 | "time": "2016-02-13 06:45:14" 1114 | }, 1115 | { 1116 | "name": "sebastian/comparator", 1117 | "version": "1.2.4", 1118 | "source": { 1119 | "type": "git", 1120 | "url": "https://github.com/sebastianbergmann/comparator.git", 1121 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" 1122 | }, 1123 | "dist": { 1124 | "type": "zip", 1125 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", 1126 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", 1127 | "shasum": "" 1128 | }, 1129 | "require": { 1130 | "php": ">=5.3.3", 1131 | "sebastian/diff": "~1.2", 1132 | "sebastian/exporter": "~1.2 || ~2.0" 1133 | }, 1134 | "require-dev": { 1135 | "phpunit/phpunit": "~4.4" 1136 | }, 1137 | "type": "library", 1138 | "extra": { 1139 | "branch-alias": { 1140 | "dev-master": "1.2.x-dev" 1141 | } 1142 | }, 1143 | "autoload": { 1144 | "classmap": [ 1145 | "src/" 1146 | ] 1147 | }, 1148 | "notification-url": "https://packagist.org/downloads/", 1149 | "license": [ 1150 | "BSD-3-Clause" 1151 | ], 1152 | "authors": [ 1153 | { 1154 | "name": "Jeff Welch", 1155 | "email": "whatthejeff@gmail.com" 1156 | }, 1157 | { 1158 | "name": "Volker Dusch", 1159 | "email": "github@wallbash.com" 1160 | }, 1161 | { 1162 | "name": "Bernhard Schussek", 1163 | "email": "bschussek@2bepublished.at" 1164 | }, 1165 | { 1166 | "name": "Sebastian Bergmann", 1167 | "email": "sebastian@phpunit.de" 1168 | } 1169 | ], 1170 | "description": "Provides the functionality to compare PHP values for equality", 1171 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 1172 | "keywords": [ 1173 | "comparator", 1174 | "compare", 1175 | "equality" 1176 | ], 1177 | "time": "2017-01-29 09:50:25" 1178 | }, 1179 | { 1180 | "name": "sebastian/diff", 1181 | "version": "1.4.1", 1182 | "source": { 1183 | "type": "git", 1184 | "url": "https://github.com/sebastianbergmann/diff.git", 1185 | "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" 1186 | }, 1187 | "dist": { 1188 | "type": "zip", 1189 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", 1190 | "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", 1191 | "shasum": "" 1192 | }, 1193 | "require": { 1194 | "php": ">=5.3.3" 1195 | }, 1196 | "require-dev": { 1197 | "phpunit/phpunit": "~4.8" 1198 | }, 1199 | "type": "library", 1200 | "extra": { 1201 | "branch-alias": { 1202 | "dev-master": "1.4-dev" 1203 | } 1204 | }, 1205 | "autoload": { 1206 | "classmap": [ 1207 | "src/" 1208 | ] 1209 | }, 1210 | "notification-url": "https://packagist.org/downloads/", 1211 | "license": [ 1212 | "BSD-3-Clause" 1213 | ], 1214 | "authors": [ 1215 | { 1216 | "name": "Kore Nordmann", 1217 | "email": "mail@kore-nordmann.de" 1218 | }, 1219 | { 1220 | "name": "Sebastian Bergmann", 1221 | "email": "sebastian@phpunit.de" 1222 | } 1223 | ], 1224 | "description": "Diff implementation", 1225 | "homepage": "https://github.com/sebastianbergmann/diff", 1226 | "keywords": [ 1227 | "diff" 1228 | ], 1229 | "time": "2015-12-08 07:14:41" 1230 | }, 1231 | { 1232 | "name": "sebastian/environment", 1233 | "version": "2.0.0", 1234 | "source": { 1235 | "type": "git", 1236 | "url": "https://github.com/sebastianbergmann/environment.git", 1237 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" 1238 | }, 1239 | "dist": { 1240 | "type": "zip", 1241 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", 1242 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", 1243 | "shasum": "" 1244 | }, 1245 | "require": { 1246 | "php": "^5.6 || ^7.0" 1247 | }, 1248 | "require-dev": { 1249 | "phpunit/phpunit": "^5.0" 1250 | }, 1251 | "type": "library", 1252 | "extra": { 1253 | "branch-alias": { 1254 | "dev-master": "2.0.x-dev" 1255 | } 1256 | }, 1257 | "autoload": { 1258 | "classmap": [ 1259 | "src/" 1260 | ] 1261 | }, 1262 | "notification-url": "https://packagist.org/downloads/", 1263 | "license": [ 1264 | "BSD-3-Clause" 1265 | ], 1266 | "authors": [ 1267 | { 1268 | "name": "Sebastian Bergmann", 1269 | "email": "sebastian@phpunit.de" 1270 | } 1271 | ], 1272 | "description": "Provides functionality to handle HHVM/PHP environments", 1273 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1274 | "keywords": [ 1275 | "Xdebug", 1276 | "environment", 1277 | "hhvm" 1278 | ], 1279 | "time": "2016-11-26 07:53:53" 1280 | }, 1281 | { 1282 | "name": "sebastian/exporter", 1283 | "version": "2.0.0", 1284 | "source": { 1285 | "type": "git", 1286 | "url": "https://github.com/sebastianbergmann/exporter.git", 1287 | "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" 1288 | }, 1289 | "dist": { 1290 | "type": "zip", 1291 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", 1292 | "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", 1293 | "shasum": "" 1294 | }, 1295 | "require": { 1296 | "php": ">=5.3.3", 1297 | "sebastian/recursion-context": "~2.0" 1298 | }, 1299 | "require-dev": { 1300 | "ext-mbstring": "*", 1301 | "phpunit/phpunit": "~4.4" 1302 | }, 1303 | "type": "library", 1304 | "extra": { 1305 | "branch-alias": { 1306 | "dev-master": "2.0.x-dev" 1307 | } 1308 | }, 1309 | "autoload": { 1310 | "classmap": [ 1311 | "src/" 1312 | ] 1313 | }, 1314 | "notification-url": "https://packagist.org/downloads/", 1315 | "license": [ 1316 | "BSD-3-Clause" 1317 | ], 1318 | "authors": [ 1319 | { 1320 | "name": "Jeff Welch", 1321 | "email": "whatthejeff@gmail.com" 1322 | }, 1323 | { 1324 | "name": "Volker Dusch", 1325 | "email": "github@wallbash.com" 1326 | }, 1327 | { 1328 | "name": "Bernhard Schussek", 1329 | "email": "bschussek@2bepublished.at" 1330 | }, 1331 | { 1332 | "name": "Sebastian Bergmann", 1333 | "email": "sebastian@phpunit.de" 1334 | }, 1335 | { 1336 | "name": "Adam Harvey", 1337 | "email": "aharvey@php.net" 1338 | } 1339 | ], 1340 | "description": "Provides the functionality to export PHP variables for visualization", 1341 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1342 | "keywords": [ 1343 | "export", 1344 | "exporter" 1345 | ], 1346 | "time": "2016-11-19 08:54:04" 1347 | }, 1348 | { 1349 | "name": "sebastian/global-state", 1350 | "version": "1.1.1", 1351 | "source": { 1352 | "type": "git", 1353 | "url": "https://github.com/sebastianbergmann/global-state.git", 1354 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" 1355 | }, 1356 | "dist": { 1357 | "type": "zip", 1358 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", 1359 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", 1360 | "shasum": "" 1361 | }, 1362 | "require": { 1363 | "php": ">=5.3.3" 1364 | }, 1365 | "require-dev": { 1366 | "phpunit/phpunit": "~4.2" 1367 | }, 1368 | "suggest": { 1369 | "ext-uopz": "*" 1370 | }, 1371 | "type": "library", 1372 | "extra": { 1373 | "branch-alias": { 1374 | "dev-master": "1.0-dev" 1375 | } 1376 | }, 1377 | "autoload": { 1378 | "classmap": [ 1379 | "src/" 1380 | ] 1381 | }, 1382 | "notification-url": "https://packagist.org/downloads/", 1383 | "license": [ 1384 | "BSD-3-Clause" 1385 | ], 1386 | "authors": [ 1387 | { 1388 | "name": "Sebastian Bergmann", 1389 | "email": "sebastian@phpunit.de" 1390 | } 1391 | ], 1392 | "description": "Snapshotting of global state", 1393 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1394 | "keywords": [ 1395 | "global state" 1396 | ], 1397 | "time": "2015-10-12 03:26:01" 1398 | }, 1399 | { 1400 | "name": "sebastian/object-enumerator", 1401 | "version": "2.0.0", 1402 | "source": { 1403 | "type": "git", 1404 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1405 | "reference": "96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35" 1406 | }, 1407 | "dist": { 1408 | "type": "zip", 1409 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35", 1410 | "reference": "96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35", 1411 | "shasum": "" 1412 | }, 1413 | "require": { 1414 | "php": ">=5.6", 1415 | "sebastian/recursion-context": "~2.0" 1416 | }, 1417 | "require-dev": { 1418 | "phpunit/phpunit": "~5" 1419 | }, 1420 | "type": "library", 1421 | "extra": { 1422 | "branch-alias": { 1423 | "dev-master": "2.0.x-dev" 1424 | } 1425 | }, 1426 | "autoload": { 1427 | "classmap": [ 1428 | "src/" 1429 | ] 1430 | }, 1431 | "notification-url": "https://packagist.org/downloads/", 1432 | "license": [ 1433 | "BSD-3-Clause" 1434 | ], 1435 | "authors": [ 1436 | { 1437 | "name": "Sebastian Bergmann", 1438 | "email": "sebastian@phpunit.de" 1439 | } 1440 | ], 1441 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1442 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1443 | "time": "2016-11-19 07:35:10" 1444 | }, 1445 | { 1446 | "name": "sebastian/recursion-context", 1447 | "version": "2.0.0", 1448 | "source": { 1449 | "type": "git", 1450 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1451 | "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" 1452 | }, 1453 | "dist": { 1454 | "type": "zip", 1455 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", 1456 | "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", 1457 | "shasum": "" 1458 | }, 1459 | "require": { 1460 | "php": ">=5.3.3" 1461 | }, 1462 | "require-dev": { 1463 | "phpunit/phpunit": "~4.4" 1464 | }, 1465 | "type": "library", 1466 | "extra": { 1467 | "branch-alias": { 1468 | "dev-master": "2.0.x-dev" 1469 | } 1470 | }, 1471 | "autoload": { 1472 | "classmap": [ 1473 | "src/" 1474 | ] 1475 | }, 1476 | "notification-url": "https://packagist.org/downloads/", 1477 | "license": [ 1478 | "BSD-3-Clause" 1479 | ], 1480 | "authors": [ 1481 | { 1482 | "name": "Jeff Welch", 1483 | "email": "whatthejeff@gmail.com" 1484 | }, 1485 | { 1486 | "name": "Sebastian Bergmann", 1487 | "email": "sebastian@phpunit.de" 1488 | }, 1489 | { 1490 | "name": "Adam Harvey", 1491 | "email": "aharvey@php.net" 1492 | } 1493 | ], 1494 | "description": "Provides functionality to recursively process PHP variables", 1495 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1496 | "time": "2016-11-19 07:33:16" 1497 | }, 1498 | { 1499 | "name": "sebastian/resource-operations", 1500 | "version": "1.0.0", 1501 | "source": { 1502 | "type": "git", 1503 | "url": "https://github.com/sebastianbergmann/resource-operations.git", 1504 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" 1505 | }, 1506 | "dist": { 1507 | "type": "zip", 1508 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1509 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1510 | "shasum": "" 1511 | }, 1512 | "require": { 1513 | "php": ">=5.6.0" 1514 | }, 1515 | "type": "library", 1516 | "extra": { 1517 | "branch-alias": { 1518 | "dev-master": "1.0.x-dev" 1519 | } 1520 | }, 1521 | "autoload": { 1522 | "classmap": [ 1523 | "src/" 1524 | ] 1525 | }, 1526 | "notification-url": "https://packagist.org/downloads/", 1527 | "license": [ 1528 | "BSD-3-Clause" 1529 | ], 1530 | "authors": [ 1531 | { 1532 | "name": "Sebastian Bergmann", 1533 | "email": "sebastian@phpunit.de" 1534 | } 1535 | ], 1536 | "description": "Provides a list of PHP built-in functions that operate on resources", 1537 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations", 1538 | "time": "2015-07-28 20:34:47" 1539 | }, 1540 | { 1541 | "name": "sebastian/version", 1542 | "version": "2.0.1", 1543 | "source": { 1544 | "type": "git", 1545 | "url": "https://github.com/sebastianbergmann/version.git", 1546 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" 1547 | }, 1548 | "dist": { 1549 | "type": "zip", 1550 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", 1551 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", 1552 | "shasum": "" 1553 | }, 1554 | "require": { 1555 | "php": ">=5.6" 1556 | }, 1557 | "type": "library", 1558 | "extra": { 1559 | "branch-alias": { 1560 | "dev-master": "2.0.x-dev" 1561 | } 1562 | }, 1563 | "autoload": { 1564 | "classmap": [ 1565 | "src/" 1566 | ] 1567 | }, 1568 | "notification-url": "https://packagist.org/downloads/", 1569 | "license": [ 1570 | "BSD-3-Clause" 1571 | ], 1572 | "authors": [ 1573 | { 1574 | "name": "Sebastian Bergmann", 1575 | "email": "sebastian@phpunit.de", 1576 | "role": "lead" 1577 | } 1578 | ], 1579 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1580 | "homepage": "https://github.com/sebastianbergmann/version", 1581 | "time": "2016-10-03 07:35:21" 1582 | }, 1583 | { 1584 | "name": "symfony/config", 1585 | "version": "v3.2.2", 1586 | "source": { 1587 | "type": "git", 1588 | "url": "https://github.com/symfony/config.git", 1589 | "reference": "c5ea878b5a7f6a01b9a2f182f905831711b9ff3f" 1590 | }, 1591 | "dist": { 1592 | "type": "zip", 1593 | "url": "https://api.github.com/repos/symfony/config/zipball/c5ea878b5a7f6a01b9a2f182f905831711b9ff3f", 1594 | "reference": "c5ea878b5a7f6a01b9a2f182f905831711b9ff3f", 1595 | "shasum": "" 1596 | }, 1597 | "require": { 1598 | "php": ">=5.5.9", 1599 | "symfony/filesystem": "~2.8|~3.0" 1600 | }, 1601 | "require-dev": { 1602 | "symfony/yaml": "~3.0" 1603 | }, 1604 | "suggest": { 1605 | "symfony/yaml": "To use the yaml reference dumper" 1606 | }, 1607 | "type": "library", 1608 | "extra": { 1609 | "branch-alias": { 1610 | "dev-master": "3.2-dev" 1611 | } 1612 | }, 1613 | "autoload": { 1614 | "psr-4": { 1615 | "Symfony\\Component\\Config\\": "" 1616 | }, 1617 | "exclude-from-classmap": [ 1618 | "/Tests/" 1619 | ] 1620 | }, 1621 | "notification-url": "https://packagist.org/downloads/", 1622 | "license": [ 1623 | "MIT" 1624 | ], 1625 | "authors": [ 1626 | { 1627 | "name": "Fabien Potencier", 1628 | "email": "fabien@symfony.com" 1629 | }, 1630 | { 1631 | "name": "Symfony Community", 1632 | "homepage": "https://symfony.com/contributors" 1633 | } 1634 | ], 1635 | "description": "Symfony Config Component", 1636 | "homepage": "https://symfony.com", 1637 | "time": "2017-01-02 20:32:22" 1638 | }, 1639 | { 1640 | "name": "symfony/console", 1641 | "version": "v3.2.2", 1642 | "source": { 1643 | "type": "git", 1644 | "url": "https://github.com/symfony/console.git", 1645 | "reference": "4f9e449e76996adf310498a8ca955c6deebe29dd" 1646 | }, 1647 | "dist": { 1648 | "type": "zip", 1649 | "url": "https://api.github.com/repos/symfony/console/zipball/4f9e449e76996adf310498a8ca955c6deebe29dd", 1650 | "reference": "4f9e449e76996adf310498a8ca955c6deebe29dd", 1651 | "shasum": "" 1652 | }, 1653 | "require": { 1654 | "php": ">=5.5.9", 1655 | "symfony/debug": "~2.8|~3.0", 1656 | "symfony/polyfill-mbstring": "~1.0" 1657 | }, 1658 | "require-dev": { 1659 | "psr/log": "~1.0", 1660 | "symfony/event-dispatcher": "~2.8|~3.0", 1661 | "symfony/filesystem": "~2.8|~3.0", 1662 | "symfony/process": "~2.8|~3.0" 1663 | }, 1664 | "suggest": { 1665 | "psr/log": "For using the console logger", 1666 | "symfony/event-dispatcher": "", 1667 | "symfony/filesystem": "", 1668 | "symfony/process": "" 1669 | }, 1670 | "type": "library", 1671 | "extra": { 1672 | "branch-alias": { 1673 | "dev-master": "3.2-dev" 1674 | } 1675 | }, 1676 | "autoload": { 1677 | "psr-4": { 1678 | "Symfony\\Component\\Console\\": "" 1679 | }, 1680 | "exclude-from-classmap": [ 1681 | "/Tests/" 1682 | ] 1683 | }, 1684 | "notification-url": "https://packagist.org/downloads/", 1685 | "license": [ 1686 | "MIT" 1687 | ], 1688 | "authors": [ 1689 | { 1690 | "name": "Fabien Potencier", 1691 | "email": "fabien@symfony.com" 1692 | }, 1693 | { 1694 | "name": "Symfony Community", 1695 | "homepage": "https://symfony.com/contributors" 1696 | } 1697 | ], 1698 | "description": "Symfony Console Component", 1699 | "homepage": "https://symfony.com", 1700 | "time": "2017-01-08 20:47:33" 1701 | }, 1702 | { 1703 | "name": "symfony/debug", 1704 | "version": "v3.2.2", 1705 | "source": { 1706 | "type": "git", 1707 | "url": "https://github.com/symfony/debug.git", 1708 | "reference": "810ba5c1c5352a4ddb15d4719e8936751dff0b05" 1709 | }, 1710 | "dist": { 1711 | "type": "zip", 1712 | "url": "https://api.github.com/repos/symfony/debug/zipball/810ba5c1c5352a4ddb15d4719e8936751dff0b05", 1713 | "reference": "810ba5c1c5352a4ddb15d4719e8936751dff0b05", 1714 | "shasum": "" 1715 | }, 1716 | "require": { 1717 | "php": ">=5.5.9", 1718 | "psr/log": "~1.0" 1719 | }, 1720 | "conflict": { 1721 | "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" 1722 | }, 1723 | "require-dev": { 1724 | "symfony/class-loader": "~2.8|~3.0", 1725 | "symfony/http-kernel": "~2.8|~3.0" 1726 | }, 1727 | "type": "library", 1728 | "extra": { 1729 | "branch-alias": { 1730 | "dev-master": "3.2-dev" 1731 | } 1732 | }, 1733 | "autoload": { 1734 | "psr-4": { 1735 | "Symfony\\Component\\Debug\\": "" 1736 | }, 1737 | "exclude-from-classmap": [ 1738 | "/Tests/" 1739 | ] 1740 | }, 1741 | "notification-url": "https://packagist.org/downloads/", 1742 | "license": [ 1743 | "MIT" 1744 | ], 1745 | "authors": [ 1746 | { 1747 | "name": "Fabien Potencier", 1748 | "email": "fabien@symfony.com" 1749 | }, 1750 | { 1751 | "name": "Symfony Community", 1752 | "homepage": "https://symfony.com/contributors" 1753 | } 1754 | ], 1755 | "description": "Symfony Debug Component", 1756 | "homepage": "https://symfony.com", 1757 | "time": "2017-01-02 20:32:22" 1758 | }, 1759 | { 1760 | "name": "symfony/dependency-injection", 1761 | "version": "v3.2.2", 1762 | "source": { 1763 | "type": "git", 1764 | "url": "https://github.com/symfony/dependency-injection.git", 1765 | "reference": "22b2c97cffc6a612db82084f9e7823b095958751" 1766 | }, 1767 | "dist": { 1768 | "type": "zip", 1769 | "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/22b2c97cffc6a612db82084f9e7823b095958751", 1770 | "reference": "22b2c97cffc6a612db82084f9e7823b095958751", 1771 | "shasum": "" 1772 | }, 1773 | "require": { 1774 | "php": ">=5.5.9" 1775 | }, 1776 | "conflict": { 1777 | "symfony/yaml": "<3.2" 1778 | }, 1779 | "require-dev": { 1780 | "symfony/config": "~2.8|~3.0", 1781 | "symfony/expression-language": "~2.8|~3.0", 1782 | "symfony/yaml": "~3.2" 1783 | }, 1784 | "suggest": { 1785 | "symfony/config": "", 1786 | "symfony/expression-language": "For using expressions in service container configuration", 1787 | "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", 1788 | "symfony/yaml": "" 1789 | }, 1790 | "type": "library", 1791 | "extra": { 1792 | "branch-alias": { 1793 | "dev-master": "3.2-dev" 1794 | } 1795 | }, 1796 | "autoload": { 1797 | "psr-4": { 1798 | "Symfony\\Component\\DependencyInjection\\": "" 1799 | }, 1800 | "exclude-from-classmap": [ 1801 | "/Tests/" 1802 | ] 1803 | }, 1804 | "notification-url": "https://packagist.org/downloads/", 1805 | "license": [ 1806 | "MIT" 1807 | ], 1808 | "authors": [ 1809 | { 1810 | "name": "Fabien Potencier", 1811 | "email": "fabien@symfony.com" 1812 | }, 1813 | { 1814 | "name": "Symfony Community", 1815 | "homepage": "https://symfony.com/contributors" 1816 | } 1817 | ], 1818 | "description": "Symfony DependencyInjection Component", 1819 | "homepage": "https://symfony.com", 1820 | "time": "2017-01-10 14:21:25" 1821 | }, 1822 | { 1823 | "name": "symfony/event-dispatcher", 1824 | "version": "v2.8.16", 1825 | "source": { 1826 | "type": "git", 1827 | "url": "https://github.com/symfony/event-dispatcher.git", 1828 | "reference": "74877977f90fb9c3e46378d5764217c55f32df34" 1829 | }, 1830 | "dist": { 1831 | "type": "zip", 1832 | "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/74877977f90fb9c3e46378d5764217c55f32df34", 1833 | "reference": "74877977f90fb9c3e46378d5764217c55f32df34", 1834 | "shasum": "" 1835 | }, 1836 | "require": { 1837 | "php": ">=5.3.9" 1838 | }, 1839 | "require-dev": { 1840 | "psr/log": "~1.0", 1841 | "symfony/config": "~2.0,>=2.0.5|~3.0.0", 1842 | "symfony/dependency-injection": "~2.6|~3.0.0", 1843 | "symfony/expression-language": "~2.6|~3.0.0", 1844 | "symfony/stopwatch": "~2.3|~3.0.0" 1845 | }, 1846 | "suggest": { 1847 | "symfony/dependency-injection": "", 1848 | "symfony/http-kernel": "" 1849 | }, 1850 | "type": "library", 1851 | "extra": { 1852 | "branch-alias": { 1853 | "dev-master": "2.8-dev" 1854 | } 1855 | }, 1856 | "autoload": { 1857 | "psr-4": { 1858 | "Symfony\\Component\\EventDispatcher\\": "" 1859 | }, 1860 | "exclude-from-classmap": [ 1861 | "/Tests/" 1862 | ] 1863 | }, 1864 | "notification-url": "https://packagist.org/downloads/", 1865 | "license": [ 1866 | "MIT" 1867 | ], 1868 | "authors": [ 1869 | { 1870 | "name": "Fabien Potencier", 1871 | "email": "fabien@symfony.com" 1872 | }, 1873 | { 1874 | "name": "Symfony Community", 1875 | "homepage": "https://symfony.com/contributors" 1876 | } 1877 | ], 1878 | "description": "Symfony EventDispatcher Component", 1879 | "homepage": "https://symfony.com", 1880 | "time": "2017-01-02 20:30:24" 1881 | }, 1882 | { 1883 | "name": "symfony/filesystem", 1884 | "version": "v3.2.2", 1885 | "source": { 1886 | "type": "git", 1887 | "url": "https://github.com/symfony/filesystem.git", 1888 | "reference": "a0c6ef2dc78d33b58d91d3a49f49797a184d06f4" 1889 | }, 1890 | "dist": { 1891 | "type": "zip", 1892 | "url": "https://api.github.com/repos/symfony/filesystem/zipball/a0c6ef2dc78d33b58d91d3a49f49797a184d06f4", 1893 | "reference": "a0c6ef2dc78d33b58d91d3a49f49797a184d06f4", 1894 | "shasum": "" 1895 | }, 1896 | "require": { 1897 | "php": ">=5.5.9" 1898 | }, 1899 | "type": "library", 1900 | "extra": { 1901 | "branch-alias": { 1902 | "dev-master": "3.2-dev" 1903 | } 1904 | }, 1905 | "autoload": { 1906 | "psr-4": { 1907 | "Symfony\\Component\\Filesystem\\": "" 1908 | }, 1909 | "exclude-from-classmap": [ 1910 | "/Tests/" 1911 | ] 1912 | }, 1913 | "notification-url": "https://packagist.org/downloads/", 1914 | "license": [ 1915 | "MIT" 1916 | ], 1917 | "authors": [ 1918 | { 1919 | "name": "Fabien Potencier", 1920 | "email": "fabien@symfony.com" 1921 | }, 1922 | { 1923 | "name": "Symfony Community", 1924 | "homepage": "https://symfony.com/contributors" 1925 | } 1926 | ], 1927 | "description": "Symfony Filesystem Component", 1928 | "homepage": "https://symfony.com", 1929 | "time": "2017-01-08 20:47:33" 1930 | }, 1931 | { 1932 | "name": "symfony/polyfill-mbstring", 1933 | "version": "v1.3.0", 1934 | "source": { 1935 | "type": "git", 1936 | "url": "https://github.com/symfony/polyfill-mbstring.git", 1937 | "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" 1938 | }, 1939 | "dist": { 1940 | "type": "zip", 1941 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", 1942 | "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", 1943 | "shasum": "" 1944 | }, 1945 | "require": { 1946 | "php": ">=5.3.3" 1947 | }, 1948 | "suggest": { 1949 | "ext-mbstring": "For best performance" 1950 | }, 1951 | "type": "library", 1952 | "extra": { 1953 | "branch-alias": { 1954 | "dev-master": "1.3-dev" 1955 | } 1956 | }, 1957 | "autoload": { 1958 | "psr-4": { 1959 | "Symfony\\Polyfill\\Mbstring\\": "" 1960 | }, 1961 | "files": [ 1962 | "bootstrap.php" 1963 | ] 1964 | }, 1965 | "notification-url": "https://packagist.org/downloads/", 1966 | "license": [ 1967 | "MIT" 1968 | ], 1969 | "authors": [ 1970 | { 1971 | "name": "Nicolas Grekas", 1972 | "email": "p@tchwork.com" 1973 | }, 1974 | { 1975 | "name": "Symfony Community", 1976 | "homepage": "https://symfony.com/contributors" 1977 | } 1978 | ], 1979 | "description": "Symfony polyfill for the Mbstring extension", 1980 | "homepage": "https://symfony.com", 1981 | "keywords": [ 1982 | "compatibility", 1983 | "mbstring", 1984 | "polyfill", 1985 | "portable", 1986 | "shim" 1987 | ], 1988 | "time": "2016-11-14 01:06:16" 1989 | }, 1990 | { 1991 | "name": "symfony/stopwatch", 1992 | "version": "v3.2.2", 1993 | "source": { 1994 | "type": "git", 1995 | "url": "https://github.com/symfony/stopwatch.git", 1996 | "reference": "9aa0b51889c01bca474853ef76e9394b02264464" 1997 | }, 1998 | "dist": { 1999 | "type": "zip", 2000 | "url": "https://api.github.com/repos/symfony/stopwatch/zipball/9aa0b51889c01bca474853ef76e9394b02264464", 2001 | "reference": "9aa0b51889c01bca474853ef76e9394b02264464", 2002 | "shasum": "" 2003 | }, 2004 | "require": { 2005 | "php": ">=5.5.9" 2006 | }, 2007 | "type": "library", 2008 | "extra": { 2009 | "branch-alias": { 2010 | "dev-master": "3.2-dev" 2011 | } 2012 | }, 2013 | "autoload": { 2014 | "psr-4": { 2015 | "Symfony\\Component\\Stopwatch\\": "" 2016 | }, 2017 | "exclude-from-classmap": [ 2018 | "/Tests/" 2019 | ] 2020 | }, 2021 | "notification-url": "https://packagist.org/downloads/", 2022 | "license": [ 2023 | "MIT" 2024 | ], 2025 | "authors": [ 2026 | { 2027 | "name": "Fabien Potencier", 2028 | "email": "fabien@symfony.com" 2029 | }, 2030 | { 2031 | "name": "Symfony Community", 2032 | "homepage": "https://symfony.com/contributors" 2033 | } 2034 | ], 2035 | "description": "Symfony Stopwatch Component", 2036 | "homepage": "https://symfony.com", 2037 | "time": "2017-01-02 20:32:22" 2038 | }, 2039 | { 2040 | "name": "symfony/yaml", 2041 | "version": "v3.2.2", 2042 | "source": { 2043 | "type": "git", 2044 | "url": "https://github.com/symfony/yaml.git", 2045 | "reference": "50eadbd7926e31842893c957eca362b21592a97d" 2046 | }, 2047 | "dist": { 2048 | "type": "zip", 2049 | "url": "https://api.github.com/repos/symfony/yaml/zipball/50eadbd7926e31842893c957eca362b21592a97d", 2050 | "reference": "50eadbd7926e31842893c957eca362b21592a97d", 2051 | "shasum": "" 2052 | }, 2053 | "require": { 2054 | "php": ">=5.5.9" 2055 | }, 2056 | "require-dev": { 2057 | "symfony/console": "~2.8|~3.0" 2058 | }, 2059 | "suggest": { 2060 | "symfony/console": "For validating YAML files using the lint command" 2061 | }, 2062 | "type": "library", 2063 | "extra": { 2064 | "branch-alias": { 2065 | "dev-master": "3.2-dev" 2066 | } 2067 | }, 2068 | "autoload": { 2069 | "psr-4": { 2070 | "Symfony\\Component\\Yaml\\": "" 2071 | }, 2072 | "exclude-from-classmap": [ 2073 | "/Tests/" 2074 | ] 2075 | }, 2076 | "notification-url": "https://packagist.org/downloads/", 2077 | "license": [ 2078 | "MIT" 2079 | ], 2080 | "authors": [ 2081 | { 2082 | "name": "Fabien Potencier", 2083 | "email": "fabien@symfony.com" 2084 | }, 2085 | { 2086 | "name": "Symfony Community", 2087 | "homepage": "https://symfony.com/contributors" 2088 | } 2089 | ], 2090 | "description": "Symfony Yaml Component", 2091 | "homepage": "https://symfony.com", 2092 | "time": "2017-01-03 13:51:32" 2093 | }, 2094 | { 2095 | "name": "webmozart/assert", 2096 | "version": "1.2.0", 2097 | "source": { 2098 | "type": "git", 2099 | "url": "https://github.com/webmozart/assert.git", 2100 | "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" 2101 | }, 2102 | "dist": { 2103 | "type": "zip", 2104 | "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", 2105 | "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", 2106 | "shasum": "" 2107 | }, 2108 | "require": { 2109 | "php": "^5.3.3 || ^7.0" 2110 | }, 2111 | "require-dev": { 2112 | "phpunit/phpunit": "^4.6", 2113 | "sebastian/version": "^1.0.1" 2114 | }, 2115 | "type": "library", 2116 | "extra": { 2117 | "branch-alias": { 2118 | "dev-master": "1.3-dev" 2119 | } 2120 | }, 2121 | "autoload": { 2122 | "psr-4": { 2123 | "Webmozart\\Assert\\": "src/" 2124 | } 2125 | }, 2126 | "notification-url": "https://packagist.org/downloads/", 2127 | "license": [ 2128 | "MIT" 2129 | ], 2130 | "authors": [ 2131 | { 2132 | "name": "Bernhard Schussek", 2133 | "email": "bschussek@gmail.com" 2134 | } 2135 | ], 2136 | "description": "Assertions to validate method input/output with nice error messages.", 2137 | "keywords": [ 2138 | "assert", 2139 | "check", 2140 | "validate" 2141 | ], 2142 | "time": "2016-11-23 20:04:58" 2143 | } 2144 | ], 2145 | "aliases": [], 2146 | "minimum-stability": "stable", 2147 | "stability-flags": [], 2148 | "prefer-stable": false, 2149 | "prefer-lowest": false, 2150 | "platform": [], 2151 | "platform-dev": [] 2152 | } 2153 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | tests 8 | 9 | 10 | 11 | 12 | src 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/ArrayTrait.php: -------------------------------------------------------------------------------- 1 | $element) { 18 | if(is_array($element)) { 19 | $array[$key] = $this->recusiveImplode($element, $glue); 20 | } 21 | } 22 | 23 | return implode($glue, $array); 24 | } 25 | 26 | /** 27 | * Alias for recursiveImplode 28 | * 29 | * @param array $array 30 | * @param string $glue 31 | * @return string 32 | */ 33 | public function recursiveJoin(array $array, $glue = ',') 34 | { 35 | return $this->recusiveImplode($array, $glue); 36 | } 37 | } -------------------------------------------------------------------------------- /src/HydratableTrait.php: -------------------------------------------------------------------------------- 1 | 19 | * @package Pbxg33k\Traits 20 | */ 21 | trait HydratableTrait 22 | { 23 | use PropertyTrait; 24 | use ReflectionTrait; 25 | 26 | /** 27 | * List of types which are not used as objects 28 | * 29 | * @var array 30 | */ 31 | public static $nonObjectTypes = ['string', 'int', 'integer', 'bool', 'boolean', 'array', 'float', 'mixed', 'null']; 32 | 33 | /** 34 | * List of classes which will take string arguments in constructor 35 | * 36 | * @var array 37 | */ 38 | protected $giveDataInConstructor = ['\DateTime']; 39 | 40 | /** 41 | * Object constructor arguments to be passed when creating an object during conversion 42 | * 43 | * @var mixed 44 | */ 45 | protected $objectConstructorArguments; 46 | 47 | /** 48 | * Converts a stdClass to models loaded in current context 49 | * 50 | * This method iterates over the passed $class 51 | * For each key, it looks for a setter and type. 52 | * If the value is an object, it initializes the object and assignes the initialized object. 53 | * 54 | * @param object|array $class class 55 | * @param boolean $failOnError Throw Exception if any error(s) occur 56 | * 57 | * @return object 58 | * 59 | * @throws \Exception if hydration failes AND $failOnError is true 60 | */ 61 | public function hydrateClass($class, $failOnError = false) 62 | { 63 | $reflection = new \ReflectionClass($this); 64 | 65 | // Iterate over $class for properties 66 | foreach ($class as $itemKey => $itemValue) { 67 | // Convert key to a propertyname in $this 68 | try { 69 | $this->hydrateProperty($itemKey, $itemValue, $reflection); 70 | } catch (\Exception $e) { 71 | if ($failOnError) { 72 | throw $e; 73 | } 74 | } 75 | } 76 | 77 | return $this; 78 | } 79 | 80 | /** 81 | * Hydrates property with value. 82 | * Value can be anything. If the property is supposed to be a Class of anykind we will try to instantiate it 83 | * and assign the class to the property 84 | * 85 | * @param $key 86 | * @param $value 87 | * @param \ReflectionClass $reflection 88 | * 89 | * @throws \Exception 90 | */ 91 | protected function hydrateProperty($key, $value, \ReflectionClass $reflection) 92 | { 93 | $propertyName = $this->resolvePropertyName($key); 94 | 95 | try { 96 | // Check if property exists and assign a ReflectionProperty class to $reflectionProperty 97 | $reflectionProperty = $reflection->getProperty($propertyName); 98 | // Get the expected property class from the property's DocBlock 99 | $propertyClassName = ReflectionTrait::getClassFromDocComment($reflectionProperty->getDocComment(), true, $reflection); 100 | // Set argument for constructor (if any), in case we're dealing with an object (IE: DateTime) 101 | $this->objectConstructorArguments = (in_array($propertyClassName, $this->giveDataInConstructor)) ? $value : null; 102 | 103 | if (!in_array($propertyClassName, self::$nonObjectTypes) && class_exists($propertyClassName)) { 104 | $object = new $propertyClassName($this->objectConstructorArguments); 105 | $this->checkObjectForErrors($object, true); 106 | 107 | if (method_exists($object, 'hydrateClass') && $this->isHydratableValue($value)) { 108 | $object->hydrateClass($value); 109 | } 110 | $value = $object; 111 | } 112 | 113 | $this->setPropertyValue($propertyName, $value, true); 114 | } catch (\Exception $e) { 115 | throw $e; 116 | } 117 | } 118 | 119 | /** 120 | * Resolves and returns propertyname 121 | * 122 | * @param $key 123 | * 124 | * @return mixed|string 125 | */ 126 | private function resolvePropertyName($key) 127 | { 128 | $propertyName = lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $key)))); 129 | 130 | return (property_exists($this, $propertyName)) ? $propertyName : 131 | (property_exists($this, lcfirst($propertyName)) ? lcfirst($propertyName) : 132 | preg_replace_callback('/([A-Z])/', function($match) { 133 | return strtolower('_' . $match[1]); 134 | }, lcfirst($propertyName)) 135 | ); 136 | } 137 | 138 | /** 139 | * Checks if the value can be hydrated for iteration 140 | * 141 | * @param $value 142 | * 143 | * @return bool 144 | */ 145 | private function isHydratableValue($value) 146 | { 147 | return (is_array($value) || is_object($value)); 148 | } 149 | 150 | /** 151 | * Checks (and fixes) objects against known errors 152 | * 153 | * @param Object &$object 154 | * @param bool $fix Fix errors 155 | * 156 | * @return void 157 | * 158 | * @throws \Exception 159 | */ 160 | private function checkObjectForErrors(&$object, $fix = false) 161 | { 162 | if ($object instanceof \DateTime) { 163 | if ($this->objectConstructorArguments == null) { 164 | $object = null; 165 | } 166 | } 167 | } 168 | } -------------------------------------------------------------------------------- /src/PropertyTrait.php: -------------------------------------------------------------------------------- 1 | 18 | * @package Pbxg33k\Traits 19 | */ 20 | trait PropertyTrait 21 | { 22 | /** 23 | * Sets the property value for the object 24 | * 25 | * @param string $key 26 | * @param mixed $value 27 | * @param bool $override 28 | * @param bool $isCollection Boolean to indicate Doctrine Collections 29 | * @return Object 30 | * @throws \Exception if setting value has failed 31 | */ 32 | public function setPropertyValue($key, $value, $override = false, $isCollection = false) 33 | { 34 | // Replace empty strings with null 35 | $value = ($value === "") ? null : $value; 36 | 37 | // Convert key to method names 38 | $methodName = $this->getMethodName($key); 39 | 40 | if (!$override && $this->getPropertyValue($key) === $value) { 41 | return $this; 42 | } 43 | 44 | $setMethod = ($isCollection) ? 'add' : 'set'; 45 | if (method_exists($this, $setMethod . $methodName)) { 46 | return $this->{$setMethod . $methodName}($value); 47 | } else { 48 | throw new \Exception(sprintf( 49 | 'Unable to set value, method not found: %s%s in class: %s', 50 | $setMethod, 51 | $methodName, 52 | static::class 53 | )); 54 | } 55 | } 56 | 57 | /** 58 | * Get property value 59 | * 60 | * @param $key 61 | * @return mixed 62 | */ 63 | public function getPropertyValue($key) { 64 | $methodName = 'get' . $this->getMethodName($key); 65 | if(method_exists($this, $methodName)) { 66 | return $this->{$methodName}(); 67 | } 68 | return false; 69 | } 70 | 71 | /** 72 | * Converts snake_case to CamelCase to convert property names to getters 73 | * 74 | * @param string $propertyKey 75 | * @return string 76 | */ 77 | protected function getMethodName($propertyKey) 78 | { 79 | return ucfirst(preg_replace_callback('/_([a-z])/', function ($match) { 80 | return strtoupper($match[1]); 81 | }, $propertyKey)); 82 | } 83 | } -------------------------------------------------------------------------------- /src/ReflectionTrait.php: -------------------------------------------------------------------------------- 1 | 10 | * @package Pbxg33k\Traits 11 | */ 12 | trait ReflectionTrait 13 | { 14 | /** 15 | * Tries to get the correct class name from the given docBlock for Reflection 16 | * 17 | * @param string $comment the docblock 18 | * @param bool $includeNamespaces 19 | * @param null|\ReflectionClass $reflectionClass 20 | * 21 | * @return bool|string 22 | */ 23 | public static function getClassFromDocComment($comment, $includeNamespaces = true, $reflectionClass = null) 24 | { 25 | if (preg_match('~\@var[\s]+([A-Za-z0-9\\\\]+)~', $comment, $matches)) { 26 | if ($includeNamespaces) { 27 | if ($reflectionClass instanceof \ReflectionClass && !in_array($matches[1], HydratableTrait::$nonObjectTypes)) { 28 | return ($reflectionClass->getNamespaceName()) ? sprintf('\%s\%s', $reflectionClass->getNamespaceName(), $matches[1]) : sprintf('\%s', $matches[1]); 29 | } 30 | return $matches[1]; 31 | } 32 | return join('', array_slice(explode('\\', $matches[1]), -1)); 33 | } 34 | 35 | return false; 36 | } 37 | } -------------------------------------------------------------------------------- /tests/ArrayTraitTest.php: -------------------------------------------------------------------------------- 1 | testClass = new ArrayTraitClass(); 16 | } 17 | 18 | /** 19 | * @test 20 | */ 21 | public function simpleImplodeReturnString() 22 | { 23 | $arr = [ 24 | 'testKey' => 'testValue', 25 | 'testKey2' => 'testValue2' 26 | ]; 27 | 28 | $this->assertSame(implode(',', $arr), $this->testClass->recusiveImplode($arr, ',')); 29 | } 30 | 31 | /** 32 | * @test 33 | */ 34 | public function implodingMultiDimensionalArrayReturnsString() 35 | { 36 | $arr = [ 37 | 'testKey' => 'testValue', 38 | 'testArr' => [ 39 | 'subKey' => 'subValue' 40 | ] 41 | ]; 42 | 43 | $expectedOutput = "testValue,subValue"; 44 | 45 | $this->assertSame($expectedOutput, $this->testClass->recusiveImplode($arr, ',')); 46 | } 47 | 48 | /** 49 | * @test 50 | */ 51 | public function joinIsAliasingImplode() 52 | { 53 | $arr = [ 54 | 'testKey' => 'testValue', 55 | 'testKey2' => 'testValue2' 56 | ]; 57 | 58 | $this->assertSame(implode(',', $arr), $this->testClass->recursiveJoin($arr, ',')); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /tests/HydratableTraitTest.php: -------------------------------------------------------------------------------- 1 | 'zero', 1 => 1, 'b', 'c' => 39]; 15 | const VAL_SNAKE_PROPERTY = 'snake_case_property'; 16 | const VAL_DATETIME_PROPERTY = '2016/05/24T01:03:00'; 17 | 18 | /** 19 | * @var HydratableTraitStub 20 | */ 21 | protected $testClass; 22 | 23 | protected $dateTimeClass; 24 | 25 | protected $seed = [ 26 | 'publicProperty' => self::VAL_PUBLIC_PROPERTY, 27 | 'protectedProperty' => self::VAL_PROTECTED_PROPERTY, 28 | 'privateProperty' => self::VAL_PRIVATE_PROPERTY, 29 | 'stringProperty' => self::VAL_STRING_PROPERTY, 30 | 'floatProperty' => self::VAL_FLOAT_PROPERTY, 31 | 'booleanProperty' => self::VAL_BOOLEAN_PROPERTY, 32 | 'nullProperty' => self::VAL_NULL_PROPERTY, 33 | 'arrayProperty' => self::VAL_ARRAY_PROPERTY, 34 | 'classProperty' => 'initialize_me', 35 | 'dateTimeProperty' => self::VAL_DATETIME_PROPERTY, 36 | 'snake_case_property' => self::VAL_SNAKE_PROPERTY, 37 | 'iterableProperty' => [ 38 | 'nonExistingClass' => '', 39 | 'nonExistingProperty' => '', 40 | 'date' => null, 41 | ] 42 | ]; 43 | 44 | public function setUp() 45 | { 46 | $this->testClass = new HydratableTraitStub; 47 | $this->seed['classProperty'] = new \stdClass(); 48 | 49 | $this->testClass->hydrateClass($this->seed); 50 | } 51 | 52 | public function testPublicProperty() 53 | { 54 | $this->assertEquals(self::VAL_PUBLIC_PROPERTY, $this->testClass->getPublicProperty()); 55 | } 56 | 57 | public function testProtectedProperty() 58 | { 59 | $this->assertEquals(self::VAL_PROTECTED_PROPERTY, $this->testClass->getProtectedProperty()); 60 | } 61 | 62 | public function testPrivateProperty() 63 | { 64 | $this->assertEquals(self::VAL_PRIVATE_PROPERTY, $this->testClass->getPrivateProperty()); 65 | } 66 | 67 | public function testDateTimeProperty() 68 | { 69 | $this->assertInstanceOf(\DateTime::class, $this->testClass->getDateTimeProperty()); 70 | $this->assertEquals('2016', $this->testClass->getDateTimeProperty()->format('Y')); 71 | $this->assertEquals('05', $this->testClass->getDateTimeProperty()->format('m')); 72 | $this->assertEquals('24', $this->testClass->getDateTimeProperty()->format('d')); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /tests/PropertyTraitTest.php: -------------------------------------------------------------------------------- 1 | testClass = new HydratableTraitStub; 14 | } 15 | 16 | /** 17 | * @test 18 | */ 19 | public function willReturnSelfIfOverrideIsFalseAndPropertyValueIsSame() 20 | { 21 | $this->testClass->setPropertyValue('stringProperty', 'string'); 22 | $value = $this->testClass->setPropertyValue('stringProperty', 'string'); 23 | 24 | $this->assertSame($this->testClass, $value); 25 | } 26 | 27 | /** 28 | * @test 29 | * @expectedException \Exception 30 | */ 31 | public function willThrowExceptionIfNoSettersAreFound() 32 | { 33 | $this->testClass->setPropertyValue('nonExistingProperty', 'test'); 34 | } 35 | 36 | /** 37 | * @test 38 | */ 39 | public function willReturnPropertyValue() 40 | { 41 | $expectedValue = 'testValue'; 42 | 43 | $this->testClass->setPropertyValue('stringProperty', $expectedValue, true); 44 | 45 | $this->assertSame($expectedValue, $this->testClass->getPropertyValue('stringProperty')); 46 | } 47 | 48 | /** 49 | * @test 50 | */ 51 | public function willReturnEmptyValueAsNull() 52 | { 53 | $this->assertSame(null, $this->testClass->getPropertyValue('stringProperty')); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /tests/ReflectionTraitTest.php: -------------------------------------------------------------------------------- 1 | assertEquals('ClassName', HydratableTraitStub::getClassFromDocComment($dockblock, false)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/stubs/ArrayTraitClass.php: -------------------------------------------------------------------------------- 1 | nonExistingClass; 24 | } 25 | 26 | /** 27 | * @param mixed $nonExistingClass 28 | * 29 | * @return EmptyHydratable 30 | */ 31 | public function setNonExistingClass($nonExistingClass) 32 | { 33 | $this->nonExistingClass = $nonExistingClass; 34 | 35 | return $this; 36 | } 37 | 38 | /** 39 | * @return DateTime 40 | */ 41 | public function getDate() 42 | { 43 | return $this->date; 44 | } 45 | 46 | /** 47 | * @param DateTime $date 48 | * 49 | * @return EmptyHydratable 50 | */ 51 | public function setDate($date) 52 | { 53 | $this->date = $date; 54 | 55 | return $this; 56 | } 57 | } -------------------------------------------------------------------------------- /tests/stubs/HydratableTraitStub.php: -------------------------------------------------------------------------------- 1 | publicProperty; 86 | } 87 | 88 | /** 89 | * @param mixed $publicProperty 90 | * @return HydratableTraitStub 91 | */ 92 | public function setPublicProperty($publicProperty) 93 | { 94 | $this->publicProperty = $publicProperty; 95 | 96 | return $this; 97 | } 98 | 99 | /** 100 | * @return mixed 101 | */ 102 | public function getProtectedProperty() 103 | { 104 | return $this->protectedProperty; 105 | } 106 | 107 | /** 108 | * @param mixed $protectedProperty 109 | * @return HydratableTraitStub 110 | */ 111 | public function setProtectedProperty($protectedProperty) 112 | { 113 | $this->protectedProperty = $protectedProperty; 114 | 115 | return $this; 116 | } 117 | 118 | /** 119 | * @return mixed 120 | */ 121 | public function getPrivateProperty() 122 | { 123 | return $this->privateProperty; 124 | } 125 | 126 | /** 127 | * @param mixed $privateProperty 128 | * @return HydratableTraitStub 129 | */ 130 | public function setPrivateProperty($privateProperty) 131 | { 132 | $this->privateProperty = $privateProperty; 133 | 134 | return $this; 135 | } 136 | 137 | /** 138 | * @return string 139 | */ 140 | public function getStringProperty() 141 | { 142 | return $this->stringProperty; 143 | } 144 | 145 | /** 146 | * @param string $stringProperty 147 | * @return HydratableTraitStub 148 | */ 149 | public function setStringProperty($stringProperty) 150 | { 151 | $this->stringProperty = $stringProperty; 152 | 153 | return $this; 154 | } 155 | 156 | /** 157 | * @return float 158 | */ 159 | public function getFloatProperty() 160 | { 161 | return $this->floatProperty; 162 | } 163 | 164 | /** 165 | * @param float $floatProperty 166 | * @return HydratableTraitStub 167 | */ 168 | public function setFloatProperty($floatProperty) 169 | { 170 | $this->floatProperty = $floatProperty; 171 | 172 | return $this; 173 | } 174 | 175 | /** 176 | * @return boolean 177 | */ 178 | public function isBooleanProperty() 179 | { 180 | return $this->booleanProperty; 181 | } 182 | 183 | /** 184 | * @param boolean $booleanProperty 185 | * @return HydratableTraitStub 186 | */ 187 | public function setBooleanProperty($booleanProperty) 188 | { 189 | $this->booleanProperty = $booleanProperty; 190 | 191 | return $this; 192 | } 193 | 194 | /** 195 | * @return null 196 | */ 197 | public function getNullProperty() 198 | { 199 | return $this->nullProperty; 200 | } 201 | 202 | /** 203 | * @param null $nullProperty 204 | * @return HydratableTraitStub 205 | */ 206 | public function setNullProperty($nullProperty) 207 | { 208 | $this->nullProperty = $nullProperty; 209 | 210 | return $this; 211 | } 212 | 213 | /** 214 | * @return array 215 | */ 216 | public function getArrayProperty() 217 | { 218 | return $this->arrayProperty; 219 | } 220 | 221 | /** 222 | * @param array $arrayProperty 223 | * @return HydratableTraitStub 224 | */ 225 | public function setArrayProperty($arrayProperty) 226 | { 227 | $this->arrayProperty = $arrayProperty; 228 | 229 | return $this; 230 | } 231 | 232 | /** 233 | * @return stdClass 234 | */ 235 | public function getClassProperty() 236 | { 237 | return $this->classProperty; 238 | } 239 | 240 | /** 241 | * @param stdClass $classProperty 242 | * @return HydratableTraitStub 243 | */ 244 | public function setClassProperty($classProperty) 245 | { 246 | $this->classProperty = $classProperty; 247 | 248 | return $this; 249 | } 250 | 251 | /** 252 | * @return DateTimeInterface 253 | */ 254 | public function getDateTimeInterfaceProperty() 255 | { 256 | return $this->dateTimeInterfaceProperty; 257 | } 258 | 259 | /** 260 | * @param DateTimeInterface $dateTimeInterfaceProperty 261 | * @return HydratableTraitStub 262 | */ 263 | public function setDateTimeInterfaceProperty($dateTimeInterfaceProperty) 264 | { 265 | $this->dateTimeInterfaceProperty = $dateTimeInterfaceProperty; 266 | 267 | return $this; 268 | } 269 | 270 | /** 271 | * @return DateTime 272 | */ 273 | public function getDateTimeProperty() 274 | { 275 | return $this->dateTimeProperty; 276 | } 277 | 278 | /** 279 | * @param DateTime $dateTimeProperty 280 | * @return HydratableTraitStub 281 | */ 282 | public function setDateTimeProperty($dateTimeProperty) 283 | { 284 | $this->dateTimeProperty = $dateTimeProperty; 285 | 286 | return $this; 287 | } 288 | 289 | /** 290 | * @return mixed 291 | */ 292 | public function getSnakeCaseProperty() 293 | { 294 | return $this->snake_case_property; 295 | } 296 | 297 | /** 298 | * @param mixed $snake_case_property 299 | * @return HydratableTraitStub 300 | */ 301 | public function setSnakeCaseProperty($snake_case_property) 302 | { 303 | $this->snake_case_property = $snake_case_property; 304 | 305 | return $this; 306 | } 307 | 308 | /** 309 | * @return HydratableTraitStub 310 | */ 311 | public function getIterableProperty() 312 | { 313 | return $this->iterableProperty; 314 | } 315 | 316 | /** 317 | * @param HydratableTraitStub $iterableProperty 318 | */ 319 | public function setIterableProperty($iterableProperty) 320 | { 321 | $this->iterableProperty = $iterableProperty; 322 | 323 | return $this; 324 | } 325 | } --------------------------------------------------------------------------------