PK CV` ` phpunit.xml.distnu W+A
src/
tests/
PK CVbx
2 2
composer.locknu W+A {
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "e41f9d8fd2fd39d95cff60c0d3b88e33",
"content-hash": "10139ddaf4e00daa762524f843a73b64",
"packages": [
{
"name": "doctrine/collections",
"version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/collections.git",
"reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
"reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Collections\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Collections Abstraction library",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"array",
"collections",
"iterator"
],
"time": "2015-04-14 22:21:58"
},
{
"name": "justinrainbow/json-schema",
"version": "1.6.1",
"source": {
"type": "git",
"url": "https://github.com/justinrainbow/json-schema.git",
"reference": "cc84765fb7317f6b07bd8ac78364747f95b86341"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341",
"reference": "cc84765fb7317f6b07bd8ac78364747f95b86341",
"shasum": ""
},
"require": {
"php": ">=5.3.29"
},
"require-dev": {
"json-schema/json-schema-test-suite": "1.1.0",
"phpdocumentor/phpdocumentor": "~2",
"phpunit/phpunit": "~3.7"
},
"bin": [
"bin/validate-json"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6.x-dev"
}
},
"autoload": {
"psr-4": {
"JsonSchema\\": "src/JsonSchema/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Bruno Prieto Reis",
"email": "bruno.p.reis@gmail.com"
},
{
"name": "Justin Rainbow",
"email": "justin.rainbow@gmail.com"
},
{
"name": "Igor Wiedler",
"email": "igor@wiedler.ch"
},
{
"name": "Robert Schönthal",
"email": "seroscho@googlemail.com"
}
],
"description": "A library to validate a json schema.",
"homepage": "https://github.com/justinrainbow/json-schema",
"keywords": [
"json",
"schema"
],
"time": "2016-01-25 15:43:01"
},
{
"name": "nikic/php-parser",
"version": "v1.4.1",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51",
"reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"files": [
"lib/bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
],
"time": "2015-09-19 14:15:08"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
"reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"suggest": {
"dflydev/markdown": "~1.0",
"erusev/parsedown": "~1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-0": {
"phpDocumentor": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "mike.vanriel@naenius.com"
}
],
"time": "2015-02-03 12:10:50"
},
{
"name": "sebastian/version",
"version": "1.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"shasum": ""
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2015-06-21 13:59:46"
},
{
"name": "seld/jsonlint",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/jsonlint.git",
"reference": "e827b5254d3e58c736ea2c5616710983d80b0b70"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/e827b5254d3e58c736ea2c5616710983d80b0b70",
"reference": "e827b5254d3e58c736ea2c5616710983d80b0b70",
"shasum": ""
},
"require": {
"php": "^5.3 || ^7.0"
},
"bin": [
"bin/jsonlint"
],
"type": "library",
"autoload": {
"psr-4": {
"Seld\\JsonLint\\": "src/Seld/JsonLint/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
}
],
"description": "JSON Linter",
"keywords": [
"json",
"linter",
"parser",
"validator"
],
"time": "2016-09-14 15:17:56"
},
{
"name": "symfony/console",
"version": "v2.8.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "3d3e4fa5f0614c8e45220e5de80332322e33bd90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/3d3e4fa5f0614c8e45220e5de80332322e33bd90",
"reference": "3d3e4fa5f0614c8e45220e5de80332322e33bd90",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/event-dispatcher": "~2.1|~3.0.0",
"symfony/process": "~2.1|~3.0.0"
},
"suggest": {
"psr/log": "For using the console logger",
"symfony/event-dispatcher": "",
"symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Console\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2016-09-06 10:55:00"
},
{
"name": "symfony/dependency-injection",
"version": "v2.8.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "0a732a9cafc30e54077967da4d019e1d618a8cb9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/0a732a9cafc30e54077967da4d019e1d618a8cb9",
"reference": "0a732a9cafc30e54077967da4d019e1d618a8cb9",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"conflict": {
"symfony/expression-language": "<2.6"
},
"require-dev": {
"symfony/config": "~2.2|~3.0.0",
"symfony/expression-language": "~2.6|~3.0.0",
"symfony/yaml": "~2.3.42|~2.7.14|~2.8.7|~3.0.7"
},
"suggest": {
"symfony/config": "",
"symfony/expression-language": "For using expressions in service container configuration",
"symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\DependencyInjection\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
"time": "2016-09-06 23:19:39"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.8.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "889983a79a043dfda68f38c38b6dba092dd49cd8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/889983a79a043dfda68f38c38b6dba092dd49cd8",
"reference": "889983a79a043dfda68f38c38b6dba092dd49cd8",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.0,>=2.0.5|~3.0.0",
"symfony/dependency-injection": "~2.6|~3.0.0",
"symfony/expression-language": "~2.6|~3.0.0",
"symfony/stopwatch": "~2.3|~3.0.0"
},
"suggest": {
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\EventDispatcher\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2016-07-28 16:56:28"
},
{
"name": "symfony/finder",
"version": "v2.8.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "bec5533e6ed650547d6ec8de4b541dc9929066f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/bec5533e6ed650547d6ec8de4b541dc9929066f7",
"reference": "bec5533e6ed650547d6ec8de4b541dc9929066f7",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Finder\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2016-08-26 11:57:43"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "dff51f72b0706335131b00a7f49606168c582594"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594",
"reference": "dff51f72b0706335131b00a7f49606168c582594",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"time": "2016-05-18 14:26:46"
},
{
"name": "symfony/stopwatch",
"version": "v2.8.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
"reference": "35bae476693150728b0eb51647faac82faf9aaca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/35bae476693150728b0eb51647faac82faf9aaca",
"reference": "35bae476693150728b0eb51647faac82faf9aaca",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Stopwatch\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com",
"time": "2016-06-29 05:29:29"
}
],
"packages-dev": [
{
"name": "bartlett/monolog-callbackfilterhandler",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/llaville/monolog-callbackfilterhandler.git",
"reference": "8ada2b01b48e8f06e578ccba9d5c867a2420cba7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/llaville/monolog-callbackfilterhandler/zipball/8ada2b01b48e8f06e578ccba9d5c867a2420cba7",
"reference": "8ada2b01b48e8f06e578ccba9d5c867a2420cba7",
"shasum": ""
},
"require": {
"monolog/monolog": "~1.10",
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Bartlett\\": "src/Bartlett"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Laurent Laville",
"email": "pear@laurent-laville.org",
"homepage": "https://github.com/llaville",
"role": "Lead"
}
],
"description": "Monolog handler wrapper that filters records based on a list of callback functions",
"homepage": "http://php5.laurent-laville.org/callbackfilterhandler/",
"keywords": [
"handler",
"log",
"logger",
"logging"
],
"time": "2015-04-21 11:26:29"
},
{
"name": "bartlett/monolog-growlhandler",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/llaville/monolog-growlhandler.git",
"reference": "b6371bcba38096b292f944385e5696d5cd516378"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/llaville/monolog-growlhandler/zipball/b6371bcba38096b292f944385e5696d5cd516378",
"reference": "b6371bcba38096b292f944385e5696d5cd516378",
"shasum": ""
},
"require": {
"monolog/monolog": "~1.10",
"pear-pear.php.net/net_growl": "~2.7",
"php": ">=5.3.0"
},
"require-dev": {
"bartlett/monolog-callbackfilterhandler": "~1.0",
"bartlett/phpunit-loggertestlistener": "~1.5"
},
"suggest": {
"bartlett/monolog-callbackfilterhandler": "Advanced filtering strategies for Monolog",
"bartlett/phpunit-loggertestlistener": "Allow logging unit tests to your favorite PSR-3 logger interface"
},
"type": "library",
"autoload": {
"psr-4": {
"Bartlett\\": "src/Bartlett"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Laurent Laville",
"email": "pear@laurent-laville.org",
"homepage": "https://github.com/llaville",
"role": "Lead"
}
],
"description": "Monolog handler that send notifications to Growl on Mac OS X and Windows",
"homepage": "http://php5.laurent-laville.org/growlhandler/",
"keywords": [
"gntp",
"growl",
"handler",
"log",
"logger",
"logging",
"notifications"
],
"time": "2015-05-11 09:24:19"
},
{
"name": "bartlett/phpunit-loggertestlistener",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/llaville/phpunit-LoggerTestListener.git",
"reference": "cb7e9332f2267f45f94a98f5f447c12dfbae2906"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/llaville/phpunit-LoggerTestListener/zipball/cb7e9332f2267f45f94a98f5f447c12dfbae2906",
"reference": "cb7e9332f2267f45f94a98f5f447c12dfbae2906",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"psr/log": "~1.0"
},
"require-dev": {
"bartlett/monolog-callbackfilterhandler": "~1.0",
"bartlett/monolog-growlhandler": "~1.0",
"monolog/monolog": "~1.10"
},
"suggest": {
"bartlett/monolog-callbackfilterhandler": "Advanced filtering strategies for Monolog",
"bartlett/monolog-growlhandler": "Sends notifications to Growl for Monolog",
"monolog/monolog": "For advanced logging strategies"
},
"type": "library",
"autoload": {
"psr-4": {
"Bartlett\\": "src/Bartlett"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Laurent Laville",
"email": "pear@laurent-laville.org",
"homepage": "https://github.com/llaville",
"role": "Lead"
}
],
"description": "PHPUnit Test Suite listener for compatible PSR-3 logger",
"homepage": "https://github.com/llaville/phpunit-LoggerTestListener",
"time": "2015-10-23 18:14:09"
},
{
"name": "bartlett/umlwriter",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/llaville/umlwriter.git",
"reference": "8b952840a317988b10b4f0c51a3dcec80e8f35dc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/llaville/umlwriter/zipball/8b952840a317988b10b4f0c51a3dcec80e8f35dc",
"reference": "8b952840a317988b10b4f0c51a3dcec80e8f35dc",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"sebastian/version": "~1.0",
"symfony/console": "~2.5"
},
"require-dev": {
"andrewsville/php-token-reflection": "~1.4",
"bartlett/php-reflect": "~4.0"
},
"suggest": {
"andrewsville/php-token-reflection": "Reverse-engine, alternative solution",
"bartlett/php-reflect": "Reverse-engine, default solution"
},
"bin": [
"bin/umlwriter"
],
"type": "library",
"autoload": {
"psr-4": {
"Bartlett\\": "src/Bartlett"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Laurent Laville",
"email": "pear@laurent-laville.org",
"homepage": "https://github.com/llaville",
"role": "Lead"
}
],
"description": "Create UML class diagrams from your PHP source.",
"homepage": "http://php5.laurent-laville.org/umlwriter/",
"keywords": [
"graphviz",
"plantuml",
"uml"
],
"time": "2015-12-09 19:43:25"
},
{
"name": "doctrine/cache",
"version": "v1.6.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/f8af318d14bdb0eff0336795b428b547bd39ccb6",
"reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6",
"shasum": ""
},
"require": {
"php": "~5.5|~7.0"
},
"conflict": {
"doctrine/common": ">2.2,<2.4"
},
"require-dev": {
"phpunit/phpunit": "~4.8|~5.0",
"predis/predis": "~1.0",
"satooshi/php-coveralls": "~0.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Caching library offering an object-oriented API for many cache backends",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"cache",
"caching"
],
"time": "2015-12-31 16:37:02"
},
{
"name": "monolog/monolog",
"version": "1.21.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f42fbdfd53e306bda545845e4dbfd3e72edb4952",
"reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"psr/log": "~1.0"
},
"provide": {
"psr/log-implementation": "1.0.0"
},
"require-dev": {
"aws/aws-sdk-php": "^2.4.9",
"doctrine/couchdb": "~1.0@dev",
"graylog2/gelf-php": "~1.0",
"jakub-onderka/php-parallel-lint": "0.9",
"php-amqplib/php-amqplib": "~2.4",
"php-console/php-console": "^3.1.3",
"phpunit/phpunit": "~4.5",
"phpunit/phpunit-mock-objects": "2.3.0",
"ruflin/elastica": ">=0.90 <3.0",
"sentry/sentry": "^0.13",
"swiftmailer/swiftmailer": "~5.3"
},
"suggest": {
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongo": "Allow sending log messages to a MongoDB server",
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
"php-console/php-console": "Allow sending log messages to Google Chrome",
"rollbar/rollbar": "Allow sending log messages to Rollbar",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
"sentry/sentry": "Allow sending log messages to a Sentry server"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Monolog\\": "src/Monolog"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
}
],
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
"homepage": "http://github.com/Seldaek/monolog",
"keywords": [
"log",
"logging",
"psr-3"
],
"time": "2016-07-29 03:23:52"
},
{
"name": "pear-pear.php.net/Net_Growl",
"version": "2.7.0",
"dist": {
"type": "file",
"url": "https://pear.php.net/get/Net_Growl-2.7.0.tgz",
"reference": null,
"shasum": null
},
"require": {
"ext-mbstring": "*",
"ext-pcre": "*",
"ext-spl": "*",
"php": ">=5.2.0.0"
},
"replace": {
"pear-pear/net_growl": "== 2.7.0.0"
},
"type": "pear-library",
"autoload": {
"classmap": [
""
]
},
"include-path": [
"/"
],
"license": [
"BSD License"
],
"description": "Growl is a MACOSX application that listen to notifications sent by\napplications and displays them on the desktop using different display\nstyles. Net_Growl offers the possibility to send notifications to Growl\nfrom your PHP application through network communication using UDP."
},
{
"name": "psr/log",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "5277094ed527a1c4477177d102fe4c53551953e0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/5277094ed527a1c4477177d102fe4c53551953e0",
"reference": "5277094ed527a1c4477177d102fe4c53551953e0",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2016-09-19 16:02:08"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.4.0",
"ext-tokenizer": "*",
"ext-pcre": "*",
"ext-phar": "*",
"ext-spl": "*",
"ext-json": "*",
"ext-date": "*",
"ext-reflection": "*"
},
"platform-dev": []
}
PK CVI6M@ @
.editorconfignu W+A # EditorConfig is awesome: http://editorconfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.bat]
end_of_line = crlf
# PHP should follow the PSR-2 standard
[*.php]
indent_size = 4
PK CV:pa" " LICENSEnu W+A Copyright (c) 2011-2016, Laurent Laville
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
PK CV phar-manifest.phpnu W+A #!/usr/bin/env php
';
$tag = exec('git describe --tags 2>&1');
if (strpos($tag, '-') === false && strpos($tag, 'No names found') === false) {
print $tag;
} else {
$branch = exec('git rev-parse --abbrev-ref HEAD');
$hash = exec('git log -1 --format="%H"');
print $branch . '@' . $hash;
}
print "\n";
$lock = json_decode(file_get_contents(__DIR__ . '/composer.lock'));
// packages that may be installed but not distributed in the phar version
$excludes = array(
'bartlett/phpunit-loggertestlistener',
'bartlett/monolog-callbackfilterhandler',
'bartlett/monolog-growlhandler',
'pear-pear.php.net/Net_Growl',
);
$packages = function ($package) use ($excludes) {
if (in_array($package->name, $excludes)) {
return;
}
print $package->name . ': ' . $package->version;
if (!preg_match('/^[v= ]*(([0-9]+)(\\.([0-9]+)(\\.([0-9]+)(-([0-9]+))?(-?([a-zA-Z-+][a-zA-Z0-9\\.\\-:]*)?)?)?)?)$/', $package->version)) {
print '@' . $package->source->reference;
}
print "\n";
};
foreach ($lock->packages as $package) {
$packages($package);
}
foreach ($lock->{'packages-dev'} as $package) {
$packages($package);
}
PK CVF0 bin/phpreflect.json-schemanu W+A {
"name": "Config",
"type": "object",
"additionalProperties": false,
"properties": {
"source-providers": {
"type": "array",
"description": "List of data sources to parse.",
"items": {
"type": "object",
"additionalProperties": true,
"properties": {
"in": {
"type": "string",
"description": "Path to the data source (with or without its alias).",
"required": true
},
"name": {
"type": "string",
"description": "Provider filename filter.",
"required": true
}
}
}
},
"plugins": {
"type": "array",
"description": "List of plugins to install.",
"items": {
"type": "object",
"additionalProperties": true,
"properties": {
"name": {
"type": "string",
"description": "Name of the plugin.",
"required": true
},
"class": {
"type": "string",
"description": "Fully Qualified Class Name of the plugin.",
"required": true
}
}
}
},
"analysers": {
"type": "array",
"description": "List of analysers to install.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Name of the analyser.",
"required": true
},
"class": {
"type": "string",
"description": "Fully Qualified Class Name of the analyser.",
"required": true
}
}
}
},
"services": {
"type": "array",
"description": "List of services available.",
"items": {
"type": "object",
"additionalProperties": true,
"properties": {
"client": {
"type": "string",
"description": "Client to interact with API.",
"required": false
},
"logger": {
"type": "string",
"description": "Fully qualified class name of a compatible PSR-3 logger.",
"required": false
}
}
}
}
}
}
PK CVO=): : bin/phpreflect.1nu W+A '\" t
.\" Title: phpreflect
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1
.\" Date: 2015-05-11
.\" Manual: \ \&
.\" Source: \ \& 3.1.0
.\" Language: English
.\"
.TH "PHPREFLECT" "1" "2015\-05\-11" "\ \& 3\&.1\&.0" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
phpreflect \- Reverse\-engineer classes, interfaces, functions, constants, namespaces and more
.SH "SYNOPSIS"
.sp
\fBphpreflect\fR [\fIoptions\fR] \fIcommand\fR [\fIarguments\fR]
.SH "DESCRIPTION"
.sp
The phpreflect(1) command parse any data source, to find out elements, such as classes, interfaces, functions, constants, namespaces\&.
.SH "OPTIONS"
.PP
\fB\-h, \-\-help\fR
.RS 4
Display this help message\&.
.RE
.PP
\fB\-q, \-\-quiet\fR
.RS 4
Do not output any message\&.
.RE
.PP
\fB\-v|vv|v, \-\-verbose\fR
.RS 4
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\&.
.RE
.PP
\fB\-V, \-\-version\fR
.RS 4
Display this application version\&.
.RE
.PP
\fB\-\-ansi\fR
.RS 4
Force ANSI output\&.
.RE
.PP
\fB\-\-no\-ansi\fR
.RS 4
Disable ANSI output\&.
.RE
.PP
\fB\-\-profile\fR
.RS 4
Display timing and memory usage information\&.
.RE
.PP
\fB\-\-progress\fR
.RS 4
Show progress bar\&.
.RE
.PP
\fB\-\-output\fR
.RS 4
Write results to file or URL\&.
.RE
.PP
\fB\-\-manifest\fR
.RS 4
Show which versions of dependencies are bundled (PHAR version only)\&.
.RE
.SH "ANALYSER:LIST COMMAND"
.sp
The phpreflect(1) \fIanalyser:list\fR command is used to show what analysers are installed (see CONF FILES section)\&.
.SH "ANALYSER:RUN COMMAND"
.sp
The phpreflect(1) \fIanalyser:run\fR command is used to analyse a data source and display results\&.
.sp
Usage:
.sp
.if n \{\
.RS 4
.\}
.nf
phpreflect analyser:run [\-\-alias] [\-\-format[="\&.\&.\&."]] [\-\-filter[="\&.\&.\&."]] source [analysers1] \&.\&.\&. [analysersN]
.fi
.if n \{\
.RE
.\}
.sp
Where:
.PP
\fBsource\fR
.RS 4
Identify a data source; may be declared in a json configuration file (see
CONF FILES
section)
.RE
.PP
\fB\-\-alias\fR
.RS 4
If set, the source refers to its alias
.RE
.PP
\fB\-\-format\fR
.RS 4
If set, convert result to a specific format\&. (default: false)
.RE
.PP
\fB\-\-filter\fR
.RS 4
Resource that provide a closure to filter results\&. (default: false)
.RE
.PP
\fBanalysers1\fR \&... \fBanalysersN\fR
.RS 4
Identify one or more analyser to execute\&. See
\fIanalyser:list\fR
command to know what analysers are available\&. (default: ["structure"])
.RE
.SH "CONFIG:VALIDATE COMMAND"
.sp
The phpreflect(1) \fIconfig:validate\fR command is used to check syntax of your json configuration file
.sp
Usage:
.sp
.if n \{\
.RS 4
.\}
.nf
phpreflect config:validate [file]
.fi
.if n \{\
.RE
.\}
.sp
Where:
.PP
\fBfile\fR
.RS 4
Path to
phpreflect\&.json
file (optional)
.RE
.SH "DIAGNOSE:RUN COMMAND"
.sp
The phpreflect(1) \fIdiagnose:run\fR command is used to identify common errors on a platform\&.
.sp
Usage:
.sp
.if n \{\
.RS 4
.\}
.nf
phpreflect diagnose:run [\-vv|\-vvv]
.fi
.if n \{\
.RE
.\}
.SH "DIAGRAM:CLASS COMMAND"
.sp
The phpreflect(1) \fIdiagram:class\fR command is used to generate diagram about a user class present in a data source
.sp
Usage:
.sp
.if n \{\
.RS 4
.\}
.nf
phpreflect diagram:class [\-\-alias] [\-\-engine[="\&.\&.\&."]] argument source
.fi
.if n \{\
.RE
.\}
.sp
Where:
.PP
\fBargument\fR
.RS 4
Name of the class to inspect
.RE
.PP
\fBsource\fR
.RS 4
Identify a data source; may be declared in a json configuration file (see
CONF FILES
section)
.RE
.PP
\fB\-\-alias\fR
.RS 4
If set, the source refers to its alias
.RE
.PP
\fB\-\-engine\fR
.RS 4
Graphical syntax\&. (default: "plantuml")
.RE
.SH "DIAGRAM:PACKAGE COMMAND"
.sp
The phpreflect(1) \fIdiagram:package\fR command is used to generate diagram about namespaces in a data source
.sp
Usage:
.sp
.if n \{\
.RS 4
.\}
.nf
phpreflect diagram:package [\-\-alias] [\-\-engine[="\&.\&.\&."]] argument source
.fi
.if n \{\
.RE
.\}
.sp
Where:
.PP
\fBargument\fR
.RS 4
Name of the namespace to inspect
.RE
.PP
\fBsource\fR
.RS 4
Identify a data source; may be declared in a json configuration file (see
CONF FILES
section)
.RE
.PP
\fB\-\-alias\fR
.RS 4
If set, the source refers to its alias
.RE
.PP
\fB\-\-engine\fR
.RS 4
Graphical syntax\&. (default: "plantuml")
.RE
.SH "PLUGIN:LIST COMMAND"
.sp
The phpreflect(1) \fIplugin:list\fR command is used to show what plugins are installed (see CONF FILES section)\&.
.SH "REFLECTION:CLASS COMMAND"
.sp
The phpreflect(1) \fIreflection:class\fR command is used to give information about a user class present in a data source\&.
.sp
Usage:
.sp
.if n \{\
.RS 4
.\}
.nf
phpreflect reflection:class [\-\-alias] [\-\-format="\&.\&.\&."] argument source
.fi
.if n \{\
.RE
.\}
.sp
Where:
.PP
\fBargument\fR
.RS 4
Name of the class to reflect\&.
.RE
.PP
\fBsource\fR
.RS 4
Identify a data source; may be declared in a json configuration file (see
CONF FILES
section)
.RE
.PP
\fB\-\-alias\fR
.RS 4
If set, the source refers to its alias
.RE
.PP
\fB\-\-format\fR
.RS 4
To ouput results in other formats\&. (default: "txt")
.RE
.SH "REFLECTION:FUNCTION COMMAND"
.sp
The phpreflect(1) \fIreflection:function\fR command is used to give information about a user function present in a data source\&.
.sp
Usage:
.sp
.if n \{\
.RS 4
.\}
.nf
phpreflect reflection:function [\-\-alias] [\-\-format="\&.\&.\&."] argument source
.fi
.if n \{\
.RE
.\}
.sp
Where:
.PP
\fBargument\fR
.RS 4
Name of the function to reflect\&.
.RE
.PP
\fBsource\fR
.RS 4
Identify a data source; may be declared in a json configuration file (see
CONF FILES
section)
.RE
.PP
\fB\-\-alias\fR
.RS 4
If set, the source refers to its alias
.RE
.PP
\fB\-\-format\fR
.RS 4
To ouput results in other formats\&. (default: "txt")
.RE
.SH "EXIT STATUS"
.PP
\fB0\fR
.RS 4
Success
.RE
.PP
\fB1\fR
.RS 4
Failure (syntax or usage error; configuration error; unexpected error)\&.
.RE
.SH "CONF FILES"
.sp
A configuration file contains data sources that can be analysed, but also optional plugins and analysers installed\&. Require configuration file is loaded in the following order:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
The CONF_FILE specified by the environment variables
BARTLETTRC
and
BARTLETT_SCAN_DIR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
phpreflect\&.json
from the current directory\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
phpreflect\&.json
from the User
$HOME/\&.config
directory\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 4." 4.2
.\}
phpreflect\&.json
from the
/etc
directory\&.
.RE
.SH "BUGS"
.sp
Report any issue at https://github\&.com/llaville/php\-reflect/issues
.SH "AUTHORS"
.sp
The Command\-Line Interface (CLI) version was introduced in version 2\&.0 and is written by Laurent Laville\&.
.SH "SEE ALSO"
.sp
Main web site: http://php5\&.laurent\-laville\&.org/reflect/
.SH "COPYRIGHT"
.sp
Copyright (C) 2011\-2015 Laurent Laville\&.
.SH "LICENSE"
.sp
Free use of this software is granted under the terms of the BSD 3\-clause license\&.
PK CVaZ bin/phpreflectnu W+A #!/usr/bin/env php
setUseIncludePath(true);
if (\Phar::running()) {
if ($home) {
// when optional resources are not embedded in phar distribution,
// avoid PHP Warnings, and lookup first in global vendor dir (COMPOSER_HOME) if exists
$classMapfiltered = $fallbackClassMap($loader->getClassMap(), 'Net_Growl');
$loader->addClassMap($classMapfiltered);
// try to find PEAR Net_Growl classes package in folder $fallbackNetGrowlDir (see phar-stub.php)
$loader->add(false, $fallbackNetGrowlDir);
}
}
if (PHP_SAPI !== 'cli') {
return;
}
use Bartlett\Reflect\Environment;
use Bartlett\Reflect\Console\Application;
Environment::setScanDir();
$application = new Application($appName, '4.0');
$application->run();
PK CV bin/phpreflect.json.distnu W+A {
"source-providers": [
{
"in": ". as current",
"name": "/\\.(php|inc|phtml)$/"
}
],
"plugins": [
],
"analysers": [
],
"services": [
]
}
PK CV;_\ \ box.jsonnu W+A {
"alias": "phpreflect.phar",
"chmod": "0755",
"directories": ["src"],
"extract": false,
"compression": "GZ",
"files": [
"bin/phpreflect.json-schema",
"bin/phpreflect.json.dist",
"manifest.txt",
"LICENSE",
"vendor/nikic/php-parser/LICENSE",
"vendor/sebastian/version/LICENSE",
"vendor/symfony/console/LICENSE",
"vendor/symfony/event-dispatcher/LICENSE",
"vendor/symfony/finder/LICENSE",
"vendor/symfony/stopwatch/LICENSE",
"vendor/symfony/dependency-injection/LICENSE",
"vendor/seld/jsonlint/LICENSE",
"vendor/justinrainbow/json-schema/LICENSE",
"vendor/phpdocumentor/reflection-docblock/LICENSE",
"vendor/doctrine/cache/LICENSE",
"vendor/doctrine/collections/LICENSE",
"vendor/psr/log/LICENSE",
"vendor/monolog/monolog/LICENSE",
"vendor/bartlett/umlwriter/LICENSE",
"vendor/autoload.php"
],
"finder": [
{
"name": "*.php",
"in": "vendor/composer"
},
{
"name": "*.php",
"in": "vendor/nikic/php-parser/lib"
},
{
"name": "Version.php",
"in": "vendor/sebastian/version/src"
},
{
"name": "*.php",
"notPath": "/Tests/",
"in": "vendor/symfony"
},
{
"name": "*.php",
"in": "vendor/seld/jsonlint/src"
},
{
"name": "*.php",
"in": "vendor/justinrainbow/json-schema/src"
},
{
"name": "*.php",
"in": "vendor/phpdocumentor/reflection-docblock/src"
},
{
"name": "*.php",
"in": "vendor/doctrine/cache/lib"
},
{
"name": "*.php",
"in": "vendor/doctrine/collections/lib"
},
{
"name": "*.php",
"in": "vendor/psr/log/Psr"
},
{
"name": "*.php",
"in": "vendor/monolog/monolog/src"
},
{
"name": "*.php",
"in": "vendor/bartlett/umlwriter/src"
}
],
"git-version": "package_version",
"main": "bin/phpreflect",
"output": "phpreflect-@git-version@.phar",
"stub": "phar-stub.php",
"web": false,
"shebang": false
}
PK CV$.3 manifest.txtnu W+A bartlett/php-reflect: 4.0.2
doctrine/collections: v1.3.0
justinrainbow/json-schema: 1.6.1
nikic/php-parser: v1.4.1
phpdocumentor/reflection-docblock: 2.0.4
sebastian/version: 1.0.6
seld/jsonlint: 1.4.1
symfony/console: v2.8.11
symfony/dependency-injection: v2.8.11
symfony/event-dispatcher: v2.8.11
symfony/finder: v2.8.11
symfony/polyfill-mbstring: v1.2.0
symfony/stopwatch: v2.8.11
bartlett/umlwriter: 1.1.0
doctrine/cache: v1.6.0
monolog/monolog: 1.21.0
psr/log: 1.0.1
PK CV=8
phar-stub.phpnu W+A #!/usr/bin/env php
=5.4.0",
"ext-tokenizer": "*",
"ext-pcre": "*",
"ext-phar": "*",
"ext-spl": "*",
"ext-json": "*",
"ext-date": "*",
"ext-reflection": "*",
"sebastian/version": "~1.0|~2.0",
"nikic/php-parser": "~1.4",
"doctrine/collections": "~1.2",
"symfony/event-dispatcher": "~2.5",
"symfony/finder": "~2.5",
"symfony/console": "~2.5",
"symfony/stopwatch": "~2.5",
"symfony/dependency-injection": "~2.5",
"phpdocumentor/reflection-docblock": "~2.0",
"justinrainbow/json-schema": "~1.3",
"seld/jsonlint": "~1.1"
},
"require-dev": {
"doctrine/cache": "~1.3",
"psr/log": "~1.0",
"monolog/monolog": "~1.10",
"bartlett/monolog-callbackfilterhandler": "~1.0",
"bartlett/monolog-growlhandler": "~1.0",
"bartlett/phpunit-loggertestlistener": "~1.5",
"bartlett/umlwriter": "~1.0"
},
"suggest": {
"doctrine/cache": "Allow caching results",
"psr/log": "Allow logging events with the LogPlugin",
"monolog/monolog": "Allow logging events with the LogPlugin",
"bartlett/monolog-callbackfilterhandler": "Advanced filtering strategies for Monolog",
"bartlett/monolog-growlhandler": "Sends notifications to Growl for Monolog",
"bartlett/phpunit-loggertestlistener": "Allow logging unit tests to your favorite PSR-3 logger interface",
"bartlett/umlwriter": "Allow writing UML class diagrams (Graphviz or PlantUML)"
},
"authors": [
{
"name": "Laurent Laville",
"email": "pear@laurent-laville.org",
"homepage": "https://github.com/llaville",
"role": "Lead"
}
],
"bin": [
"bin/phpreflect"
],
"autoload": {
"psr-4": {
"Bartlett\\": "src/Bartlett"
}
},
"autoload-dev": {
"psr-4": {
"Bartlett\\Tests\\Reflect\\": "tests/"
}
}
}
PK CVw README.asciidocnu W+A = PHP Reflect
**PHP Reflect** is a library that
adds the ability to reverse-engineer classes, interfaces, functions, constants, namespaces, traits and more.
Both were distributed as source code (install via composer) and a PHAR version
that bundles all dependencies in a single file.
Follow development on the http://php5.laurent-laville.org/reflect/blog/[official Blog].
Have a look on https://github.com/llaville/php-reflect/tree/3.1[branch 3.1] for previous stable API 3.1
== Install
You can either :
* download the phar version http://bartlett.laurent-laville.org/get/phpreflect-4.0.1.phar[4.0.1]
* install via https://packagist.org/packages/bartlett/php-reflect/[packagist] the current source dev-master or the stable version 4.0.1
== Documentation
The documentation for PHP Reflect 4.0 is available
in http://php5.laurent-laville.org/reflect/manual/4.0/en/[English]
to read it online or download to read it later (multiple formats).
AsciiDoc source code are available on `docs` folder of the repository.
== Authors
* Laurent Laville
== License
This handler is licensed under the BSD-3-clauses License - see the `LICENSE` file for details
PK CVU33 3 ) examples/api_analyser_run_with_logger.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
* @since Example available since Release 3.0.0-beta2
*/
$loader = require_once dirname(__DIR__) . '/vendor/autoload.php';
$loader->addClassMap(
array(
'YourNamespace\LogPlugin'
=> __DIR__ . '/YourNamespace/LogPlugin.php',
'YourNamespace\YourLogger'
=> __DIR__ . '/YourNamespace/YourLogger.php',
)
);
use Bartlett\Reflect\Client;
// set our own location of JSON config file
putenv("BARTLETT_SCAN_DIR=" . __DIR__ . '/YourNamespace');
// set our own JSON config file
putenv("BARTLETTRC=yournamespace.json");
// creates an instance of client
$client = new Client();
// request for a Bartlett\Reflect\Api\Analyser
$api = $client->api('analyser');
// perform request, on a data source with default analyser (structure)
$dataSource = dirname(__DIR__) . '/src';
$analysers = array('structure');
// equivalent to CLI command `phpreflect analyser:run ../src`
$metrics = $api->run($dataSource, $analysers);
var_export($metrics);
PK CVKa examples/YourFilters.phpnu W+A &$keys) {
if (strpos($title, 'StructureAnalyser') === false) {
continue;
}
// looking into Structure Analyser metrics only
foreach ($keys as $key => $val) {
if (!in_array($key, $filterOnKeys)) {
unset($keys[$key]); // "removed" unsolicited values
continue;
}
}
}
return $data;
};
return $closure;
PK CVα % examples/YourNamespace/YourLogger.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
* @since Example available since Release 3.1.0
*/
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Bartlett\Reflect\Client;
// creates an instance of client
$client = new Client();
// request for a Bartlett\Reflect\Api\Analyser
$api = $client->api('analyser');
// perform request, on a data source with two analysers (structure, loc)
$dataSource = dirname(__DIR__) . '/src';
$analysers = array('structure', 'loc');
// filter rules on final results
$closure = function ($data) {
$filterOnKeys = array(
'classes', 'abstractClasses', 'concreteClasses',
'classConstants', 'globalConstants', 'magicConstants',
);
foreach ($data as $title => &$keys) {
if (strpos($title, 'StructureAnalyser') === false) {
continue;
}
// looking into Structure Analyser metrics and keep classes and constants info
foreach ($keys as $key => $val) {
if (!in_array($key, $filterOnKeys)) {
unset($keys[$key]); // "removed" unsolicited values
continue;
}
}
}
return $data;
};
// equivalent to CLI command `phpreflect analyser:run --filter=YourFilters.php ../src structure loc`
//$metrics = $api->run($dataSource, $analysers, null, false, $closure = 'YourFilters.php');
// OR with embeded $closure code
$metrics = $api->run($dataSource, $analysers, null, false, $closure);
var_export($metrics);
PK CVЈC C examples/api_plugin_list.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
* @since Example available since Release 3.0.0-alpha3+1
*/
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Bartlett\Reflect\Client;
use Bartlett\Reflect\Environment;
// defines environment where to find the JSON config file
if (!getenv("BARTLETTRC")) {
putenv("BARTLETTRC=phpreflect.json");
}
Environment::setScanDir();
// creates an instance of client
$client = new Client();
// request for a Bartlett\Reflect\Api\Plugin
$api = $client->api('plugin');
$plugins = $api->dir();
print_r($plugins);
PK CVD D examples/api_analyser_run.phpnu W+A
* array (
* 'files' =>
* array (
* // ...
* ),
* 'Bartlett\\Reflect\\Analyser\\StructureAnalyser' =>
* array (
* 'namespaces' => 19,
* 'interfaces' => 7,
* 'traits' => 0,
* 'classes' => 56,
* 'abstractClasses' => 6,
* 'concreteClasses' => 50,
* 'functions' => 6,
* 'namedFunctions' => 0,
* 'anonymousFunctions' => 6,
* 'methods' => 280,
* 'publicMethods' => 241,
* 'protectedMethods' => 29,
* 'privateMethods' => 10,
* 'nonStaticMethods' => 273,
* 'staticMethods' => 7,
* 'constants' => 0,
* 'classConstants' => 17,
* 'globalConstants' => 0,
* 'magicConstants' => 3,
* 'testClasses' => 0,
* 'testMethods' => 0,
* ),
* 'Bartlett\\Reflect\\Analyser\\LocAnalyser' =>
* array (
* 'llocClasses' => 995,
* 'llocByNoc' => 0,
* 'llocByNom' => 0,
* 'llocFunctions' => 48,
* 'llocByNof' => 0,
* 'llocGlobal' => 0,
* 'classes' => 56,
* 'functions' => 6,
* 'methods' => 303,
* 'cloc' => 117,
* 'eloc' => 2700,
* 'lloc' => 1043,
* 'wloc' => 329,
* 'loc' => 3146,
* 'ccn' => 475,
* 'ccnMethods' => 451,
* ),
* )
*
*
* @category PHP
* @package PHP_Reflect
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
* @since Example available since Release 3.0.0-alpha3
*/
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Bartlett\Reflect\Client;
// creates an instance of client
$client = new Client();
// request for a Bartlett\Reflect\Api\Analyser
$api = $client->api('analyser');
// perform request, on a data source with two analysers (structure, loc)
$dataSource = dirname(__DIR__) . '/src';
$analysers = array('structure', 'loc');
// equivalent to CLI command `phpreflect analyser:run ../src structure loc`
$metrics = $api->run($dataSource, $analysers);
var_export($metrics);
PK CVM M ! examples/api_reflection_class.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
* @since Example available since Release 3.0.0-alpha3+1
*/
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Bartlett\Reflect\Client;
// creates an instance of client
$client = new Client();
// request for a Bartlett\Reflect\Api\Reflection
$api = $client->api('reflection');
// perform request, on a data source
$dataSource = dirname(__DIR__) . '/src';
// equivalent to CLI command `phpreflect reflection:class Bartlett\Reflect ../src`
$model = $api->class('Bartlett\\Reflect', $dataSource);
echo $model;
PK CV ( examples/api_analyser_run_with_cache.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
* @since Example available since Release 3.0.0-beta2
*/
$loader = require_once dirname(__DIR__) . '/vendor/autoload.php';
$loader->addClassMap(
array(
'YourNamespace\CachePlugin'
=> __DIR__ . '/YourNamespace/CachePlugin.php',
)
);
use Bartlett\Reflect\Client;
// set our own location of JSON config file
putenv("BARTLETT_SCAN_DIR=" . __DIR__ . '/YourNamespace');
// set our own JSON config file
putenv("BARTLETTRC=yournamespace.json");
// creates an instance of client
$client = new Client();
// request for a Bartlett\Reflect\Api\Analyser
$api = $client->api('analyser');
// perform request, on a data source with default analyser (structure)
$dataSource = dirname(__DIR__) . '/src';
$analysers = array('structure');
// equivalent to CLI command `phpreflect analyser:run ../src`
$metrics = $api->run($dataSource, $analysers);
var_export($metrics);
PK CV=@ + examples/api_analyser_run_with_listener.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
* @since Example available since Release 3.0.0-beta2
*/
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Bartlett\Reflect\Client;
use Symfony\Component\EventDispatcher\GenericEvent;
// creates an instance of client
$client = new Client();
// request for a Bartlett\Reflect\Api\Analyser
$api = $client->api('analyser');
$dispatcher = $api->getEventDispatcher();
$dispatcher->addListener(
'reflect.progress',
function (GenericEvent $e) {
printf(
'Parsing Data source "%s" in progress ... File "%s"' . PHP_EOL,
$e['source'],
$e['file']->getPathname()
);
}
);
// perform request, on a data source with default analyser (structure)
$dataSource = dirname(__DIR__) . '/src';
$analysers = array('structure');
// equivalent to CLI command `phpreflect analyser:run ../src`
$metrics = $api->run($dataSource, $analysers);
var_export($metrics);
PK CVy build/build.xmlnu W+A
A toolchain manager for ${phing.project.name} ${build.version}
targets:
adoc.all Generate the full documentation
all Do all tasks above
PK CV + tests/Environment/dir1/phpreflect.json.distnu W+A {
"source-providers": [
{
"in": ". as current",
"name": "/\\.(php|inc|phtml)$/"
}
],
"plugins": [
],
"analysers": [
],
"services": [
]
}
PK CV'ePE E tests/Environment/YourLogger.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http://php5.laurent-laville.org/reflect/
* @since Class available since Release 3.1.0
*/
namespace Bartlett\Tests\Reflect;
use Bartlett\LoggerTestListenerTrait;
use Psr\Log\LoggerAwareTrait;
use Psr\Log\LogLevel;
/**
* Prints the result of a TestRunner run using a PSR-3 logger.
*
* Use with `--printer` switch on command line
* or `printerClass` attribute in phpunit.xml config file.
*
* @category PHP
* @package PHP_Reflect
* @subpackage Tests
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
*/
class ResultPrinter extends \PHPUnit_TextUI_ResultPrinter
{
use LoggerTestListenerTrait, LoggerAwareTrait;
/**
* {@inheritDoc}
*/
public function __construct($out = null, $verbose = false, $colors = self::COLOR_DEFAULT, $debug = false, $numberOfColumns = 80)
{
parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns);
if ($this->debug) {
$minLevelOrList = LogLevel::INFO;
} elseif ($this->verbose) {
$minLevelOrList = LogLevel::NOTICE;
} else {
$minLevelOrList = array(LogLevel::NOTICE, LogLevel::ERROR);
}
$console = new MonologConsoleLogger('ResultPrinter');
$console->setAcceptedLevels($minLevelOrList);
$handlers = $console->getHandlers();
foreach ($handlers as &$handler) {
// attachs processors only to console handler
if ($handler instanceof \Monolog\Handler\FilterHandler) {
// new results presentation when color is supported or not
$handler->pushProcessor(array($this, 'messageProcessor'));
}
}
$this->setLogger($console);
}
/**
* {@inheritDoc}
*/
public function printResult(\PHPUnit_Framework_TestResult $result)
{
$this->printHeader();
$this->printFooter($result);
}
protected function printHeader()
{
$this->logger->notice(
\PHP_Timer::resourceUsage() .
"\n",
array('operation' => __FUNCTION__)
);
}
public function messageProcessor(array $record)
{
$self = $this;
$debug = $this->debug;
$context = $record['context'];
if (!array_key_exists('operation', $context)) {
return $record;
}
if ('printHeader' == $context['operation']) {
$color = 'fg-yellow';
$record['message'] = $self->formatWithColor($color, $record['message']);
} elseif ('printFooter' == $context['operation']) {
if ($context['testCount'] === 0) {
$color = 'fg-black, bg-yellow';
} else {
$color = ($context['status'] == 'OK')
? 'fg-black, bg-green' : 'fg-white, bg-red';
}
$record['message'] = $self->formatWithColor($color, $record['message']);
} elseif ('startTestSuite' == $context['operation']) {
$record['message'] =
$self->formatWithColor('fg-yellow', $context['suiteName'].':') .
"\n\n " .
$self->formatWithColor(
'fg-cyan',
sprintf('Test suite started with %d tests', $context['testCount'])
) .
"\n"
;
} elseif ('endTestSuite' == $context['operation']) {
$resultStatus = ($context['errorCount'] + $context['failureCount']) ? 'KO' : 'OK';
$resultMessage = sprintf('Results %s. ', $resultStatus) .
$self->formatCounters(
$context['testCount'],
$context['assertionCount'],
$context['failureCount'],
$context['errorCount'],
$context['incompleteCount'],
$context['skipCount'],
$context['riskyCount']
)
;
if ($resultStatus == 'OK') {
if ($context['testCount'] === 0) {
$color = 'fg-black, bg-yellow';
} else {
$color = 'fg-yellow';
}
} else {
$color = 'fg-red';
}
$record['message'] =
$self->formatWithColor('fg-yellow', $context['suiteName'].':') .
"\n\n " .
$self->formatWithColor(
'fg-cyan',
'Test suite ended. '
) .
$self->formatWithColor(
$color,
$resultMessage
) .
"\n"
;
} elseif (in_array(strtolower($record['level_name']), array(LogLevel::INFO, LogLevel::WARNING, LogLevel::ERROR))) {
// indent messages
$indent = str_repeat(' ', 4);
$shortLabel = $context['testName'];
$longLabel = str_replace($context['testDescriptionArr'][0].'::', '', $context['testDescriptionStr']);
if ('startTest' == $context['operation']) {
$record['message'] = sprintf("%sTest '%s' started.", $indent, ($debug ? $longLabel : $shortLabel));
} elseif ('endTest' == $context['operation']) {
$record['message'] = sprintf("%sTest '%s' ended.", $indent, $shortLabel);
} elseif ('addError' == $context['operation']) {
$record['message'] = sprintf("%sError while running test '%s'. %s", $indent, $shortLabel, $context['reason']);
} elseif ('addFailure' == $context['operation']) {
$record['message'] = sprintf("%sTest '%s' failed. %s", $indent, $shortLabel, $context['reason']);
} elseif ('addIncompleteTest' == $context['operation']) {
$record['message'] = sprintf("%sTest '%s' is incomplete. %s", $indent, $shortLabel, $context['reason']);
} elseif ('addRiskyTest' == $context['operation']) {
$record['message'] = sprintf("%sTest '%s' is risky. %s", $indent, $shortLabel, $context['reason']);
} elseif ('addSkippedTest' == $context['operation']) {
$record['message'] = sprintf("%sTest '%s' has been skipped. %s", $indent, $shortLabel, $context['reason']);
}
}
return $record;
}
}
PK CV
1 1 tests/EnvironmentTest.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http://php5.laurent-laville.org/reflect/
* @since Class available since Release 2.6.0
*/
namespace Bartlett\Tests\Reflect;
use Bartlett\Reflect\Environment;
/**
* Unit Test Case that covers Bartlett\Reflect\Environment
*
* @category PHP
* @package PHP_Reflect
* @subpackage Tests
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
*/
class EnvironmentTest extends \PHPUnit_Framework_TestCase
{
const DIST_RC = 'phpreflect.json.dist';
/**
* Clean-up single test environment
*
* @return void
*/
public function tearDown()
{
putenv("BARTLETT_SCAN_DIR=");
putenv("BARTLETTRC=");
}
/**
* @covers Bartlett\Reflect\Environment::getJsonConfigFilename
*
* @return void
*/
public function testUndefinedScanDir()
{
$this->assertFalse(
Environment::getJsonConfigFilename(),
"Environment variable BARTLETT_SCAN_DIR is not defined."
);
}
/**
* @covers Bartlett\Reflect\Environment::getJsonConfigFilename
*
* @return void
*/
public function testUndefinedConfigFilename()
{
putenv("BARTLETT_SCAN_DIR=.");
$this->assertFalse(
Environment::getJsonConfigFilename(),
"Environment variable BARTLETTRC is not defined."
);
}
/**
* @covers Bartlett\Reflect\Environment::getJsonConfigFilename
*
* @return void
*/
public function testGetConfigFilenameInSingleScanDirEnvironment()
{
$singleScanDir = __DIR__ . DIRECTORY_SEPARATOR . 'Environment' . DIRECTORY_SEPARATOR . 'dir1';
putenv("BARTLETT_SCAN_DIR=$singleScanDir");
putenv("BARTLETTRC=" . self::DIST_RC);
$this->assertEquals(
$singleScanDir . DIRECTORY_SEPARATOR . self::DIST_RC,
Environment::getJsonConfigFilename(),
"Config filename does not match."
);
}
/**
* @covers Bartlett\Reflect\Environment::getJsonConfigFilename
*
* @return void
*/
public function testGetConfigFilenameInMultipleScanDirEnvironment()
{
$baseScanDir = __DIR__ . DIRECTORY_SEPARATOR . 'Environment';
$multipleScanDir = $baseScanDir . DIRECTORY_SEPARATOR . 'dir1'
. PATH_SEPARATOR .
$baseScanDir . DIRECTORY_SEPARATOR . 'dir2'
;
putenv("BARTLETT_SCAN_DIR=$multipleScanDir");
putenv("BARTLETTRC=" . self::DIST_RC);
$this->assertEquals(
$baseScanDir . DIRECTORY_SEPARATOR . 'dir1' . DIRECTORY_SEPARATOR . self::DIST_RC,
Environment::getJsonConfigFilename(),
"Config filename does not match."
);
}
/**
* @covers Bartlett\Reflect\Environment::setScanDir
*
* @return void
*/
public function testSetDefaultScanDir()
{
$home = defined('PHP_WINDOWS_VERSION_BUILD') ? 'USERPROFILE' : 'HOME';
$dirs = array(
realpath('.'),
getenv($home) . DIRECTORY_SEPARATOR . '.config',
DIRECTORY_SEPARATOR . 'etc'
);
$multipleScanDir = implode(PATH_SEPARATOR, $dirs);
Environment::setScanDir();
$this->assertEquals(
$multipleScanDir,
getenv("BARTLETT_SCAN_DIR"),
"Environment variable BARTLETT_SCAN_DIR does not match."
);
}
/**
* @covers Bartlett\Reflect\Environment::getLogger
* @runInSeparateProcess
*
* @return void
*/
public function testDefaultLoggerAccessor()
{
$singleScanDir = __DIR__ . DIRECTORY_SEPARATOR . 'Environment' . DIRECTORY_SEPARATOR . 'dir1';
putenv("BARTLETT_SCAN_DIR=$singleScanDir");
putenv("BARTLETTRC=" . self::DIST_RC);
$logger = Environment::getLogger();
$this->assertInstanceOf(
'Psr\Log\LoggerInterface',
$logger,
'This is not a compatible PSR-3 logger'
);
$this->assertEquals(
'Bartlett\Reflect\Plugin\Log\DefaultLogger',
get_class($logger),
'Default logger does not match.'
);
}
/**
* @covers Bartlett\Reflect\Environment::getLogger
* @runInSeparateProcess
*
* @return void
*/
public function testCustomLoggerAccessor()
{
$singleScanDir = __DIR__ . DIRECTORY_SEPARATOR . 'Environment';
putenv("BARTLETT_SCAN_DIR=$singleScanDir");
putenv("BARTLETTRC=phpreflect.json");
$logger = Environment::getLogger();
$this->assertInstanceOf(
'Psr\Log\LoggerInterface',
$logger,
'This is not a compatible PSR-3 logger'
);
$this->assertEquals(
'Bartlett\Tests\Reflect\Environment\YourLogger',
get_class($logger),
'Custom logger does not match.'
);
}
/**
* @covers Bartlett\Reflect\Environment::getClient
* @runInSeparateProcess
*
* @return void
*/
public function testDefaultClientAccessor()
{
$singleScanDir = __DIR__ . DIRECTORY_SEPARATOR . 'Environment' . DIRECTORY_SEPARATOR . 'dir1';
putenv("BARTLETT_SCAN_DIR=$singleScanDir");
putenv("BARTLETTRC=" . self::DIST_RC);
$client = Environment::getClient();
$this->assertInstanceOf(
'Bartlett\Reflect\Client\ClientInterface',
$client,
'This is not a compatible Reflect API client'
);
$this->assertEquals(
'Bartlett\Reflect\Client\LocalClient',
get_class($client),
'Default client does not match.'
);
}
}
PK CV)a a tests/bootstrap.phpnu W+A addClassMap(
array(
'Bartlett\Tests\Reflect\Analyser\FooAnalyser'
=> __DIR__ . '/Analyser/FooAnalyser.php',
'Bartlett\Tests\Reflect\Analyser\BarAnalyser'
=> __DIR__ . '/Analyser/BarAnalyser.php',
'Bartlett\Tests\Reflect\Model\GenericModelTest'
=> __DIR__ . '/Model/GenericModelTest.php',
'Bartlett\Tests\Reflect\Environment\YourLogger'
=> __DIR__ . '/Environment/YourLogger.php',
)
);
PK CVѨ2 ! tests/Model/ConstantModelTest.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http://php5.laurent-laville.org/reflect/
* @since Class available since Release 2.0.0RC1
*/
namespace Bartlett\Tests\Reflect\Model;
/**
* Unit Test Case that covers Bartlett\Reflect\Model\ConstantModel
*
* @category PHP
* @package PHP_Reflect
* @subpackage Tests
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
*/
class ConstantModelTest extends GenericModelTest
{
/**
* Sets up the shared fixture.
*
* @return void
*/
public static function setUpBeforeClass()
{
self::$fixture = 'constants.php';
parent::setUpBeforeClass();
}
/**
* Tests the Doc comment accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getDocComment
* @group reflection
* @return void
*/
public function testDocCommentAccessor()
{
$c = 0; // sandbox\CONNECT_OK
$expected = '/** connection semaphore */';
$this->assertEquals(
$expected,
self::$models[$c]->getDocComment(),
self::$models[$c]->getName() . ' doc comment does not match.'
);
}
/**
* Tests file name accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getFileName
* @group reflection
* @return void
*/
public function testFileNameAccessor()
{
$c = 0; // sandbox\CONNECT_OK
$this->assertEquals(
self::$fixture,
self::$models[$c]->getFileName(),
self::$models[$c]->getName() . ' file name does not match.'
);
}
/**
* Tests name accessor.
*
* covers Bartlett\Reflect\Model\ConstantModel::getName
* @group reflection
* @return void
*/
public function testNameAccessor()
{
$c = 0; // sandbox\CONNECT_OK
$this->assertEquals(
'sandbox\CONNECT_OK',
self::$models[$c]->getName(),
self::$models[$c]->getName() . ' constant name does not match.'
);
}
/**
* Tests value accessor of a user constant.
*
* covers Bartlett\Reflect\Model\ConstantModel::getValue
* @group reflection
* @return void
*/
public function testUserConstantValueAccessor()
{
$c = 0; // sandbox\CONNECT_OK
$this->assertEquals(
1,
self::$models[$c]->getValue(),
self::$models[$c]->getName() . ' user constant value does not match.'
);
}
/**
* Tests the namespace name accessor.
*
* covers Bartlett\Reflect\Model\ConstantModel::getNamespaceName
* @group reflection
* @return void
*/
public function testNamespaceNameAccessor()
{
$c = 0; // sandbox\CONNECT_OK
$this->assertEquals(
'sandbox',
self::$models[$c]->getNamespaceName(),
self::$models[$c]->getName() . ' namespace does not match.'
);
}
/**
* Tests function short name accessor.
*
* covers Bartlett\Reflect\Model\ConstantModel::getShortName
* @group reflection
* @return void
*/
public function testShortNameAccessor()
{
$c = 0; // sandbox\CONNECT_OK
$this->assertEquals(
'CONNECT_OK',
self::$models[$c]->getShortName(),
self::$models[$c]->getName() . ' short name does not match.'
);
}
/**
* Tests whether a constant is defined in a namespace.
*
* covers Bartlett\Reflect\Model\ConstantModel::inNamespace
* @group reflection
* @return void
*/
public function testInNamespace()
{
$c = 0; // sandbox\CONNECT_OK
$this->assertTrue(
self::$models[$c]->inNamespace(),
self::$models[$c]->getName() . ' is defined in a namespace.'
);
}
/**
* Tests whether a constant is internal.
*
* covers Bartlett\Reflect\Model\ConstantModel::isInternal
* @group reflection
* @return void
*/
public function testIsInternal()
{
$c = 0; // sandbox\CONNECT_OK
$this->assertFalse(
self::$models[$c]->isInternal(),
self::$models[$c]->getName() . ' is an internal constant.'
);
}
/**
* Tests whether a constant is magic.
*
* covers Bartlett\Reflect\Model\ConstantModel::isMagic
* @group reflection
* @return void
*/
public function testIsMagic()
{
$c = 0; // sandbox\CONNECT_OK
$this->assertFalse(
self::$models[$c]->isMagic(),
self::$models[$c]->getName() . ' is a magic constant.'
);
}
/**
* Tests whether a constant is scalar.
*
* covers Bartlett\Reflect\Model\ConstantModel::isScalar
* @group reflection
* @return void
*/
public function testIsScalar()
{
$c = 4; // sandbox\TWO
$this->assertFalse(
self::$models[$c]->isScalar(),
self::$models[$c]->getName() . ' is a scalar constant.'
);
}
/**
* Tests string representation of the FunctionModel object
*
* covers Bartlett\Reflect\Model\ConstantModel::__toString
* @group reflection
* @return void
*/
public function testToString()
{
$c = 4; // sandbox\TWO
$expected = <<expectOutputString($expected);
print(
self::$models[$c]->__toString()
);
}
}
PK CV@ ! tests/Model/PropertyModelTest.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http://php5.laurent-laville.org/reflect/
* @since Class available since Release 2.0.0RC2
*/
namespace Bartlett\Tests\Reflect\Model;
/**
* Unit Test Case that covers Bartlett\Reflect\Model\PropertyModel
*
* @category PHP
* @package PHP_Reflect
* @subpackage Tests
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
*/
class PropertyModelTest extends GenericModelTest
{
/**
* Sets up the shared fixture.
*
* @return void
*/
public static function setUpBeforeClass()
{
self::$fixture = 'properties.php';
parent::setUpBeforeClass();
}
/**
* Tests doc comment accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getDocComment
* @group reflection
* @return void
*/
public function testDocCommentAccessor()
{
$c = 0; // class SimpleClass
$p = 5; // var6 property
$properties = self::$models[$c]->getProperties();
$this->assertEquals(
'/** This is allowed only in PHP 5.3.0 and later. */',
$properties[$p]->getDocComment(),
$properties[$p]->getName()
. ' doc comment does not match.'
);
}
/**
* Tests name of the property.
*
* covers Bartlett\Reflect\Model\PropertyModel::getName
* @group reflection
* @return void
*/
public function testNameAccessor()
{
$c = 0; // class SimpleClass
$p = 1; // var2 property
$properties = self::$models[$c]->getProperties();
$this->assertEquals(
'var2',
$properties[$p]->getName(),
$properties[$p]->getName()
. ", property #$p name does not match."
);
}
/**
* Tests declaring class of the property.
*
* covers Bartlett\Reflect\Model\PropertyModel::getDeclaringClass
* @group reflection
* @return void
*/
public function testDeclaringClassAccessor()
{
$c = 0; // class SimpleClass
$p = 1; // var2 property
$properties = self::$models[$c]->getProperties();
$this->assertEquals(
'SimpleClass',
$properties[$p]->getDeclaringClass()->getName(),
$properties[$p]->getName()
. ", property #$p declaring class does not match."
);
}
/**
* Tests if property is defined at run-time or compile-time.
*
* covers Bartlett\Reflect\Model\PropertyModel::isDefault
* @group reflection
* @return void
*/
public function testDefaultValue()
{
$c = 0; // class SimpleClass
$p = 1; // var2 property
$properties = self::$models[$c]->getProperties();
$this->assertTrue(
$properties[$p]->isDefault(),
$properties[$p]->getName()
. ", property #$p was not declared at compile-time."
);
}
/**
* Tests default value of the property.
*
* covers Bartlett\Reflect\Model\PropertyModel::getValue
* @group reflection
* @return void
*/
public function testValueAccessor()
{
$c = 0; // class SimpleClass
$p = 5; // var6 property
$properties = self::$models[$c]->getProperties();
$expected = 'hello world';
$this->assertEquals(
$expected,
$properties[$p]->getValue(),
$properties[$p]->getName()
. ", property #$p value does not match."
);
}
/**
* Tests property with private visibility.
*
* covers Bartlett\Reflect\Model\PropertyModel::isPrivate
* @group reflection
* @return void
*/
public function testPrivateProperty()
{
$c = 0; // class SimpleClass
$p = 2; // var3 property
$properties = self::$models[$c]->getProperties();
$this->assertTrue(
$properties[$p]->isPrivate(),
$properties[$p]->getName()
. ' is not a private property.'
);
}
/**
* Tests property with protected visibility.
*
* covers Bartlett\Reflect\Model\PropertyModel::isProtected
* @group reflection
* @return void
*/
public function testProtectedProperty()
{
$c = 0; // class SimpleClass
$p = 3; // var4 property
$properties = self::$models[$c]->getProperties();
$this->assertTrue(
$properties[$p]->isProtected(),
$properties[$p]->getName()
. ' is not a protected property.'
);
}
/**
* Tests property with public visibility.
*
* covers Bartlett\Reflect\Model\PropertyModel::isPublic
* @group reflection
* @return void
*/
public function testPublicProperty()
{
$c = 0; // class SimpleClass
$p = 4; // var5 property
$properties = self::$models[$c]->getProperties();
$this->assertTrue(
$properties[$p]->isPublic(),
$properties[$p]->getName()
. ' is not a public property.'
);
}
/**
* Tests property with static keyword.
*
* covers Bartlett\Reflect\Model\PropertyModel::isStatic
* @group reflection
* @return void
*/
public function testStaticProperty()
{
$c = 0; // class SimpleClass
$p = 2; // var3 property
$properties = self::$models[$c]->getProperties();
$this->assertTrue(
$properties[$p]->isStatic(),
$properties[$p]->getName()
. ' is not a static property.'
);
}
/**
* Tests property with implicit public visibility.
*
* covers Bartlett\Reflect\Model\PropertyModel::isImplicitlyPublic
* @group reflection
* @return void
*/
public function testImplicitlyPublicProperty()
{
$c = 0; // class SimpleClass
$p = 0; // debug property
$properties = self::$models[$c]->getProperties();
$this->assertTrue(
$properties[$p]->isImplicitlyPublic(),
$properties[$p]->getName()
. ' is not implicitly public.'
);
}
/**
* Tests string representation of the PropertyModel object
* for a static property.
*
* covers Bartlett\Reflect\Model\PropertyModel::__toString
* @group reflection
* @return void
*/
public function testToStringStaticProperty()
{
$c = 0; // class SimpleClass
$p = 2; // var3 property
$properties = self::$models[$c]->getProperties();
$this->assertEquals(
'Property [ private static $var3 ]' . "\n",
$properties[$p]->__toString(),
$properties[$p]->getName()
. ", property #$p string representation does not match."
);
}
}
PK CVh4
},3 ,3 " tests/Model/ParameterModelTest.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http://php5.laurent-laville.org/reflect/
* @since Class available since Release 2.0.0RC1
*/
namespace Bartlett\Tests\Reflect\Model;
use Bartlett\Reflect\Exception\ModelException;
/**
* Unit Test Case that covers Bartlett\Reflect\Model\ParameterModel
*
* @category PHP
* @package PHP_Reflect
* @subpackage Tests
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
*/
class ParameterModelTest extends GenericModelTest
{
/**
* Sets up the shared fixture.
*
* @return void
*/
public static function setUpBeforeClass()
{
self::$fixture = 'functions.php';
parent::setUpBeforeClass();
}
/**
* Tests name of the parameter.
*
* covers Bartlett\Reflect\Model\ParameterModel::getName
* @group reflection
* @return void
*/
public function testNameAccessor()
{
$c = 1; // class Foo
$m = 1; // method otherfunction
$p = 0; // parameter $baz
$methods = self::$models[$c]->getMethods();
$parameters = $methods[$m]->getParameters();
$this->assertEquals(
'baz',
$parameters[$p]->getName(),
$methods[$m]->getName()
. ", parameter #$p name does not match."
);
}
/**
* Tests position of the parameter.
*
* covers Bartlett\Reflect\Model\ParameterModel::getPosition
* @group reflection
* @return void
*/
public function testPositionAccessor()
{
$f = 2; // function singleFunction
$p = 1; // parameter $somethingelse
$parameters = self::$models[$f]->getParameters();
$this->assertEquals(
1,
$parameters[$p]->getPosition(),
self::$models[$f]->getName() . ", parameter #$p position does not match."
);
}
/**
* Tests type hinting of the parameter.
*
* covers Bartlett\Reflect\Model\ParameterModel::getTypeHint
* @group reflection
* @return void
*/
public function testTypeHintAccessor()
{
$f = 2; // function singleFunction
$p = 0; // parameter $someparam
$parameters = self::$models[$f]->getParameters();
$this->assertEquals(
'array',
$parameters[$p]->getTypeHint(),
self::$models[$f]->getName() . ", parameter #$p type hint does not match."
);
}
/**
* Tests whether the parameter allows NULL
* when type hint is defined without default value for a class method.
*
* covers Bartlett\Reflect\Model\ParameterModel::allowsNull
* @group reflection
* @return void
*/
public function testAllowsNullWhenOnlyTypeHintDefinedOnClassMethod()
{
$i = 0; // interface iB extends iA
$m = 0; // method baz
$p = 0; // parameter $baz
$methods = self::$models[$i]->getMethods();
$parameters = $methods[$m]->getParameters();
$this->assertFalse(
$parameters[$p]->allowsNull(),
self::$models[$i]->getName()
. '::'
. $methods[$m]->getName()
. ", parameter #$p does not allow null with type hint without null default value."
);
}
/**
* Tests whether the parameter allows NULL
* when type hint is defined with default value is null for a class method.
*
* covers Bartlett\Reflect\Model\ParameterModel::allowsNull
* @group reflection
* @return void
*/
public function testAllowsNullWhenTypeHintDefinedWithNullDefaultValueOnClassMethod()
{
$c = 1; // class Foo
$m = 0; // method myfunction
$p = 0; // parameter $param
$methods = self::$models[$c]->getMethods();
$parameters = $methods[$m]->getParameters();
$this->assertTrue(
$parameters[$p]->allowsNull(),
self::$models[$c]->getName()
. '::'
. $methods[$m]->getName()
. ", parameter #$p allows null with type hint and null default value."
);
}
/**
* Tests whether the parameter allows NULL
* when type hint is not defined for a class method.
*
* covers Bartlett\Reflect\Model\ParameterModel::allowsNull
* @group reflection
* @return void
*/
public function testAllowsNullWithoutTypeHintDefinedOnClassMethod()
{
$c = 1; // class Foo
$m = 1; // method otherfunction
$p = 1; // parameter $param
$methods = self::$models[$c]->getMethods();
$parameters = $methods[$m]->getParameters();
$this->assertTrue(
$parameters[$p]->allowsNull(),
$methods[$m]->getName()
. ", parameter #$p allows null without type hint."
);
}
/**
* Tests whether the parameter allows NULL
* for a user-defined function.
*
* covers Bartlett\Reflect\Model\ParameterModel::allowsNull
* @group reflection
* @return void
*/
public function testAllowsNullOnUserFunction()
{
$f = 2; // function singleFunction
$p = 2; // parameter $lastone
$parameters = self::$models[$f]->getParameters();
$this->assertTrue(
$parameters[$p]->allowsNull(),
self::$models[$f]->getName() . ", parameter #$p allows null when default value is null."
);
}
/**
* Tests if the parameter is optional.
*
* covers Bartlett\Reflect\Model\ParameterModel::isOptional
* @group reflection
* @return void
*/
public function testIsOptional()
{
$f = 2; // function singleFunction
$p = 1; // parameter $somethingelse
$parameters = self::$models[$f]->getParameters();
$this->assertFalse(
$parameters[$p]->isOptional(),
self::$models[$f]->getName() . ", parameter #$p is required."
);
}
/**
* Checks if the parameter is passed in by reference.
*
* covers Bartlett\Reflect\Model\ParameterModel::isPassedByReference
* @group reflection
* @return void
*/
public function testIsPassedByReference()
{
$f = 3; // function myprocess
$p = 1; // parameter $myresult
$parameters = self::$models[$f]->getParameters();
$this->assertTrue(
$parameters[$p]->isPassedByReference(),
self::$models[$f]->getName() . ", parameter #$p is passed by reference."
);
}
/**
* Checks if the parameter is variadic.
*
* covers Bartlett\Reflect\Model\ParameterModel::isVariadic
* @group reflection
* @link http://php.net/manual/en/migration56.new-features.php#migration56.new-features.variadics
* @return void
*/
public function testIsVariadic()
{
$f = 3; // function myprocess
$p = 2; // parameter $opt
$parameters = self::$models[$f]->getParameters();
$this->assertTrue(
$parameters[$p]->isVariadic(),
self::$models[$f]->getName() . ", parameter #$p is not variadic."
);
}
/**
* Tests if the parameter expects an array.
*
* covers Bartlett\Reflect\Model\ParameterModel::isArray
* @group reflection
* @return void
*/
public function testIsArray()
{
$f = 2; // function singleFunction
$p = 0; // parameter $someparam
$parameters = self::$models[$f]->getParameters();
$this->assertTrue(
$parameters[$p]->isArray(),
self::$models[$f]->getName() . ", parameter #$p expects an array."
);
}
/**
* Tests if the parameter expects a callback.
*
* covers Bartlett\Reflect\Model\ParameterModel::isCallable
* @group reflection
* @return void
*/
public function testIsCallable()
{
$f = 3; // function myprocess
$p = 0; // parameter $param
$parameters = self::$models[$f]->getParameters();
$this->assertTrue(
$parameters[$p]->isCallable(),
self::$models[$f]->getName() . ", parameter #$p expects a callback."
);
}
/**
* Tests if a default value for the parameter is available
* for a user-defined function.
*
* covers Bartlett\Reflect\Model\ParameterModel::isDefaultValueAvailable
* @group reflection
* @return void
*/
public function testIsDefaultValueAvailableOnUserFunction()
{
$f = 2; // function singleFunction
$p = 2; // parameter $lastone
$parameters = self::$models[$f]->getParameters();
$this->assertTrue(
$parameters[$p]->isDefaultValueAvailable(),
self::$models[$f]->getName() . ", parameter #$p have a default value."
);
}
/**
* Tests the default value of the parameter for a class method.
*
* covers Bartlett\Reflect\Model\ParameterModel::getDefaultValue
* @group reflection
* @return void
*/
public function testDefaultValueAccessorOnClassMethod()
{
$c = 1; // class Foo
$m = 0; // method myfunction
$p = 1; // parameter $otherparam
$methods = self::$models[$c]->getMethods();
$parameters = $methods[$m]->getParameters();
$this->assertEquals(
'TRUE',
$parameters[$p]->getDefaultValue(),
$methods[$m]->getName()
. ", parameter #$p default value does not match."
);
}
/**
* Tests the default value of the parameter for a user-defined function.
*
* covers Bartlett\Reflect\Model\ParameterModel::getDefaultValue
* @group reflection
* @return void
*/
public function testDefaultValueAccessorOnUserFunction()
{
$f = 2; // function singleFunction
$p = 2; // parameter $lastone
$parameters = self::$models[$f]->getParameters();
$this->assertEquals(
'NULL',
$parameters[2]->getDefaultValue(),
self::$models[$f]->getName() . ", parameter #$p default value does not match."
);
}
/**
* Tests the default value of a parameter not optional.
*
* covers Bartlett\Reflect\Model\ParameterModel::getDefaultValue
* @group reflection
* @return void
*/
public function testDefaultValueAccessorOnRequiredParameter()
{
try {
$f = 2; // function singleFunction
$p = 0; // parameter $someparam
$parameters = self::$models[$f]->getParameters();
$parameters[$p]->getDefaultValue();
} catch (ModelException $expected) {
$this->assertEquals(
'Parameter #0 [$someparam] is not optional.',
$expected->getMessage(),
'Expected exception message does not match'
);
return;
}
$this->fail(
'An expected Bartlett\Reflect\Exception\ModelException exception' .
' has not been raised.'
);
}
/**
* Tests string representation of the ParameterModel object
* for a required parameter.
*
* covers Bartlett\Reflect\Model\ParameterModel::__toString
* @group reflection
* @return void
*/
public function testToStringRequiredParameter()
{
$f = 3; // function myprocess
$p = 1; // parameter $myresult
$parameters = self::$models[$f]->getParameters();
$this->assertEquals(
'Parameter #1 [ &$myresult ]' . "\n",
$parameters[$p]->__toString(),
self::$models[$f]->getName() . ", parameter #$p string representation does not match."
);
}
/**
* Tests string representation of the ParameterModel object
* for an optional parameter.
*
* covers Bartlett\Reflect\Model\ParameterModel::__toString
* @group reflection
* @return void
*/
public function testToStringOptionalParameter()
{
$c = 1; // class Foo
$m = 0; // method myfunction
$p = 0; // parameter $param
$methods = self::$models[$c]->getMethods();
$parameters = $methods[$m]->getParameters();
$this->assertEquals(
'Parameter #0 [ stdClass $param = NULL ]' . "\n",
$parameters[$p]->__toString(),
$methods[$m]->getName()
. ", parameter #$p string representation does not match."
);
}
}
PK CV =.? ? tests/Model/ClassModelTest.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http://php5.laurent-laville.org/reflect/
* @since Class available since Release 2.0.0RC1
*/
namespace Bartlett\Tests\Reflect\Model;
use Bartlett\Reflect\Exception\ModelException;
/**
* Unit Test Case that covers Bartlett\Reflect\Model\ClassModel
*
* @category PHP
* @package PHP_Reflect
* @subpackage Tests
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
*/
class ClassModelTest extends GenericModelTest
{
/**
* Sets up the shared fixture.
*
* @return void
*/
public static function setUpBeforeClass()
{
self::$fixture = 'classes.php';
parent::setUpBeforeClass();
}
/**
* Tests the Doc comment accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getDocComment
* @group reflection
* @return void
*/
public function testDocCommentAccessor()
{
$c = 3; // class Foo implements iB
$expected = '/** short desc for class that implement a unique interface */';
$this->assertEquals(
$expected,
self::$models[$c]->getDocComment(),
self::$models[$c]->getName() . ' doc comment does not match.'
);
}
/**
* Tests starting line number accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getStartLine
* @group reflection
* @return void
*/
public function testStartLineAccessor()
{
$c = 3; // class Foo implements iB
$this->assertEquals(
21,
self::$models[$c]->getStartLine(),
self::$models[$c]->getName() . ' starting line does not match.'
);
}
/**
* Tests ending line number accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getEndLine
* @group reflection
* @return void
*/
public function testEndLineAccessor()
{
$c = 3; // class Foo implements iB
$this->assertEquals(
33,
self::$models[$c]->getEndLine(),
self::$models[$c]->getName() . ' ending line does not match.'
);
}
/**
* Tests file name accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getFileName
* @group reflection
* @return void
*/
public function testFileNameAccessor()
{
$c = 3; // class Foo implements iB
$this->assertEquals(
self::$fixture,
self::$models[$c]->getFileName(),
self::$models[$c]->getName() . ' file name does not match.'
);
}
/**
* Tests class name accessor.
*
* covers Bartlett\Reflect\Model\ClassModel::getName
* @group reflection
* @return void
*/
public function testNameAccessor()
{
$c = 3; // class Foo implements iB
$this->assertEquals(
'Foo',
self::$models[$c]->getName(),
self::$models[$c]->getName() . ' class name does not match.'
);
}
/**
* Tests the namespace name accessor.
*
* covers Bartlett\Reflect\Model\ClassModel::getNamespaceName
* @group reflection
* @return void
*/
public function testNamespaceNameAccessor()
{
$c = 3; // class Foo implements iB
$this->assertEquals(
'',
self::$models[$c]->getNamespaceName(),
self::$models[$c]->getName() . ' namespace does not match.'
);
}
/**
* Tests class short name accessor.
*
* covers Bartlett\Reflect\Model\ClassModel::getShortName
* @group reflection
* @return void
*/
public function testShortNameAccessor()
{
$c = 3; // class Foo implements iB
$this->assertEquals(
'Foo',
self::$models[$c]->getShortName(),
self::$models[$c]->getName() . ' short name does not match.'
);
}
/**
* Tests class constants accessor.
*
* covers Bartlett\Reflect\Model\ClassModel::getConstants
* @group reflection
* @return void
*/
public function testConstantsAccessor()
{
$c = 6; // class Bar
$this->assertCount(
2,
self::$models[$c]->getConstants(),
self::$models[$c]->getName() . ' constants number does not match.'
);
}
/**
* Tests class constant accessor.
*
* covers Bartlett\Reflect\Model\ClassModel::getConstant
* @group reflection
* @return void
*/
public function testConstantAccessor()
{
$c = 6; // class Bar
$k = 'ONE'; // constant ONE
$this->assertEquals(
'Number one',
self::$models[$c]->getConstant($k),
self::$models[$c]->getName() . "::$k constant value does not match."
);
}
/**
* Tests class constant accessor.
*
* covers Bartlett\Reflect\Model\ClassModel::getConstant
* @group reflection
* @return void
*/
public function testUndefinedConstant()
{
$c = 6; // class Bar
$k = 'FOO'; // constant FOO is not implemented
$this->assertFalse(
self::$models[$c]->getConstant($k),
"Constant [$k] is defined."
);
}
/**
* Tests whether a specific constant is defined in a class.
*
* covers Bartlett\Reflect\Model\ClassModel::hasConstant
* @group reflection
* @return void
*/
public function testHasConstant()
{
$c = 6; // class Bar
$k = 'TWO'; // constant TWO
$this->assertTrue(
self::$models[$c]->hasConstant($k),
self::$models[$c]->getName() . " $k constant does not exist."
);
}
/**
* Tests class methods accessor.
*
* covers Bartlett\Reflect\Model\ClassModel::getMethods
* @group reflection
* @return void
*/
public function testMethodsAccessor()
{
$c = 6; // class Bar
$this->assertCount(
2,
self::$models[$c]->getMethods(),
self::$models[$c]->getName() . ' methods number does not match.'
);
}
/**
* Tests class method accessor.
*
* covers Bartlett\Reflect\Model\ClassModel::getMethod
* @group reflection
* @return void
*/
public function testMethodAccessor()
{
$c = 6; // class Bar
$m = 'otherfunction';
$this->assertInstanceOf(
'Bartlett\Reflect\Model\MethodModel',
self::$models[$c]->getMethod($m),
'This is not a MethodModel object'
);
}
/**
* Tests class method accessor.
*
* covers Bartlett\Reflect\Model\ClassModel::getMethod
* @group reflection
* @return void
*/
public function testUndefinedMethod()
{
try {
$c = 6; // class Bar
$m = 'nemo'; // method nemo is not implemented
self::$models[$c]->getMethod($m);
} catch (ModelException $expected) {
$this->assertEquals(
"Method $m does not exist.",
$expected->getMessage(),
'Expected exception message does not match'
);
return;
}
$this->fail(
'An expected Bartlett\Reflect\Exception\ModelException exception' .
' has not been raised.'
);
}
/**
* Tests whether a specific method is defined in a class.
*
* covers Bartlett\Reflect\Model\ClassModel::hasMethod
* @group reflection
* @return void
*/
public function testHasMethod()
{
$c = 6; // class Bar
$m = 'otherfunction';
$this->assertTrue(
self::$models[$c]->hasMethod($m),
self::$models[$c]->getName() . " $m method does not exist."
);
}
/**
* Tests whether a class is defined in a namespace.
*
* covers Bartlett\Reflect\Model\ClassModel::inNamespace
* @group reflection
* @return void
*/
public function testInNamespace()
{
$c = 6; // class Bar
$this->assertFalse(
self::$models[$c]->inNamespace(),
self::$models[$c]->getName() . " is in a namespace."
);
}
/**
* Tests if the class is abstract.
*
* covers Bartlett\Reflect\Model\ClassModel::isAbstract
* @group reflection
* @return void
*/
public function testAbstractClass()
{
$c = 4; // abstract class AbstractClass
$this->assertTrue(
self::$models[$c]->isAbstract(),
self::$models[$c]->getName() . ' is not an abstract class.'
);
}
/**
* Tests if the class is an interface.
*
* covers Bartlett\Reflect\Model\ClassModel::isInterface
* @group reflection
* @return void
*/
public function testInterfaceClass()
{
$c = 4; // abstract class AbstractClass
$this->assertFalse(
self::$models[$c]->isInterface(),
self::$models[$c]->getName() . ' is an abstract class.'
);
}
/**
* Tests if the class is a trait.
*
* covers Bartlett\Reflect\Model\ClassModel::isTrait
* @group reflection
* @return void
*/
public function testTraitClass()
{
$i = 1; // interface iA
$this->assertFalse(
self::$models[$i]->isTrait(),
self::$models[$i]->getName() . ' is an interface.'
);
}
/**
* Tests if the class is a user-defined class.
*
* covers Bartlett\Reflect\Model\ClassModel::isUserDefined
* @group reflection
* @return void
*/
public function testUserDefinedClass()
{
$c = 5; // class MyDestructableClass
$this->assertTrue(
self::$models[$c]->isUserDefined(),
self::$models[$c]->getName() . ' is not a user-defined class.'
);
}
/**
* Tests if the class is iterateable.
*
* covers Bartlett\Reflect\Model\ClassModel::isIterateable
* @group reflection
* @return void
*/
public function testIterateableClass()
{
$c = 7; // class IteratorClass implements Iterator
$this->assertTrue(
self::$models[$c]->isIterateable(),
self::$models[$c]->getName() . ' is not iterateable.'
);
}
/**
* Tests if the class is iterateable by inheritance.
*
* covers Bartlett\Reflect\Model\ClassModel::isIterateable
* @group reflection
* @return void
*/
public function testIterateableClassByInheritance()
{
$this->markTestIncomplete('Not yet fully implemented (FIXME)');
$c = 8; // class DerivedClass
$this->assertTrue(
self::$models[$c]->isIterateable(),
self::$models[$c]->getName() . ' is not iterateable.'
);
}
/**
* Tests if the class is cloneable.
*
* covers Bartlett\Reflect\Model\ClassModel::isCloneable
* @group reflection
* @return void
*/
public function testNotCloneableClass()
{
$c = 9; // class NotCloneable
$this->assertFalse(
self::$models[$c]->isCloneable(),
self::$models[$c]->getName() . ' is cloneable and should not be.'
);
}
/**
* Tests if the class is cloneable.
*
* covers Bartlett\Reflect\Model\ClassModel::isCloneable
* @group reflection
* @return void
*/
public function testCloneableClass()
{
$c = 10; // class Cloneable
$this->assertTrue(
self::$models[$c]->isCloneable(),
self::$models[$c]->getName() . ' is not cloneable.'
);
}
/**
* Tests if the class is final.
*
* covers Bartlett\Reflect\Model\ClassModel::isFinal
* @group reflection
* @return void
*/
public function testNotFinalClass()
{
$c = 3; // class Foo implements iB
$this->assertFalse(
self::$models[$c]->isFinal(),
self::$models[$c]->getName() . ' should not be a final class.'
);
}
/**
* Tests if the class is final.
*
* covers Bartlett\Reflect\Model\ClassModel::isFinal
* @group reflection
* @return void
*/
public function testFinalClass()
{
$c = 11; // class TestFinalClass
$this->assertTrue(
self::$models[$c]->isFinal(),
self::$models[$c]->getName() . ' is not a final class.'
);
}
/**
* Tests if the class is instantiable.
*
* covers Bartlett\Reflect\Model\ClassModel::isInstantiable
* @group reflection
* @return void
*/
public function testNotInstantiableClass()
{
$i = 0; // interface iTemplate
$this->assertFalse(
self::$models[$i]->isInstantiable(),
self::$models[$i]->getName() . ' should not be instantiable.'
);
}
/**
* Tests if the class is instantiable.
*
* covers Bartlett\Reflect\Model\ClassModel::isInstantiable
* @group reflection
* @return void
*/
public function testInstantiableClass()
{
$c = 3; // class Foo implements iB
$this->assertTrue(
self::$models[$c]->isInstantiable(),
self::$models[$c]->getName() . ' is not instantiable.'
);
}
/**
* Tests if the class is a subclass of a specified class.
*
* covers Bartlett\Reflect\Model\ClassModel::isSubclassOf
* @group reflection
* @return void
*/
public function testSubclassOfInterface()
{
$this->markTestIncomplete('Not yet fully implemented (FIXME)');
$c = 8; // class DerivedClass extends IteratorClass
$n = 'Iterator';
$this->assertTrue(
self::$models[$c]->isSubclassOf($n),
self::$models[$c]->getName() . " is not a subclass of $n."
);
}
/**
* Tests if the class is a subclass of a specified class.
*
* covers Bartlett\Reflect\Model\ClassModel::isSubclassOf
* @group reflection
* @return void
*/
public function testSubclassOfClass()
{
$this->markTestIncomplete('Not yet fully implemented (FIXME)');
$c = 8; // class DerivedClass extends IteratorClass
$n = 'IteratorClass';
$this->assertTrue(
self::$models[$c]->isSubclassOf($n),
self::$models[$c]->getName() . " is not a subclass of $n."
);
}
/**
* Tests string representation of the ClassModel object
*
* covers Bartlett\Reflect\Model\ClassModel::__toString
* @group reflection
* @return void
*/
public function testToString()
{
$c = 6; // class Bar
$expected = << class Bar ] {
@@ %filename% 60 - 72
- Constants [2] {
Constant [ ONE ] { Number one }
Constant [ TWO ] { Number two }
}
- Properties [0] {
}
- Methods [2] {
Method [ public method myfunction ] {
@@ %filename% 65 - 66
- Parameters [2] {
Parameter #0 [ stdClass \$param = NULL ]
Parameter #1 [ \$otherparam = TRUE ]
}
}
Method [ protected method otherfunction ] {
@@ %filename% 68 - 70
- Parameters [2] {
Parameter #0 [ Baz \$baz ]
Parameter #1 [ \$param ]
}
}
}
}
EOS;
$this->expectOutputString(
str_replace('%filename%', self::$fixture, $expected)
);
print(
self::$models[$c]->__toString()
);
}
}
PK CVa* * tests/Model/IssueTest.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http://php5.laurent-laville.org/reflect/
* @since Class available since Release 3.0.0-alpha2
*/
namespace Bartlett\Tests\Reflect\Model;
use Bartlett\Reflect\Client;
/**
* Tests for PHP_CompatInfo, retrieving reference elements,
* and versioning information.
*
* @category PHP
* @package PHP_Reflect
* @subpackage Tests
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
*/
class IssueTest extends \PHPUnit_Framework_TestCase
{
const GH4 = 'packages.php';
protected static $fixtures;
protected static $analyserId;
protected static $api;
/**
* Sets up the shared fixture.
*
* @return void
*/
public static function setUpBeforeClass()
{
self::$fixtures = dirname(__DIR__) . DIRECTORY_SEPARATOR
. 'fixtures' . DIRECTORY_SEPARATOR;
self::$analyserId = 'Bartlett\Reflect\Analyser\ReflectionAnalyser';
$client = new Client();
// request for a Bartlett\Reflect\Api\Analyser
self::$api = $client->api('analyser');
}
/**
* Regression test for bug GH#4
*
* @link https://github.com/llaville/php-reflect/issues/
* "Handle namespaces without name"
* @link https://github.com/llaville/php-reflect/pull/4 by Eric Colinet
* @group regression
* @return void
*/
public function testBugGH4()
{
$dataSource = self::$fixtures . self::GH4;
$analysers = array('reflection');
$metrics = self::$api->run($dataSource, $analysers);
$models = $metrics[self::$analyserId];
$c = 0; // empty namespace, class MyGlobalClass
$this->assertInstanceOf(
'Bartlett\Reflect\Model\ClassModel',
$models[$c]
);
$this->assertEquals('MyGlobalClass', $models[$c]->getName());
}
}
PK CV m- - tests/Model/MethodModelTest.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http://php5.laurent-laville.org/reflect/
* @since Class available since Release 2.0.0RC1
*/
namespace Bartlett\Tests\Reflect\Model;
/**
* Unit Test Case that covers Bartlett\Reflect\Model\MethodModel
*
* @category PHP
* @package PHP_Reflect
* @subpackage Tests
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
*/
class MethodModelTest extends GenericModelTest
{
/**
* Sets up the shared fixture.
*
* @return void
*/
public static function setUpBeforeClass()
{
self::$fixture = 'classes.php';
parent::setUpBeforeClass();
}
/**
* Tests doc comment accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getDocComment
* @group reflection
* @return void
*/
public function testDocCommentAccessor()
{
$c = 4; // abstract class AbstractClass
$m = 0; // method lambdaMethod
$methods = self::$models[$c]->getMethods();
$this->assertEquals(
'/** static meth: */',
$methods[$m]->getDocComment(),
$methods[$m]->getName()
. ' doc comment does not match.'
);
}
/**
* Tests starting line number accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getStartLine
* @group reflection
* @return void
*/
public function testStartLineAccessor()
{
$c = 5; // class MyDestructableClass
$m = 2; // method dump;
$methods = self::$models[$c]->getMethods();
$this->assertEquals(
54,
$methods[$m]->getStartLine(),
$methods[$m]->getName()
. ' starting line does not match.'
);
}
/**
* Tests ending line number accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getEndLine
* @group reflection
* @return void
*/
public function testEndLineAccessor()
{
$c = 5; // class MyDestructableClass
$m = 2; // method dump;
$methods = self::$models[$c]->getMethods();
$this->assertEquals(
57,
$methods[$m]->getEndLine(),
$methods[$m]->getName()
. ' ending line does not match.'
);
}
/**
* Tests file name accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getFileName
* @group reflection
* @return void
*/
public function testFileNameAccessor()
{
$c = 5; // class MyDestructableClass
$m = 2; // method dump;
$methods = self::$models[$c]->getMethods();
$this->assertEquals(
self::$fixtures . 'classes.php',
$methods[$m]->getFileName(),
$methods[$m]->getName()
. ' file name does not match.'
);
}
/**
* Tests method name accessor.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::getShortName
* @group reflection
* @return void
*/
public function testNameAccessor()
{
$c = 5; // class MyDestructableClass
$m = 2; // method dump;
$methods = self::$models[$c]->getMethods();
$this->assertEquals(
'dump',
$methods[$m]->getShortName(),
$methods[$m]->getName()
. ' method name does not match.'
);
}
/**
* Tests declaring class of the method.
*
* covers Bartlett\Reflect\Model\MethodModel::getDeclaringClass
* @group reflection
* @return void
*/
public function testDeclaringClassAccessor()
{
$c = 5; // class MyDestructableClass
$m = 2; // method dump;
$methods = self::$models[$c]->getMethods();
$this->assertEquals(
'MyDestructableClass',
$methods[$m]->getDeclaringClass()->getName(),
$methods[$m]->getName()
. ", method #$m declaring class does not match."
);
}
/**
* Tests method extension name acessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getExtensionName
* @group reflection
* @return void
*/
public function testExtensionNameAccessor()
{
$c = 5; // class MyDestructableClass
$m = 2; // method dump;
$methods = self::$models[$c]->getMethods();
$this->assertEquals(
'user',
$methods[$m]->getExtensionName(),
$methods[$m]->getName()
. ' extension name does not match.'
);
}
/**
* Tests class method is a PHP4 constructor.
*
* covers Bartlett\Reflect\Model\MethodModel::isConstructor
* @group reflection
* @return void
*/
public function testPHP4Constructor()
{
$c = 3; // class Foo implements iB
$m = 0; // method Foo
$methods = self::$models[$c]->getMethods();
$this->assertTrue(
$methods[$m]->isConstructor(),
$methods[$m]->getName()
. ' is not a class constructor.'
);
}
/**
* Tests class method is a PHP5 constructor.
*
* covers Bartlett\Reflect\Model\MethodModel::isConstructor
* @group reflection
* @return void
*/
public function testPHP5Constructor()
{
$c = 5; // class MyDestructableClass
$m = 0; // method __construct
$methods = self::$models[$c]->getMethods();
$this->assertTrue(
$methods[$m]->isConstructor(),
$methods[$m]->getName()
. ' is not a class constructor.'
);
}
/**
* Tests class method is a destructor.
*
* covers Bartlett\Reflect\Model\MethodModel::isDestructor
* @group reflection
* @return void
*/
public function testDestructor()
{
$c = 5; // class MyDestructableClass
$m = 1; // method __destruct
$methods = self::$models[$c]->getMethods();
$this->assertTrue(
$methods[$m]->isDestructor(),
$methods[$m]->getName()
. ' is not a class destructor.'
);
}
/**
* Tests class method with abstract keyword.
*
* covers Bartlett\Reflect\Model\MethodModel::isAbstract
* @group reflection
* @return void
*/
public function testAbstractMethod()
{
$c = 4; // abstract class AbstractClass
$m = 1; // method abstractMethod
$methods = self::$models[$c]->getMethods();
$this->assertTrue(
$methods[$m]->isAbstract(),
$methods[$m]->getName()
. ' is not an abstract class method.'
);
}
/**
* Tests class method with final keyword.
*
* covers Bartlett\Reflect\Model\MethodModel::isFinal
* @group reflection
* @return void
*/
public function testFinalMethod()
{
$c = 3; // class Foo implements iB
$m = 2; // method baz
$methods = self::$models[$c]->getMethods();
$this->assertTrue(
$methods[$m]->isFinal(),
$methods[$m]->getName()
. ' is not a final class method.'
);
}
/**
* Tests class method with static keyword.
*
* covers Bartlett\Reflect\Model\MethodModel::isStatic
* @group reflection
* @return void
*/
public function testStaticMethod()
{
$c = 4; // abstract class AbstractClass
$m = 0; // method lambdaMethod
$methods = self::$models[$c]->getMethods();
$this->assertTrue(
$methods[$m]->isStatic(),
$methods[$m]->getName()
. ' is not a static class method.'
);
}
/**
* Tests class method with private visibility.
*
* covers Bartlett\Reflect\Model\MethodModel::isPrivate
* @group reflection
* @return void
*/
public function testPrivateMethod()
{
$c = 3; // class Foo implements iB
$m = 1; // method FooBaz
$methods = self::$models[$c]->getMethods();
$this->assertTrue(
$methods[$m]->isPrivate(),
$methods[$m]->getName()
. ' is not a private class method.'
);
}
/**
* Tests class method with protected visibility.
*
* covers Bartlett\Reflect\Model\MethodModel::isProtected
* @group reflection
* @return void
*/
public function testProtectedMethod()
{
$c = 6; // class Bar
$m = 1; // method otherfunction
$methods = self::$models[$c]->getMethods();
$this->assertTrue(
$methods[$m]->isProtected(),
$methods[$m]->getName()
. ' is not a protected class method.'
);
}
/**
* Tests class method with public visibility.
*
* covers Bartlett\Reflect\Model\MethodModel::isPublic
* @group reflection
* @return void
*/
public function testPublicMethod()
{
$c = 4; // abstract class AbstractClass
$m = 0; // method lambdaMethod
$methods = self::$models[$c]->getMethods();
$this->assertTrue(
$methods[$m]->isPublic(),
$methods[$m]->getName()
. ' is not a public class method.'
);
}
/**
* Tests class method with implicit public visibility.
*
* covers Bartlett\Reflect\Model\MethodModel::isImplicitlyPublic
* @group reflection
* @return void
*/
public function testImplicitlyPublicMethod()
{
$c = 5; // class MyDestructableClass
$m = 2; // method dump;
$methods = self::$models[$c]->getMethods();
$this->assertTrue(
$methods[$m]->isImplicitlyPublic(),
$methods[$m]->getName()
. ' is not implicitly public.'
);
}
/**
* Tests parameters of the class method.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::getParameters
* @group reflection
* @return void
*/
public function testParametersAccessor()
{
$i = 2; // interface iB extends iA
$m = 0; // method baz
$methods = self::$models[$i]->getMethods();
$this->assertCount(
1,
$methods[$m]->getParameters(),
$methods[$m]->getName()
. ' parameters number does not match.'
);
}
/**
* Tests string representation of the MethodModel object
*
* covers Bartlett\Reflect\Model\MethodModel::__toString
* @group reflection
* @return void
*/
public function testToString()
{
$c = 6; // class Bar
$m = 0; // method myfunction
$expected = << public method myfunction ] {
@@ %filename% 65 - 66
- Parameters [2] {
Parameter #0 [ stdClass \$param = NULL ]
Parameter #1 [ \$otherparam = TRUE ]
}
}
EOS;
$this->expectOutputString(
str_replace('%filename%', self::$fixture, $expected)
);
$methods = self::$models[$c]->getMethods();
print(
$methods[$m]->__toString()
);
}
}
PK CV! ! ! tests/Model/FunctionModelTest.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http://php5.laurent-laville.org/reflect/
* @since Class available since Release 2.0.0RC1
*/
namespace Bartlett\Tests\Reflect\Model;
/**
* Unit Test Case that covers Bartlett\Reflect\Model\FunctionModel
*
* @category PHP
* @package PHP_Reflect
* @subpackage Tests
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
*/
class FunctionModelTest extends GenericModelTest
{
/**
* Sets up the shared fixture.
*
* @return void
*/
public static function setUpBeforeClass()
{
self::$fixture = 'namespaces.php';
parent::setUpBeforeClass();
}
/**
* Tests starting line number accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getStartLine
* @group reflection
* @return void
*/
public function testStartLineAccessor()
{
$f = 3; // function glob\myprocess
$this->assertEquals(
29,
self::$models[$f]->getStartLine(),
self::$models[$f]->getName() . ' starting line does not match.'
);
}
/**
* Tests ending line number accessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getEndLine
* @group reflection
* @return void
*/
public function testEndLineAccessor()
{
$f = 3; // function glob\myprocess
$this->assertEquals(
32,
self::$models[$f]->getEndLine(),
self::$models[$f]->getName() . ' ending line does not match.'
);
}
/**
* Tests file name accessor.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::getFileName
* @group reflection
* @return void
*/
public function testFileNameAccessor()
{
$f = 3; // function glob\myprocess
$this->assertEquals(
self::$fixtures . 'namespaces.php',
self::$models[$f]->getFileName(),
self::$models[$f]->getName() . ' file name does not match.'
);
}
/**
* Tests method name accessor.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::getName
* @group reflection
* @return void
*/
public function testNameAccessor()
{
$f = 3; // function glob\myprocess
$this->assertEquals(
'glob\myprocess',
self::$models[$f]->getName(),
self::$models[$f]->getName() . ' function name does not match.'
);
}
/**
* Tests method extension name acessor.
*
* covers Bartlett\Reflect\Model\AbstractModel::getExtensionName
* @group reflection
* @return void
*/
public function testExtensionNameAccessor()
{
$f = 3; // function glob\myprocess
$this->assertEquals(
'user',
self::$models[$f]->getExtensionName(),
self::$models[$f]->getName() . ' extension name does not match.'
);
}
/**
* Tests the namespace name accessor.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::getNamespaceName
* @group reflection
* @return void
*/
public function testNamespaceNameAccessor()
{
$f = 4; // function nemo\nobody
$this->assertEquals(
'nemo',
self::$models[$f]->getNamespaceName(),
self::$models[$f]->getName() . ' namespace does not match.'
);
}
/**
* Tests function short name accessor.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::getShortName
* @group reflection
* @return void
*/
public function testShortNameAccessor()
{
$f = 2; // function glob\singleFunction
$this->assertEquals(
'singleFunction',
self::$models[$f]->getShortName(),
self::$models[$f]->getName() . ' short name does not match.'
);
}
/**
* Tests the number of parameters that a function defines.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::getNumberOfParameters
* @group reflection
* @return void
*/
public function testNumberOfParametersAccessor()
{
$f = 2; // function glob\singleFunction
$this->assertEquals(
3,
self::$models[$f]->getNumberOfParameters(),
self::$models[$f]->getName() . ' number of parameters does not match.'
);
}
/**
* Tests the number of required parameters that a function defines.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::getNumberOfRequiredParameters
* @group reflection
* @return void
*/
public function testNumberOfRequiredParametersAccessor()
{
$f = 2; // function glob\singleFunction
$this->assertEquals(
2,
self::$models[$f]->getNumberOfRequiredParameters(),
self::$models[$f]->getName() . ' number of required parameters does not match.'
);
}
/**
* Tests parameters of the class method.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::getParameters
* @group reflection
* @return void
*/
public function testParametersAccessor()
{
$f = 2; // function glob\singleFunction
$this->assertCount(
3,
self::$models[$f]->getParameters(),
self::$models[$f]->getName() . ' parameters number does not match.'
);
}
/**
* Tests whether a function is defined in a namespace.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::inNamespace
* @group reflection
* @return void
*/
public function testInNamespace()
{
$f = 2; // function glob\singleFunction
$this->assertTrue(
self::$models[$f]->inNamespace(),
self::$models[$f]->getName() . ' is defined in a namespace.'
);
}
/**
* Tests whether it's an anonymous function (closure).
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::isClosure
* @group reflection
* @return void
*/
public function testAnonymousFunction()
{
$f = 2; // function glob\singleFunction
$this->assertFalse(
self::$models[$f]->isClosure(),
self::$models[$f]->getName() . ' is not an anonymous function.'
);
}
/**
* Tests whether it's a closure in a user namespace.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::isClosure
* @group reflection
* @return void
*/
public function testClosureInNamespace()
{
$f = 5; // closure in nemo namespace
$this->assertTrue(
self::$models[$f]->isClosure(),
self::$models[$f]->getName() . ' is a closure.'
);
}
/**
* Tests whether it's an internal function.
*
* covers Bartlett\Reflect\Model\AbstractFunctionModel::isInternal
* @group reflection
* @return void
*/
public function testInternalFunction()
{
$f = 2; // function glob\singleFunction
$this->assertFalse(
self::$models[$f]->isInternal(),
self::$models[$f]->getName() . ' is a user-defined function.'
);
}
/**
* Tests string representation of the FunctionModel object
*
* covers Bartlett\Reflect\Model\FunctionModel::__toString
* @group reflection
* @return void
*/
public function testToString()
{
$f = 2; // function glob\singleFunction
$expected = << function glob\\singleFunction ] {
@@ %filename% 25 - 27
- Parameters [3] {
Parameter #0 [ array \$someparam ]
Parameter #1 [ glob\stdClass \$somethingelse ]
Parameter #2 [ \$lastone = NULL ]
}
}
EOS;
$this->expectOutputString(
str_replace('%filename%', self::$fixture, $expected)
);
print(
self::$models[$f]->__toString()
);
}
}
PK CVMY Y tests/Model/GenericModelTest.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http://php5.laurent-laville.org/reflect/
* @since Class available since Release 3.0.0-alpha2
*/
namespace Bartlett\Tests\Reflect\Model;
use Bartlett\Reflect\Client;
/**
* Unit Test Case that covers Bartlett\Reflect\Model\*Model
*
* @category PHP
* @package PHP_Reflect
* @subpackage Tests
* @author Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://php5.laurent-laville.org/reflect/
*/
abstract class GenericModelTest extends \PHPUnit_Framework_TestCase
{
protected static $fixtures;
protected static $fixture;
protected static $models;
protected static $api;
/**
* Sets up the shared fixture.
*
* @return void
* @link http://phpunit.de/manual/current/en/fixtures.html#fixtures.sharing-fixture
*/
public static function setUpBeforeClass()
{
self::$fixtures = dirname(__DIR__) . DIRECTORY_SEPARATOR
. 'fixtures' . DIRECTORY_SEPARATOR;
self::$fixture = self::$fixtures . self::$fixture;
$client = new Client();
// request for a Bartlett\Reflect\Api\Analyser
self::$api = $client->api('analyser');
$analyserId = 'Bartlett\Reflect\Analyser\ReflectionAnalyser';
$dataSource = self::$fixture;
$analysers = array('reflection');
$metrics = self::$api->run($dataSource, $analysers);
self::$models = $metrics[$analyserId];
}
}
PK CVQVr r tests/fixtures/classes.phpnu W+A name = "MyDestructableClass";
}
function __destruct() {
print "Destroying " . $this->name . "\n";
}
function dump() {
print "Dump content of " . $this->name . "\n";
}
}
class Bar
{
const ONE = "Number one";
const TWO = "Number two";
function myfunction ( stdClass $param = NULL, $otherparam = TRUE ) {
}
protected function otherfunction( Baz $baz, $param )
{
}
}
class IteratorClass implements Iterator {
public function __construct() { }
public function key() { }
public function current() { }
function next() { }
function valid() { }
function rewind() { }
}
class DerivedClass extends IteratorClass { }
class NotCloneable {
public $var1;
private function __clone() {
}
}
class Cloneable {
public $var1;
}
final class TestFinalClass { }
PK CV( tests/fixtures/constants.phpnu W+A $field = new stdClass;
}
}
}
PK CV S &