diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..485dee6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.idea
diff --git a/.scrutinizer.yml b/.scrutinizer.yml
new file mode 100644
index 0000000..288b592
--- /dev/null
+++ b/.scrutinizer.yml
@@ -0,0 +1,8 @@
+filter:
+ paths:
+ - source/*
+
+checks:
+ php:
+ code_rating: true
+ duplication: true
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..8eac82e
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,14 @@
+language: php
+php:
+ - 5.3
+ - 5.4
+ - 5.5
+ - 5.6
+before_script:
+ - composer self-update
+ - composer install --dev
+ - phpenv rehash
+script: phpunit -v --colors --coverage-text
+notifications:
+ email:
+ - artodeto@bazzline.net
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..1b5f59f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,105 @@
+# Process Pipe Component in PHP
+
+This component easy up creation of a [pipe](http://en.wikipedia.org/wiki/Pipeline_(computing)) for processes in php.
+
+Indeed, it is a [pseudo pipeline](http://en.wikipedia.org/wiki/Pipeline_(software)#Pseudo-pipelines) (process collection or process batch) since the php process is single threaded so far.
+
+Currently, there is no plan to bloat the code base with an implementation of [STDIN](http://en.wikipedia.org/wiki/Standard_streams#Standard_input_.28stdin.29), [STDOUT](http://en.wikipedia.org/wiki/Standard_streams#Standard_output_.28stdout.29) or [STDERR](http://en.wikipedia.org/wiki/Standard_streams#Standard_error_.28stderr.29).
+Errors can be handled by the thrown exception. Input is defined by the ExecutableInterface, as well as the output (return value).
+
+
+@todo
+The build status of the current master branch is tracked by Travis CI:
+[](http://travis-ci.org/bazzline/php_component_process_pipe)
+[](https://packagist.org/packages/net_bazzline/php_component_process_pipe)
+
+
+@todo
+The scrutinizer status are:
+[](https://scrutinizer-ci.com/g/bazzline/php_component_process_pipe/) | [](https://scrutinizer-ci.com/g/bazzline/php_component_process_pipe/) | [](https://scrutinizer-ci.com/g/bazzline/php_component_process_pipe/)
+
+@todo
+The versioneye status is:
+[](https://www.versioneye.com/user/projects/53e48c23e0a229172f000146)
+
+Downloads:
+[](https://packagist.org/packages/net_bazzline/php_component_process_pipe)
+
+@todo
+It is also available at [openhub.net](http://www.openhub.net/p/718154).
+
+# Examples
+
+* [no input](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/NoInput/run.php]
+* [input array](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/InputArray/run.php]
+* [failing execution](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/FailingExecution/run.php]
+* [input generator](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/InputGenerator/run.php]
+* [input transformer](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/InputTransformer/run.php]
+* [input validator](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/InputValidator/run.php]
+* [data flow manipulator](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/DataFlowManipulator/run.php]
+
+# Install
+
+## Manuel
+
+ mkdir -p vendor/net_bazzline/php_component_process_pipe
+ cd vendor/net_bazzline/php_component_process_pipe
+ git clone https://github.com/bazzline/php_component_process_pipe
+
+## With [Packagist](https://packagist.org/packages/net_bazzline/php_component_process_pipe)
+
+ composer require net_bazzline/php_component_process_pipe:dev-master
+
+# Usage
+
+## By using the pipe method for multiple process
+
+```php
+$pipe = new Pipe();
+
+$pipe->pipe(
+ new ProcessOne(),
+ new ProcessTwo()
+);
+
+$output = $pipe->execute($input);
+
+```
+## By using the pipe method once for each process
+
+```php
+$pipe = new Pipe();
+
+$pipe->pipe(new ProcessOne());
+$pipe->pipe(new ProcessTwo());
+
+$output = $pipe->execute($input);
+```
+
+## By instantiation
+
+```php
+$pipe = new Pipe(
+ new ProcessOne(),
+ new ProcessTwo()
+);
+
+$output = $pipe->execute($input);
+```
+
+
+# API
+
+Thanks to [apigen](https://github.com/apigen/apigen), the api is available in the [document](https://github.com/bazzline/php_component_process_pipe/blob/master/document/index.html) section or [online](http://code.bazzline.net/).
+
+# History
+
+* [1.0.1](https://github.com/bazzline/php_component_process_pipe/tree/1.0.1) - not released yet
+* [1.0.0](https://github.com/bazzline/php_component_process_pipe/tree/1.0.0) - not released yet
+ * initial release
+
+# Links
+
+* [pipes](https://github.com/vkartaviy/pipes)
+* [php-pipeline](https://github.com/JosephMoniz/php-pipeline)
+* [php-pipeline-lib](https://github.com/phppro/php-pipeline-lib)
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..15c996e
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,32 @@
+{
+ "description": "php component process to easy up creation of pipe process in php",
+ "keywords": ["php", "pipe", "process", "component", "process pipe"],
+ "license": "LGPLv3",
+ "name": "net_bazzline/php_component_process_pipe",
+ "type": "library",
+ "authors": [
+ {
+ "email": "artodeto@bazzline.net",
+ "homepage": "https://artodeto.bazzline.et",
+ "name": "Stev Leibelt",
+ "role": "Developer"
+ }
+ ],
+ "minimum-stability": "dev",
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "apigen/apigen": "2.8.1",
+ "mockery/mockery": "0.9.2",
+ "phpmd/phpmd": "2.1.3",
+ "phpunit/phpunit": "4.3.4"
+ },
+ "autoload": {
+ "psr-0": {
+ "Example": "example/",
+ "Net\\Bazzline\\Component\\ProcessPipe": "source/",
+ "Test\\Net\\Bazzline\\Component\\ProcessPipe": "test/"
+ }
+ }
+}
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 0000000..f3358bc
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,1339 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
+ ],
+ "hash": "b63723a93f3ae58d45d4071e20fa6689",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "andrewsville/php-token-reflection",
+ "version": "1.3.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Andrewsville/PHP-Token-Reflection.git",
+ "reference": "3e3a36de17f32889fd2d4b8108af16d3033ce9bf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Andrewsville/PHP-Token-Reflection/zipball/3e3a36de17f32889fd2d4b8108af16d3033ce9bf",
+ "reference": "3e3a36de17f32889fd2d4b8108af16d3033ce9bf",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "TokenReflection": "./"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3"
+ ],
+ "authors": [
+ {
+ "name": "Ondřej Nešpor",
+ "homepage": "https://github.com/andrewsville"
+ },
+ {
+ "name": "Jaroslav Hanslík",
+ "homepage": "https://github.com/kukulich"
+ }
+ ],
+ "description": "Library emulating the PHP internal reflection using just the tokenized source code.",
+ "homepage": "http://andrewsville.github.com/PHP-Token-Reflection/",
+ "keywords": [
+ "library",
+ "reflection",
+ "tokenizer"
+ ],
+ "time": "2012-08-25 21:26:44"
+ },
+ {
+ "name": "apigen/apigen",
+ "version": "v2.8.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/apigen/apigen.git",
+ "reference": "bca0954e92621a48c6870be57115026a8d032706"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/apigen/apigen/zipball/bca0954e92621a48c6870be57115026a8d032706",
+ "reference": "bca0954e92621a48c6870be57115026a8d032706",
+ "shasum": ""
+ },
+ "require": {
+ "andrewsville/php-token-reflection": "~1.3.1",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "kukulich/fshl": "~2.1.0",
+ "nette/nette": "~2.1.1",
+ "php": ">=5.3.0",
+ "texy/texy": "~2.4.0"
+ },
+ "suggest": {
+ "ext-bz2": "*",
+ "ext-phar": "*",
+ "ext-zip": "*",
+ "ext-zlib": "*"
+ },
+ "bin": [
+ "apigen"
+ ],
+ "type": "project",
+ "extra": {
+ "branch-alias": {
+ "dev-develop": "3.0.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "ApiGen": "./"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "David Grudl",
+ "homepage": "http://davidgrudl.com"
+ },
+ {
+ "name": "Ondřej Nešpor",
+ "homepage": "https://github.com/andrewsville"
+ },
+ {
+ "name": "Jaroslav Hanslík",
+ "homepage": "https://github.com/kukulich"
+ }
+ ],
+ "description": "API documentation generator for PHP 5.3+",
+ "homepage": "http://apigen.org/",
+ "keywords": [
+ "api",
+ "docblock",
+ "documentation",
+ "generator",
+ "phpDocumentor",
+ "phpdoc"
+ ],
+ "time": "2014-09-01 18:06:36"
+ },
+ {
+ "name": "doctrine/instantiator",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/instantiator.git",
+ "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119",
+ "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3,<8.0-DEV"
+ },
+ "require-dev": {
+ "athletic/athletic": "~0.1.8",
+ "ext-pdo": "*",
+ "ext-phar": "*",
+ "phpunit/phpunit": "~4.0",
+ "squizlabs/php_codesniffer": "2.0.*@ALPHA"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\Instantiator\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "http://ocramius.github.com/"
+ }
+ ],
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+ "homepage": "https://github.com/doctrine/instantiator",
+ "keywords": [
+ "constructor",
+ "instantiate"
+ ],
+ "time": "2014-10-13 12:58:55"
+ },
+ {
+ "name": "kukulich/fshl",
+ "version": "2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/kukulich/fshl.git",
+ "reference": "974c294ade5d76c0c16b6fe3fd3a584ba999b24f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/kukulich/fshl/zipball/974c294ade5d76c0c16b6fe3fd3a584ba999b24f",
+ "reference": "974c294ade5d76c0c16b6fe3fd3a584ba999b24f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "FSHL": "./"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "GPL-2.0+"
+ ],
+ "authors": [
+ {
+ "name": "Jaroslav Hanslík",
+ "homepage": "https://github.com/kukulich"
+ }
+ ],
+ "description": "FSHL is a free, open source, universal, fast syntax highlighter written in PHP.",
+ "homepage": "http://fshl.kukulich.cz/",
+ "keywords": [
+ "highlight",
+ "library",
+ "syntax"
+ ],
+ "time": "2012-09-08 19:00:07"
+ },
+ {
+ "name": "mockery/mockery",
+ "version": "0.9.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/padraic/mockery.git",
+ "reference": "95a4855380dc70176c51807c678fb3bd6198529a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/padraic/mockery/zipball/95a4855380dc70176c51807c678fb3bd6198529a",
+ "reference": "95a4855380dc70176c51807c678fb3bd6198529a",
+ "shasum": ""
+ },
+ "require": {
+ "lib-pcre": ">=7.0",
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "hamcrest/hamcrest-php": "~1.1",
+ "phpunit/phpunit": "~4.0",
+ "satooshi/php-coveralls": "~0.7@dev"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.9.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Mockery": "library/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Pádraic Brady",
+ "email": "padraic.brady@gmail.com",
+ "homepage": "http://blog.astrumfutura.com"
+ },
+ {
+ "name": "Dave Marshall",
+ "email": "dave.marshall@atstsolutions.co.uk",
+ "homepage": "http://davedevelopment.co.uk"
+ }
+ ],
+ "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.",
+ "homepage": "http://github.com/padraic/mockery",
+ "keywords": [
+ "BDD",
+ "TDD",
+ "library",
+ "mock",
+ "mock objects",
+ "mockery",
+ "stub",
+ "test",
+ "test double",
+ "testing"
+ ],
+ "time": "2014-09-03 10:11:10"
+ },
+ {
+ "name": "nette/nette",
+ "version": "2.1.x-dev",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nette/nette.git",
+ "reference": "34cdcbff5b2c22a17e8efeb0a9035d8b7a29a53d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nette/nette/zipball/34cdcbff5b2c22a17e8efeb0a9035d8b7a29a53d",
+ "reference": "34cdcbff5b2c22a17e8efeb0a9035d8b7a29a53d",
+ "shasum": ""
+ },
+ "require": {
+ "ext-iconv": "*",
+ "ext-tokenizer": "*",
+ "php": ">=5.3.1"
+ },
+ "require-dev": {
+ "nette/tester": "~1.3"
+ },
+ "suggest": {
+ "ext-fileinfo": "",
+ "ext-gd": "",
+ "ext-mbstring": "",
+ "ext-pdo": ""
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "Nette/"
+ ],
+ "files": [
+ "Nette/common/shortcuts.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause",
+ "GPL-2.0",
+ "GPL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "David Grudl",
+ "homepage": "http://davidgrudl.com"
+ },
+ {
+ "name": "Nette Community",
+ "homepage": "http://nette.org/contributors"
+ }
+ ],
+ "description": "Nette Framework - innovative framework for fast and easy development of secured web applications in PHP. Write less, have cleaner code and your work will bring you joy.",
+ "homepage": "http://nette.org",
+ "keywords": [
+ "Forms",
+ "database",
+ "debugging",
+ "framework",
+ "mailing",
+ "mvc",
+ "templating"
+ ],
+ "time": "2014-11-08 18:49:54"
+ },
+ {
+ "name": "pdepend/pdepend",
+ "version": "2.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/pdepend/pdepend.git",
+ "reference": "dc582a3c0180664a8fbfc5a34efaf4cc13fccc60"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/pdepend/pdepend/zipball/dc582a3c0180664a8fbfc5a34efaf4cc13fccc60",
+ "reference": "dc582a3c0180664a8fbfc5a34efaf4cc13fccc60",
+ "shasum": ""
+ },
+ "require": {
+ "symfony/config": "@stable",
+ "symfony/dependency-injection": "@stable",
+ "symfony/filesystem": "@stable"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.*@stable",
+ "squizlabs/php_codesniffer": "@stable"
+ },
+ "bin": [
+ "src/bin/pdepend"
+ ],
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "PDepend\\": "src/main/php/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "description": "Official version of pdepend to be handled with Composer",
+ "time": "2014-10-08 06:54:50"
+ },
+ {
+ "name": "phpmd/phpmd",
+ "version": "2.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpmd/phpmd.git",
+ "reference": "1a485d9db869137af5e9678bd844568c92998b25"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpmd/phpmd/zipball/1a485d9db869137af5e9678bd844568c92998b25",
+ "reference": "1a485d9db869137af5e9678bd844568c92998b25",
+ "shasum": ""
+ },
+ "require": {
+ "pdepend/pdepend": "2.0.*",
+ "php": ">=5.3.0",
+ "symfony/config": "2.5.*",
+ "symfony/dependency-injection": "2.5.*",
+ "symfony/filesystem": "2.5.*"
+ },
+ "bin": [
+ "src/bin/phpmd"
+ ],
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "PHPMD\\": "src/main/php"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "description": "Official version of PHPMD handled with Composer.",
+ "time": "2014-09-25 15:56:22"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "2.0.x-dev",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "c3e185a27ae59680237c836caecef66c8bd839a8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c3e185a27ae59680237c836caecef66c8bd839a8",
+ "reference": "c3e185a27ae59680237c836caecef66c8bd839a8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "phpunit/php-file-iterator": "~1.3",
+ "phpunit/php-text-template": "~1.2",
+ "phpunit/php-token-stream": "~1.3",
+ "sebastian/environment": "~1.0",
+ "sebastian/version": "~1.0"
+ },
+ "require-dev": {
+ "ext-xdebug": ">=2.1.4",
+ "phpunit/phpunit": "~4.1"
+ },
+ "suggest": {
+ "ext-dom": "*",
+ "ext-xdebug": ">=2.2.1",
+ "ext-xmlwriter": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "time": "2014-10-31 10:06:54"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "1.3.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
+ "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "File/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "time": "2013-10-10 15:34:57"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
+ "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "Text/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "time": "2014-01-30 17:20:04"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "1.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+ "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "PHP/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "time": "2013-08-02 07:42:54"
+ },
+ {
+ "name": "phpunit/php-token-stream",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+ "reference": "f8d5d08c56de5cfd592b3340424a81733259a876"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876",
+ "reference": "f8d5d08c56de5cfd592b3340424a81733259a876",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Wrapper around PHP's tokenizer extension.",
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+ "keywords": [
+ "tokenizer"
+ ],
+ "time": "2014-08-31 06:12:13"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "4.3.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "23e4e0310f037aae873cc81b8658dbbb82878f71"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/23e4e0310f037aae873cc81b8658dbbb82878f71",
+ "reference": "23e4e0310f037aae873cc81b8658dbbb82878f71",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-pcre": "*",
+ "ext-reflection": "*",
+ "ext-spl": "*",
+ "php": ">=5.3.3",
+ "phpunit/php-code-coverage": "~2.0",
+ "phpunit/php-file-iterator": "~1.3.2",
+ "phpunit/php-text-template": "~1.2",
+ "phpunit/php-timer": "~1.0.2",
+ "phpunit/phpunit-mock-objects": "~2.3",
+ "sebastian/comparator": "~1.0",
+ "sebastian/diff": "~1.1",
+ "sebastian/environment": "~1.0",
+ "sebastian/exporter": "~1.0",
+ "sebastian/version": "~1.0",
+ "symfony/yaml": "~2.0"
+ },
+ "suggest": {
+ "phpunit/php-invoker": "~1.1"
+ },
+ "bin": [
+ "phpunit"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.3.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ "",
+ "../../symfony/yaml/"
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "http://www.phpunit.de/",
+ "keywords": [
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "time": "2014-10-22 11:43:12"
+ },
+ {
+ "name": "phpunit/phpunit-mock-objects",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+ "reference": "96c5b81f9842f38fe6c73ad0020306cc4862a9e3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/96c5b81f9842f38fe6c73ad0020306cc4862a9e3",
+ "reference": "96c5b81f9842f38fe6c73ad0020306cc4862a9e3",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/instantiator": "~1.0,>=1.0.2",
+ "php": ">=5.3.3",
+ "phpunit/php-text-template": "~1.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.4.*@dev"
+ },
+ "suggest": {
+ "ext-soap": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.4.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Mock Object library for PHPUnit",
+ "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+ "keywords": [
+ "mock",
+ "xunit"
+ ],
+ "time": "2014-10-04 10:04:20"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "6f67d2ae044ba17ba30573941f4ac96c4777be97"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6f67d2ae044ba17ba30573941f4ac96c4777be97",
+ "reference": "6f67d2ae044ba17ba30573941f4ac96c4777be97",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "sebastian/diff": "~1.1",
+ "sebastian/exporter": "~1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "http://www.github.com/sebastianbergmann/comparator",
+ "keywords": [
+ "comparator",
+ "compare",
+ "equality"
+ ],
+ "time": "2014-10-21 10:04:18"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "3e22c89be2e1cddf7db89699cb23a9159df12e0c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3e22c89be2e1cddf7db89699cb23a9159df12e0c",
+ "reference": "3e22c89be2e1cddf7db89699cb23a9159df12e0c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "http://www.github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff"
+ ],
+ "time": "2014-11-05 15:28:21"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7",
+ "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "time": "2014-10-25 08:00:45"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0",
+ "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "http://www.github.com/sebastianbergmann/exporter",
+ "keywords": [
+ "export",
+ "exporter"
+ ],
+ "time": "2014-09-10 00:51:36"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "1.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
+ "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
+ "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": "2014-03-07 15:35:33"
+ },
+ {
+ "name": "symfony/config",
+ "version": "2.5.x-dev",
+ "target-dir": "Symfony/Component/Config",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Config.git",
+ "reference": "9332a28782d97a1cb80deb5aa3459df5aabe75d6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Config/zipball/9332a28782d97a1cb80deb5aa3459df5aabe75d6",
+ "reference": "9332a28782d97a1cb80deb5aa3459df5aabe75d6",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/filesystem": "~2.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Config\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Symfony Config Component",
+ "homepage": "http://symfony.com",
+ "time": "2014-11-03 03:54:42"
+ },
+ {
+ "name": "symfony/dependency-injection",
+ "version": "2.5.x-dev",
+ "target-dir": "Symfony/Component/DependencyInjection",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/DependencyInjection.git",
+ "reference": "0bac5e7436e2627785b0497d72130a015e881fdc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/0bac5e7436e2627785b0497d72130a015e881fdc",
+ "reference": "0bac5e7436e2627785b0497d72130a015e881fdc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "symfony/config": "~2.2",
+ "symfony/expression-language": "~2.4",
+ "symfony/yaml": "~2.0"
+ },
+ "suggest": {
+ "symfony/config": "",
+ "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
+ "symfony/yaml": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\DependencyInjection\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Symfony DependencyInjection Component",
+ "homepage": "http://symfony.com",
+ "time": "2014-11-03 03:54:42"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "2.5.x-dev",
+ "target-dir": "Symfony/Component/Filesystem",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Filesystem.git",
+ "reference": "4e62fab0060a826561c78b665925b37c870c45f5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Filesystem/zipball/4e62fab0060a826561c78b665925b37c870c45f5",
+ "reference": "4e62fab0060a826561c78b665925b37c870c45f5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Filesystem\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Symfony Filesystem Component",
+ "homepage": "http://symfony.com",
+ "time": "2014-09-22 09:14:18"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "dev-master",
+ "target-dir": "Symfony/Component/Yaml",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Yaml.git",
+ "reference": "3db1d6cb51b49840e0f3b1663da23cccf0286bf6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/3db1d6cb51b49840e0f3b1663da23cccf0286bf6",
+ "reference": "3db1d6cb51b49840e0f3b1663da23cccf0286bf6",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.7-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Yaml\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Symfony Yaml Component",
+ "homepage": "http://symfony.com",
+ "time": "2014-11-10 18:00:54"
+ },
+ {
+ "name": "texy/texy",
+ "version": "v2.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/dg/texy.git",
+ "reference": "67d02cd95e4aaa7dae96b24a7d04ba924d641015"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/dg/texy/zipball/67d02cd95e4aaa7dae96b24a7d04ba924d641015",
+ "reference": "67d02cd95e4aaa7dae96b24a7d04ba924d641015",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2.0"
+ },
+ "replace": {
+ "dg/texy": "self.version"
+ },
+ "require-dev": {
+ "nette/tester": "~1.0.0"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/texy.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause",
+ "GPL-2.0",
+ "GPL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "David Grudl",
+ "homepage": "http://davidgrudl.com"
+ }
+ ],
+ "description": "Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated against spambots), national typographic single and double quotation marks, ellipses, em dashes, dimension sign, nonbreakable spaces (e.g. in phone numbers), acronyms, arrows and many others. Texy code can optionally contain HTML tags.",
+ "homepage": "http://texy.info",
+ "keywords": [
+ "html",
+ "markdown",
+ "markup language",
+ "plain text",
+ "text",
+ "textile",
+ "texy",
+ "wiki",
+ "xhtml"
+ ],
+ "time": "2014-02-10 02:34:57"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "dev",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "platform": {
+ "php": ">=5.3.3"
+ },
+ "platform-dev": []
+}
diff --git a/example/Example/DataFlowManipulator/run.php b/example/Example/DataFlowManipulator/run.php
new file mode 100644
index 0000000..fe58b80
--- /dev/null
+++ b/example/Example/DataFlowManipulator/run.php
@@ -0,0 +1,115 @@
+
+ * @since 2014-11-09
+ */
+
+namespace Example\DataFlowManipulator;
+
+use Net\Bazzline\Component\ProcessPipe\ExecutableException;
+use Net\Bazzline\Component\ProcessPipe\ExecutableInterface;
+use Net\Bazzline\Component\ProcessPipe\Pipe;
+
+require_once __DIR__ . '/../../../vendor/autoload.php';
+
+/**
+ * Class ArrayProcess
+ * @package De\Leibelt\ProcessPipe\Example\DataFlowManipulator
+ */
+class ArrayProcess implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws ExecutableException
+ */
+ public function execute($input = null)
+ {
+ $input[] = __METHOD__;
+
+ return $input;
+ }
+}
+
+/**
+ * Class StringProcess
+ * @package De\Leibelt\ProcessPipe\Example\DataFlowManipulator
+ */
+class StringProcess implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws ExecutableException
+ */
+ public function execute($input = null)
+ {
+ $input .= PHP_EOL . __METHOD__;
+
+ return $input;
+ }
+}
+
+/**
+ * Class DataFlowManipulator
+ */
+class DataFlowManipulator implements ExecutableInterface
+{
+ /** @var ArrayProcess */
+ private $arrayProcess;
+
+ /** @var StringProcess */
+ private $stringProcess;
+
+ /**
+ * @param ArrayProcess $process
+ * @return $this
+ */
+ public function setArrayProcess(ArrayProcess $process)
+ {
+ $this->arrayProcess = $process;
+
+ return $this;
+ }
+
+ /**
+ * @param StringProcess $process
+ * @return $this
+ */
+ public function setStringProcess(StringProcess $process)
+ {
+ $this->stringProcess = $process;
+
+ return $this;
+ }
+
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ if (is_array($input)) {
+ return $this->arrayProcess->execute($input);
+ } else if (is_string($input)) {
+ return $this->stringProcess->execute($input);
+ } else {
+ throw new ExecutableException('input must be from type of array or string');
+ }
+ }
+}
+
+$dataFlowManipulator = new DataFlowManipulator();
+$dataFlowManipulator->setArrayProcess(new ArrayProcess())
+ ->setStringProcess(new StringProcess());
+
+$pipe = new Pipe($dataFlowManipulator);
+
+$output = $pipe->execute('Hello World');
+echo 'string' . PHP_EOL;
+echo var_export($output, true) . PHP_EOL;
+
+$output = $pipe->execute(array('Hello World'));
+echo 'array' . PHP_EOL;
+echo var_export($output, true) . PHP_EOL;
diff --git a/example/Example/FailingExecution/run.php b/example/Example/FailingExecution/run.php
new file mode 100644
index 0000000..c0c5b21
--- /dev/null
+++ b/example/Example/FailingExecution/run.php
@@ -0,0 +1,57 @@
+
+ * @since 2014-11-08
+ */
+
+namespace Example\FailingExecution;
+
+use Net\Bazzline\Component\ProcessPipe\ExecutableException;
+use Net\Bazzline\Component\ProcessPipe\ExecutableInterface;
+use Net\Bazzline\Component\ProcessPipe\Pipe;
+
+require_once __DIR__ . '/../../../vendor/autoload.php';
+
+/**
+ * Class ProcessOne
+ */
+class ProcessOne implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ return $input;
+ }
+}
+
+/**
+ * Class ProcessTwo
+ */
+class ProcessTwo implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ throw new ExecutableException(__METHOD__ . ' has failed');
+ }
+}
+
+$pipe = new Pipe(
+ new ProcessOne(),
+ new ProcessTwo()
+);
+
+try {
+ $pipe->execute();
+} catch (ExecutableException $exception) {
+ echo 'error occurred:' . PHP_EOL;
+ echo $exception->getMessage() . PHP_EOL;
+}
diff --git a/example/Example/InputArray/run.php b/example/Example/InputArray/run.php
new file mode 100644
index 0000000..6a968af
--- /dev/null
+++ b/example/Example/InputArray/run.php
@@ -0,0 +1,72 @@
+
+ * @since 2014-11-08
+ */
+
+namespace Example\InputArray;
+
+use Net\Bazzline\Component\ProcessPipe\ExecutableInterface;
+use Net\Bazzline\Component\ProcessPipe\Pipe;
+
+require_once __DIR__ . '/../../../vendor/autoload.php';
+
+/**
+ * Class ProcessOne
+ */
+class ProcessOne implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ $input['name'] = 'bar';
+ $input['steps'][] = __METHOD__;
+ $input['times'][] = microtime(true);
+
+ return $input;
+ }
+}
+
+/**
+ * Class ProcessTwo
+ */
+class ProcessTwo implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ $input['name'] = 'foobar';
+ $input['steps'][] = __METHOD__;
+ $input['times'][] = microtime(true);
+
+ return $input;
+ }
+}
+
+$input = array(
+ 'name' => 'foo',
+ 'steps' => array(),
+ 'times' => array()
+);
+$pipe = new Pipe();
+
+$pipe->pipe(
+ new ProcessOne(),
+ new ProcessTwo()
+);
+
+echo 'input' . PHP_EOL;
+echo var_export($input, true) . PHP_EOL;
+
+$output = $pipe->execute($input);
+
+echo 'output' . PHP_EOL;
+echo var_export($output, true) . PHP_EOL;
diff --git a/example/Example/InputGenerator/run.php b/example/Example/InputGenerator/run.php
new file mode 100644
index 0000000..78a71d2
--- /dev/null
+++ b/example/Example/InputGenerator/run.php
@@ -0,0 +1,68 @@
+
+ * @since 2014-11-08
+ */
+
+namespace Example\InputGenerator;
+
+use Net\Bazzline\Component\ProcessPipe\ExecutableInterface;
+use Net\Bazzline\Component\ProcessPipe\Pipe;
+
+require_once __DIR__ . '/../../../vendor/autoload.php';
+
+/**
+ * Class DataGeneratorProcess
+ */
+class DataGeneratorProcess implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ $input = array();
+ $input[] = array(
+ microtime(true),
+ 'debug',
+ 'new generated log data'
+ );
+
+ return $input;
+ }
+}
+
+/**
+ * Class ProcessTwo
+ */
+class ProcessTwo implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ $input[] = array(
+ microtime(true),
+ 'debug',
+ 'hello world'
+ );
+
+ return $input;
+ }
+}
+
+$pipe = new Pipe(
+ new DataGeneratorProcess(),
+ new ProcessTwo()
+);
+
+$output = $pipe->execute();
+
+foreach ($output as $log) {
+ echo '[' . $log[0] . '] [' . $log[1] . '] - ' . $log[2] . PHP_EOL;
+}
diff --git a/example/Example/InputTransformer/run.php b/example/Example/InputTransformer/run.php
new file mode 100644
index 0000000..f2fd263
--- /dev/null
+++ b/example/Example/InputTransformer/run.php
@@ -0,0 +1,74 @@
+
+ * @since 2014-11-08
+ */
+
+namespace Example\InputTransformer;
+
+use Net\Bazzline\Component\ProcessPipe\ExecutableException;
+use Net\Bazzline\Component\ProcessPipe\ExecutableInterface;
+use Net\Bazzline\Component\ProcessPipe\Pipe;
+use stdClass;
+
+require_once __DIR__ . '/../../../vendor/autoload.php';
+
+/**
+ * Class ObjectToArrayTransformer
+ */
+class ObjectToArrayTransformer implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ if (!is_object($input)) {
+ throw new ExecutableException('input must be instance of object');
+ }
+
+ $array = array();
+
+ foreach (get_object_vars($input) as $property => $value) {
+ $array[$property] = $value;
+ }
+
+ return $array;
+ }
+}
+
+/**
+ * Class ArrayToJSONTransformer
+ * @package De\Leibelt\ProcessPipe\Example\WithDataTransformer
+ */
+class ArrayToJSONTransformer implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws ExecutableException
+ */
+ public function execute($input = null)
+ {
+ if (!is_array($input)) {
+ throw new ExecutableException('input must be an array');
+ }
+
+ return json_encode($input);
+ }
+}
+
+$pipe = new Pipe(
+ new ObjectToArrayTransformer(),
+ new ArrayToJSONTransformer()
+);
+
+$object = new stdClass();
+
+$object->foo = 'bar';
+$object->bar = 'foo';
+$object->foobar = 'barfoo';
+
+echo $pipe->execute($object) . PHP_EOL;
diff --git a/example/Example/InputValidator/run.php b/example/Example/InputValidator/run.php
new file mode 100644
index 0000000..12de615
--- /dev/null
+++ b/example/Example/InputValidator/run.php
@@ -0,0 +1,70 @@
+
+ * @since 2014-11-09
+ */
+
+namespace Example\InputValidator;
+
+use Net\Bazzline\Component\ProcessPipe\ExecutableException;
+use Net\Bazzline\Component\ProcessPipe\ExecutableInterface;
+use Net\Bazzline\Component\ProcessPipe\Pipe;
+use Exception;
+
+require_once __DIR__ . '/../../../vendor/autoload.php';
+
+/**
+ * Class ProcessOne
+ */
+class ProcessOne implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ $input .= ' ' . __METHOD__;
+
+ return $input;
+ }
+}
+
+/**
+ * Class ProcessTwo
+ */
+class ProcessTwo implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ if (!is_array($input)) {
+ throw new ExecutableException('input must be type of array');
+ }
+
+ $input[] = __METHOD__;
+
+ return $input;
+ }
+}
+
+$input = 'string';
+
+$pipe = new Pipe();
+
+$pipe->pipe(
+ new ProcessOne(),
+ new ProcessTwo()
+);
+
+try {
+ $output = $pipe->execute($input);
+ echo $output . PHP_EOL;
+} catch (Exception $exception) {
+ echo 'caught exception with message: ' . $exception->getMessage() . PHP_EOL;
+}
diff --git a/example/Example/NoInput/run.php b/example/Example/NoInput/run.php
new file mode 100644
index 0000000..a01f562
--- /dev/null
+++ b/example/Example/NoInput/run.php
@@ -0,0 +1,58 @@
+
+ * @since 2014-11-08
+ */
+
+namespace Example\NoInput;
+
+use Net\Bazzline\Component\ProcessPipe\ExecutableInterface;
+use Net\Bazzline\Component\ProcessPipe\Pipe;
+
+require_once __DIR__ . '/../../../vendor/autoload.php';
+
+/**
+ * Class ProcessOne
+ */
+class ProcessOne implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ echo __METHOD__ . PHP_EOL;
+ sleep(1);
+
+ return $input;
+ }
+}
+
+/**
+ * Class ProcessTwo
+ */
+class ProcessTwo implements ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws \Net\Bazzline\Component\ProcessPipe\ExecutableException
+ */
+ public function execute($input = null)
+ {
+ echo __METHOD__ . PHP_EOL;
+
+ return $input;
+ }
+}
+
+$pipe = new Pipe();
+$processOne = new ProcessOne();
+$processTwo = new ProcessTwo();
+
+$pipe->pipe($processOne);
+$pipe->pipe($processTwo);
+
+$pipe->execute();
diff --git a/generate_api.php b/generate_api.php
new file mode 100755
index 0000000..b3fa2af
--- /dev/null
+++ b/generate_api.php
@@ -0,0 +1,6 @@
+#!/bin/php
+
+
+
+
+ test/
+
+
+
diff --git a/source/Net/Bazzline/Component/ProcessPipe/ExecutableException.php b/source/Net/Bazzline/Component/ProcessPipe/ExecutableException.php
new file mode 100644
index 0000000..cec54cf
--- /dev/null
+++ b/source/Net/Bazzline/Component/ProcessPipe/ExecutableException.php
@@ -0,0 +1,15 @@
+
+ * @since 2014-11-07
+ */
+
+namespace Net\Bazzline\Component\ProcessPipe;
+
+use RuntimeException;
+
+/**
+ * Class ExecutableException
+ * @package De\Leibelt\ProcessPipeline
+ */
+class ExecutableException extends RuntimeException {}
\ No newline at end of file
diff --git a/source/Net/Bazzline/Component/ProcessPipe/ExecutableInterface.php b/source/Net/Bazzline/Component/ProcessPipe/ExecutableInterface.php
new file mode 100644
index 0000000..fba3231
--- /dev/null
+++ b/source/Net/Bazzline/Component/ProcessPipe/ExecutableInterface.php
@@ -0,0 +1,21 @@
+
+ * @since 2014-11-07
+ */
+
+namespace Net\Bazzline\Component\ProcessPipe;
+
+/**
+ * Interface ExecutableInterface
+ * @package De\Leibelt\ProcessPipeline
+ */
+interface ExecutableInterface
+{
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws ExecutableException
+ */
+ public function execute($input = null);
+}
\ No newline at end of file
diff --git a/source/Net/Bazzline/Component/ProcessPipe/Pipe.php b/source/Net/Bazzline/Component/ProcessPipe/Pipe.php
new file mode 100644
index 0000000..21caea1
--- /dev/null
+++ b/source/Net/Bazzline/Component/ProcessPipe/Pipe.php
@@ -0,0 +1,59 @@
+
+ * @since 2014-11-07
+ */
+
+namespace Net\Bazzline\Component\ProcessPipe;
+
+/**
+ * Class ProcessPipe
+ * @package De\Leibelt\ProcessPipeline
+ */
+class Pipe implements PipeInterface
+{
+ /** @var array|ExecutableInterface[] */
+ private $processes;
+
+ /**
+ * @param ExecutableInterface $process
+ * [@param ExecutableInterface $process]
+ */
+ public function __construct()
+ {
+ $this->processes = array();
+
+ if (func_num_args() > 0) {
+ call_user_func_array(array($this, 'pipe'), func_get_args());
+ }
+ }
+
+ /**
+ * @param mixed $input
+ * @return mixed
+ * @throws ExecutableException
+ */
+ public function execute($input = null)
+ {
+ foreach ($this->processes as $process) {
+ $input = $process->execute($input);
+ }
+
+ return $input;
+ }
+
+ /**
+ * @param ExecutableInterface $process
+ * @return $this
+ */
+ public function pipe(ExecutableInterface $process)
+ {
+ foreach (func_get_args() as $process) {
+ if ($process instanceof ExecutableInterface) {
+ $this->processes[] = $process;
+ }
+ }
+
+ return $this;
+ }
+}
\ No newline at end of file
diff --git a/source/Net/Bazzline/Component/ProcessPipe/PipeInterface.php b/source/Net/Bazzline/Component/ProcessPipe/PipeInterface.php
new file mode 100644
index 0000000..ea3e623
--- /dev/null
+++ b/source/Net/Bazzline/Component/ProcessPipe/PipeInterface.php
@@ -0,0 +1,20 @@
+
+ * @since 2014-11-07
+ */
+
+namespace Net\Bazzline\Component\ProcessPipe;
+
+/**
+ * Interface PipeInterface
+ * @package De\Leibelt\ProcessPipeline
+ */
+interface PipeInterface extends ExecutableInterface
+{
+ /**
+ * @param ExecutableInterface $process - or more
+ * @return $this
+ */
+ public function pipe(ExecutableInterface $process);
+}
\ No newline at end of file
diff --git a/test/Test/Net/Bazzline/Component/ProcessPipe/PipeTest.php b/test/Test/Net/Bazzline/Component/ProcessPipe/PipeTest.php
new file mode 100644
index 0000000..bdc6a08
--- /dev/null
+++ b/test/Test/Net/Bazzline/Component/ProcessPipe/PipeTest.php
@@ -0,0 +1,16 @@
+
+ * @since 2014-11-10
+ */
+
+namespace Test\Net\Bazzline\Component\ProcessPipe;
+
+/**
+ * Class PipeTest
+ * @package Test\Net\Bazzline\Component\ProcessPipe
+ */
+class PipeTest
+{
+
+}
\ No newline at end of file
diff --git a/test/bootstrap.php b/test/bootstrap.php
new file mode 100644
index 0000000..6c8c4f5
--- /dev/null
+++ b/test/bootstrap.php
@@ -0,0 +1,3 @@
+getParentClass();```, the class reflection asks the Broker for a reflection of a class by its name and returns it.
+
+An interesting thing happens when there is a parent class defined but it was not processed (in other words, you ask the Broker for a class that it does not know). It still returns a reflection! Yes, we do have reflections for classes that do not exist! COOL!
+
+There are reflections for file (\*), file-namespace (\*), namespace, class, function/method, constant, property and parameter. You will not normally get in touch with those marked with an asterisk but they are used internally.
+
+**ReflectionFile** is the topmost structure in our reflection tree. It gets the whole tokenized source and tries to find namespaces there. If it does, it creates ReflectionFileNamespace instances and passes them the appropriate part of the tokens array. If not, it creates a single pseudo-namespace (called no-namespace) a passes the whole tokenized source to it.
+
+**ReflectionFileNamespace** gets the namespace definition from the file, finds out its name, other aliased namespaces and tries to find any defined constants, functions and classes. If it finds any, it creates their reflections and passes them the appropriate parts of the tokens array.
+
+**ReflectionNamespace** is a similar (in name) yet quite different (in meaning) structure. It is a unique structure for every namespace and it holds all constants, functions and classes from this particular namespace inside. In fact, it is a simple container. It also is not created directly by any parent reflection, but the Broker creates it.
+
+Why do we need two separate classes? Because namespaces can be split into many files and in each file it can have individual namespace aliases. And those have to be taken into consideration when resolving parent class/interface names. It means that a ReflectionFileNamespace is created for every namespace in every file and it parses its contents, resolves fully qualified names of all classes, their parents and interfaces. Later, the Broker takes all ReflectionFileNamespace instances of the same namespace and merges them into a single ReflectionNameaspace instance.
+
+**ReflectionClass**, **ReflectionFunction**, **ReflectionMethod**, **ReflectionParameter** and **ReflectionProperty** work the same way like their internal reflection namesakes.
+
+**ReflectionConstants** is our addition to the reflection model. There is not much it can do - it can return its name, value (we will speak about values later) and how it was defined.
+
+(Almost) all reflection classes share a common base class, that defines some common functionality and interface. This means that our reflection model is much more unified than the internal one.
+
+There are reflections for the tokenized source (those mentioned above), but also descendants of the internal reflection that implement our additional features (they both use the same interface). They represent the PHP's internal classes, functions, ... So when you ask the Broker for an internal class, it returns a [TokenReflection\\Php\\ReflectionClass](https://github.com/Andrewsville/PHP-Token-Reflection/blob/master/library/TokenReflection/Php/ReflectionClass.php) instance that encapsulates the internal reflection functionality and adds our features. And there is also the [TokenReflection\\Php\\ReflectionConstant](https://github.com/Andrewsville/PHP-Token-Reflection/blob/master/library/TokenReflection/Php/ReflectionConstant.php) class that has no parent in the internal reflection model.
+
+## Remarks
+
+From the beginning we tried to be as compatible as possible with the internal reflection (including things like returning the interface list in the same - pretty weird - order). However there are situations where it is just impossible.
+
+We are limited in the way we can handle constant values and property and parameter default values. When defined as a constant, we try to resolve its value (within parsed and internal constants) and use it. This is eventually made via a combination of ```var_export()``` and ```eval()```. Yes, that sucks, but there is no better way. Moreover the referenced constant may not exist. In that case it is replaced by a ```~~NOT RESOLVED~~``` string.
+
+At the moment we do not support constants declared using the define() function. We will implement support for names defined using a single string and simple values, but there is no way to implement support for something like
+
+```
+define('CONSTANT', $a ? 1 : 0);
+```
+
+When the library encounters a duplicate class, function or constant name, it converts the previously created reflection into an "invalid reflection" instance. That means that the parser is unable to distinguish between such classes and it is unable to build a proper class tree for example. And it throws an exception. When you catch this exception and continue to work with the Broker instance, the duplicate classes, functions or constants will have only one reflection and it will be an instance of **Invalid\ReflectionClass**, **Invalid\ReflectionFunction** or **Invalid\ReflectionConstant** respectively.
+
+## Usage
+
+To be able to work with reflections you have to let the library parse the source code first. That is what [TokenReflection\\Broker](https://github.com/Andrewsville/PHP-Token-Reflection/blob/master/library/TokenReflection/Broker.php) does. It walks through the given directories, tokenizes PHP sources and caches reflection objects. Moreover, you cannot just instantiate a reflection class. You have to ask the Broker for the reflection. And once you have a reflection instance, everything works as expected :)
+
+```php
+processDirectory('~/lib/Zend_Framework');
+
+$class = $broker->getClass('Zend_Version'); // returns a TokenReflection\ReflectionClass instance
+$class = $broker->getClass('Exception'); // returns a TokenReflection\Php\ReflectionClass instance
+$class = $broker->getClass('Nonexistent'); // returns a TokenReflection\Dummy\ReflectionClass instance
+
+$function = $broker->getFunction(...);
+$constant = $broker->getConstant(...);
+```
+
+## Requirements
+
+The library requires PHP 5.3 with the [tokenizer extension](http://cz.php.net/manual/en/book.tokenizer.php) enabled. If you want to process PHAR archives, you will require the [appropriate extension](http://cz.php.net/manual/en/book.phar.php) enabled as well.
+
+## Current status
+
+The current version is 1.2. It should support the vast majority of PHP internal reflection features and add many more.
+
+Every release is tested using our testing package (several PHP frameworks and other libraries) and its compatibility is tested on all PHP versions of the 5.3 and 5.4 branch and the actual trunk.
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Broker.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Broker.php
new file mode 100644
index 0000000..0276e3f
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Broker.php
@@ -0,0 +1,542 @@
+cache = array(
+ self::CACHE_NAMESPACE => array(),
+ self::CACHE_CLASS => array(),
+ self::CACHE_CONSTANT => array(),
+ self::CACHE_FUNCTION => array()
+ );
+
+ $this->options = $options;
+
+ $this->backend = $backend
+ ->setBroker($this)
+ ->setStoringTokenStreams((bool) ($options & self::OPTION_SAVE_TOKEN_STREAM));
+ }
+
+ /**
+ * Returns broker/parser options.
+ *
+ * @return integer
+ */
+ public function getOptions()
+ {
+ return $this->options;
+ }
+
+ /**
+ * Returns if a particular option setting is set.
+ *
+ * @param integer $option Option setting
+ * @return boolean
+ */
+ public function isOptionSet($option)
+ {
+ return (bool) ($this->options & $option);
+ }
+
+ /**
+ * Parses a string with the PHP source code using the given file name and returns the appropriate reflection object.
+ *
+ * @param string $source PHP source code
+ * @param string $fileName Used file name
+ * @param boolean $returnReflectionFile Returns the appropriate \TokenReflection\ReflectionFile instance(s)
+ * @return boolean|\TokenReflection\ReflectionFile
+ */
+ public function processString($source, $fileName, $returnReflectionFile = false)
+ {
+ if ($this->backend->isFileProcessed($fileName)) {
+ $tokens = $this->backend->getFileTokens($fileName);
+ } else {
+ $tokens = new Stream\StringStream($source, $fileName);
+ }
+
+ $reflectionFile = new ReflectionFile($tokens, $this);
+ if (!$this->backend->isFileProcessed($fileName)) {
+ $this->backend->addFile($tokens, $reflectionFile);
+
+ // Clear the cache - leave only tokenized reflections
+ foreach ($this->cache as $type => $cached) {
+ if (!empty($cached)) {
+ $this->cache[$type] = array_filter($cached, function(IReflection $reflection) {
+ return $reflection->isTokenized();
+ });
+ }
+ }
+ }
+
+ return $returnReflectionFile ? $reflectionFile : true;
+ }
+
+ /**
+ * Parses a file and returns the appropriate reflection object.
+ *
+ * @param string $fileName Filename
+ * @param boolean $returnReflectionFile Returns the appropriate \TokenReflection\ReflectionFile instance(s)
+ * @return boolean|\TokenReflection\ReflectionFile
+ * @throws \TokenReflection\Exception\BrokerException If the file could not be processed.
+ */
+ public function processFile($fileName, $returnReflectionFile = false)
+ {
+ try {
+ if ($this->backend->isFileProcessed($fileName)) {
+ $tokens = $this->backend->getFileTokens($fileName);
+ } else {
+ $tokens = new Stream\FileStream($fileName);
+ }
+
+ $reflectionFile = new ReflectionFile($tokens, $this);
+ if (!$this->backend->isFileProcessed($fileName)) {
+ $this->backend->addFile($tokens, $reflectionFile);
+
+ // Clear the cache - leave only tokenized reflections
+ foreach ($this->cache as $type => $cached) {
+ if (!empty($cached)) {
+ $this->cache[$type] = array_filter($cached, function(IReflection $reflection) {
+ return $reflection->isTokenized();
+ });
+ }
+ }
+ }
+
+ return $returnReflectionFile ? $reflectionFile : true;
+ } catch (Exception\ParseException $e) {
+ throw $e;
+ } catch (Exception\StreamException $e) {
+ throw new Exception\BrokerException($this, 'Could not process the file.', 0, $e);
+ }
+ }
+
+ /**
+ * Processes a PHAR archive.
+ *
+ * @param string $fileName Archive filename.
+ * @param boolean $returnReflectionFile Returns the appropriate \TokenReflection\ReflectionFile instance(s)
+ * @return boolean|array of \TokenReflection\ReflectionFile
+ * @throws \TokenReflection\Exception\BrokerException If the PHAR PHP extension is not loaded.
+ * @throws \TokenReflection\Exception\BrokerException If the given archive could not be read.
+ * @throws \TokenReflection\Exception\BrokerException If the given archive could not be processed.
+ */
+ public function processPhar($fileName, $returnReflectionFile = false)
+ {
+ if (!is_file($fileName)) {
+ throw new Exception\BrokerException($this, 'File does not exist.', Exception\BrokerException::DOES_NOT_EXIST);
+ }
+
+ if (!extension_loaded('Phar')) {
+ throw new Exception\BrokerException($this, 'The PHAR PHP extension is not loaded.', Exception\BrokerException::PHP_EXT_MISSING);
+ }
+
+ try {
+ $result = array();
+ foreach (new RecursiveIteratorIterator(new \Phar($fileName)) as $entry) {
+ if ($entry->isFile()) {
+ $result[$entry->getPathName()] = $this->processFile($entry->getPathName(), $returnReflectionFile);
+ }
+ }
+
+ return $returnReflectionFile ? $result : true;
+ } catch (Exception\ParseException $e) {
+ throw $e;
+ } catch (Exception\StreamException $e) {
+ throw new Exception\BrokerException($this, 'Could not process the archive.', 0, $e);
+ }
+ }
+
+ /**
+ * Processes recursively a directory and returns an array of file reflection objects.
+ *
+ * @param string $path Directora path
+ * @param string|array $filters Filename filters
+ * @param boolean $returnReflectionFile Returns the appropriate \TokenReflection\ReflectionFile instance(s)
+ * @return boolean|array of \TokenReflection\ReflectionFile
+ * @throws \TokenReflection\Exception\BrokerException If the given directory does not exist.
+ * @throws \TokenReflection\Exception\BrokerException If the given directory could not be processed.
+ */
+ public function processDirectory($path, $filters = array(), $returnReflectionFile = false)
+ {
+ $realPath = realpath($path);
+ if (!is_dir($realPath)) {
+ throw new Exception\BrokerException($this, 'File does not exist.', Exception\BrokerException::DOES_NOT_EXIST);
+ }
+
+ try {
+ $result = array();
+ foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($realPath)) as $entry) {
+ if ($entry->isFile()) {
+ $process = empty($filters);
+ if (!$process) {
+ foreach ((array) $filters as $filter) {
+ $whitelisting = '!' !== $filter{0};
+ if (fnmatch($whitelisting ? $filter : substr($filter, 1), $entry->getPathName(), FNM_NOESCAPE)) {
+ $process = $whitelisting;
+ }
+ }
+ }
+
+ if ($process) {
+ $result[$entry->getPathName()] = $this->processFile($entry->getPathName(), $returnReflectionFile);
+ }
+ }
+ }
+
+ return $returnReflectionFile ? $result : true;
+ } catch (Exception\ParseException $e) {
+ throw $e;
+ } catch (Exception\StreamException $e) {
+ throw new Exception\BrokerException($this, 'Could not process the directory.', 0, $e);
+ }
+ }
+
+ /**
+ * Process a file, directory or a PHAR archive.
+ *
+ * @param string $path Path
+ * @param boolean $returnReflectionFile Returns the appropriate \TokenReflection\ReflectionFile instance(s)
+ * @return boolean|array|\TokenReflection\ReflectionFile
+ * @throws \TokenReflection\Exception\BrokerException If the target does not exist.
+ */
+ public function process($path, $returnReflectionFile = false)
+ {
+ if (is_dir($path)) {
+ return $this->processDirectory($path, array(), $returnReflectionFile);
+ } elseif (is_file($path)) {
+ if (preg_match('~\\.phar(?:$|\\.)~i', $path)) {
+ return $this->processPhar($path, $returnReflectionFile);
+ }
+
+ return $this->processFile($path, $returnReflectionFile);
+ } else {
+ throw new Exception\BrokerException($this, 'The given directory/file does not exist.', Exception\BrokerException::DOES_NOT_EXIST);
+ }
+ }
+
+ /**
+ * Returns if the broker contains a namespace of the given name.
+ *
+ * @param string $namespaceName Namespace name
+ * @return boolean
+ */
+ public function hasNamespace($namespaceName)
+ {
+ return isset($this->cache[self::CACHE_NAMESPACE][$namespaceName]) || $this->backend->hasNamespace($namespaceName);
+ }
+
+ /**
+ * Returns a reflection object of the given namespace.
+ *
+ * @param string $namespaceName Namespace name
+ * @return \TokenReflection\ReflectionNamespace|null
+ */
+ public function getNamespace($namespaceName)
+ {
+ $namespaceName = ltrim($namespaceName, '\\');
+
+ if (isset($this->cache[self::CACHE_NAMESPACE][$namespaceName])) {
+ return $this->cache[self::CACHE_NAMESPACE][$namespaceName];
+ }
+
+ $namespace = $this->backend->getNamespace($namespaceName);
+ if (null !== $namespace) {
+ $this->cache[self::CACHE_NAMESPACE][$namespaceName] = $namespace;
+ }
+
+ return $namespace;
+ }
+
+ /**
+ * Returns if the broker contains a class of the given name.
+ *
+ * @param string $className Class name
+ * @return boolean
+ */
+ public function hasClass($className)
+ {
+ return isset($this->cache[self::CACHE_CLASS][$className]) || $this->backend->hasClass($className);
+ }
+
+ /**
+ * Returns a reflection object of the given class (FQN expected).
+ *
+ * @param string $className CLass bame
+ * @return \TokenReflection\ReflectionClass|null
+ */
+ public function getClass($className)
+ {
+ $className = ltrim($className, '\\');
+
+ if (isset($this->cache[self::CACHE_CLASS][$className])) {
+ return $this->cache[self::CACHE_CLASS][$className];
+ }
+
+ $this->cache[self::CACHE_CLASS][$className] = $this->backend->getClass($className);
+ return $this->cache[self::CACHE_CLASS][$className];
+ }
+
+ /**
+ * Returns all classes from all namespaces.
+ *
+ * @param integer $types Returned class types (multiple values may be OR-ed)
+ * @return array
+ */
+ public function getClasses($types = Broker\Backend::TOKENIZED_CLASSES)
+ {
+ return $this->backend->getClasses($types);
+ }
+
+ /**
+ * Returns if the broker contains a constant of the given name.
+ *
+ * @param string $constantName Constant name
+ * @return boolean
+ */
+ public function hasConstant($constantName)
+ {
+ return isset($this->cache[self::CACHE_CONSTANT][$constantName]) || $this->backend->hasConstant($constantName);
+ }
+
+ /**
+ * Returns a reflection object of a constant (FQN expected).
+ *
+ * @param string $constantName Constant name
+ * @return \TokenReflection\ReflectionConstant|null
+ */
+ public function getConstant($constantName)
+ {
+ $constantName = ltrim($constantName, '\\');
+
+ if (isset($this->cache[self::CACHE_CONSTANT][$constantName])) {
+ return $this->cache[self::CACHE_CONSTANT][$constantName];
+ }
+
+ if ($constant = $this->backend->getConstant($constantName)) {
+ $this->cache[self::CACHE_CONSTANT][$constantName] = $constant;
+ }
+
+ return $constant;
+ }
+
+ /**
+ * Returns all constants from all namespaces.
+ *
+ * @return array
+ */
+ public function getConstants()
+ {
+ return $this->backend->getConstants();
+ }
+
+ /**
+ * Returns if the broker contains a function of the given name.
+ *
+ * @param string $functionName Function name
+ * @return boolean
+ */
+ public function hasFunction($functionName)
+ {
+ return isset($this->cache[self::CACHE_FUNCTION][$functionName]) || $this->backend->hasFunction($functionName);
+ }
+
+ /**
+ * Returns a reflection object of a function (FQN expected).
+ *
+ * @param string $functionName Function name
+ * @return \TokenReflection\ReflectionFunction|null
+ */
+ public function getFunction($functionName)
+ {
+ $functionName = ltrim($functionName, '\\');
+
+ if (isset($this->cache[self::CACHE_FUNCTION][$functionName])) {
+ return $this->cache[self::CACHE_FUNCTION][$functionName];
+ }
+
+ if ($function = $this->backend->getFunction($functionName)) {
+ $this->cache[self::CACHE_FUNCTION][$functionName] = $function;
+ }
+
+ return $function;
+ }
+
+ /**
+ * Returns all functions from all namespaces.
+ *
+ * @return array
+ */
+ public function getFunctions()
+ {
+ return $this->backend->getFunctions();
+ }
+
+ /**
+ * Returns if the broker contains a file reflection of the given name.
+ *
+ * @param string $fileName File name
+ * @return boolean
+ */
+ public function hasFile($fileName)
+ {
+ return $this->backend->hasFile($fileName);
+ }
+
+ /**
+ * Returns a reflection object of a file.
+ *
+ * @param string $fileName File name
+ * @return \TokenReflection\ReflectionFile|null
+ */
+ public function getFile($fileName)
+ {
+ return $this->backend->getFile($fileName);
+ }
+
+ /**
+ * Returns all processed files reflections.
+ *
+ * @return array
+ */
+ public function getFiles()
+ {
+ return $this->backend->getFiles();
+ }
+
+ /**
+ * Returns an array of tokens from a processed file.
+ *
+ * @param string $fileName File name
+ * @return \TokenReflection\Stream\StreamBase|null
+ */
+ public function getFileTokens($fileName)
+ {
+ return $this->backend->getFileTokens($fileName);
+ }
+
+ /**
+ * Returns a real system path.
+ *
+ * @param string $path Source path
+ * @return string|boolean
+ */
+ public static function getRealPath($path)
+ {
+ if (0 === strpos($path, 'phar://')) {
+ return is_file($path) || is_dir($path) ? $path : false;
+ } else {
+ return realpath($path);
+ }
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Broker/Backend.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Broker/Backend.php
new file mode 100644
index 0000000..2c36a30
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Broker/Backend.php
@@ -0,0 +1,212 @@
+files[$fileName]);
+ }
+
+ /**
+ * Returns a file reflection.
+ *
+ * @param string $fileName File name
+ * @return \TokenReflection\ReflectionFile
+ * @throws \TokenReflection\Exception\BrokerException If the requested file has not been processed
+ */
+ public function getFile($fileName)
+ {
+ if (!isset($this->files[$fileName])) {
+ throw new Exception\BrokerException($this->getBroker(), sprintf('File "%s" has not been processed.', $fileName), Exception\BrokerException::DOES_NOT_EXIST);
+ }
+
+ return $this->files[$fileName];
+ }
+
+ /**
+ * Returns file reflections.
+ *
+ * @return array
+ */
+ public function getFiles()
+ {
+ return $this->files;
+ }
+
+ /**
+ * Returns if there was such namespace processed (FQN expected).
+ *
+ * @param string $namespaceName Namespace name
+ * @return boolean
+ */
+ public function hasNamespace($namespaceName)
+ {
+ return isset($this->namespaces[ltrim($namespaceName, '\\')]);
+ }
+
+ /**
+ * Returns a reflection object of the given namespace.
+ *
+ * @param string $namespaceName Namespace name
+ * @return \TokenReflection\IReflectionNamespace
+ * @throws \TokenReflection\Exception\BrokerException If the requested namespace does not exist.
+ */
+ public function getNamespace($namespaceName)
+ {
+ if (!isset($this->namespaces[TokenReflection\ReflectionNamespace::NO_NAMESPACE_NAME])) {
+ $this->namespaces[TokenReflection\ReflectionNamespace::NO_NAMESPACE_NAME] = new TokenReflection\ReflectionNamespace(TokenReflection\ReflectionNamespace::NO_NAMESPACE_NAME, $this->broker);
+ }
+
+ $namespaceName = ltrim($namespaceName, '\\');
+ if (!isset($this->namespaces[$namespaceName])) {
+ throw new Exception\BrokerException($this->getBroker(), sprintf('Namespace %s does not exist.', $namespaceName), Exception\BrokerException::DOES_NOT_EXIST);
+ }
+
+ return $this->namespaces[$namespaceName];
+ }
+
+ /**
+ * Returns all present namespaces.
+ *
+ * @return array
+ */
+ public function getNamespaces()
+ {
+ return $this->namespaces;
+ }
+
+ /**
+ * Returns if there was such class processed (FQN expected).
+ *
+ * @param string $className Class name
+ * @return boolean
+ */
+ public function hasClass($className)
+ {
+ $className = ltrim($className, '\\');
+ if ($pos = strrpos($className, '\\')) {
+ $namespace = substr($className, 0, $pos);
+
+ if (!isset($this->namespaces[$namespace])) {
+ return false;
+ }
+
+ $namespace = $this->getNamespace($namespace);
+ $className = substr($className, $pos + 1);
+ } else {
+ $namespace = $this->getNamespace(TokenReflection\ReflectionNamespace::NO_NAMESPACE_NAME);
+ }
+
+ return $namespace->hasClass($className);
+ }
+
+ /**
+ * Returns a reflection object of the given class (FQN expected).
+ *
+ * @param string $className CLass bame
+ * @return \TokenReflection\IReflectionClass
+ */
+ public function getClass($className)
+ {
+ if (empty($this->declaredClasses)) {
+ $this->declaredClasses = array_flip(array_merge(get_declared_classes(), get_declared_interfaces()));
+ }
+
+ $className = ltrim($className, '\\');
+ try {
+ $ns = $this->getNamespace(
+ ($boundary = strrpos($className, '\\'))
+ // Class within a namespace
+ ? substr($className, 0, $boundary)
+ // Class without a namespace
+ : TokenReflection\ReflectionNamespace::NO_NAMESPACE_NAME
+ );
+
+ return $ns->getClass($className);
+ } catch (Exception\BaseException $e) {
+ if (isset($this->declaredClasses[$className])) {
+ $reflection = new Php\ReflectionClass($className, $this->broker);
+ if ($reflection->isInternal()) {
+ return $reflection;
+ }
+ }
+
+ return new Dummy\ReflectionClass($className, $this->broker);
+ }
+ }
+
+ /**
+ * Returns all classes from all namespaces.
+ *
+ * @param integer $type Returned class types (multiple values may be OR-ed)
+ * @return array
+ */
+ public function getClasses($type = self::TOKENIZED_CLASSES)
+ {
+ if (null === $this->allClasses) {
+ $this->allClasses = $this->parseClassLists();
+ }
+
+ $result = array();
+ foreach ($this->allClasses as $classType => $classes) {
+ if ($type & $classType) {
+ $result = array_merge($result, $classes);
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Returns if there was such constant processed (FQN expected).
+ *
+ * @param string $constantName Constant name
+ * @return boolean
+ */
+ public function hasConstant($constantName)
+ {
+ $constantName = ltrim($constantName, '\\');
+
+ if ($pos = strpos($constantName, '::')) {
+ $className = substr($constantName, 0, $pos);
+ $constantName = substr($constantName, $pos + 2);
+
+ if (!$this->hasClass($className)) {
+ return false;
+ }
+
+ $parent = $this->getClass($className);
+ } else {
+ if ($pos = strrpos($constantName, '\\')) {
+ $namespace = substr($constantName, 0, $pos);
+ if (!$this->hasNamespace($namespace)) {
+ return false;
+ }
+
+ $parent = $this->getNamespace($namespace);
+ $constantName = substr($constantName, $pos + 1);
+ } else {
+ $parent = $this->getNamespace(TokenReflection\ReflectionNamespace::NO_NAMESPACE_NAME);
+ }
+ }
+
+ return $parent->hasConstant($constantName);
+ }
+
+ /**
+ * Returns a reflection object of a constant (FQN expected).
+ *
+ * @param string $constantName Constant name
+ * @return \TokenReflection\IReflectionConstant
+ * @throws \TokenReflection\Exception\RuntimeException If the requested constant does not exist.
+ */
+ public function getConstant($constantName)
+ {
+ static $declared = array();
+ if (empty($declared)) {
+ $declared = get_defined_constants();
+ }
+
+ if ($boundary = strpos($constantName, '::')) {
+ // Class constant
+ $className = substr($constantName, 0, $boundary);
+ $constantName = substr($constantName, $boundary + 2);
+
+ return $this->getClass($className)->getConstantReflection($constantName);
+ }
+
+ try {
+ $constantName = ltrim($constantName, '\\');
+ if ($boundary = strrpos($constantName, '\\')) {
+ $ns = $this->getNamespace(substr($constantName, 0, $boundary));
+ $constantName = substr($constantName, $boundary + 1);
+ } else {
+ $ns = $this->getNamespace(TokenReflection\ReflectionNamespace::NO_NAMESPACE_NAME);
+ }
+
+ return $ns->getConstant($constantName);
+ } catch (Exception\BaseException $e) {
+ if (isset($declared[$constantName])) {
+ $reflection = new Php\ReflectionConstant($constantName, $declared[$constantName], $this->broker);
+ if ($reflection->isInternal()) {
+ return $reflection;
+ }
+ }
+
+ throw new Exception\BrokerException($this->getBroker(), sprintf('Constant %s does not exist.', $constantName), Exception\BrokerException::DOES_NOT_EXIST);
+ }
+ }
+
+ /**
+ * Returns all constants from all namespaces.
+ *
+ * @return array
+ */
+ public function getConstants()
+ {
+ if (null === $this->allConstants) {
+ $this->allConstants = array();
+ foreach ($this->namespaces as $namespace) {
+ foreach ($namespace->getConstants() as $constant) {
+ $this->allConstants[$constant->getName()] = $constant;
+ }
+ }
+ }
+
+ return $this->allConstants;
+ }
+
+ /**
+ * Returns if there was such function processed (FQN expected).
+ *
+ * @param string $functionName Function name
+ * @return boolean
+ */
+ public function hasFunction($functionName)
+ {
+ $functionName = ltrim($functionName, '\\');
+ if ($pos = strrpos($functionName, '\\')) {
+ $namespace = substr($functionName, 0, $pos);
+ if (!isset($this->namespaces[$namespace])) {
+ return false;
+ }
+
+ $namespace = $this->getNamespace($namespace);
+ $functionName = substr($functionName, $pos + 1);
+ } else {
+ $namespace = $this->getNamespace(TokenReflection\ReflectionNamespace::NO_NAMESPACE_NAME);
+ }
+
+ return $namespace->hasFunction($functionName);
+ }
+
+ /**
+ * Returns a reflection object of a function (FQN expected).
+ *
+ * @param string $functionName Function name
+ * @return \TokenReflection\IReflectionFunction
+ * @throws \TokenReflection\Exception\RuntimeException If the requested function does not exist.
+ */
+ public function getFunction($functionName)
+ {
+ static $declared = array();
+ if (empty($declared)) {
+ $functions = get_defined_functions();
+ $declared = array_flip($functions['internal']);
+ }
+
+ $functionName = ltrim($functionName, '\\');
+ try {
+ $ns = $this->getNamespace(
+ ($boundary = strrpos($functionName, '\\'))
+ // Function within a namespace
+ ? substr($functionName, 0, $boundary)
+ // Function wihout a namespace
+ : TokenReflection\ReflectionNamespace::NO_NAMESPACE_NAME
+ );
+
+ return $ns->getFunction($functionName);
+ } catch (Exception\BaseException $e) {
+ if (isset($declared[$functionName])) {
+ return new Php\ReflectionFunction($functionName, $this->broker);
+ }
+
+ throw new Exception\BrokerException($this->getBroker(), sprintf('Function %s does not exist.', $functionName), Exception\BrokerException::DOES_NOT_EXIST);
+ }
+ }
+
+ /**
+ * Returns all functions from all namespaces.
+ *
+ * @return array
+ */
+ public function getFunctions()
+ {
+ if (null === $this->allFunctions) {
+ $this->allFunctions = array();
+ foreach ($this->namespaces as $namespace) {
+ foreach ($namespace->getFunctions() as $function) {
+ $this->allFunctions[$function->getName()] = $function;
+ }
+ }
+ }
+
+ return $this->allFunctions;
+ }
+
+ /**
+ * Returns if the given file was already processed.
+ *
+ * @param string $fileName File name
+ * @return boolean
+ */
+ public function isFileProcessed($fileName)
+ {
+ return isset($this->tokenStreams[Broker::getRealPath($fileName)]);
+ }
+
+ /**
+ * Returns an array of tokens for a particular file.
+ *
+ * @param string $fileName File name
+ * @return \TokenReflection\Stream\StreamBase
+ * @throws \TokenReflection\Exception\BrokerException If the requested file was not processed.
+ */
+ public function getFileTokens($fileName)
+ {
+ $realName = Broker::getRealPath($fileName);
+ if (!isset($this->tokenStreams[$realName])) {
+ throw new Exception\BrokerException($this->getBroker(), sprintf('File "%s" was not processed yet.', $fileName), Exception\BrokerException::DOES_NOT_EXIST);
+ }
+
+ return true === $this->tokenStreams[$realName] ? new FileStream($realName) : $this->tokenStreams[$realName];
+ }
+
+ /**
+ * Adds a file to the backend storage.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token stream
+ * @param \TokenReflection\ReflectionFile $file File reflection object
+ * @return \TokenReflection\Broker\Backend\Memory
+ */
+ public function addFile(TokenReflection\Stream\StreamBase $tokenStream, TokenReflection\ReflectionFile $file)
+ {
+ $this->tokenStreams[$file->getName()] = $this->storingTokenStreams ? $tokenStream : true;
+ $this->files[$file->getName()] = $file;
+
+ $errors = array();
+
+ foreach ($file->getNamespaces() as $fileNamespace) {
+ try {
+ $namespaceName = $fileNamespace->getName();
+ if (!isset($this->namespaces[$namespaceName])) {
+ $this->namespaces[$namespaceName] = new TokenReflection\ReflectionNamespace($namespaceName, $file->getBroker());
+ }
+
+ $this->namespaces[$namespaceName]->addFileNamespace($fileNamespace);
+ } catch (Exception\FileProcessingException $e) {
+ $errors = array_merge($errors, $e->getReasons());
+ } catch (\Exception $e) {
+ echo $e->getTraceAsString();
+ die($e->getMessage());
+ }
+ }
+
+ // Reset all-*-cache
+ $this->allClasses = null;
+ $this->allFunctions = null;
+ $this->allConstants = null;
+
+ if (!empty($errors)) {
+ throw new Exception\FileProcessingException($errors, $file);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets the reflection broker instance.
+ *
+ * @param \TokenReflection\Broker $broker Reflection broker
+ * @return \TokenReflection\Broker\Backend\Memory
+ */
+ public function setBroker(Broker $broker)
+ {
+ $this->broker = $broker;
+ return $this;
+ }
+
+ /**
+ * Returns the reflection broker instance.
+ *
+ * @return \TokenReflection\Broker $broker Reflection broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Sets if token streams are stored in the backend.
+ *
+ * @param boolean $store
+ * @return \TokenReflection\Broker\Backend
+ */
+ public function setStoringTokenStreams($store)
+ {
+ $this->storingTokenStreams = (bool) $store;
+ return $this;
+ }
+
+ /**
+ * Returns if token streams are stored in the backend.
+ *
+ * @return boolean
+ */
+ public function getStoringTokenStreams()
+ {
+ return $this->storingTokenStreams;
+ }
+
+ /**
+ * Prepares and returns used class lists.
+ *
+ * @return array
+ */
+ protected function parseClassLists()
+ {
+ // Initialize the all-classes-cache
+ $allClasses = array(
+ self::TOKENIZED_CLASSES => array(),
+ self::INTERNAL_CLASSES => array(),
+ self::NONEXISTENT_CLASSES => array()
+ );
+
+ foreach ($this->namespaces as $namespace) {
+ foreach ($namespace->getClasses() as $class) {
+ $allClasses[self::TOKENIZED_CLASSES][$class->getName()] = $class;
+ }
+ }
+
+ foreach ($allClasses[self::TOKENIZED_CLASSES] as $className => $class) {
+ foreach (array_merge($class->getParentClasses(), $class->getInterfaces()) as $parent) {
+ if ($parent->isInternal()) {
+ $allClasses[self::INTERNAL_CLASSES][$parent->getName()] = $parent;
+ } elseif (!$parent->isTokenized()) {
+ $allClasses[self::NONEXISTENT_CLASSES][$parent->getName()] = $parent;
+ }
+ }
+ }
+
+ return $allClasses;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Dummy/ReflectionClass.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Dummy/ReflectionClass.php
new file mode 100644
index 0000000..d8322a7
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Dummy/ReflectionClass.php
@@ -0,0 +1,1091 @@
+name = ltrim($className, '\\');
+ $this->broker = $broker;
+ }
+
+ /**
+ * Returns the name (FQN).
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the unqualified name (UQN).
+ *
+ * @return string
+ */
+ public function getShortName()
+ {
+ $pos = strrpos($this->name, '\\');
+ return false === $pos ? $this->name : substr($this->name, $pos + 1);
+ }
+
+ /**
+ * Returns the namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ $pos = strrpos($this->name, '\\');
+ return false === $pos ? '' : substr($this->name, 0, $pos);
+ }
+
+ /**
+ * Returns if the class is defined within a namespace.
+ *
+ * @return boolean
+ */
+ public function inNamespace()
+ {
+ return false !== strrpos($this->name, '\\');
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return null
+ */
+ public function getExtension()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * @return boolean
+ */
+ public function getExtensionName()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the file name the reflection object is defined in.
+ *
+ * @return null
+ */
+ public function getFileName()
+ {
+ return null;
+ }
+
+ /**
+ * Returns a file reflection.
+ *
+ * @return \TokenReflection\ReflectionFile
+ * @throws \TokenReflection\Exception\RuntimeException If the file is not stored inside the broker
+ */
+ public function getFileReflection()
+ {
+ throw new Exception\BrokerException($this->getBroker(), sprintf('Class was not parsed from a file', $this->getName()), Exception\BrokerException::UNSUPPORTED);
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return null
+ */
+ public function getStartLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return null
+ */
+ public function getEndLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return boolean
+ */
+ public function getDocComment()
+ {
+ return false;
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return null
+ */
+ public function getAnnotation($name)
+ {
+ return null;
+ }
+
+ /**
+ * Returns parsed docblock.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ return array();
+ }
+
+ /**
+ * Returns modifiers.
+ *
+ * @return integer
+ */
+ public function getModifiers()
+ {
+ return 0;
+ }
+
+ /**
+ * Returns if the class is abstract.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class is final.
+ *
+ * @return boolean
+ */
+ public function isFinal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class is an interface.
+ *
+ * @return boolean
+ */
+ public function isInterface()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class is an exception or its descendant.
+ *
+ * @return boolean
+ */
+ public function isException()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if it is possible to create an instance of this class.
+ *
+ * @return boolean
+ */
+ public function isInstantiable()
+ {
+ return false;
+ }
+
+ /**
+ * Returns traits used by this class.
+ *
+ * @return array
+ */
+ public function getTraits()
+ {
+ return array();
+ }
+
+ /**
+ * Returns traits used by this class and not its parents.
+ *
+ * @return array
+ */
+ public function getOwnTraits()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of used traits.
+ *
+ * @return array
+ */
+ public function getTraitNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns traits used by this class and not its parents.
+ *
+ * @return array
+ */
+ public function getOwnTraitNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns method aliases from traits.
+ *
+ * @return array
+ */
+ public function getTraitAliases()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class is a trait.
+ *
+ * @return boolean
+ */
+ public function isTrait()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class uses a particular trait.
+ *
+ * @param \ReflectionClass|\TokenReflection\IReflectionClass|string $trait Trait reflection or name
+ * @return boolean
+ */
+ public function usesTrait($trait)
+ {
+ return false;
+ }
+
+ /**
+ * Returns if objects of this class are cloneable.
+ *
+ * Introduced in PHP 5.4.
+ *
+ * @return boolean
+ * @see http://svn.php.net/viewvc/php/php-src/trunk/ext/reflection/php_reflection.c?revision=307971&view=markup#l4059
+ */
+ public function isCloneable()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class is iterateable.
+ *
+ * Returns true if the class implements the Traversable interface.
+ *
+ * @return boolean
+ */
+ public function isIterateable()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection object is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection object is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the current class is a subclass of the given class.
+ *
+ * @param string|object $class Class name or reflection object
+ * @return boolean
+ */
+ public function isSubclassOf($class)
+ {
+ return false;
+ }
+
+ /**
+ * Returns the parent class reflection.
+ *
+ * @return null
+ */
+ public function getParentClass()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the parent classes reflections.
+ *
+ * @return array
+ */
+ public function getParentClasses()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the parent classes names.
+ *
+ * @return array
+ */
+ public function getParentClassNameList()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the parent class reflection.
+ *
+ * @return null
+ */
+ public function getParentClassName()
+ {
+ return null;
+ }
+
+ /**
+ * Returns if the class implements the given interface.
+ *
+ * @param string|object $interface Interface name or reflection object
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If the provided parameter is not an interface.
+ */
+ public function implementsInterface($interface)
+ {
+ if (is_object($interface)) {
+ if (!$interface instanceof IReflectionClass) {
+ throw new Exception\RuntimeException(sprintf('Parameter must be a string or an instance of class reflection, "%s" provided.', get_class($interface)), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $interfaceName = $interface->getName();
+
+ if (!$interface->isInterface()) {
+ throw new Exception\RuntimeException(sprintf('"%s" is not an interface.', $interfaceName), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+ }
+
+ // Only validation, always returns false
+ return false;
+ }
+
+ /**
+ * Returns interface reflections.
+ *
+ * @return array
+ */
+ public function getInterfaces()
+ {
+ return array();
+ }
+
+ /**
+ * Returns interface names.
+ *
+ * @return array
+ */
+ public function getInterfaceNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns interfaces implemented by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnInterfaces()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of interfaces implemented by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnInterfaceNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the class constructor reflection.
+ *
+ * @return null
+ */
+ public function getConstructor()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the class desctructor reflection.
+ *
+ * @return null
+ */
+ public function getDestructor()
+ {
+ return null;
+ }
+
+ /**
+ * Returns if the class implements the given method.
+ *
+ * @param string $name Method name
+ * @return boolean
+ */
+ public function hasMethod($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a method reflection.
+ *
+ * @param string $name Method name
+ * @throws \TokenReflection\Exception\RuntimeException If the requested method does not exist.
+ */
+ public function getMethod($name)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no method "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns method reflections.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ */
+ public function getMethods($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class implements (and not its parents) the given method.
+ *
+ * @param string $name Method name
+ * @return boolean
+ */
+ public function hasOwnMethod($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns methods declared by this class, not its parents.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ */
+ public function getOwnMethods($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class imports the given method from traits.
+ *
+ * @param string $name Method name
+ * @return boolean
+ */
+ public function hasTraitMethod($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns method reflections imported from traits.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ */
+ public function getTraitMethods($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class defines the given constant.
+ *
+ * @param string $name Constant name.
+ * @return boolean
+ */
+ public function hasConstant($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a constant value.
+ *
+ * @param string $name Constant name
+ * @throws \TokenReflection\Exception\RuntimeException If the requested constant does not exist.
+ */
+ public function getConstant($name)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no constant "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @throws \TokenReflection\Exception\RuntimeException If the requested constant does not exist.
+ */
+ public function getConstantReflection($name)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no constant "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns an array of constant values.
+ *
+ * @return array
+ */
+ public function getConstants()
+ {
+ return array();
+ }
+
+ /**
+ * Returns an array of constant reflections.
+ *
+ * @return array
+ */
+ public function getConstantReflections()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class (and not its parents) defines the given constant.
+ *
+ * @param string $name Constant name.
+ * @return boolean
+ */
+ public function hasOwnConstant($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns constants declared by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnConstants()
+ {
+ return array();
+ }
+
+ /**
+ * Returns an array of constant reflections defined by this class not its parents.
+ *
+ * @return array
+ */
+ public function getOwnConstantReflections()
+ {
+ return array();
+ }
+
+ /**
+ * Returns default properties.
+ *
+ * @return array
+ */
+ public function getDefaultProperties()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class implements the given property.
+ *
+ * @param string $name Property name
+ * @return boolean
+ */
+ public function hasProperty($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns class properties.
+ *
+ * @param integer $filter Property types
+ * @return array
+ */
+ public function getProperties($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Return a property reflections.
+ *
+ * @param string $name Property name
+ * @throws \TokenReflection\Exception\RuntimeException If the requested property does not exist.
+ */
+ public function getProperty($name)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no property "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns if the class (and not its parents) implements the given property.
+ *
+ * @param string $name Property name
+ * @return boolean
+ */
+ public function hasOwnProperty($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns properties declared by this class, not its parents.
+ *
+ * @param integer $filter Properties filter
+ * @return array
+ */
+ public function getOwnProperties($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class imports the given property from traits.
+ *
+ * @param string $name Property name
+ * @return boolean
+ */
+ public function hasTraitProperty($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns property reflections imported from traits.
+ *
+ * @param integer $filter Properties filter
+ * @return array
+ */
+ public function getTraitProperties($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns static properties reflections.
+ *
+ * @return array
+ */
+ public function getStaticProperties()
+ {
+ return array();
+ }
+
+ /**
+ * Returns a value of a static property.
+ *
+ * @param string $name Property name
+ * @param mixed $default Default value
+ * @throws \TokenReflection\Exception\RuntimeException If the requested static property does not exist.
+ */
+ public function getStaticPropertyValue($name, $default = null)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no static property "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns reflections of direct subclasses.
+ *
+ * @return array
+ */
+ public function getDirectSubclasses()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of direct subclasses.
+ *
+ * @return array
+ */
+ public function getDirectSubclassNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns reflections of indirect subclasses.
+ *
+ * @return array
+ */
+ public function getIndirectSubclasses()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of indirect subclasses.
+ *
+ * @return array
+ */
+ public function getIndirectSubclassNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns reflections of classes directly implementing this interface.
+ *
+ * @return array
+ */
+ public function getDirectImplementers()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of classes directly implementing this interface.
+ *
+ * @return array
+ */
+ public function getDirectImplementerNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns reflections of classes indirectly implementing this interface.
+ *
+ * @return array
+ */
+ public function getIndirectImplementers()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of classes indirectly implementing this interface.
+ *
+ * @return array
+ */
+ public function getIndirectImplementerNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the given object is an instance of this class.
+ *
+ * @param object $object Instance
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If the provided argument is not an object.
+ */
+ public function isInstance($object)
+ {
+ if (!is_object($object)) {
+ throw new Exception\RuntimeException(sprintf('Parameter must be a class instance, "%s" provided.', gettype($object)), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ return $this->name === get_class($object) || is_subclass_of($object, $this->name);
+ }
+
+ /**
+ * Creates a new class instance without using a constructor.
+ *
+ * @return object
+ * @throws \TokenReflection\Exception\RuntimeException If the class inherits from an internal class.
+ */
+ public function newInstanceWithoutConstructor()
+ {
+ if (!class_exists($this->name, true)) {
+ throw new Exception\RuntimeException('Could not create an instance; class does not exist.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $reflection = new \TokenReflection\Php\ReflectionClass($this->name, $this->getBroker());
+ return $reflection->newInstanceWithoutConstructor();
+ }
+
+ /**
+ * Creates a new instance using variable number of parameters.
+ *
+ * Use any number of constructor parameters as function parameters.
+ *
+ * @param mixed $args
+ * @return object
+ */
+ public function newInstance($args)
+ {
+ return $this->newInstanceArgs(func_get_args());
+ }
+
+ /**
+ * Creates a new instance using an array of parameters.
+ *
+ * @param array $args Array of constructor parameters
+ * @return object
+ * @throws \TokenReflection\Exception\RuntimeException If the required class does not exist.
+ */
+ public function newInstanceArgs(array $args = array())
+ {
+ if (!class_exists($this->name, true)) {
+ throw new Exception\RuntimeException('Could not create an instance of class; class does not exist.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $reflection = new InternalReflectionClass($this->name);
+ return $reflection->newInstanceArgs($args);
+ }
+
+ /**
+ * Sets a static property value.
+ *
+ * @param string $name Property name
+ * @param mixed $value Property value
+ * @throws \TokenReflection\Exception\RuntimeException If the requested static property does not exist.
+ */
+ public function setStaticPropertyValue($name, $value)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no static property "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf(
+ "Class|Interface [ class|interface %s ] {\n %s%s%s%s%s\n}\n",
+ $this->getName(),
+ "\n\n - Constants [0] {\n }",
+ "\n\n - Static properties [0] {\n }",
+ "\n\n - Static methods [0] {\n }",
+ "\n\n - Properties [0] {\n }",
+ "\n\n - Methods [0] {\n }"
+ );
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string|object $className Class name or class instance
+ * @param boolean $return Return the export instead of outputting it
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If requested parameter doesn't exist.
+ */
+ public static function export(Broker $broker, $className, $return = false)
+ {
+ TokenReflection\ReflectionClass::export($broker, $className, $return);
+ }
+
+ /**
+ * Outputs the reflection subject source code.
+ *
+ * @return string
+ */
+ public function getSource()
+ {
+ return '';
+ }
+
+ /**
+ * Returns the start position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getStartPosition()
+ {
+ return -1;
+ }
+
+ /**
+ * Returns the end position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getEndPosition()
+ {
+ return -1;
+ }
+
+ /**
+ * Returns if the class definition is complete.
+ *
+ * Dummy classes never have the definition complete.
+ *
+ * @return boolean
+ */
+ public function isComplete()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class definition is valid.
+ *
+ * Dummy classes are always valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the reflection subject is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return ReflectionBase::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return ReflectionBase::exists($this, $key);
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/BaseException.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/BaseException.php
new file mode 100644
index 0000000..aaebfe1
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/BaseException.php
@@ -0,0 +1,102 @@
+getDetail();
+
+ return sprintf(
+ "exception '%s'%s in %s on line %d\n%s\nStack trace:\n%s",
+ get_class($this),
+ $this->getMessage() ? " with message '" . $this->getMessage() . "'" : '',
+ $this->getFile(),
+ $this->getLine(),
+ empty($detail) ? '' : $detail . "\n",
+ $this->getTraceAsString()
+ );
+ }
+
+ /**
+ * Returns the exception details as string.
+ *
+ * @return string
+ */
+ final public function __toString()
+ {
+ $output = '';
+
+ if ($ex = $this->getPrevious()) {
+ $output .= (string) $ex . "\n\nNext ";
+ }
+
+ return $output . $this->getOutput() . "\n";
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/BrokerException.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/BrokerException.php
new file mode 100644
index 0000000..eb7e21d
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/BrokerException.php
@@ -0,0 +1,66 @@
+broker = $broker;
+ }
+
+ /**
+ * Returns the current Broker.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Returns an exception description detail.
+ *
+ * @return string
+ */
+ public function getDetail()
+ {
+ return '';
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/FileProcessingException.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/FileProcessingException.php
new file mode 100644
index 0000000..48da374
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/FileProcessingException.php
@@ -0,0 +1,80 @@
+getName()),
+ 0,
+ $sender
+ );
+
+ $this->reasons = $reasons;
+ }
+
+ /**
+ * Returns a list of reasons why the file could not be processed.
+ *
+ * @return array
+ */
+ public function getReasons()
+ {
+ return $this->reasons;
+ }
+
+ /**
+ * Returns an exception description detail.
+ *
+ * @return string
+ */
+ public function getDetail()
+ {
+ if (!empty($this->reasons)) {
+ $reasons = array_map(function(BaseException $reason) {
+ if ($reason instanceof ParseException) {
+ return $reason->getDetail();
+ } else {
+ return $reason->getMessage();
+ }
+ }, $this->reasons);
+
+ return "There were following reasons for this exception:\n" . implode("\n", $reasons);
+ }
+
+ return '';
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/ParseException.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/ParseException.php
new file mode 100644
index 0000000..c9161c6
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/ParseException.php
@@ -0,0 +1,264 @@
+sender = $sender;
+
+ $token = $tokenStream->current();
+ $position = $tokenStream->key();
+
+ if (!empty($token) && !empty($position)) {
+ $this->token = $token;
+ $this->tokenName = $tokenStream->getTokenName();
+
+ $line = $this->token[2];
+ $min = $max = $position;
+ } else {
+ $min = $max = $tokenStream->count() - 1;
+ $line = $tokenStream[$min][2];
+ }
+
+ $this->exceptionLine = $line;
+
+ static $skip = array(T_WHITESPACE => true, T_COMMENT => true, T_DOC_COMMENT => true);
+
+ $significant = array();
+ while (isset($tokenStream[$min - 1])) {
+ if (!isset($significant[$tokenStream[$min][2]])) {
+ if (self::SOURCE_LINES_AROUND <= array_sum($significant)) {
+ break;
+ }
+
+ $significant[$tokenStream[$min][2]] = !isset($skip[$tokenStream[$min][0]]);
+ } else {
+ $significant[$tokenStream[$min][2]] |= !isset($skip[$tokenStream[$min][0]]);
+ }
+
+ $min--;
+ }
+
+ $significant = array();
+ while (isset($tokenStream[$max + 1])) {
+ if (!isset($significant[$tokenStream[$max][2]])) {
+ if (self::SOURCE_LINES_AROUND <= array_sum($significant)) {
+ break;
+ }
+
+ $significant[$tokenStream[$max][2]] = !isset($skip[$tokenStream[$max][0]]);
+ } else {
+ $significant[$tokenStream[$max][2]] |= !isset($skip[$tokenStream[$max][0]]);
+ }
+
+ $max++;
+ }
+
+ $this->scopeBoundaries = array($min, $max);
+ }
+
+ /**
+ * Returns the token where the problem was detected or NULL if the token stream was empty or an end was reached.
+ *
+ * @return array|null
+ */
+ public function getToken()
+ {
+ return $this->token;
+ }
+
+ /**
+ * Returns the name of the token where the problem was detected or NULL if the token stream was empty or an end was reached.
+ *
+ * @return string|null
+ */
+ public function getTokenName()
+ {
+ return $this->tokenName;
+ }
+
+ /**
+ * Returns the line where the exception was thrown.
+ *
+ * @return integer
+ */
+ public function getExceptionLine()
+ {
+ return $this->exceptionLine;
+ }
+
+ /**
+ * Returns the file line with the token or null.
+ *
+ * @return integer|null
+ */
+ public function getTokenLine()
+ {
+ return null === $this->token ? null : $this->token[2];
+ }
+
+ /**
+ * Returns the source code part around the token.
+ *
+ * @param boolean $lineNumbers Returns the source code part with line numbers
+ * @return string|null
+ */
+ public function getSourcePart($lineNumbers = false)
+ {
+ if (empty($this->scopeBoundaries)) {
+ return null;
+ }
+
+ list($lo, $hi) = $this->scopeBoundaries;
+ $stream = $this->getStream();
+
+ $code = $stream->getSourcePart($lo, $hi);
+
+ if ($lineNumbers) {
+ $lines = explode("\n", $code);
+
+ $startLine = $stream[$lo][2];
+ $width = strlen($startLine + count($lines) - 1);
+ $errorLine = $this->token[2];
+ $actualLine = $startLine;
+
+ $code = implode(
+ "\n",
+ array_map(function($line) use (&$actualLine, $width, $errorLine) {
+ return ($actualLine === $errorLine ? '*' : ' ') . str_pad($actualLine++, $width, ' ', STR_PAD_LEFT) . ': ' . $line;
+ }, $lines)
+ );
+ }
+
+ return $code;
+ }
+
+ /**
+ * Returns the reflection element that caused the exception to be raised.
+ *
+ * @return \TokenReflection\IReflection
+ */
+ public function getSender()
+ {
+ return $this->sender;
+ }
+
+ /**
+ * Returns an exception description detail.
+ *
+ * @return string
+ */
+ public function getDetail()
+ {
+ if (0 === $this->getStream()->count()) {
+ return parent::getDetail() . 'The token stream was empty.';
+ } elseif (empty($this->token)) {
+ return parent::getDetail() . 'The token stream was read out of its bounds.';
+ } else {
+ return parent::getDetail() .
+ sprintf(
+ "\nThe cause of the exception was the %s token (line %s) in following part of %s source code:\n\n%s",
+ $this->tokenName,
+ $this->token[2],
+ $this->sender && $this->sender->getName() ? $this->sender->getPrettyName() : 'the',
+ $this->getSourcePart(true)
+ );
+ }
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/RuntimeException.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/RuntimeException.php
new file mode 100644
index 0000000..9857779
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/RuntimeException.php
@@ -0,0 +1,72 @@
+sender = $sender;
+ }
+
+ /**
+ * Returns the reflection element that caused the exception to be raised.
+ *
+ * @return \TokenReflection\IReflection
+ */
+ public function getSender()
+ {
+ return $this->sender;
+ }
+
+ /**
+ * Returns an exception description detail.
+ *
+ * @return string
+ */
+ public function getDetail()
+ {
+ return null === $this->sender ? '' : sprintf('Thrown when working with "%s".', $this->sender->getPrettyName());
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/StreamException.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/StreamException.php
new file mode 100644
index 0000000..5aa7519
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Exception/StreamException.php
@@ -0,0 +1,96 @@
+stream = $stream;
+ }
+
+ /**
+ * Returns the reflection element that caused the exception to be raised.
+ *
+ * @return \TokenReflection\Stream\StreamBase
+ */
+ public function getStream()
+ {
+ return $this->stream;
+ }
+
+ /**
+ * Returns the processed file name.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->stream->getFileName();
+ }
+
+ /**
+ * Returns an exception description detail.
+ *
+ * @return string
+ */
+ public function getDetail()
+ {
+ return sprintf('Thrown when working with file "%s" token stream.', $this->getFileName());
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/IReflection.php b/vendor/andrewsville/php-token-reflection/TokenReflection/IReflection.php
new file mode 100644
index 0000000..911dd63
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/IReflection.php
@@ -0,0 +1,80 @@
+ 5.3.0, you can uncomment it.
+ *
+ * @return mixed
+ */
+ // public function invoke();
+
+ /**
+ * Calls the function.
+ *
+ * @param array $args Function parameter values
+ * @return mixed
+ */
+ public function invokeArgs(array $args);
+
+ /**
+ * Returns the function/method as closure.
+ *
+ * @return \Closure
+ */
+ public function getClosure();
+
+ /**
+ * Returns if the function definition is valid.
+ *
+ * That means that the source code is valid and the function name is unique within parsed files.
+ *
+ * @return boolean
+ */
+ public function isValid();
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases();
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/IReflectionFunctionBase.php b/vendor/andrewsville/php-token-reflection/TokenReflection/IReflectionFunctionBase.php
new file mode 100644
index 0000000..9076590
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/IReflectionFunctionBase.php
@@ -0,0 +1,135 @@
+name = ltrim($className, '\\');
+ $this->fileName = $fileName;
+ $this->broker = $broker;
+ }
+
+ /**
+ * Returns the name (FQN).
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the unqualified name (UQN).
+ *
+ * @return string
+ */
+ public function getShortName()
+ {
+ $pos = strrpos($this->name, '\\');
+ return false === $pos ? $this->name : substr($this->name, $pos + 1);
+ }
+
+ /**
+ * Returns the namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ $pos = strrpos($this->name, '\\');
+ return false === $pos ? '' : substr($this->name, 0, $pos);
+ }
+
+ /**
+ * Returns if the class is defined within a namespace.
+ *
+ * @return boolean
+ */
+ public function inNamespace()
+ {
+ return false !== strrpos($this->name, '\\');
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return null
+ */
+ public function getExtension()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * @return boolean
+ */
+ public function getExtensionName()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the file name the reflection object is defined in.
+ *
+ * @return null
+ */
+ public function getFileName()
+ {
+ return $this->fileName;
+ }
+
+ /**
+ * Returns a file reflection.
+ *
+ * @return \TokenReflection\ReflectionFile
+ * @throws \TokenReflection\Exception\RuntimeException If the file is not stored inside the broker
+ */
+ public function getFileReflection()
+ {
+ throw new Exception\BrokerException($this->getBroker(), sprintf('Class was not parsed from a file', $this->getName()), Exception\BrokerException::UNSUPPORTED);
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return null
+ */
+ public function getStartLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return null
+ */
+ public function getEndLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return boolean
+ */
+ public function getDocComment()
+ {
+ return false;
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return null
+ */
+ public function getAnnotation($name)
+ {
+ return null;
+ }
+
+ /**
+ * Returns parsed docblock.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ return array();
+ }
+
+ /**
+ * Returns modifiers.
+ *
+ * @return integer
+ */
+ public function getModifiers()
+ {
+ return 0;
+ }
+
+ /**
+ * Returns if the class is abstract.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class is final.
+ *
+ * @return boolean
+ */
+ public function isFinal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class is an interface.
+ *
+ * @return boolean
+ */
+ public function isInterface()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class is an exception or its descendant.
+ *
+ * @return boolean
+ */
+ public function isException()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if it is possible to create an instance of this class.
+ *
+ * @return boolean
+ */
+ public function isInstantiable()
+ {
+ return false;
+ }
+
+ /**
+ * Returns traits used by this class.
+ *
+ * @return array
+ */
+ public function getTraits()
+ {
+ return array();
+ }
+
+ /**
+ * Returns traits used by this class and not its parents.
+ *
+ * @return array
+ */
+ public function getOwnTraits()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of used traits.
+ *
+ * @return array
+ */
+ public function getTraitNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns traits used by this class and not its parents.
+ *
+ * @return array
+ */
+ public function getOwnTraitNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns method aliases from traits.
+ *
+ * @return array
+ */
+ public function getTraitAliases()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class is a trait.
+ *
+ * @return boolean
+ */
+ public function isTrait()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class uses a particular trait.
+ *
+ * @param \ReflectionClass|\TokenReflection\IReflectionClass|string $trait Trait reflection or name
+ * @return boolean
+ */
+ public function usesTrait($trait)
+ {
+ return false;
+ }
+
+ /**
+ * Returns if objects of this class are cloneable.
+ *
+ * Introduced in PHP 5.4.
+ *
+ * @return boolean
+ * @see http://svn.php.net/viewvc/php/php-src/trunk/ext/reflection/php_reflection.c?revision=307971&view=markup#l4059
+ */
+ public function isCloneable()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the class is iterateable.
+ *
+ * Returns true if the class implements the Traversable interface.
+ *
+ * @return boolean
+ */
+ public function isIterateable()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection object is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection object is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the current class is a subclass of the given class.
+ *
+ * @param string|object $class Class name or reflection object
+ * @return boolean
+ */
+ public function isSubclassOf($class)
+ {
+ return false;
+ }
+
+ /**
+ * Returns the parent class reflection.
+ *
+ * @return null
+ */
+ public function getParentClass()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the parent classes reflections.
+ *
+ * @return array
+ */
+ public function getParentClasses()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the parent classes names.
+ *
+ * @return array
+ */
+ public function getParentClassNameList()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the parent class reflection.
+ *
+ * @return null
+ */
+ public function getParentClassName()
+ {
+ return null;
+ }
+
+ /**
+ * Returns if the class implements the given interface.
+ *
+ * @param string|object $interface Interface name or reflection object
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If the provided parameter is not an interface.
+ */
+ public function implementsInterface($interface)
+ {
+ if (is_object($interface)) {
+ if (!$interface instanceof IReflectionClass) {
+ throw new Exception\RuntimeException(sprintf('Parameter must be a string or an instance of class reflection, "%s" provided.', get_class($interface)), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $interfaceName = $interface->getName();
+
+ if (!$interface->isInterface()) {
+ throw new Exception\RuntimeException(sprintf('"%s" is not an interface.', $interfaceName), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+ }
+
+ // Only validation, always returns false
+ return false;
+ }
+
+ /**
+ * Returns interface reflections.
+ *
+ * @return array
+ */
+ public function getInterfaces()
+ {
+ return array();
+ }
+
+ /**
+ * Returns interface names.
+ *
+ * @return array
+ */
+ public function getInterfaceNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns interfaces implemented by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnInterfaces()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of interfaces implemented by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnInterfaceNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the class constructor reflection.
+ *
+ * @return null
+ */
+ public function getConstructor()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the class desctructor reflection.
+ *
+ * @return null
+ */
+ public function getDestructor()
+ {
+ return null;
+ }
+
+ /**
+ * Returns if the class implements the given method.
+ *
+ * @param string $name Method name
+ * @return boolean
+ */
+ public function hasMethod($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a method reflection.
+ *
+ * @param string $name Method name
+ * @throws \TokenReflection\Exception\RuntimeException If the requested method does not exist.
+ */
+ public function getMethod($name)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no method "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns method reflections.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ */
+ public function getMethods($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class implements (and not its parents) the given method.
+ *
+ * @param string $name Method name
+ * @return boolean
+ */
+ public function hasOwnMethod($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns methods declared by this class, not its parents.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ */
+ public function getOwnMethods($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class imports the given method from traits.
+ *
+ * @param string $name Method name
+ * @return boolean
+ */
+ public function hasTraitMethod($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns method reflections imported from traits.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ */
+ public function getTraitMethods($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class defines the given constant.
+ *
+ * @param string $name Constant name.
+ * @return boolean
+ */
+ public function hasConstant($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a constant value.
+ *
+ * @param string $name Constant name
+ * @throws \TokenReflection\Exception\RuntimeException If the requested constant does not exist.
+ */
+ public function getConstant($name)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no constant "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @throws \TokenReflection\Exception\RuntimeException If the requested constant does not exist.
+ */
+ public function getConstantReflection($name)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no constant "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns an array of constant values.
+ *
+ * @return array
+ */
+ public function getConstants()
+ {
+ return array();
+ }
+
+ /**
+ * Returns an array of constant reflections.
+ *
+ * @return array
+ */
+ public function getConstantReflections()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class (and not its parents) defines the given constant.
+ *
+ * @param string $name Constant name.
+ * @return boolean
+ */
+ public function hasOwnConstant($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns constants declared by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnConstants()
+ {
+ return array();
+ }
+
+ /**
+ * Returns an array of constant reflections defined by this class not its parents.
+ *
+ * @return array
+ */
+ public function getOwnConstantReflections()
+ {
+ return array();
+ }
+
+ /**
+ * Returns default properties.
+ *
+ * @return array
+ */
+ public function getDefaultProperties()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class implements the given property.
+ *
+ * @param string $name Property name
+ * @return boolean
+ */
+ public function hasProperty($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns class properties.
+ *
+ * @param integer $filter Property types
+ * @return array
+ */
+ public function getProperties($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Return a property reflections.
+ *
+ * @param string $name Property name
+ * @throws \TokenReflection\Exception\RuntimeException If the requested property does not exist.
+ */
+ public function getProperty($name)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no property "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns if the class (and not its parents) implements the given property.
+ *
+ * @param string $name Property name
+ * @return boolean
+ */
+ public function hasOwnProperty($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns properties declared by this class, not its parents.
+ *
+ * @param integer $filter Properties filter
+ * @return array
+ */
+ public function getOwnProperties($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class imports the given property from traits.
+ *
+ * @param string $name Property name
+ * @return boolean
+ */
+ public function hasTraitProperty($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns property reflections imported from traits.
+ *
+ * @param integer $filter Properties filter
+ * @return array
+ */
+ public function getTraitProperties($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns static properties reflections.
+ *
+ * @return array
+ */
+ public function getStaticProperties()
+ {
+ return array();
+ }
+
+ /**
+ * Returns a value of a static property.
+ *
+ * @param string $name Property name
+ * @param mixed $default Default value
+ * @throws \TokenReflection\Exception\RuntimeException If the requested static property does not exist.
+ */
+ public function getStaticPropertyValue($name, $default = null)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no static property "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns reflections of direct subclasses.
+ *
+ * @return array
+ */
+ public function getDirectSubclasses()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of direct subclasses.
+ *
+ * @return array
+ */
+ public function getDirectSubclassNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns reflections of indirect subclasses.
+ *
+ * @return array
+ */
+ public function getIndirectSubclasses()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of indirect subclasses.
+ *
+ * @return array
+ */
+ public function getIndirectSubclassNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns reflections of classes directly implementing this interface.
+ *
+ * @return array
+ */
+ public function getDirectImplementers()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of classes directly implementing this interface.
+ *
+ * @return array
+ */
+ public function getDirectImplementerNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns reflections of classes indirectly implementing this interface.
+ *
+ * @return array
+ */
+ public function getIndirectImplementers()
+ {
+ return array();
+ }
+
+ /**
+ * Returns names of classes indirectly implementing this interface.
+ *
+ * @return array
+ */
+ public function getIndirectImplementerNames()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the given object is an instance of this class.
+ *
+ * @param object $object Instance
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If the provided argument is not an object.
+ */
+ public function isInstance($object)
+ {
+ if (!is_object($object)) {
+ throw new Exception\RuntimeException(sprintf('Parameter must be a class instance, "%s" provided.', gettype($object)), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ return $this->name === get_class($object) || is_subclass_of($object, $this->name);
+ }
+
+ /**
+ * Creates a new class instance without using a constructor.
+ *
+ * @return object
+ * @throws \TokenReflection\Exception\RuntimeException If the class inherits from an internal class.
+ */
+ public function newInstanceWithoutConstructor()
+ {
+ if (!class_exists($this->name, true)) {
+ throw new Exception\RuntimeException('Could not create an instance; class does not exist.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $reflection = new \TokenReflection\Php\ReflectionClass($this->name, $this->getBroker());
+ return $reflection->newInstanceWithoutConstructor();
+ }
+
+ /**
+ * Creates a new instance using variable number of parameters.
+ *
+ * Use any number of constructor parameters as function parameters.
+ *
+ * @param mixed $args
+ * @return object
+ */
+ public function newInstance($args)
+ {
+ return $this->newInstanceArgs(func_get_args());
+ }
+
+ /**
+ * Creates a new instance using an array of parameters.
+ *
+ * @param array $args Array of constructor parameters
+ * @return object
+ * @throws \TokenReflection\Exception\RuntimeException If the required class does not exist.
+ */
+ public function newInstanceArgs(array $args = array())
+ {
+ if (!class_exists($this->name, true)) {
+ throw new Exception\RuntimeException('Could not create an instance of class; class does not exist.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $reflection = new InternalReflectionClass($this->name);
+ return $reflection->newInstanceArgs($args);
+ }
+
+ /**
+ * Sets a static property value.
+ *
+ * @param string $name Property name
+ * @param mixed $value Property value
+ * @throws \TokenReflection\Exception\RuntimeException If the requested static property does not exist.
+ */
+ public function setStaticPropertyValue($name, $value)
+ {
+ throw new Exception\RuntimeException(sprintf('There is no static property "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf(
+ "Class|Interface [ class|interface %s ] {\n %s%s%s%s%s\n}\n",
+ $this->getName(),
+ "\n\n - Constants [0] {\n }",
+ "\n\n - Static properties [0] {\n }",
+ "\n\n - Static methods [0] {\n }",
+ "\n\n - Properties [0] {\n }",
+ "\n\n - Methods [0] {\n }"
+ );
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string|object $className Class name or class instance
+ * @param boolean $return Return the export instead of outputting it
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If requested parameter doesn't exist.
+ */
+ public static function export(Broker $broker, $className, $return = false)
+ {
+ TokenReflection\ReflectionClass::export($broker, $className, $return);
+ }
+
+ /**
+ * Outputs the reflection subject source code.
+ *
+ * @return string
+ */
+ public function getSource()
+ {
+ return '';
+ }
+
+ /**
+ * Returns the start position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getStartPosition()
+ {
+ return -1;
+ }
+
+ /**
+ * Returns the end position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getEndPosition()
+ {
+ return -1;
+ }
+
+ /**
+ * Returns if the class definition is complete.
+ *
+ * Invalid classes are always complete.
+ *
+ * @return boolean
+ */
+ public function isComplete()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the class definition is valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection subject is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return ReflectionBase::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return ReflectionBase::exists($this, $key);
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Invalid/ReflectionConstant.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Invalid/ReflectionConstant.php
new file mode 100644
index 0000000..6fb75bb
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Invalid/ReflectionConstant.php
@@ -0,0 +1,403 @@
+name = $name;
+ $this->broker = $broker;
+ $this->fileName = $fileName;
+ }
+
+ /**
+ * Returns the name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the unqualified name (UQN).
+ *
+ * @return string
+ */
+ public function getShortName()
+ {
+ $pos = strrpos($this->name, '\\');
+ return false === $pos ? $this->name : substr($this->name, $pos + 1);
+ }
+
+ /**
+ * Returns the declaring class reflection.
+ *
+ * @return null
+ */
+ public function getDeclaringClass()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return null
+ */
+ public function getDeclaringClassName()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ $pos = strrpos($this->name, '\\');
+ return false === $pos ? '' : substr($this->name, 0, $pos);
+ }
+
+ /**
+ * Returns if the function/method is defined within a namespace.
+ *
+ * @return boolean
+ */
+ public function inNamespace()
+ {
+ return false !== strpos($this->name, '\\');
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return null
+ */
+ public function getExtension()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * @return boolean
+ */
+ public function getExtensionName()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the appropriate source code part.
+ *
+ * @return string
+ */
+ public function getSource()
+ {
+ return '';
+ }
+
+ /**
+ * Returns the start position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getStartPosition()
+ {
+ return -1;
+ }
+
+ /**
+ * Returns the end position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getEndPosition()
+ {
+ return -1;
+ }
+
+ /**
+ * Returns the file name the reflection object is defined in.
+ *
+ * @return null
+ */
+ public function getFileName()
+ {
+ return $this->fileName;
+ }
+
+ /**
+ * Returns a file reflection.
+ *
+ * @return \TokenReflection\ReflectionFile
+ * @throws \TokenReflection\Exception\RuntimeException If the file is not stored inside the broker
+ */
+ public function getFileReflection()
+ {
+ throw new Exception\BrokerException($this->getBroker(), sprintf('Constant %s was not parsed from a file', $this->getPrettyName()), Exception\BrokerException::UNSUPPORTED);
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return null
+ */
+ public function getStartLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return null
+ */
+ public function getEndLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return boolean
+ */
+ public function getDocComment()
+ {
+ return false;
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return null
+ */
+ public function getAnnotation($name)
+ {
+ return null;
+ }
+
+ /**
+ * Returns parsed docblock.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the constant value.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the part of the source code defining the constant value.
+ *
+ * @return string
+ */
+ public function getValueDefinition()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the originaly provided value definition.
+ *
+ * @return string
+ */
+ public function getOriginalValueDefinition()
+ {
+ return null;
+ }
+
+ /**
+ * Returns if the constant is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the constant is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the reflection subject is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return false;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf(
+ "Constant [ %s %s ] { %s }\n",
+ gettype(null),
+ $this->getName(),
+ null
+ );
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the constant definition is valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ return false;
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return ReflectionBase::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return ReflectionBase::exists($this, $key);
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Invalid/ReflectionElement.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Invalid/ReflectionElement.php
new file mode 100644
index 0000000..344d62b
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Invalid/ReflectionElement.php
@@ -0,0 +1,53 @@
+reasons[] = $reason;
+
+ return $this;
+ }
+
+ /**
+ * Returns a list of reasons why this element's reflection is invalid.
+ *
+ * @return array
+ */
+ public function getReasons()
+ {
+ return $this->reasons;
+ }
+
+ /**
+ * Returns if there are any known reasons why this element's reflection is invalid.
+ *
+ * @return boolean
+ */
+ public function hasReasons()
+ {
+ return !empty($this->reasons);
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Invalid/ReflectionFunction.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Invalid/ReflectionFunction.php
new file mode 100644
index 0000000..475914b
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Invalid/ReflectionFunction.php
@@ -0,0 +1,490 @@
+name = ltrim($name, '\\');
+ $this->broker = $broker;
+ $this->fileName = $fileName;
+ }
+
+ /**
+ * Returns the name (FQN).
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the unqualified name (UQN).
+ *
+ * @return string
+ */
+ public function getShortName()
+ {
+ $pos = strrpos($this->name, '\\');
+ return false === $pos ? $this->name : substr($this->name, $pos + 1);
+ }
+
+ /**
+ * Returns the namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ $pos = strrpos($this->name, '\\');
+ return false === $pos ? '' : substr($this->name, 0, $pos);
+ }
+
+ /**
+ * Returns if the class is defined within a namespace.
+ *
+ * @return boolean
+ */
+ public function inNamespace()
+ {
+ return false !== strrpos($this->name, '\\');
+ }
+
+ /**
+ * Returns if the reflection object is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection object is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return true;
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->name . '()';
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return \TokenReflection\IReflectionExtension|null
+ */
+ public function getExtension()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * @return false
+ */
+ public function getExtensionName()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the file name the reflection object is defined in.
+ *
+ * @return null
+ */
+ public function getFileName()
+ {
+ return $this->fileName;
+ }
+
+ /**
+ * Returns a file reflection.
+ *
+ * @return \TokenReflection\ReflectionFile
+ * @throws \TokenReflection\Exception\RuntimeException If the file is not stored inside the broker
+ */
+ public function getFileReflection()
+ {
+ throw new Exception\BrokerException($this->getBroker(), sprintf('Function was not parsed from a file', $this->getPrettyName()), Exception\BrokerException::UNSUPPORTED);
+ }
+
+ /**
+ * Returns the appropriate source code part.
+ *
+ * @return string
+ */
+ public function getSource()
+ {
+ return '';
+ }
+
+ /**
+ * Returns the start position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getStartPosition()
+ {
+ return -1;
+ }
+
+ /**
+ * Returns the end position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getEndPosition()
+ {
+ return -1;
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return integer
+ */
+ public function getStartLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return integer
+ */
+ public function getEndLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return boolean
+ */
+ public function getDocComment()
+ {
+ return false;
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return string|array|null
+ */
+ public function getAnnotation($name)
+ {
+ return null;
+ }
+
+ /**
+ * Returns all annotations.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the function/method is a closure.
+ *
+ * @return boolean
+ */
+ public function isClosure()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the function/method is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the function/method returns its value as reference.
+ *
+ * @return boolean
+ */
+ public function returnsReference()
+ {
+ return false;
+ }
+
+ /**
+ * Returns a function/method parameter.
+ *
+ * @param integer|string $parameter Parameter name or position
+ */
+ public function getParameter($parameter)
+ {
+ if (is_numeric($parameter)) {
+ throw new Exception\RuntimeException(sprintf('There is no parameter at position "%d".', $parameter), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ } else {
+ throw new Exception\RuntimeException(sprintf('There is no parameter "%s".', $parameter), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+ }
+
+ /**
+ * Returns function/method parameters.
+ *
+ * @return array
+ */
+ public function getParameters(){
+ return array();
+ }
+
+ /**
+ * Returns the number of parameters.
+ *
+ * @return integer
+ */
+ public function getNumberOfParameters()
+ {
+ return 0;
+ }
+
+ /**
+ * Returns the number of required parameters.
+ *
+ * @return integer
+ */
+ public function getNumberOfRequiredParameters()
+ {
+ return 0;
+ }
+
+ /**
+ * Returns static variables.
+ *
+ * @return array
+ */
+ public function getStaticVariables()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the method is is disabled via the disable_functions directive.
+ *
+ * @return boolean
+ */
+ public function isDisabled()
+ {
+ return false;
+ }
+
+ /**
+ * Calls the function.
+ *
+ * @return mixed
+ */
+ public function invoke()
+ {
+ return $this->invokeArgs(array());
+ }
+
+ /**
+ * Calls the function.
+ *
+ * @param array $args Function parameter values
+ * @return mixed
+ */
+ public function invokeArgs(array $args)
+ {
+ throw new Exception\RuntimeException('Cannot invoke invalid functions', Exception\RuntimeException::UNSUPPORTED, $this);
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the function/method as closure.
+ *
+ * @return \Closure
+ */
+ public function getClosure()
+ {
+ throw new Exception\RuntimeException('Cannot invoke invalid functions', Exception\RuntimeException::UNSUPPORTED, $this);
+ }
+
+ /**
+ * Returns the closure scope class.
+ *
+ * @return null
+ */
+ public function getClosureScopeClass()
+ {
+ return null;
+ }
+
+ /**
+ * Returns this pointer bound to closure.
+ *
+ * @return null
+ */
+ public function getClosureThis()
+ {
+ return null;
+ }
+
+ /**
+ * Returns if the function definition is valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf(
+ "%sFunction [ function %s%s ] {\n @@ %s %d - %d\n}\n",
+ $this->getDocComment() ? $this->getDocComment() . "\n" : '',
+ $this->returnsReference() ? '&' : '',
+ $this->getName(),
+ $this->getFileName(),
+ $this->getStartLine(),
+ $this->getEndLine()
+ );
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return ReflectionBase::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return ReflectionBase::exists($this, $key);
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Php/IReflection.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/IReflection.php
new file mode 100644
index 0000000..ce8353e
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/IReflection.php
@@ -0,0 +1,36 @@
+broker = $broker;
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return \TokenReflection\Php\ReflectionExtension
+ */
+ public function getExtension()
+ {
+ return ReflectionExtension::create(parent::getExtension(), $this->broker);
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return null
+ */
+ public function getAnnotation($name)
+ {
+ return null;
+ }
+
+ /**
+ * Returns parsed docblock.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the class is an exception or its descendant.
+ *
+ * @return boolean
+ */
+ public function isException()
+ {
+ return 'Exception' === $this->getName() || $this->isSubclassOf('Exception');
+ }
+
+ /**
+ * Returns if objects of this class are cloneable.
+ *
+ * Introduced in PHP 5.4.
+ *
+ * @return boolean
+ * @see http://svn.php.net/viewvc/php/php-src/trunk/ext/reflection/php_reflection.c?revision=307971&view=markup#l4059
+ */
+ public function isCloneable()
+ {
+ if ($this->isInterface() || $this->isAbstract()) {
+ return false;
+ }
+
+ $methods = $this->getMethods();
+ return isset($methods['__clone']) ? $methods['__clone']->isPublic() : true;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection subject is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the current class is a subclass of the given class.
+ *
+ * @param string|object $class Class name or reflection object
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid parameter was provided.
+ */
+ public function isSubclassOf($class)
+ {
+ if (is_object($class)) {
+ if (!$class instanceof InternalReflectionClass && !$class instanceof IReflectionClass) {
+ throw new Exception\RuntimeException('Parameter must be a string or an instance of class reflection.', Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $class = $class->getName();
+ }
+
+ return in_array($class, $this->getParentClassNameList());
+ }
+
+ /**
+ * Returns parent class reflection.
+ *
+ * @return \TokenReflection\Php\ReflectionClass
+ */
+ public function getParentClass()
+ {
+ $parent = parent::getParentClass();
+ return $parent ? self::create($parent, $this->broker) : null;
+ }
+
+ /**
+ * Returns the parent class name.
+ *
+ * @return string
+ */
+ public function getParentClassName()
+ {
+ $parent = $this->getParentClass();
+ return $parent ? $parent->getName() : null;
+ }
+
+ /**
+ * Returns the parent classes reflections.
+ *
+ * @return array
+ */
+ public function getParentClasses()
+ {
+ $broker = $this->broker;
+ return array_map(function($className) use ($broker) {
+ return $broker->getClass($className);
+ }, $this->getParentClassNameList());
+ }
+
+ /**
+ * Returns the parent classes names.
+ *
+ * @return array
+ */
+ public function getParentClassNameList()
+ {
+ return class_parents($this->getName());
+ }
+
+ /**
+ * Returns if the class implements the given interface.
+ *
+ * @param string|object $interface Interface name or reflection object
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If the provided parameter is not an interface.
+ */
+ public function implementsInterface($interface)
+ {
+ if (is_object($interface)) {
+ if (!$interface instanceof InternalReflectionClass && !$interface instanceof IReflectionClass) {
+ throw new Exception\RuntimeException('Parameter must be a string or an instance of class reflection.', Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $interfaceName = $interface->getName();
+
+ if (!$interface->isInterface()) {
+ throw new Exception\RuntimeException(sprintf('"%s" is not an interface.', $interfaceName), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+ } else {
+ $reflection = $this->getBroker()->getClass($interface);
+ if (!$reflection->isInterface()) {
+ throw new Exception\RuntimeException(sprintf('"%s" is not an interface.', $interface), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $interfaceName = $interface;
+ }
+
+ $interfaces = $this->getInterfaces();
+ return isset($interfaces[$interfaceName]);
+ }
+
+ /**
+ * Returns an array of interface reflections.
+ *
+ * @return array
+ */
+ public function getInterfaces()
+ {
+ if (null === $this->interfaces) {
+ $broker = $this->broker;
+ $interfaceNames = $this->getInterfaceNames();
+
+ if (empty($interfaceNames)) {
+ $this->interfaces = array();
+ } else {
+ $this->interfaces = array_combine($interfaceNames, array_map(function($interfaceName) use ($broker) {
+ return $broker->getClass($interfaceName);
+ }, $interfaceNames));
+ }
+ }
+
+ return $this->interfaces;
+ }
+
+ /**
+ * Returns interfaces implemented by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnInterfaces()
+ {
+ $parent = $this->getParentClass();
+ return $parent ? array_diff_key($this->getInterfaces(), $parent->getInterfaces()) : $this->getInterfaces();
+ }
+
+ /**
+ * Returns names of interfaces implemented by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnInterfaceNames()
+ {
+ return array_keys($this->getOwnInterfaces());
+ }
+
+ /**
+ * Returns class constructor reflection.
+ *
+ * @return \TokenReflection\Php\ReflectionClass|null
+ */
+ public function getConstructor()
+ {
+ return ReflectionMethod::create(parent::getConstructor(), $this->broker);
+ }
+
+ /**
+ * Returns class desctructor reflection.
+ *
+ * @return \TokenReflection\Php\ReflectionClass|null
+ */
+ public function getDestructor()
+ {
+ foreach ($this->getMethods() as $method) {
+ if ($method->isDestructor()) {
+ return $method;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns a particular method reflection.
+ *
+ * @param string $name Method name
+ * @return \TokenReflection\Php\ReflectionMethod
+ * @throws \TokenReflection\Exception\RuntimeException If the requested method does not exist.
+ */
+ public function getMethod($name)
+ {
+ foreach ($this->getMethods() as $method) {
+ if ($method->getName() === $name) {
+ return $method;
+ }
+ }
+
+ throw new Exception\RuntimeException(sprintf('Method %s does not exist.', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns class methods.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ */
+ public function getMethods($filter = null)
+ {
+ if (null === $this->methods) {
+ $broker = $this->broker;
+ $this->methods = array_map(function(InternalReflectionMethod $method) use ($broker) {
+ return ReflectionMethod::create($method, $broker);
+ }, parent::getMethods());
+ }
+
+ if (null === $filter) {
+ return $this->methods;
+ }
+
+ return array_filter($this->methods, function(ReflectionMethod $method) use ($filter) {
+ return (bool) ($method->getModifiers() & $filter);
+ });
+ }
+
+ /**
+ * Returns if the class implements (and not its parents) the given method.
+ *
+ * @param string $name Method name
+ * @return boolean
+ */
+ public function hasOwnMethod($name)
+ {
+ foreach ($this->getOwnMethods() as $method) {
+ if ($name === $method->getName()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns methods declared by this class, not its parents.
+ *
+ * @param integer $filter
+ * @return array
+ */
+ public function getOwnMethods($filter = null)
+ {
+ $me = $this->getName();
+ return array_filter($this->getMethods($filter), function(ReflectionMethod $method) use ($me) {
+ return $method->getDeclaringClass()->getName() === $me;
+ });
+ }
+
+ /**
+ * Returns if the class imports the given method from traits.
+ *
+ * @param string $name Method name
+ * @return boolean
+ * @todo Impossible with the current status of reflection
+ */
+ public function hasTraitMethod($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns method reflections imported from traits.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ * @todo Impossible with the current status of reflection
+ */
+ public function getTraitMethods($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @return \TokenReflection\ReflectionConstant
+ * @throws \TokenReflection\Exception\RuntimeException If the requested constant does not exist.
+ */
+ public function getConstantReflection($name)
+ {
+ if ($this->hasConstant($name)) {
+ return new ReflectionConstant($name, $this->getConstant($name), $this->broker, $this);
+ }
+
+ throw new Exception\RuntimeException(sprintf('Constant "%s" does not exist.', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns an array of constant reflections.
+ *
+ * @return array
+ */
+ public function getConstantReflections()
+ {
+ if (null === $this->constants) {
+ $this->constants = array();
+ foreach ($this->getConstants() as $name => $value) {
+ $this->constants[$name] = $this->getConstantReflection($name);
+ }
+ }
+
+ return array_values($this->constants);
+ }
+
+ /**
+ * Returns if the class (and not its parents) defines the given constant.
+ *
+ * @param string $name Constant name.
+ * @return boolean
+ */
+ public function hasOwnConstant($name)
+ {
+ $constants = $this->getOwnConstants();
+ return isset($constants[$name]);
+ }
+
+ /**
+ * Returns constants declared by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnConstants()
+ {
+ return array_diff_assoc($this->getConstants(), $this->getParentClass() ? $this->getParentClass()->getConstants() : array());
+ }
+
+ /**
+ * Returns an array of constant reflections defined by this class and not its parents.
+ *
+ * @return array
+ */
+ public function getOwnConstantReflections()
+ {
+ $constants = array();
+ foreach ($this->getOwnConstants() as $name => $value) {
+ $constants[] = $this->getConstantReflection($name);
+ }
+ return $constants;
+ }
+
+ /**
+ * Returns a particular property reflection.
+ *
+ * @param string $name Property name
+ * @return \TokenReflection\Php\ReflectionProperty
+ * @throws \TokenReflection\Exception\RuntimeException If the requested property does not exist.
+ */
+ public function getProperty($name)
+ {
+ foreach ($this->getProperties() as $property) {
+ if ($name === $property->getName()) {
+ return $property;
+ }
+ }
+
+ throw new Exception\RuntimeException(sprintf('Property %s does not exist.', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns class properties.
+ *
+ * @param integer $filter Properties filter
+ * @return array
+ */
+ public function getProperties($filter = null)
+ {
+ if (null === $this->properties) {
+ $broker = $this->broker;
+ $this->properties = array_map(function(InternalReflectionProperty $property) use ($broker) {
+ return ReflectionProperty::create($property, $broker);
+ }, parent::getProperties());
+ }
+
+ if (null === $filter) {
+ return $this->properties;
+ }
+
+ return array_filter($this->properties, function(ReflectionProperty $property) use ($filter) {
+ return (bool) ($property->getModifiers() & $filter);
+ });
+ }
+
+ /**
+ * Returns if the class has (and not its parents) the given property.
+ *
+ * @param string $name Property name
+ * @return boolean
+ */
+ public function hasOwnProperty($name)
+ {
+ foreach ($this->getOwnProperties() as $property) {
+ if ($name === $property->getName()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns properties declared by this class, not its parents.
+ *
+ * @param integer $filter
+ * @return array
+ */
+ public function getOwnProperties($filter = null)
+ {
+ $me = $this->getName();
+ return array_filter($this->getProperties($filter), function(ReflectionProperty $property) use ($me) {
+ return $property->getDeclaringClass()->getName() === $me;
+ });
+ }
+
+ /**
+ * Returns if the class imports the given property from traits.
+ *
+ * @param string $name Property name
+ * @return boolean
+ * @todo Impossible with the current status of reflection
+ */
+ public function hasTraitProperty($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns property reflections imported from traits.
+ *
+ * @param integer $filter Properties filter
+ * @return array
+ * @todo Impossible with the current status of reflection
+ */
+ public function getTraitProperties($filter = null)
+ {
+ return array();
+ }
+
+ /**
+ * Returns static properties reflections.
+ *
+ * @return array
+ */
+ public function getStaticProperties()
+ {
+ return $this->getProperties(InternalReflectionProperty::IS_STATIC);
+ }
+
+ /**
+ * Returns reflections of direct subclasses.
+ *
+ * @return array
+ */
+ public function getDirectSubclasses()
+ {
+ $that = $this->name;
+ return array_filter($this->getBroker()->getClasses(Broker\Backend::INTERNAL_CLASSES | Broker\Backend::TOKENIZED_CLASSES), function(IReflectionClass $class) use ($that) {
+ if (!$class->isSubclassOf($that)) {
+ return false;
+ }
+
+ return null === $class->getParentClassName() || !$class->getParentClass()->isSubClassOf($that);
+ });
+ }
+
+ /**
+ * Returns names of direct subclasses.
+ *
+ * @return array
+ */
+ public function getDirectSubclassNames()
+ {
+ return array_keys($this->getDirectSubclasses());
+ }
+
+ /**
+ * Returns reflections of indirect subclasses.
+ *
+ * @return array
+ */
+ public function getIndirectSubclasses()
+ {
+ $that = $this->name;
+ return array_filter($this->getBroker()->getClasses(Broker\Backend::INTERNAL_CLASSES | Broker\Backend::TOKENIZED_CLASSES), function(IReflectionClass $class) use ($that) {
+ if (!$class->isSubclassOf($that)) {
+ return false;
+ }
+
+ return null !== $class->getParentClassName() && $class->getParentClass()->isSubClassOf($that);
+ });
+ }
+
+ /**
+ * Returns names of indirect subclasses.
+ *
+ * @return array
+ */
+ public function getIndirectSubclassNames()
+ {
+ return array_keys($this->getIndirectSubclasses());
+ }
+
+ /**
+ * Returns reflections of classes directly implementing this interface.
+ *
+ * @return array
+ */
+ public function getDirectImplementers()
+ {
+ if (!$this->isInterface()) {
+ return array();
+ }
+
+ $that = $this->name;
+ return array_filter($this->getBroker()->getClasses(Broker\Backend::INTERNAL_CLASSES | Broker\Backend::TOKENIZED_CLASSES), function(IReflectionClass $class) use ($that) {
+ if (!$class->implementsInterface($that)) {
+ return false;
+ }
+
+ return null === $class->getParentClassName() || !$class->getParentClass()->implementsInterface($that);
+ });
+ }
+
+ /**
+ * Returns names of classes directly implementing this interface.
+ *
+ * @return array
+ */
+ public function getDirectImplementerNames()
+ {
+ return array_keys($this->getDirectImplementers());
+ }
+
+ /**
+ * Returns reflections of classes indirectly implementing this interface.
+ *
+ * @return array
+ */
+ public function getIndirectImplementers()
+ {
+ if (!$this->isInterface()) {
+ return array();
+ }
+
+ $that = $this->name;
+ return array_filter($this->getBroker()->getClasses(Broker\Backend::INTERNAL_CLASSES | Broker\Backend::TOKENIZED_CLASSES), function(IReflectionClass $class) use ($that) {
+ if (!$class->implementsInterface($that)) {
+ return false;
+ }
+
+ return null !== $class->getParentClassName() && $class->getParentClass()->implementsInterface($that);
+ });
+ }
+
+ /**
+ * Returns names of classes indirectly implementing this interface.
+ *
+ * @return array
+ */
+ public function getIndirectImplementerNames()
+ {
+ return array_keys($this->getIndirectImplementers());
+ }
+
+ /**
+ * Returns if the class definition is complete.
+ *
+ * Internal classes always have the definition complete.
+ *
+ * @return boolean
+ */
+ public function isComplete()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the class definition is valid.
+ *
+ * Internal classes are always valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ return true;
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return TokenReflection\ReflectionElement::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return TokenReflection\ReflectionElement::exists($this, $key);
+ }
+
+ /**
+ * Returns traits used by this class.
+ *
+ * @return array
+ */
+ public function getTraits()
+ {
+ return NATIVE_TRAITS ? parent::getTraits() : array();
+ }
+
+ /**
+ * Returns traits used by this class and not its parents.
+ *
+ * @return array
+ */
+ public function getOwnTraits()
+ {
+ if (!NATIVE_TRAITS) {
+ return array();
+ }
+
+ $parent = $this->getParentClass();
+ return $parent ? array_diff_key($this->getTraits(), $parent->getTraits()) : $this->getTraits();
+ }
+
+ /**
+ * Returns names of used traits.
+ *
+ * @return array
+ */
+ public function getTraitNames()
+ {
+ return NATIVE_TRAITS ? parent::getTraitNames() : array();
+ }
+
+ /**
+ * Returns traits used by this class and not its parents.
+ *
+ * @return array
+ */
+ public function getOwnTraitNames()
+ {
+ return array_keys($this->getOwnTraits());
+ }
+
+ /**
+ * Returns method aliases from traits.
+ *
+ * @return array
+ */
+ public function getTraitAliases()
+ {
+ return NATIVE_TRAITS ? parent::getTraitAliases() : array();
+ }
+
+ /**
+ * Returns if the class is a trait.
+ *
+ * @return boolean
+ */
+ public function isTrait()
+ {
+ return NATIVE_TRAITS && parent::isTrait();
+ }
+
+ /**
+ * Returns if the class uses a particular trait.
+ *
+ * @param \ReflectionClass|\TokenReflection\IReflectionClass|string $trait Trait reflection or name
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid parameter was provided.
+ */
+ public function usesTrait($trait)
+ {
+ if (is_object($trait)) {
+ if (!$trait instanceof InternalReflectionClass && !$trait instanceof TokenReflection\IReflectionClass) {
+ throw new Exception\RuntimeException('Parameter must be a string or an instance of trait reflection.', Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $traitName = $trait->getName();
+
+ if (!$trait->isTrait()) {
+ throw new Exception\RuntimeException(sprintf('"%s" is not a trait.', $traitName), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+ } else {
+ $reflection = $this->getBroker()->getClass($trait);
+ if (!$reflection->isTrait()) {
+ throw new Exception\RuntimeException(sprintf('"%s" is not a trait.', $trait), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $traitName = $trait;
+ }
+
+ return in_array($traitName, $this->getTraitNames());
+ }
+
+ /**
+ * Creates a new class instance without using a constructor.
+ *
+ * @return object
+ * @throws \TokenReflection\Exception\RuntimeException If the class inherits from an internal class.
+ */
+ public function newInstanceWithoutConstructor()
+ {
+ if ($this->isInternal()) {
+ throw new Exception\RuntimeException('Could not create an instance; only user defined classes can be instantiated.', Exception\RuntimeException::UNSUPPORTED, $this);
+ }
+
+ foreach ($this->getParentClasses() as $parent) {
+ if ($parent->isInternal()) {
+ throw new Exception\RuntimeException('Could not create an instance; only user defined classes can be instantiated.', Exception\RuntimeException::UNSUPPORTED, $this);
+ }
+ }
+
+ if (PHP_VERSION_ID >= 50400) {
+ return parent::newInstanceWithoutConstructor();
+ }
+
+ return unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->getName()), $this->getName()));
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->getName();
+ }
+
+ /**
+ * Creates a reflection instance.
+ *
+ * @param \ReflectionClass $internalReflection Internal reflection instance
+ * @param \TokenReflection\Broker $broker Reflection broker instance
+ * @return \TokenReflection\Php\ReflectionClass
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid internal reflection object was provided.
+ */
+ public static function create(Reflector $internalReflection, Broker $broker)
+ {
+ if (!$internalReflection instanceof InternalReflectionClass) {
+ throw new Exception\RuntimeException('Invalid reflection instance provided, ReflectionClass expected.', Exception\RuntimeException::INVALID_ARGUMENT);
+ }
+
+ return $broker->getClass($internalReflection->getName());
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionConstant.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionConstant.php
new file mode 100644
index 0000000..e0de08f
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionConstant.php
@@ -0,0 +1,486 @@
+name = $name;
+ $this->value = $value;
+ $this->broker = $broker;
+
+ if (null !== $parent) {
+ $realParent = null;
+
+ if (array_key_exists($name, $parent->getOwnConstants())) {
+ $realParent = $parent;
+ }
+
+ if (null === $realParent) {
+ foreach ($parent->getParentClasses() as $grandParent) {
+ if (array_key_exists($name, $grandParent->getOwnConstants())) {
+ $realParent = $grandParent;
+ break;
+ }
+ }
+ }
+
+ if (null === $realParent) {
+ foreach ($parent->getInterfaces() as $interface) {
+ if (array_key_exists($name, $interface->getOwnConstants())) {
+ $realParent = $interface;
+ break;
+ }
+ }
+ }
+
+ if (null === $realParent) {
+ throw new Exception\RuntimeException('Could not determine constant real parent class.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $this->declaringClassName = $realParent->getName();
+ $this->userDefined = $realParent->isUserDefined();
+ } else {
+ if (!array_key_exists($name, get_defined_constants(false))) {
+ $this->userDefined = true;
+ } else {
+ $declared = get_defined_constants(true);
+ $this->userDefined = array_key_exists($name, $declared['user']);
+ }
+ }
+ }
+
+ /**
+ * Returns the name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the unqualified name (UQN).
+ *
+ * @return string
+ */
+ public function getShortName()
+ {
+ $name = $this->getName();
+ if (null !== $this->namespaceName && $this->namespaceName !== ReflectionNamespace::NO_NAMESPACE_NAME) {
+ $name = substr($name, strlen($this->namespaceName) + 1);
+ }
+
+ return $name;
+ }
+
+ /**
+ * Returns the declaring class reflection.
+ *
+ * @return \TokenReflection\IReflectionClass|null
+ */
+ public function getDeclaringClass()
+ {
+ if (null === $this->declaringClassName) {
+ return null;
+ }
+
+ return $this->getBroker()->getClass($this->declaringClassName);
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->declaringClassName;
+ }
+
+ /**
+ * Returns the namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return $this->namespaceName === TokenReflection\ReflectionNamespace::NO_NAMESPACE_NAME ? '' : $this->namespaceName;
+ }
+
+ /**
+ * Returns if the function/method is defined within a namespace.
+ *
+ * @return boolean
+ */
+ public function inNamespace()
+ {
+ return '' !== $this->getNamespaceName();
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return null
+ */
+ public function getExtension()
+ {
+ // @todo
+ return null;
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * @return boolean
+ */
+ public function getExtensionName()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the file name the reflection object is defined in.
+ *
+ * @return null
+ */
+ public function getFileName()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return null
+ */
+ public function getStartLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return null
+ */
+ public function getEndLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return boolean
+ */
+ public function getDocComment()
+ {
+ return false;
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return null
+ */
+ public function getAnnotation($name)
+ {
+ return null;
+ }
+
+ /**
+ * Returns parsed docblock.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the constant value.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Returns the part of the source code defining the constant value.
+ *
+ * @return string
+ */
+ public function getValueDefinition()
+ {
+ return var_export($this->value, true);
+ }
+
+ /**
+ * Returns the originaly provided value definition.
+ *
+ * @return string
+ */
+ public function getOriginalValueDefinition()
+ {
+ return token_get_all($this->getValueDefinition());
+ }
+
+ /**
+ * Returns if the constant is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return !$this->userDefined;
+ }
+
+ /**
+ * Returns if the constant is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return $this->userDefined;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection subject is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return false;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return null === $this->declaringClassName ? $this->name : sprintf('%s::%s', $this->declaringClassName, $this->name);
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf(
+ "Constant [ %s %s ] { %s }\n",
+ gettype($this->getValue()),
+ $this->getName(),
+ $this->getValue()
+ );
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string|object|null $class Class name, class instance or null
+ * @param string $constant Constant name
+ * @param boolean $return Return the export instead of outputting it
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If requested parameter doesn't exist.
+ */
+ public static function export(Broker $broker, $class, $constant, $return = false)
+ {
+ $className = is_object($class) ? get_class($class) : $class;
+ $constantName = $constant;
+
+ if (null === $className) {
+ try {
+ $constant = $broker->getConstant($constantName);
+ } catch (Exception\BrokerException $e) {
+ throw new Exception\RuntimeException(sprintf('Constant %s does not exist.', $constantName), Exception\RuntimeException::DOES_NOT_EXIST);
+ }
+ } else {
+ $class = $broker->getClass($className);
+ if ($class instanceof Invalid\ReflectionClass) {
+ throw new Exception\RuntimeException('Class is invalid.', Exception\RuntimeException::UNSUPPORTED);
+ } elseif ($class instanceof Dummy\ReflectionClass) {
+ throw new Exception\RuntimeException(sprintf('Class %s does not exist.', $className), Exception\RuntimeException::DOES_NOT_EXIST);
+ }
+ $constant = $class->getConstantReflection($constantName);
+ }
+
+ if ($return) {
+ return $constant->__toString();
+ }
+
+ echo $constant->__toString();
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the constant definition is valid.
+ *
+ * Internal constants are always valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ return true;
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return TokenReflection\ReflectionElement::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return TokenReflection\ReflectionElement::exists($this, $key);
+ }
+
+ /**
+ * Creates a reflection instance.
+ *
+ * Not supported for constants since there is no internal constant reflection.
+ *
+ * @param \ReflectionClass $internalReflection Internal reflection instance
+ * @param \TokenReflection\Broker $broker Reflection broker instance
+ * @return null
+ */
+ public static function create(Reflector $internalReflection, Broker $broker)
+ {
+ return null;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionExtension.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionExtension.php
new file mode 100644
index 0000000..20bbe7b
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionExtension.php
@@ -0,0 +1,282 @@
+broker = $broker;
+ }
+
+ /**
+ * Returns if the constant is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the constant is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection subject is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return false;
+ }
+
+ /**
+ * Returns a class reflection.
+ *
+ * @param string $name Class name
+ * @return \TokenReflection\IReflectionClass|null
+ */
+ public function getClass($name)
+ {
+ $classes = $this->getClasses();
+ return isset($classes[$name]) ? $classes[$name] : null;
+ }
+
+ /**
+ * Returns classes defined by this extension.
+ *
+ * @return array
+ */
+ public function getClasses()
+ {
+ if (null === $this->classes) {
+ $broker = $this->broker;
+ $this->classes = array_map(function($className) use ($broker) {
+ return $broker->getClass($className);
+ }, $this->getClassNames());
+ }
+
+ return $this->classes;
+ }
+
+ /**
+ * Returns a constant value.
+ *
+ * @param string $name Constant name
+ * @return mixed|false
+ */
+ public function getConstant($name)
+ {
+ $constants = $this->getConstants();
+ return isset($constants[$name]) ? $constants[$name] : false;
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @return \TokenReflection\IReflectionConstant
+ */
+ public function getConstantReflection($name)
+ {
+ $constants = $this->getConstantReflections();
+ return isset($constants[$name]) ? $constants[$name] : null;
+ }
+
+ /**
+ * Returns reflections of defined constants.
+ *
+ * @return array
+ */
+ public function getConstantReflections()
+ {
+ if (null === $this->constants) {
+ $broker = $this->broker;
+ $this->constants = array_map(function($constantName) use ($broker) {
+ return $broker->getConstant($constantName);
+ }, array_keys($this->getConstants()));
+ }
+
+ return $this->constants;
+ }
+
+ /**
+ * Returns a function reflection.
+ *
+ * @param string $name Function name
+ * @return \TokenReflection\IReflectionFunction
+ */
+ public function getFunction($name)
+ {
+ $functions = $this->getFunctions();
+ return isset($functions[$name]) ? $functions[$name] : null;
+ }
+
+ /**
+ * Returns functions defined by this extension.
+ *
+ * @return array
+ */
+ public function getFunctions()
+ {
+ if (null === $this->functions) {
+ $broker = $this->broker;
+ $this->classes = array_map(function($functionName) use ($broker) {
+ return $broker->getFunction($functionName);
+ }, array_keys(parent::getFunctions()));
+ }
+
+ return $this->functions;
+ }
+
+ /**
+ * Returns names of functions defined by this extension.
+ *
+ * @return array
+ */
+ public function getFunctionNames()
+ {
+ return array_keys($this->getFunctions());
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->getName();
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return TokenReflection\ReflectionElement::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return TokenReflection\ReflectionElement::exists($this, $key);
+ }
+
+ /**
+ * Creates a reflection instance.
+ *
+ * @param \ReflectionClass $internalReflection Internal reflection instance
+ * @param \TokenReflection\Broker $broker Reflection broker instance
+ * @return \TokenReflection\Php\ReflectionExtension
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid internal reflection object was provided.
+ */
+ public static function create(Reflector $internalReflection, Broker $broker)
+ {
+ static $cache = array();
+
+ if (!$internalReflection instanceof InternalReflectionExtension) {
+ throw new Exception\RuntimeException('Invalid reflection instance provided, ReflectionExtension expected.', Exception\RuntimeException::INVALID_ARGUMENT);
+ }
+
+ if (!isset($cache[$internalReflection->getName()])) {
+ $cache[$internalReflection->getName()] = new self($internalReflection->getName(), $broker);
+ }
+
+ return $cache[$internalReflection->getName()];
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionFunction.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionFunction.php
new file mode 100644
index 0000000..63e4737
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionFunction.php
@@ -0,0 +1,271 @@
+broker = $broker;
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return \TokenReflection\IReflectionExtension
+ */
+ public function getExtension()
+ {
+ return ReflectionExtension::create(parent::getExtension(), $this->broker);
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return null
+ */
+ public function getAnnotation($name)
+ {
+ return null;
+ }
+
+ /**
+ * Returns parsed docblock.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular parameter.
+ *
+ * @param integer|string $parameter Parameter name or position
+ * @return \TokenReflection\Php\ReflectionParameter
+ * @throws \TokenReflection\Exception\RuntimeException If there is no parameter of the given name.
+ * @throws \TokenReflection\Exception\RuntimeException If there is no parameter at the given position.
+ */
+ public function getParameter($parameter)
+ {
+ $parameters = $this->getParameters();
+
+ if (is_numeric($parameter)) {
+ if (!isset($parameters[$parameter])) {
+ throw new Exception\RuntimeException(sprintf('There is no parameter at position "%d".', $parameter), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ return $parameters[$parameter];
+ } else {
+ foreach ($parameters as $reflection) {
+ if ($reflection->getName() === $parameter) {
+ return $reflection;
+ }
+ }
+
+ throw new Exception\RuntimeException(sprintf('There is no parameter "%s".', $parameter), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+ }
+
+ /**
+ * Returns function parameters.
+ *
+ * @return array
+ */
+ public function getParameters()
+ {
+ if (null === $this->parameters) {
+ $broker = $this->broker;
+ $parent = $this;
+ $this->parameters = array_map(function(InternalReflectionParameter $parameter) use ($broker, $parent) {
+ return ReflectionParameter::create($parameter, $broker, $parent);
+ }, parent::getParameters());
+ }
+
+ return $this->parameters;
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return array();
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return TokenReflection\ReflectionElement::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return TokenReflection\ReflectionElement::exists($this, $key);
+ }
+
+ /**
+ * Returns the function/method as closure.
+ *
+ * @return \Closure
+ */
+ public function getClosure()
+ {
+ if (PHP_VERSION >= 50400) {
+ return parent::getClosure();
+ } else {
+ $that = $this;
+ return function() use ($that) {
+ return $that->invokeArgs(func_get_args());
+ };
+ }
+ }
+
+ /**
+ * Returns the closure scope class.
+ *
+ * @return string|null
+ */
+ public function getClosureScopeClass()
+ {
+ return PHP_VERSION >= 50400 ? parent::getClosureScopeClass() : null;
+ }
+
+ /**
+ * Returns this pointer bound to closure.
+ *
+ * @return null
+ */
+ public function getClosureThis()
+ {
+ return PHP_VERSION >= 50400 ? parent::getClosureThis() : null;
+ }
+
+ /**
+ * Returns if the function definition is valid.
+ *
+ * Internal functions are always valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ return true;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->getName() . '()';
+ }
+
+ /**
+ * Creates a reflection instance.
+ *
+ * @param \ReflectionClass $internalReflection Internal reflection instance
+ * @param \TokenReflection\Broker $broker Reflection broker instance
+ * @return \TokenReflection\Php\ReflectionFunction
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid internal reflection object was provided.
+ */
+ public static function create(Reflector $internalReflection, Broker $broker)
+ {
+ if (!$internalReflection instanceof InternalReflectionFunction) {
+ throw new Exception\RuntimeException('Invalid reflection instance provided, ReflectionFunction expected.', Exception\RuntimeException::INVALID_ARGUMENT);
+ }
+
+ return $broker->getFunction($internalReflection->getName());
+ }
+}
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionMethod.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionMethod.php
new file mode 100644
index 0000000..7a0c90f
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionMethod.php
@@ -0,0 +1,385 @@
+broker = $broker;
+ }
+
+ /**
+ * Returns the declaring class reflection.
+ *
+ * @return \TokenReflection\IReflectionClass
+ */
+ public function getDeclaringClass()
+ {
+ return ReflectionClass::create(parent::getDeclaringClass(), $this->broker);
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return string
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->getDeclaringClass()->getName();
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->getDeclaringClass()->getNamespaceAliases();
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return null
+ */
+ public function getAnnotation($name)
+ {
+ return null;
+ }
+
+ /**
+ * Returns parsed docblock.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ return array();
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the method prototype.
+ *
+ * @return \TokenReflection\Php\ReflectionMethod
+ */
+ public function getPrototype()
+ {
+ return self::create(parent::getPrototype(), $this->broker);
+ }
+
+ /**
+ * Returns a particular parameter.
+ *
+ * @param integer|string $parameter Parameter name or position
+ * @return \TokenReflection\Php\ReflectionParameter
+ * @throws \TokenReflection\Exception\RuntimeException If there is no parameter of the given name.
+ * @throws \TokenReflection\Exception\RuntimeException If there is no parameter at the given position.
+ */
+ public function getParameter($parameter)
+ {
+ $parameters = $this->getParameters();
+
+ if (is_numeric($parameter)) {
+ if (!isset($parameters[$parameter])) {
+ throw new Exception\RuntimeException(sprintf('There is no parameter at position "%d".', $parameter), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ return $parameters[$parameter];
+ } else {
+ foreach ($parameters as $reflection) {
+ if ($reflection->getName() === $parameter) {
+ return $reflection;
+ }
+ }
+
+ throw new Exception\RuntimeException(sprintf('There is no parameter "%s".', $parameter), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+ }
+
+ /**
+ * Returns function parameters.
+ *
+ * @return array
+ */
+ public function getParameters()
+ {
+ if (null === $this->parameters) {
+ $broker = $this->broker;
+ $parent = $this;
+ $this->parameters = array_map(function(InternalReflectionParameter $parameter) use ($broker, $parent) {
+ return ReflectionParameter::create($parameter, $broker, $parent);
+ }, parent::getParameters());
+ }
+
+ return $this->parameters;
+ }
+
+ /**
+ * Returns if the method is set accessible.
+ *
+ * @return boolean
+ */
+ public function isAccessible()
+ {
+ return $this->accessible;
+ }
+
+ /**
+ * Sets a method to be accessible or not.
+ *
+ * Introduced in PHP 5.3.2. Throws an exception if run on an older version.
+ *
+ * @param boolean $accessible
+ * @throws \TokenReflection\Exception\RuntimeException If run on PHP version < 5.3.2.
+ */
+ public function setAccessible($accessible)
+ {
+ if (PHP_VERSION_ID < 50302) {
+ throw new Exception\RuntimeException(sprintf('Method setAccessible was introduced the internal reflection in PHP 5.3.2, you are using %s.', PHP_VERSION), Exception\RuntimeException::UNSUPPORTED, $this);
+ }
+
+ $this->accessible = $accessible;
+
+ parent::setAccessible($accessible);
+ }
+
+ /**
+ * Shortcut for isPublic(), ... methods that allows or-ed modifiers.
+ *
+ * @param integer $filter Filter
+ * @return boolean
+ */
+ public function is($filter = null)
+ {
+ return null === $filter || ($this->getModifiers() & $filter);
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return TokenReflection\ReflectionElement::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return TokenReflection\ReflectionElement::exists($this, $key);
+ }
+
+ /**
+ * Returns the function/method as closure.
+ *
+ * @param object $object Object
+ * @return \Closure
+ */
+ public function getClosure($object)
+ {
+ if (PHP_VERSION >= 50400) {
+ return parent::getClosure();
+ } else {
+ $that = $this;
+ return function() use ($object, $that) {
+ return $that->invokeArgs($object, func_get_args());
+ };
+ }
+ }
+
+ /**
+ * Returns the closure scope class.
+ *
+ * @return string|null
+ */
+ public function getClosureScopeClass()
+ {
+ return PHP_VERSION >= 50400 ? parent::getClosureScopeClass() : null;
+ }
+
+ /**
+ * Returns this pointer bound to closure.
+ *
+ * @return null
+ */
+ public function getClosureThis()
+ {
+ return PHP_VERSION >= 50400 ? parent::getClosureThis() : null;
+ }
+
+ /**
+ * Returns the original name when importing from a trait.
+ *
+ * @return string
+ */
+ public function getOriginalName()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the original method when importing from a trait.
+ *
+ * @return null
+ */
+ public function getOriginal()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the original modifiers value when importing from a trait.
+ *
+ * @return null
+ */
+ public function getOriginalModifiers()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the defining trait.
+ *
+ * @return \TokenReflection\IReflectionClass|null
+ */
+ public function getDeclaringTrait()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the declaring trait name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringTraitName()
+ {
+ return null;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return sprintf('%s::%s()', $this->getDeclaringClassName(), $this->getName());
+ }
+
+ /**
+ * Creates a reflection instance.
+ *
+ * @param \ReflectionClass $internalReflection Internal reflection instance
+ * @param \TokenReflection\Broker $broker Reflection broker instance
+ * @return \TokenReflection\Php\IReflection
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid internal reflection object was provided.
+ */
+ public static function create(Reflector $internalReflection, Broker $broker)
+ {
+ static $cache = array();
+
+ if (!$internalReflection instanceof InternalReflectionMethod) {
+ throw new Exception\RuntimeException('Invalid reflection instance provided, ReflectionMethod expected.', Exception\RuntimeException::INVALID_ARGUMENT);
+ }
+
+ $key = $internalReflection->getDeclaringClass()->getName() . '::' . $internalReflection->getName();
+ if (!isset($cache[$key])) {
+ $cache[$key] = new self($internalReflection->getDeclaringClass()->getName(), $internalReflection->getName(), $broker);
+ }
+
+ return $cache[$key];
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionParameter.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionParameter.php
new file mode 100644
index 0000000..35cd7bb
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionParameter.php
@@ -0,0 +1,368 @@
+broker = $broker;
+ $this->userDefined = $parent->isUserDefined();
+ }
+
+ /**
+ * Returns the declaring class reflection.
+ *
+ * @return \TokenReflection\IReflectionClass
+ */
+ public function getDeclaringClass()
+ {
+ $class = parent::getDeclaringClass();
+ return $class ? ReflectionClass::create($class, $this->broker) : null;
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringClassName()
+ {
+ $class = parent::getDeclaringClass();
+ return $class ? $class->getName() : null;
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->getDeclaringFunction()->getNamespaceAliases();
+ }
+
+ /**
+ * Returns the file name the reflection object is defined in.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->getDeclaringFunction()->getFileName();
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return \TokenReflection\Php\ReflectionExtension
+ */
+ public function getExtension()
+ {
+ return $this->getDeclaringFunction()->getExtension();
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * @return string|boolean
+ */
+ public function getExtensionName()
+ {
+ $extension = $this->getExtension();
+ return $extension ? $extension->getName() : false;
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return null
+ */
+ public function getAnnotation($name)
+ {
+ return null;
+ }
+
+ /**
+ * Returns parsed docblock.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the declaring function reflection.
+ *
+ * @return \TokenReflection\Php\ReflectionFunction|\TokenReflection\Php\ReflectionMethod
+ */
+ public function getDeclaringFunction()
+ {
+ $class = $this->getDeclaringClass();
+ $function = parent::getDeclaringFunction();
+
+ return $class ? $class->getMethod($function->getName()) : ReflectionFunction::create($function, $this->broker);
+ }
+
+ /**
+ * Returns the declaring function name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringFunctionName()
+ {
+ $function = parent::getDeclaringFunction();
+ return $function ? $function->getName() : $function;
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return null
+ */
+ public function getStartLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return null
+ */
+ public function getEndLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return boolean
+ */
+ public function getDocComment()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the part of the source code defining the paramter default value.
+ *
+ * @return string|null
+ */
+ public function getDefaultValueDefinition()
+ {
+ $value = $this->getDefaultValue();
+ return null === $value ? null : var_export($value, true);
+ }
+
+ /**
+ * Returns if the parameter expects a callback.
+ *
+ * @return boolean
+ */
+ public function isCallable()
+ {
+ return PHP_VERSION >= 50400 && parent::isCallable();
+ }
+
+ /**
+ * Returns the original type hint as defined in the source code.
+ *
+ * @return string|null
+ */
+ public function getOriginalTypeHint()
+ {
+ return !$this->isArray() && !$this->isCallable() ? $this->getClass() : null;
+ }
+
+ /**
+ * Returns the required class name of the value.
+ *
+ * @return string|null
+ */
+ public function getClassName()
+ {
+ return $this->getClass() ? $this->getClass()->getName() : null;
+ }
+
+ /**
+ * Returns if the parameter is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return !$this->userDefined;
+ }
+
+ /**
+ * Returns if the parameter is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return $this->userDefined;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection subject is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Returns if the paramter value can be passed by value.
+ *
+ * @return boolean
+ */
+ public function canBePassedByValue()
+ {
+ return method_exists($this, 'canBePassedByValue') ? parent::canBePassedByValue() : !$this->isPassedByReference();
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return str_replace('()', '($' . $this->getName() . ')', $this->getDeclaringFunction()->getPrettyName());
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return TokenReflection\ReflectionElement::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return TokenReflection\ReflectionElement::exists($this, $key);
+ }
+
+ /**
+ * Creates a reflection instance.
+ *
+ * @param \ReflectionClass $internalReflection Internal reflection instance
+ * @param \TokenReflection\Broker $broker Reflection broker instance
+ * @return \TokenReflection\Php\ReflectionParameter
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid internal reflection object was provided.
+ */
+ public static function create(Reflector $internalReflection, Broker $broker)
+ {
+ static $cache = array();
+
+ if (!$internalReflection instanceof InternalReflectionParameter) {
+ throw new Exception\RuntimeException('Invalid reflection instance provided, ReflectionParameter expected.', Exception\RuntimeException::INVALID_ARGUMENT);
+ }
+
+ $class = $internalReflection->getDeclaringClass();
+ $function = $internalReflection->getDeclaringFunction();
+
+ $key = $class ? $class->getName() . '::' : '';
+ $key .= $function->getName() . '(' . $internalReflection->getName() . ')';
+
+ if (!isset($cache[$key])) {
+ $cache[$key] = new self($class ? array($class->getName(), $function->getName()) : $function->getName(), $internalReflection->getName(), $broker, $function);
+ }
+
+ return $cache[$key];
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionProperty.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionProperty.php
new file mode 100644
index 0000000..fc0c192
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Php/ReflectionProperty.php
@@ -0,0 +1,348 @@
+broker = $broker;
+ }
+
+ /**
+ * Returns the declaring class reflection.
+ *
+ * @return \TokenReflection\IReflectionClass
+ */
+ public function getDeclaringClass()
+ {
+ return ReflectionClass::create(parent::getDeclaringClass(), $this->broker);
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return string
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->getDeclaringClass()->getName();
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return null
+ */
+ public function getStartLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return null
+ */
+ public function getEndLine()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return boolean
+ */
+ public function getDocComment()
+ {
+ return false;
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ return false;
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return null
+ */
+ public function getAnnotation($name)
+ {
+ return null;
+ }
+
+ /**
+ * Returns parsed docblock.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the property default value.
+ *
+ * @return mixed
+ */
+ public function getDefaultValue()
+ {
+ $values = $this->getDeclaringClass()->getDefaultProperties();
+ return $values[$this->getName()];
+ }
+
+ /**
+ * Returns the part of the source code defining the property default value.
+ *
+ * @return string
+ */
+ public function getDefaultValueDefinition()
+ {
+ $value = $this->getDefaultValue();
+ return null === $value ? null : var_export($value, true);
+ }
+
+ /**
+ * Returns if the property is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return $this->getDeclaringClass()->isInternal();
+ }
+
+ /**
+ * Returns if the property is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return $this->getDeclaringClass()->isUserDefined();
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection subject is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return array();
+ }
+
+ /**
+ * Returns the defining trait.
+ *
+ * @return \TokenReflection\IReflectionClass|null
+ */
+ public function getDeclaringTrait()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the declaring trait name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringTraitName()
+ {
+ return null;
+ }
+
+ /**
+ * Returns if the property is set accessible.
+ *
+ * @return boolean
+ */
+ public function isAccessible()
+ {
+ return $this->accessible;
+ }
+
+ /**
+ * Sets a property to be accessible or not.
+ *
+ * @param boolean $accessible If the property should be accessible.
+ */
+ public function setAccessible($accessible)
+ {
+ $this->accessible = (bool) $accessible;
+
+ parent::setAccessible($accessible);
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return \TokenReflection\Php\ReflectionExtension
+ */
+ public function getExtension()
+ {
+ return $this->getDeclaringClass()->getExtension();
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * @return string|boolean
+ */
+ public function getExtensionName()
+ {
+ $extension = $this->getExtension();
+ return $extension ? $extension->getName() : false;
+ }
+
+ /**
+ * Returns the file name the reflection object is defined in.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->getDeclaringClass()->getFileName();
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return sprintf('%s::$%s', $this->getDeclaringClassName(), $this->getName());
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return TokenReflection\ReflectionElement::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return TokenReflection\ReflectionElement::exists($this, $key);
+ }
+
+ /**
+ * Creates a reflection instance.
+ *
+ * @param \ReflectionClass $internalReflection Internal reflection instance
+ * @param \TokenReflection\Broker $broker Reflection broker instance
+ * @return \TokenReflection\Php\ReflectionProperty
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid internal reflection object was provided.
+ */
+ public static function create(Reflector $internalReflection, Broker $broker)
+ {
+ static $cache = array();
+
+ if (!$internalReflection instanceof InternalReflectionProperty) {
+ throw new Exception\RuntimeException('Invalid reflection instance provided, ReflectionProperty expected.', Exception\RuntimeException::INVALID_ARGUMENT);
+ }
+
+ $key = $internalReflection->getDeclaringClass()->getName() . '::' . $internalReflection->getName();
+ if (!isset($cache[$key])) {
+ $cache[$key] = new self($internalReflection->getDeclaringClass()->getName(), $internalReflection->getName(), $broker);
+ }
+
+ return $cache[$key];
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionAnnotation.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionAnnotation.php
new file mode 100644
index 0000000..6cd8def
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionAnnotation.php
@@ -0,0 +1,484 @@
+reflection = $reflection;
+ $this->docComment = $docComment ?: false;
+ }
+
+ /**
+ * Returns the docblock.
+ *
+ * @return string|boolean
+ */
+ public function getDocComment()
+ {
+ return $this->docComment;
+ }
+
+ /**
+ * Returns if the current docblock contains the requrested annotation.
+ *
+ * @param string $annotation Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($annotation)
+ {
+ if (null === $this->annotations) {
+ $this->parse();
+ }
+
+ return isset($this->annotations[$annotation]);
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $annotation Annotation name
+ * @return string|array|null
+ */
+ public function getAnnotation($annotation)
+ {
+ if (null === $this->annotations) {
+ $this->parse();
+ }
+
+ return isset($this->annotations[$annotation]) ? $this->annotations[$annotation] : null;
+ }
+
+ /**
+ * Returns all parsed annotations.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ if (null === $this->annotations) {
+ $this->parse();
+ }
+
+ return $this->annotations;
+ }
+
+ /**
+ * Sets Docblock templates.
+ *
+ * @param array $templates Docblock templates
+ * @return \TokenReflection\ReflectionAnnotation
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid annotation template was provided.
+ */
+ public function setTemplates(array $templates)
+ {
+ foreach ($templates as $template) {
+ if (!$template instanceof ReflectionAnnotation) {
+ throw new Exception\RuntimeException(
+ sprintf(
+ 'All templates have to be instances of \\TokenReflection\\ReflectionAnnotation; %s given.',
+ is_object($template) ? get_class($template) : gettype($template)
+ ),
+ Exception\RuntimeException::INVALID_ARGUMENT,
+ $this->reflection
+ );
+ }
+ }
+
+ $this->templates = $templates;
+
+ return $this;
+ }
+
+ /**
+ * Parses reflection object documentation.
+ */
+ private function parse()
+ {
+ $this->annotations = array();
+
+ if (false !== $this->docComment) {
+ // Parse docblock
+ $name = self::SHORT_DESCRIPTION;
+ $docblock = trim(
+ preg_replace(
+ array(
+ '~^' . preg_quote(ReflectionElement::DOCBLOCK_TEMPLATE_START, '~') . '~',
+ '~^' . preg_quote(ReflectionElement::DOCBLOCK_TEMPLATE_END, '~') . '$~',
+ '~^/\\*\\*~',
+ '~\\*/$~'
+ ),
+ '',
+ $this->docComment
+ )
+ );
+ foreach (explode("\n", $docblock) as $line) {
+ $line = preg_replace('~^\\*\\s?~', '', trim($line));
+
+ // End of short description
+ if ('' === $line && self::SHORT_DESCRIPTION === $name) {
+ $name = self::LONG_DESCRIPTION;
+ continue;
+ }
+
+ // @annotation
+ if (preg_match('~^\\s*@([\\S]+)\\s*(.*)~', $line, $matches)) {
+ $name = $matches[1];
+ $this->annotations[$name][] = $matches[2];
+ continue;
+ }
+
+ // Continuation
+ if (self::SHORT_DESCRIPTION === $name || self::LONG_DESCRIPTION === $name) {
+ if (!isset($this->annotations[$name])) {
+ $this->annotations[$name] = $line;
+ } else {
+ $this->annotations[$name] .= "\n" . $line;
+ }
+ } else {
+ $this->annotations[$name][count($this->annotations[$name]) - 1] .= "\n" . $line;
+ }
+ }
+
+ array_walk_recursive($this->annotations, function(&$value) {
+ // {@*} is a placeholder for */ (phpDocumentor compatibility)
+ $value = str_replace('{@*}', '*/', $value);
+ $value = trim($value);
+ });
+ }
+
+ if ($this->reflection instanceof ReflectionElement) {
+ // Merge docblock templates
+ $this->mergeTemplates();
+
+ // Copy annotations if the @copydoc tag is present.
+ if (!empty($this->annotations['copydoc'])) {
+ $this->copyAnnotation();
+ }
+
+ // Process docblock inheritance for supported reflections
+ if ($this->reflection instanceof ReflectionClass || $this->reflection instanceof ReflectionMethod || $this->reflection instanceof ReflectionProperty) {
+ $this->inheritAnnotations();
+ }
+ }
+ }
+
+ /**
+ * Copies annotations if the @copydoc tag is present.
+ *
+ * @throws \TokenReflection\Exception\RuntimeException When stuck in an infinite loop when resolving the @copydoc tag.
+ */
+ private function copyAnnotation()
+ {
+ self::$copydocStack[] = $this->reflection;
+ $broker = $this->reflection->getBroker();
+
+ $parentNames = $this->annotations['copydoc'];
+ unset($this->annotations['copydoc']);
+
+ foreach ($parentNames as $parentName) {
+ try {
+ if ($this->reflection instanceof ReflectionClass) {
+ $parent = $broker->getClass($parentName);
+ if ($parent instanceof Dummy\ReflectionClass) {
+ // The class to copy from is not usable
+ return;
+ }
+ } elseif ($this->reflection instanceof ReflectionFunction) {
+ $parent = $broker->getFunction(rtrim($parentName, '()'));
+ } elseif ($this->reflection instanceof ReflectionConstant && null === $this->reflection->getDeclaringClassName()) {
+ $parent = $broker->getConstant($parentName);
+ } elseif ($this->reflection instanceof ReflectionMethod || $this->reflection instanceof ReflectionProperty || $this->reflection instanceof ReflectionConstant) {
+ if (false !== strpos($parentName, '::')) {
+ list($className, $parentName) = explode('::', $parentName, 2);
+ $class = $broker->getClass($className);
+ } else {
+ $class = $this->reflection->getDeclaringClass();
+ }
+
+ if ($class instanceof Dummy\ReflectionClass) {
+ // The source element class is not usable
+ return;
+ }
+
+ if ($this->reflection instanceof ReflectionMethod) {
+ $parent = $class->getMethod(rtrim($parentName, '()'));
+ } elseif ($this->reflection instanceof ReflectionConstant) {
+ $parent = $class->getConstantReflection($parentName);
+ } else {
+ $parent = $class->getProperty(ltrim($parentName, '$'));
+ }
+ }
+
+ if (!empty($parent)) {
+ // Don't get into an infinite recursion loop
+ if (in_array($parent, self::$copydocStack, true)) {
+ throw new Exception\RuntimeException('Infinite loop detected when copying annotations using the @copydoc tag.', Exception\RuntimeException::INVALID_ARGUMENT, $this->reflection);
+ }
+
+ self::$copydocStack[] = $parent;
+
+ // We can get into an infinite loop here (e.g. when two methods @copydoc from each other)
+ foreach ($parent->getAnnotations() as $name => $value) {
+ // Add annotations that are not already present
+ if (empty($this->annotations[$name])) {
+ $this->annotations[$name] = $value;
+ }
+ }
+
+ array_pop(self::$copydocStack);
+ }
+ } catch (Exception\BaseException $e) {
+ // Ignoring links to non existent elements, ...
+ }
+ }
+
+ array_pop(self::$copydocStack);
+ }
+
+ /**
+ * Merges templates with the current docblock.
+ */
+ private function mergeTemplates()
+ {
+ foreach ($this->templates as $index => $template) {
+ if (0 === $index && $template->getDocComment() === $this->docComment) {
+ continue;
+ }
+
+ foreach ($template->getAnnotations() as $name => $value) {
+ if ($name === self::LONG_DESCRIPTION) {
+ // Long description
+ if (isset($this->annotations[self::LONG_DESCRIPTION])) {
+ $this->annotations[self::LONG_DESCRIPTION] = $value . "\n" . $this->annotations[self::LONG_DESCRIPTION];
+ } else {
+ $this->annotations[self::LONG_DESCRIPTION] = $value;
+ }
+ } elseif ($name !== self::SHORT_DESCRIPTION) {
+ // Tags; short description is not inherited
+ if (isset($this->annotations[$name])) {
+ $this->annotations[$name] = array_merge($this->annotations[$name], $value);
+ } else {
+ $this->annotations[$name] = $value;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Inherits annotations from parent classes/methods/properties if needed.
+ *
+ * @throws \TokenReflection\Exception\RuntimeException If unsupported reflection was used.
+ */
+ private function inheritAnnotations()
+ {
+ if ($this->reflection instanceof ReflectionClass) {
+ $declaringClass = $this->reflection;
+ } elseif ($this->reflection instanceof ReflectionMethod || $this->reflection instanceof ReflectionProperty) {
+ $declaringClass = $this->reflection->getDeclaringClass();
+ }
+
+ $parents = array_filter(array_merge(array($declaringClass->getParentClass()), $declaringClass->getOwnInterfaces()), function($class) {
+ return $class instanceof ReflectionClass;
+ });
+
+ // In case of properties and methods, look for a property/method of the same name and return
+ // and array of such members.
+ $parentDefinitions = array();
+ if ($this->reflection instanceof ReflectionProperty) {
+ $name = $this->reflection->getName();
+ foreach ($parents as $parent) {
+ if ($parent->hasProperty($name)) {
+ $parentDefinitions[] = $parent->getProperty($name);
+ }
+ }
+
+ $parents = $parentDefinitions;
+ } elseif ($this->reflection instanceof ReflectionMethod) {
+ $name = $this->reflection->getName();
+ foreach ($parents as $parent) {
+ if ($parent->hasMethod($name)) {
+ $parentDefinitions[] = $parent->getMethod($name);
+ }
+ }
+
+ $parents = $parentDefinitions;
+ }
+
+ if (false === $this->docComment) {
+ // Inherit the entire docblock
+ foreach ($parents as $parent) {
+ $annotations = $parent->getAnnotations();
+ if (!empty($annotations)) {
+ $this->annotations = $annotations;
+ break;
+ }
+ }
+ } else {
+ if (isset($this->annotations[self::LONG_DESCRIPTION]) && false !== stripos($this->annotations[self::LONG_DESCRIPTION], '{@inheritdoc}')) {
+ // Inherit long description
+ foreach ($parents as $parent) {
+ if ($parent->hasAnnotation(self::LONG_DESCRIPTION)) {
+ $this->annotations[self::LONG_DESCRIPTION] = str_ireplace(
+ '{@inheritdoc}',
+ $parent->getAnnotation(self::LONG_DESCRIPTION),
+ $this->annotations[self::LONG_DESCRIPTION]
+ );
+ break;
+ }
+ }
+
+ $this->annotations[self::LONG_DESCRIPTION] = str_ireplace('{@inheritdoc}', '', $this->annotations[self::LONG_DESCRIPTION]);
+ }
+ if (isset($this->annotations[self::SHORT_DESCRIPTION]) && false !== stripos($this->annotations[self::SHORT_DESCRIPTION], '{@inheritdoc}')) {
+ // Inherit short description
+ foreach ($parents as $parent) {
+ if ($parent->hasAnnotation(self::SHORT_DESCRIPTION)) {
+ $this->annotations[self::SHORT_DESCRIPTION] = str_ireplace(
+ '{@inheritdoc}',
+ $parent->getAnnotation(self::SHORT_DESCRIPTION),
+ $this->annotations[self::SHORT_DESCRIPTION]
+ );
+ break;
+ }
+ }
+
+ $this->annotations[self::SHORT_DESCRIPTION] = str_ireplace('{@inheritdoc}', '', $this->annotations[self::SHORT_DESCRIPTION]);
+ }
+ }
+
+ // In case of properties check if we need and can inherit the data type
+ if ($this->reflection instanceof ReflectionProperty && empty($this->annotations['var'])) {
+ foreach ($parents as $parent) {
+ if ($parent->hasAnnotation('var')) {
+ $this->annotations['var'] = $parent->getAnnotation('var');
+ break;
+ }
+ }
+ }
+
+ if ($this->reflection instanceof ReflectionMethod) {
+ if (0 !== $this->reflection->getNumberOfParameters() && (empty($this->annotations['param']) || count($this->annotations['param']) < $this->reflection->getNumberOfParameters())) {
+ // In case of methods check if we need and can inherit parameter descriptions
+ $params = isset($this->annotations['param']) ? $this->annotations['param'] : array();
+ $complete = false;
+ foreach ($parents as $parent) {
+ if ($parent->hasAnnotation('param')) {
+ $parentParams = array_slice($parent->getAnnotation('param'), count($params));
+
+ while (!empty($parentParams) && !$complete) {
+ array_push($params, array_shift($parentParams));
+
+ if (count($params) === $this->reflection->getNumberOfParameters()) {
+ $complete = true;
+ }
+ }
+ }
+
+ if ($complete) {
+ break;
+ }
+ }
+
+ if (!empty($params)) {
+ $this->annotations['param'] = $params;
+ }
+ }
+
+ // And check if we need and can inherit the return and throws value
+ foreach (array('return', 'throws') as $paramName) {
+ if (!isset($this->annotations[$paramName])) {
+ foreach ($parents as $parent) {
+ if ($parent->hasAnnotation($paramName)) {
+ $this->annotations[$paramName] = $parent->getAnnotation($paramName);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionBase.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionBase.php
new file mode 100644
index 0000000..c7b15b0
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionBase.php
@@ -0,0 +1,273 @@
+broker = $broker;
+
+ $this->parseStream($tokenStream, $parent);
+ }
+
+ /**
+ * Parses the token substream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ */
+ abstract protected function parseStream(Stream $tokenStream, IReflection $parent = null);
+
+ /**
+ * Returns the name (FQN).
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return string|boolean
+ */
+ public function getDocComment()
+ {
+ return $this->docComment->getDocComment();
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ final public function hasAnnotation($name)
+ {
+ return $this->docComment->hasAnnotation($name);
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return string|array|null
+ */
+ final public function getAnnotation($name)
+ {
+ return $this->docComment->getAnnotation($name);
+ }
+
+ /**
+ * Returns all annotations.
+ *
+ * @return array
+ */
+ final public function getAnnotations()
+ {
+ return $this->docComment->getAnnotations();
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Returns if the reflection object is internal.
+ *
+ * Always returns false - everything is user defined.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection object is user defined.
+ *
+ * Always returns true - everything is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the reflection subject is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return $this->hasAnnotation('deprecated');
+ }
+
+ /**
+ * Returns the appropriate source code part.
+ *
+ * @return string
+ */
+ abstract public function getSource();
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return self::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return self::exists($this, $key);
+ }
+
+ /**
+ * Magic __get method helper.
+ *
+ * @param \TokenReflection\IReflection $object Reflection object
+ * @param string $key Variable name
+ * @return mixed
+ * @throws \TokenReflection\Exception\RuntimeException If the requested parameter does not exist.
+ */
+ final public static function get(IReflection $object, $key)
+ {
+ if (!empty($key)) {
+ $className = get_class($object);
+ if (!isset(self::$methodCache[$className])) {
+ self::$methodCache[$className] = array_flip(get_class_methods($className));
+ }
+
+ $methods = self::$methodCache[$className];
+ $key2 = ucfirst($key);
+ if (isset($methods['get' . $key2])) {
+ return $object->{'get' . $key2}();
+ } elseif (isset($methods['is' . $key2])) {
+ return $object->{'is' . $key2}();
+ }
+ }
+
+ throw new Exception\RuntimeException(sprintf('Cannot read property "%s".', $key), Exception\RuntimeException::DOES_NOT_EXIST);
+ }
+
+ /**
+ * Magic __isset method helper.
+ *
+ * @param \TokenReflection\IReflection $object Reflection object
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public static function exists(IReflection $object, $key)
+ {
+ try {
+ self::get($object, $key);
+ return true;
+ } catch (RuntimeException $e) {
+ return false;
+ }
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionClass.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionClass.php
new file mode 100644
index 0000000..088ebca
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionClass.php
@@ -0,0 +1,1986 @@
+::] => array(
+ * array(, [])|null
+ * [, ...]
+ * )
+ *
+ * @var array
+ */
+ private $traitImports = array();
+
+ /**
+ * Stores if the class definition is complete.
+ *
+ * @var array
+ */
+ private $methods = array();
+
+ /**
+ * Constant reflections.
+ *
+ * @var array
+ */
+ private $constants = array();
+
+ /**
+ * Properties reflections.
+ *
+ * @var array
+ */
+ private $properties = array();
+
+ /**
+ * Stores if the class definition is complete.
+ *
+ * @var boolean
+ */
+ private $definitionComplete = false;
+
+ /**
+ * Imported namespace/class aliases.
+ *
+ * @var array
+ */
+ private $aliases = array();
+
+ /**
+ * Returns the unqualified name (UQN).
+ *
+ * @return string
+ */
+ public function getShortName()
+ {
+ $name = $this->getName();
+ if ($this->namespaceName !== ReflectionNamespace::NO_NAMESPACE_NAME) {
+ $name = substr($name, strlen($this->namespaceName) + 1);
+ }
+
+ return $name;
+ }
+
+ /**
+ * Returns the namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return $this->namespaceName === ReflectionNamespace::NO_NAMESPACE_NAME ? '' : $this->namespaceName;
+ }
+
+ /**
+ * Returns if the class is defined within a namespace.
+ *
+ * @return boolean
+ */
+ public function inNamespace()
+ {
+ return null !== $this->namespaceName && ReflectionNamespace::NO_NAMESPACE_NAME !== $this->namespaceName;
+ }
+
+ /**
+ * Returns modifiers.
+ *
+ * @return array
+ */
+ public function getModifiers()
+ {
+ if (false === $this->modifiersComplete) {
+ if (($this->modifiers & InternalReflectionClass::IS_EXPLICIT_ABSTRACT) && !($this->modifiers & InternalReflectionClass::IS_IMPLICIT_ABSTRACT)) {
+ foreach ($this->getMethods() as $reflectionMethod) {
+ if ($reflectionMethod->isAbstract()) {
+ $this->modifiers |= InternalReflectionClass::IS_IMPLICIT_ABSTRACT;
+ }
+ }
+
+ if (!empty($this->interfaces)) {
+ $this->modifiers |= InternalReflectionClass::IS_IMPLICIT_ABSTRACT;
+ }
+ }
+
+ if (!empty($this->interfaces)) {
+ $this->modifiers |= self::IMPLEMENTS_INTERFACES;
+ }
+
+ if ($this->isInterface() && !empty($this->methods)) {
+ $this->modifiers |= InternalReflectionClass::IS_IMPLICIT_ABSTRACT;
+ }
+
+ if (!empty($this->traits)) {
+ $this->modifiers |= self::IMPLEMENTS_TRAITS;
+ }
+
+ $this->modifiersComplete = null === $this->parentClassName || $this->getParentClass()->isComplete();
+
+ if ($this->modifiersComplete) {
+ foreach ($this->getInterfaces() as $interface) {
+ if (!$interface->isComplete()) {
+ $this->modifiersComplete = false;
+ break;
+ }
+ }
+ }
+ if ($this->modifiersComplete) {
+ foreach ($this->getTraits() as $trait) {
+ if (!$trait->isComplete()) {
+ $this->modifiersComplete = false;
+ break;
+ }
+ }
+ }
+ }
+
+ return $this->modifiers;
+ }
+
+ /**
+ * Returns if the class is abstract.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ if ($this->modifiers & InternalReflectionClass::IS_EXPLICIT_ABSTRACT) {
+ return true;
+ } elseif ($this->isInterface() && !empty($this->methods)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns if the class is final.
+ *
+ * @return boolean
+ */
+ public function isFinal()
+ {
+ return (bool) ($this->modifiers & InternalReflectionClass::IS_FINAL);
+ }
+
+ /**
+ * Returns if the class is an interface.
+ *
+ * @return boolean
+ */
+ public function isInterface()
+ {
+ return (bool) ($this->modifiers & self::IS_INTERFACE);
+ }
+
+ /**
+ * Returns if the class is an exception or its descendant.
+ *
+ * @return boolean
+ */
+ public function isException()
+ {
+ return 'Exception' === $this->name || $this->isSubclassOf('Exception');
+ }
+
+ /**
+ * Returns if it is possible to create an instance of this class.
+ *
+ * @return boolean
+ */
+ public function isInstantiable()
+ {
+ if ($this->isInterface() || $this->isAbstract()) {
+ return false;
+ }
+
+ if (null === ($constructor = $this->getConstructor())) {
+ return true;
+ }
+
+ return $constructor->isPublic();
+ }
+
+ /**
+ * Returns if objects of this class are cloneable.
+ *
+ * Introduced in PHP 5.4.
+ *
+ * @return boolean
+ * @see http://svn.php.net/viewvc/php/php-src/trunk/ext/reflection/php_reflection.c?revision=307971&view=markup#l4059
+ */
+ public function isCloneable()
+ {
+ if ($this->isInterface() || $this->isAbstract()) {
+ return false;
+ }
+
+ if ($this->hasMethod('__clone')) {
+ return $this->getMethod('__clone')->isPublic();
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns if the class is iterateable.
+ *
+ * Returns true if the class implements the Traversable interface.
+ *
+ * @return boolean
+ * @todo traits
+ */
+ public function isIterateable()
+ {
+ return $this->implementsInterface('Traversable');
+ }
+
+ /**
+ * Returns if the current class is a subclass of the given class.
+ *
+ * @param string|object $class Class name or reflection object
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If the provided parameter is not a reflection class instance.
+ */
+ public function isSubclassOf($class)
+ {
+ if (is_object($class)) {
+ if ($class instanceof InternalReflectionClass || $class instanceof IReflectionClass) {
+ $class = $class->getName();
+ } else {
+ $class = get_class($class);
+ }
+ }
+
+ if ($class === $this->parentClassName) {
+ return true;
+ }
+
+ $parent = $this->getParentClass();
+ return false === $parent ? false : $parent->isSubclassOf($class);
+ }
+
+ /**
+ * Returns the parent class reflection.
+ *
+ * @return \TokenReflection\ReflectionClass|boolean
+ */
+ public function getParentClass()
+ {
+ $className = $this->getParentClassName();
+ if (null === $className) {
+ return false;
+ }
+
+ return $this->getBroker()->getClass($className);
+ }
+
+ /**
+ * Returns the parent class name.
+ *
+ * @return string|null
+ */
+ public function getParentClassName()
+ {
+ return $this->parentClassName;
+ }
+
+ /**
+ * Returns the parent classes reflections.
+ *
+ * @return array
+ */
+ public function getParentClasses()
+ {
+ $parent = $this->getParentClass();
+ if (false === $parent) {
+ return array();
+ }
+
+ return array_merge(array($parent->getName() => $parent), $parent->getParentClasses());
+ }
+
+ /**
+ * Returns the parent classes names.
+ *
+ * @return array
+ */
+ public function getParentClassNameList()
+ {
+ $parent = $this->getParentClass();
+ if (false === $parent) {
+ return array();
+ }
+
+ return array_merge(array($parent->getName()), $parent->getParentClassNameList());
+ }
+
+ /**
+ * Returns if the class implements the given interface.
+ *
+ * @param string|object $interface Interface name or reflection object
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If the provided parameter is not an interface.
+ */
+ public function implementsInterface($interface)
+ {
+ if (is_object($interface)) {
+ if (!$interface instanceof InternalReflectionClass && !$interface instanceof IReflectionClass) {
+ throw new Exception\RuntimeException(sprintf('Parameter must be a string or an instance of class reflection, "%s" provided.', get_class($interface)), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ if (!$interface->isInterface()) {
+ throw new Exception\RuntimeException(sprintf('"%s" is not an interface.', $interfaceName), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $interfaceName = $interface->getName();
+ } else {
+ $interfaceName = $interface;
+ }
+
+ return in_array($interfaceName, $this->getInterfaceNames());
+ }
+
+ /**
+ * Returns interface reflections.
+ *
+ * @return array
+ */
+ public function getInterfaces()
+ {
+ $interfaceNames = $this->getInterfaceNames();
+ if (empty($interfaceNames)) {
+ return array();
+ }
+
+ $broker = $this->getBroker();
+ return array_combine($interfaceNames, array_map(function($interfaceName) use ($broker) {
+ return $broker->getClass($interfaceName);
+ }, $interfaceNames));
+ }
+
+ /**
+ * Returns interface names.
+ *
+ * @return array
+ */
+ public function getInterfaceNames()
+ {
+ $parentClass = $this->getParentClass();
+
+ $names = false !== $parentClass ? array_reverse(array_flip($parentClass->getInterfaceNames())) : array();
+ foreach ($this->interfaces as $interfaceName) {
+ $names[$interfaceName] = true;
+ foreach (array_reverse($this->getBroker()->getClass($interfaceName)->getInterfaceNames()) as $parentInterfaceName) {
+ $names[$parentInterfaceName] = true;
+ }
+ }
+
+ return array_keys($names);
+ }
+
+ /**
+ * Returns reflections of interfaces implemented by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnInterfaces()
+ {
+ $interfaceNames = $this->getOwnInterfaceNames();
+ if (empty($interfaceNames)) {
+ return array();
+ }
+
+ $broker = $this->getBroker();
+ return array_combine($interfaceNames, array_map(function($interfaceName) use ($broker) {
+ return $broker->getClass($interfaceName);
+ }, $interfaceNames));
+ }
+
+ /**
+ * Returns names of interfaces implemented by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnInterfaceNames()
+ {
+ return $this->interfaces;
+ }
+
+ /**
+ * Returns the class constructor reflection.
+ *
+ * @return \TokenReflection\ReflectionMethod|null
+ */
+ public function getConstructor()
+ {
+ foreach ($this->getMethods() as $method) {
+ if ($method->isConstructor()) {
+ return $method;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the class destructor reflection.
+ *
+ * @return \TokenReflection\ReflectionMethod|null
+ */
+ public function getDestructor()
+ {
+ foreach ($this->getMethods() as $method) {
+ if ($method->isDestructor()) {
+ return $method;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns if the class implements the given method.
+ *
+ * @param string $name Method name
+ * @return boolean
+ */
+ public function hasMethod($name)
+ {
+ foreach ($this->getMethods() as $method) {
+ if ($name === $method->getName()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns a method reflection.
+ *
+ * @param string $name Method name
+ * @return \TokenReflection\ReflectionMethod
+ * @throws \TokenReflection\Exception\RuntimeException If the requested method does not exist.
+ */
+ public function getMethod($name)
+ {
+ if (isset($this->methods[$name])) {
+ return $this->methods[$name];
+ }
+
+ foreach ($this->getMethods() as $method) {
+ if ($name === $method->getName()) {
+ return $method;
+ }
+ }
+
+ throw new Exception\RuntimeException(sprintf('There is no method "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns method reflections.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ */
+ public function getMethods($filter = null)
+ {
+ $methods = $this->methods;
+
+ foreach ($this->getTraitMethods() as $traitMethod) {
+ if (!isset($methods[$traitMethod->getName()])) {
+ $methods[$traitMethod->getName()] = $traitMethod;
+ }
+ }
+
+ if (null !== $this->parentClassName) {
+ foreach ($this->getParentClass()->getMethods(null) as $parentMethod) {
+ if (!isset($methods[$parentMethod->getName()])) {
+ $methods[$parentMethod->getName()] = $parentMethod;
+ }
+ }
+ }
+ foreach ($this->getOwnInterfaces() as $interface) {
+ foreach ($interface->getMethods(null) as $parentMethod) {
+ if (!isset($methods[$parentMethod->getName()])) {
+ $methods[$parentMethod->getName()] = $parentMethod;
+ }
+ }
+ }
+
+ if (null !== $filter) {
+ $methods = array_filter($methods, function(IReflectionMethod $method) use ($filter) {
+ return $method->is($filter);
+ });
+ }
+
+ return array_values($methods);
+ }
+
+ /**
+ * Returns if the class implements (and not its parents) the given method.
+ *
+ * @param string $name Method name
+ * @return boolean
+ */
+ public function hasOwnMethod($name)
+ {
+ return isset($this->methods[$name]);
+ }
+
+ /**
+ * Returns reflections of methods declared by this class, not its parents.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ */
+ public function getOwnMethods($filter = null)
+ {
+ $methods = $this->methods;
+
+ if (null !== $filter) {
+ $methods = array_filter($methods, function(ReflectionMethod $method) use ($filter) {
+ return $method->is($filter);
+ });
+ }
+
+ return array_values($methods);
+ }
+
+ /**
+ * Returns if the class imports the given method from traits.
+ *
+ * @param string $name Method name
+ * @return boolean
+ */
+ public function hasTraitMethod($name)
+ {
+ if (isset($this->methods[$name])) {
+ return false;
+ }
+
+ foreach ($this->getOwnTraits() as $trait) {
+ if ($trait->hasMethod($name)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns reflections of method imported from traits.
+ *
+ * @param integer $filter Methods filter
+ * @return array
+ * @throws \TokenReflection\Exception\RuntimeException If trait method was already imported.
+ */
+ public function getTraitMethods($filter = null)
+ {
+ $methods = array();
+
+ foreach ($this->getOwnTraits() as $trait) {
+ $traitName = $trait->getName();
+ foreach ($trait->getMethods(null) as $traitMethod) {
+ $methodName = $traitMethod->getName();
+
+ $imports = array();
+ if (isset($this->traitImports[$traitName . '::' . $methodName])) {
+ $imports = $this->traitImports[$traitName . '::' . $methodName];
+ }
+ if (isset($this->traitImports[$methodName])) {
+ $imports = empty($imports) ? $this->traitImports[$methodName] : array_merge($imports, $this->traitImports[$methodName]);
+ }
+
+ foreach ($imports as $import) {
+ if (null !== $import) {
+ list($newName, $accessLevel) = $import;
+
+ if ('' === $newName) {
+ $newName = $methodName;
+ $imports[] = null;
+ }
+
+ if (!isset($this->methods[$newName])) {
+ if (isset($methods[$newName])) {
+ throw new Exception\RuntimeException(sprintf('Trait method "%s" was already imported.', $newName), Exception\RuntimeException::ALREADY_EXISTS, $this);
+ }
+
+ $methods[$newName] = $traitMethod->alias($this, $newName, $accessLevel);
+ }
+ }
+ }
+
+ if (!in_array(null, $imports)) {
+ if (!isset($this->methods[$methodName])) {
+ if (isset($methods[$methodName])) {
+ throw new Exception\RuntimeException(sprintf('Trait method "%s" was already imported.', $methodName), Exception\RuntimeException::ALREADY_EXISTS, $this);
+ }
+
+ $methods[$methodName] = $traitMethod->alias($this);
+ }
+ }
+ }
+ }
+
+ if (null !== $filter) {
+ $methods = array_filter($methods, function(IReflectionMethod $method) use ($filter) {
+ return (bool) ($method->getModifiers() & $filter);
+ });
+ }
+
+ return array_values($methods);
+ }
+
+ /**
+ * Returns if the class defines the given constant.
+ *
+ * @param string $name Constant name.
+ * @return boolean
+ */
+ public function hasConstant($name)
+ {
+ if (isset($this->constants[$name])) {
+ return true;
+ }
+
+ foreach ($this->getConstantReflections() as $constant) {
+ if ($name === $constant->getName()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns a constant value.
+ *
+ * @param string $name Constant name
+ * @return mixed|false
+ */
+ public function getConstant($name)
+ {
+ try {
+ return $this->getConstantReflection($name)->getValue();
+ } catch (Exception\BaseException $e) {
+ return false;
+ }
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @return \TokenReflection\ReflectionConstant
+ * @throws \TokenReflection\Exception\RuntimeException If the requested constant does not exist.
+ */
+ public function getConstantReflection($name)
+ {
+ if (isset($this->constants[$name])) {
+ return $this->constants[$name];
+ }
+
+ foreach ($this->getConstantReflections() as $constant) {
+ if ($name === $constant->getName()) {
+ return $constant;
+ }
+ }
+
+ throw new Exception\RuntimeException(sprintf('There is no constant "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns constant values.
+ *
+ * @return array
+ */
+ public function getConstants()
+ {
+ $constants = array();
+ foreach ($this->getConstantReflections() as $constant) {
+ $constants[$constant->getName()] = $constant->getValue();
+ }
+ return $constants;
+ }
+
+ /**
+ * Returns constant reflections.
+ *
+ * @return array
+ */
+ public function getConstantReflections()
+ {
+ if (null === $this->parentClassName && empty($this->interfaces)) {
+ return array_values($this->constants);
+ } else {
+ $reflections = array_values($this->constants);
+
+ if (null !== $this->parentClassName) {
+ $reflections = array_merge($reflections, $this->getParentClass()->getConstantReflections());
+ }
+ foreach ($this->getOwnInterfaces() as $interface) {
+ $reflections = array_merge($reflections, $interface->getConstantReflections());
+ }
+
+ return $reflections;
+ }
+ }
+
+ /**
+ * Returns if the class (and not its parents) defines the given constant.
+ *
+ * @param string $name Constant name.
+ * @return boolean
+ */
+ public function hasOwnConstant($name)
+ {
+ return isset($this->constants[$name]);
+ }
+
+ /**
+ * Returns constants declared by this class, not by its parents.
+ *
+ * @return array
+ */
+ public function getOwnConstants()
+ {
+ return array_map(function(ReflectionConstant $constant) {
+ return $constant->getValue();
+ }, $this->constants);
+ }
+
+ /**
+ * Returns reflections of constants declared by this class, not by its parents.
+ *
+ * @return array
+ */
+ public function getOwnConstantReflections()
+ {
+ return array_values($this->constants);
+ }
+
+ /**
+ * Returns if the class defines the given property.
+ *
+ * @param string $name Property name
+ * @return boolean
+ */
+ public function hasProperty($name)
+ {
+ foreach ($this->getProperties() as $property) {
+ if ($name === $property->getName()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Return a property reflection.
+ *
+ * @param string $name Property name
+ * @return \TokenReflection\ReflectionProperty
+ * @throws \TokenReflection\Exception\RuntimeException If the requested property does not exist.
+ */
+ public function getProperty($name)
+ {
+ if (isset($this->properties[$name])) {
+ return $this->properties[$name];
+ }
+
+ foreach ($this->getProperties() as $property) {
+ if ($name === $property->getName()) {
+ return $property;
+ }
+ }
+
+ throw new Exception\RuntimeException(sprintf('There is no property "%s".', $name, $this->name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns property reflections.
+ *
+ * @param integer $filter Properties filter
+ * @return array
+ */
+ public function getProperties($filter = null)
+ {
+ $properties = $this->properties;
+
+ foreach ($this->getTraitProperties(null) as $traitProperty) {
+ if (!isset($properties[$traitProperty->getName()])) {
+ $properties[$traitProperty->getName()] = $traitProperty->alias($this);
+ }
+ }
+
+ if (null !== $this->parentClassName) {
+ foreach ($this->getParentClass()->getProperties(null) as $parentProperty) {
+ if (!isset($properties[$parentProperty->getName()])) {
+ $properties[$parentProperty->getName()] = $parentProperty;
+ }
+ }
+ }
+
+ if (null !== $filter) {
+ $properties = array_filter($properties, function(IReflectionProperty $property) use ($filter) {
+ return (bool) ($property->getModifiers() & $filter);
+ });
+ }
+
+ return array_values($properties);
+ }
+
+ /**
+ * Returns if the class (and not its parents) defines the given property.
+ *
+ * @param string $name Property name
+ * @return boolean
+ */
+ public function hasOwnProperty($name)
+ {
+ return isset($this->properties[$name]);
+ }
+
+ /**
+ * Returns reflections of properties declared by this class, not its parents.
+ *
+ * @param integer $filter Properties filter
+ * @return array
+ */
+ public function getOwnProperties($filter = null)
+ {
+ $properties = $this->properties;
+
+ if (null !== $filter) {
+ $properties = array_filter($properties, function(ReflectionProperty $property) use ($filter) {
+ return (bool) ($property->getModifiers() & $filter);
+ });
+ }
+
+ return array_values($properties);
+ }
+
+ /**
+ * Returns if the class imports the given property from traits.
+ *
+ * @param string $name Property name
+ * @return boolean
+ */
+ public function hasTraitProperty($name)
+ {
+ if (isset($this->properties[$name])) {
+ return false;
+ }
+
+ foreach ($this->getOwnTraits() as $trait) {
+ if ($trait->hasProperty($name)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns reflections of properties imported from traits.
+ *
+ * @param integer $filter Properties filter
+ * @return array
+ */
+ public function getTraitProperties($filter = null)
+ {
+ $properties = array();
+
+ foreach ($this->getOwnTraits() as $trait) {
+ foreach ($trait->getProperties(null) as $traitProperty) {
+ if (!isset($this->properties[$traitProperty->getName()]) && !isset($properties[$traitProperty->getName()])) {
+ $properties[$traitProperty->getName()] = $traitProperty->alias($this);
+ }
+ }
+ }
+
+ if (null !== $filter) {
+ $properties = array_filter($properties, function(IReflectionProperty $property) use ($filter) {
+ return (bool) ($property->getModifiers() & $filter);
+ });
+ }
+
+ return array_values($properties);
+ }
+
+ /**
+ * Returns default properties.
+ *
+ * @return array
+ */
+ public function getDefaultProperties()
+ {
+ static $accessLevels = array(InternalReflectionProperty::IS_PUBLIC, InternalReflectionProperty::IS_PROTECTED, InternalReflectionProperty::IS_PRIVATE);
+
+ $defaults = array();
+ $properties = $this->getProperties();
+ foreach (array(true, false) as $static) {
+ foreach ($properties as $property) {
+ foreach ($accessLevels as $level) {
+ if ($property->isStatic() === $static && ($property->getModifiers() & $level)) {
+ $defaults[$property->getName()] = $property->getDefaultValue();
+ }
+ }
+ }
+ }
+
+ return $defaults;
+ }
+
+ /**
+ * Returns static properties reflections.
+ *
+ * @return array
+ */
+ public function getStaticProperties()
+ {
+ $defaults = array();
+ foreach ($this->getProperties(InternalReflectionProperty::IS_STATIC) as $property) {
+ if ($property instanceof ReflectionProperty) {
+ $defaults[$property->getName()] = $property->getDefaultValue();
+ }
+ }
+
+ return $defaults;
+ }
+
+ /**
+ * Returns a value of a static property.
+ *
+ * @param string $name Property name
+ * @param mixed $default Default value
+ * @return mixed
+ * @throws \TokenReflection\Exception\RuntimeException If the requested static property does not exist.
+ * @throws \TokenReflection\Exception\RuntimeException If the requested static property is not accessible.
+ */
+ public function getStaticPropertyValue($name, $default = null)
+ {
+ if ($this->hasProperty($name) && ($property = $this->getProperty($name)) && $property->isStatic()) {
+ if (!$property->isPublic() && !$property->isAccessible()) {
+ throw new Exception\RuntimeException(sprintf('Static property "%s" is not accessible.', $name), Exception\RuntimeException::NOT_ACCESSBILE, $this);
+ }
+
+ return $property->getDefaultValue();
+ }
+
+ throw new Exception\RuntimeException(sprintf('There is no static property "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns traits used by this class.
+ *
+ * @return array
+ */
+ public function getTraits()
+ {
+ $traitNames = $this->getTraitNames();
+ if (empty($traitNames)) {
+ return array();
+ }
+
+ $broker = $this->getBroker();
+ return array_combine($traitNames, array_map(function($traitName) use ($broker) {
+ return $broker->getClass($traitName);
+ }, $traitNames));
+ }
+
+ /**
+ * Returns traits used by this class and not its parents.
+ *
+ * @return array
+ */
+ public function getOwnTraits()
+ {
+ $ownTraitNames = $this->getOwnTraitNames();
+ if (empty($ownTraitNames)) {
+ return array();
+ }
+
+ $broker = $this->getBroker();
+ return array_combine($ownTraitNames, array_map(function($traitName) use ($broker) {
+ return $broker->getClass($traitName);
+ }, $ownTraitNames));
+ }
+
+ /**
+ * Returns names of used traits.
+ *
+ * @return array
+ */
+ public function getTraitNames()
+ {
+ $parentClass = $this->getParentClass();
+
+ $names = $parentClass ? $parentClass->getTraitNames() : array();
+ foreach ($this->traits as $traitName) {
+ $names[] = $traitName;
+ }
+
+ return array_unique($names);
+ }
+
+ /**
+ * Returns names of traits used by this class an not its parents.
+ *
+ * @return array
+ */
+ public function getOwnTraitNames()
+ {
+ return $this->traits;
+ }
+
+ /**
+ * Returns method aliases from traits.
+ *
+ * @return array
+ */
+ public function getTraitAliases()
+ {
+ return $this->traitAliases;
+ }
+
+ /**
+ * Returns if the class is a trait.
+ *
+ * @return boolean
+ */
+ public function isTrait()
+ {
+ return self::IS_TRAIT === $this->type;
+ }
+
+ /**
+ * Returns if the class definition is valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ if (null !== $this->parentClassName && !$this->getParentClass()->isValid()) {
+ return false;
+ }
+
+ foreach ($this->getInterfaces() as $interface) {
+ if (!$interface->isValid()) {
+ return false;
+ }
+ }
+
+ foreach ($this->getTraits() as $trait) {
+ if (!$trait->isValid()) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns if the class uses a particular trait.
+ *
+ * @param \ReflectionClass|\TokenReflection\IReflectionClass|string $trait Trait reflection or name
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid parameter was provided.
+ */
+ public function usesTrait($trait)
+ {
+ if (is_object($trait)) {
+ if (!$trait instanceof InternalReflectionClass && !$trait instanceof IReflectionClass) {
+ throw new Exception\RuntimeException(sprintf('Parameter must be a string or an instance of trait reflection, "%s" provided.', get_class($trait)), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $traitName = $trait->getName();
+
+ if (!$trait->isTrait()) {
+ throw new Exception\RuntimeException(sprintf('"%s" is not a trait.', $traitName), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+ } else {
+ $reflection = $this->getBroker()->getClass($trait);
+ if (!$reflection->isTrait()) {
+ throw new Exception\RuntimeException(sprintf('"%s" is not a trait.', $trait), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $traitName = $trait;
+ }
+
+ return in_array($traitName, $this->getTraitNames());
+ }
+
+ /**
+ * Returns reflections of direct subclasses.
+ *
+ * @return array
+ */
+ public function getDirectSubclasses()
+ {
+ $that = $this->name;
+ return array_filter($this->getBroker()->getClasses(), function(ReflectionClass $class) use ($that) {
+ if (!$class->isSubclassOf($that)) {
+ return false;
+ }
+
+ return null === $class->getParentClassName() || !$class->getParentClass()->isSubClassOf($that);
+ });
+ }
+
+ /**
+ * Returns names of direct subclasses.
+ *
+ * @return array
+ */
+ public function getDirectSubclassNames()
+ {
+ return array_keys($this->getDirectSubclasses());
+ }
+
+ /**
+ * Returns reflections of indirect subclasses.
+ *
+ * @return array
+ */
+ public function getIndirectSubclasses()
+ {
+ $that = $this->name;
+ return array_filter($this->getBroker()->getClasses(), function(ReflectionClass $class) use ($that) {
+ if (!$class->isSubclassOf($that)) {
+ return false;
+ }
+
+ return null !== $class->getParentClassName() && $class->getParentClass()->isSubClassOf($that);
+ });
+ }
+
+ /**
+ * Returns names of indirect subclasses.
+ *
+ * @return array
+ */
+ public function getIndirectSubclassNames()
+ {
+ return array_keys($this->getIndirectSubclasses());
+ }
+
+ /**
+ * Returns reflections of classes directly implementing this interface.
+ *
+ * @return array
+ */
+ public function getDirectImplementers()
+ {
+ if (!$this->isInterface()) {
+ return array();
+ }
+
+ $that = $this->name;
+ return array_filter($this->getBroker()->getClasses(), function(ReflectionClass $class) use ($that) {
+ if ($class->isInterface() || !$class->implementsInterface($that)) {
+ return false;
+ }
+
+ return null === $class->getParentClassName() || !$class->getParentClass()->implementsInterface($that);
+ });
+ }
+
+ /**
+ * Returns names of classes directly implementing this interface.
+ *
+ * @return array
+ */
+ public function getDirectImplementerNames()
+ {
+ return array_keys($this->getDirectImplementers());
+ }
+
+ /**
+ * Returns reflections of classes indirectly implementing this interface.
+ *
+ * @return array
+ */
+ public function getIndirectImplementers()
+ {
+ if (!$this->isInterface()) {
+ return array();
+ }
+
+ $that = $this->name;
+ return array_filter($this->getBroker()->getClasses(), function(ReflectionClass $class) use ($that) {
+ if ($class->isInterface() || !$class->implementsInterface($that)) {
+ return false;
+ }
+
+ return null !== $class->getParentClassName() && $class->getParentClass()->implementsInterface($that);
+ });
+ }
+
+ /**
+ * Returns names of classes indirectly implementing this interface.
+ *
+ * @return array
+ */
+ public function getIndirectImplementerNames()
+ {
+ return array_keys($this->getIndirectImplementers());
+ }
+
+ /**
+ * Returns if the given object is an instance of this class.
+ *
+ * @param object $object Instance
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If the provided argument is not an object.
+ */
+ public function isInstance($object)
+ {
+ if (!is_object($object)) {
+ throw new Exception\RuntimeException(sprintf('Parameter must be an object, "%s" provided.', gettype($object)), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ return $this->name === get_class($object) || is_subclass_of($object, $this->getName());
+ }
+
+ /**
+ * Creates a new class instance without using a constructor.
+ *
+ * @return object
+ * @throws \TokenReflection\Exception\RuntimeException If the class inherits from an internal class.
+ */
+ public function newInstanceWithoutConstructor()
+ {
+ if (!class_exists($this->name, true)) {
+ throw new Exception\RuntimeException('Could not create an instance; class does not exist.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $reflection = new \TokenReflection\Php\ReflectionClass($this->getName(), $this->getBroker());
+ return $reflection->newInstanceWithoutConstructor();
+ }
+
+ /**
+ * Creates a new instance using variable number of parameters.
+ *
+ * Use any number of constructor parameters as function parameters.
+ *
+ * @param mixed $args
+ * @return object
+ */
+ public function newInstance($args)
+ {
+ return $this->newInstanceArgs(func_get_args());
+ }
+
+ /**
+ * Creates a new instance using an array of parameters.
+ *
+ * @param array $args Array of constructor parameters
+ * @return object
+ * @throws \TokenReflection\Exception\RuntimeException If the required class does not exist.
+ */
+ public function newInstanceArgs(array $args = array())
+ {
+ if (!class_exists($this->name, true)) {
+ throw new Exception\RuntimeException('Could not create an instance; class does not exist.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $reflection = new InternalReflectionClass($this->name);
+ return $reflection->newInstanceArgs($args);
+ }
+
+ /**
+ * Sets a static property value.
+ *
+ * @param string $name Property name
+ * @param mixed $value Property value
+ * @throws \TokenReflection\Exception\RuntimeException If the requested static property does not exist.
+ * @throws \TokenReflection\Exception\RuntimeException If the requested static property is not accessible.
+ */
+ public function setStaticPropertyValue($name, $value)
+ {
+ if ($this->hasProperty($name) && ($property = $this->getProperty($name)) && $property->isStatic()) {
+ if (!$property->isPublic() && !$property->isAccessible()) {
+ throw new Exception\RuntimeException(sprintf('Static property "%s" is not accessible.', $name), Exception\RuntimeException::NOT_ACCESSBILE, $this);
+ }
+
+ $property->setDefaultValue($value);
+ return;
+ }
+
+ throw new Exception\RuntimeException(sprintf('There is no static property "%s".', $name), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $implements = '';
+ $interfaceNames = $this->getInterfaceNames();
+ if (count($interfaceNames) > 0) {
+ $implements = sprintf(
+ ' %s %s',
+ $this->isInterface() ? 'extends' : 'implements',
+ implode(', ', $interfaceNames)
+ );
+ }
+
+ $buffer = '';
+ $count = 0;
+ foreach ($this->getConstantReflections() as $constant) {
+ $buffer .= ' ' . $constant->__toString();
+ $count++;
+ }
+ $constants = sprintf("\n\n - Constants [%d] {\n%s }", $count, $buffer);
+
+ $sBuffer = '';
+ $sCount = 0;
+ $buffer = '';
+ $count = 0;
+ foreach ($this->getProperties() as $property) {
+ $string = ' ' . preg_replace('~\n(?!$)~', "\n ", $property->__toString());
+ if ($property->isStatic()) {
+ $sBuffer .= $string;
+ $sCount++;
+ } else {
+ $buffer .= $string;
+ $count++;
+ }
+ }
+ $staticProperties = sprintf("\n\n - Static properties [%d] {\n%s }", $sCount, $sBuffer);
+ $properties = sprintf("\n\n - Properties [%d] {\n%s }", $count, $buffer);
+
+ $sBuffer = '';
+ $sCount = 0;
+ $buffer = '';
+ $count = 0;
+ foreach ($this->getMethods() as $method) {
+ // Skip private methods of parent classes
+ if ($method->getDeclaringClassName() !== $this->getName() && $method->isPrivate()) {
+ continue;
+ }
+ // Indent
+ $string = "\n ";
+
+ $string .= preg_replace('~\n(?!$|\n|\s*\*)~', "\n ", $method->__toString());
+ // Add inherits
+ if ($method->getDeclaringClassName() !== $this->getName()) {
+ $string = preg_replace(
+ array('~Method [ <[\w:]+~', '~, overwrites[^,]+~'),
+ array('\0, inherits ' . $method->getDeclaringClassName(), ''),
+ $string
+ );
+ }
+ if ($method->isStatic()) {
+ $sBuffer .= $string;
+ $sCount++;
+ } else {
+ $buffer .= $string;
+ $count++;
+ }
+ }
+ $staticMethods = sprintf("\n\n - Static methods [%d] {\n%s }", $sCount, ltrim($sBuffer, "\n"));
+ $methods = sprintf("\n\n - Methods [%d] {\n%s }", $count, ltrim($buffer, "\n"));
+
+ return sprintf(
+ "%s%s [ %s %s%s%s %s%s%s ] {\n @@ %s %d-%d%s%s%s%s%s\n}\n",
+ $this->getDocComment() ? $this->getDocComment() . "\n" : '',
+ $this->isInterface() ? 'Interface' : 'Class',
+ $this->isIterateable() ? ' ' : '',
+ $this->isAbstract() && !$this->isInterface() ? 'abstract ' : '',
+ $this->isFinal() ? 'final ' : '',
+ $this->isInterface() ? 'interface' : 'class',
+ $this->getName(),
+ null !== $this->getParentClassName() ? ' extends ' . $this->getParentClassName() : '',
+ $implements,
+ $this->getFileName(),
+ $this->getStartLine(),
+ $this->getEndLine(),
+ $constants,
+ $staticProperties,
+ $staticMethods,
+ $properties,
+ $methods
+ );
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string|object $className Class name or class instance
+ * @param boolean $return Return the export instead of outputting it
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If requested parameter doesn't exist.
+ */
+ public static function export(Broker $broker, $className, $return = false)
+ {
+ if (is_object($className)) {
+ $className = get_class($className);
+ }
+
+ $class = $broker->getClass($className);
+ if ($class instanceof Invalid\ReflectionClass) {
+ throw new Exception\RuntimeException('Class is invalid.', Exception\RuntimeException::UNSUPPORTED);
+ } elseif ($class instanceof Dummy\ReflectionClass) {
+ throw new Exception\RuntimeException('Class does not exist.', Exception\RuntimeException::DOES_NOT_EXIST);
+ }
+
+ if ($return) {
+ return $class->__toString();
+ }
+
+ echo $class->__toString();
+ }
+
+ /**
+ * Returns if the class definition is complete.
+ *
+ * @return boolean
+ */
+ public function isComplete()
+ {
+ if (!$this->definitionComplete) {
+ if (null !== $this->parentClassName && !$this->getParentClass()->isComplete()) {
+ return false;
+ }
+
+ foreach ($this->getOwnInterfaces() as $interface) {
+ if (!$interface->isComplete()) {
+ return false;
+ }
+ }
+
+ $this->definitionComplete = true;
+ }
+
+ return $this->definitionComplete;
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->aliases;
+ }
+
+ /**
+ * Processes the parent reflection object.
+ *
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionClass
+ * @throws \TokenReflection\ParseException On invalid parent reflection provided
+ */
+ protected function processParent(IReflection $parent, Stream $tokenStream)
+ {
+ if (!$parent instanceof ReflectionFileNamespace) {
+ throw new Exception\ParseException($this, $tokenStream, sprintf('Invalid parent reflection provided: "%s".', get_class($parent)), Exception\ParseException::INVALID_PARENT);
+ }
+
+ $this->namespaceName = $parent->getName();
+ $this->aliases = $parent->getNamespaceAliases();
+ return parent::processParent($parent, $tokenStream);
+ }
+
+ /**
+ * Parses reflected element metadata from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionClass
+ */
+ protected function parse(Stream $tokenStream, IReflection $parent)
+ {
+ return $this
+ ->parseModifiers($tokenStream)
+ ->parseName($tokenStream)
+ ->parseParent($tokenStream, $parent)
+ ->parseInterfaces($tokenStream, $parent);
+ }
+
+ /**
+ * Parses class modifiers (abstract, final) and class type (class, interface).
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionClass
+ */
+ private function parseModifiers(Stream $tokenStream)
+ {
+ while (true) {
+ switch ($tokenStream->getType()) {
+ case null:
+ break 2;
+ case T_ABSTRACT:
+ $this->modifiers = InternalReflectionClass::IS_EXPLICIT_ABSTRACT;
+ break;
+ case T_FINAL:
+ $this->modifiers = InternalReflectionClass::IS_FINAL;
+ break;
+ case T_INTERFACE:
+ $this->modifiers = self::IS_INTERFACE;
+ $this->type = self::IS_INTERFACE;
+ $tokenStream->skipWhitespaces(true);
+ break 2;
+ case T_TRAIT:
+ $this->modifiers = self::IS_TRAIT;
+ $this->type = self::IS_TRAIT;
+ $tokenStream->skipWhitespaces(true);
+ break 2;
+ case T_CLASS:
+ $tokenStream->skipWhitespaces(true);
+ break 2;
+ default:
+ break;
+ }
+
+ $tokenStream->skipWhitespaces(true);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Parses the class/interface name.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionClass
+ * @throws \TokenReflection\Exception\ParseException If the class name could not be determined.
+ */
+ protected function parseName(Stream $tokenStream)
+ {
+ if (!$tokenStream->is(T_STRING)) {
+ throw new Exception\ParseException($this, $tokenStream, 'Unexpected token found.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ if ($this->namespaceName === ReflectionNamespace::NO_NAMESPACE_NAME) {
+ $this->name = $tokenStream->getTokenValue();
+ } else {
+ $this->name = $this->namespaceName . '\\' . $tokenStream->getTokenValue();
+ }
+
+ $tokenStream->skipWhitespaces(true);
+
+ return $this;
+ }
+
+ /**
+ * Parses the parent class.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionClass
+ */
+ private function parseParent(Stream $tokenStream, ReflectionElement $parent = null)
+ {
+ if (!$tokenStream->is(T_EXTENDS)) {
+ return $this;
+ }
+
+ while (true) {
+ $tokenStream->skipWhitespaces(true);
+
+ $parentClassName = '';
+ while (true) {
+ switch ($tokenStream->getType()) {
+ case T_STRING:
+ case T_NS_SEPARATOR:
+ $parentClassName .= $tokenStream->getTokenValue();
+ break;
+ default:
+ break 2;
+ }
+
+ $tokenStream->skipWhitespaces(true);
+ }
+
+ $parentClassName = Resolver::resolveClassFQN($parentClassName, $this->aliases, $this->namespaceName);
+
+ if ($this->isInterface()) {
+ $this->interfaces[] = $parentClassName;
+
+ if (',' === $tokenStream->getTokenValue()) {
+ continue;
+ }
+ } else {
+ $this->parentClassName = $parentClassName;
+ }
+
+ break;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Parses implemented interfaces.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionClass
+ * @throws \TokenReflection\Exception\ParseException On error while parsing interfaces.
+ */
+ private function parseInterfaces(Stream $tokenStream, ReflectionElement $parent = null)
+ {
+ if (!$tokenStream->is(T_IMPLEMENTS)) {
+ return $this;
+ }
+
+ if ($this->isInterface()) {
+ throw new Exception\ParseException($this, $tokenStream, 'Interfaces cannot implement interfaces.', Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ while (true) {
+ $interfaceName = '';
+
+ $tokenStream->skipWhitespaces(true);
+ while (true) {
+ switch ($tokenStream->getType()) {
+ case T_STRING:
+ case T_NS_SEPARATOR:
+ $interfaceName .= $tokenStream->getTokenValue();
+ break;
+ default:
+ break 2;
+ }
+
+ $tokenStream->skipWhitespaces(true);
+ }
+
+ $this->interfaces[] = Resolver::resolveClassFQN($interfaceName, $this->aliases, $this->namespaceName);
+
+ $type = $tokenStream->getType();
+ if ('{' === $type) {
+ break;
+ } elseif (',' !== $type) {
+ throw new Exception\ParseException($this, $tokenStream, 'Unexpected token found, expected "{" or ";".', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Parses child reflection objects from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionClass
+ * @throws \TokenReflection\Exception\ParseException If a parse error was detected.
+ */
+ protected function parseChildren(Stream $tokenStream, IReflection $parent)
+ {
+ while (true) {
+ switch ($type = $tokenStream->getType()) {
+ case null:
+ break 2;
+ case T_COMMENT:
+ case T_DOC_COMMENT:
+ $docblock = $tokenStream->getTokenValue();
+ if (preg_match('~^' . preg_quote(self::DOCBLOCK_TEMPLATE_START, '~') . '~', $docblock)) {
+ array_unshift($this->docblockTemplates, new ReflectionAnnotation($this, $docblock));
+ } elseif (self::DOCBLOCK_TEMPLATE_END === $docblock) {
+ array_shift($this->docblockTemplates);
+ }
+ $tokenStream->next();
+ break;
+ case '}':
+ break 2;
+ case T_PUBLIC:
+ case T_PRIVATE:
+ case T_PROTECTED:
+ case T_STATIC:
+ case T_VAR:
+ case T_VARIABLE:
+ static $searching = array(T_VARIABLE => true, T_FUNCTION => true);
+
+ if (T_VAR !== $tokenStream->getType()) {
+ $position = $tokenStream->key();
+ while (null !== ($type = $tokenStream->getType($position)) && !isset($searching[$type])) {
+ $position++;
+ }
+ }
+
+ if (T_VARIABLE === $type || T_VAR === $type) {
+ $property = new ReflectionProperty($tokenStream, $this->getBroker(), $this);
+ $this->properties[$property->getName()] = $property;
+ $tokenStream->next();
+ break;
+ }
+ // Break missing on purpose
+ case T_FINAL:
+ case T_ABSTRACT:
+ case T_FUNCTION:
+ $method = new ReflectionMethod($tokenStream, $this->getBroker(), $this);
+ $this->methods[$method->getName()] = $method;
+ $tokenStream->next();
+ break;
+ case T_CONST:
+ $tokenStream->skipWhitespaces(true);
+ while ($tokenStream->is(T_STRING)) {
+ $constant = new ReflectionConstant($tokenStream, $this->getBroker(), $this);
+ $this->constants[$constant->getName()] = $constant;
+ if ($tokenStream->is(',')) {
+ $tokenStream->skipWhitespaces(true);
+ } else {
+ $tokenStream->next();
+ }
+ }
+ break;
+ case T_USE:
+ $tokenStream->skipWhitespaces(true);
+
+ while (true) {
+ $traitName = '';
+ $type = $tokenStream->getType();
+ while (T_STRING === $type || T_NS_SEPARATOR === $type) {
+ $traitName .= $tokenStream->getTokenValue();
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+ }
+
+ if ('' === trim($traitName, '\\')) {
+ throw new Exception\ParseException($this, $tokenStream, 'An empty trait name found.', Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ $this->traits[] = Resolver::resolveClassFQN($traitName, $this->aliases, $this->namespaceName);
+
+ if (';' === $type) {
+ // End of "use"
+ $tokenStream->skipWhitespaces();
+ break;
+ } elseif (',' === $type) {
+ // Next trait name follows
+ $tokenStream->skipWhitespaces();
+ continue;
+ } elseif ('{' !== $type) {
+ // Unexpected token
+ throw new Exception\ParseException($this, $tokenStream, 'Unexpected token found: "%s".', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ // Aliases definition
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+ while (true) {
+ if ('}' === $type) {
+ $tokenStream->skipWhitespaces();
+ break 2;
+ }
+
+ $leftSide = '';
+ $rightSide = array('', null);
+ $alias = true;
+
+ while (T_STRING === $type || T_NS_SEPARATOR === $type || T_DOUBLE_COLON === $type) {
+ $leftSide .= $tokenStream->getTokenValue();
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+ }
+
+ if (T_INSTEADOF === $type) {
+ $alias = false;
+ } elseif (T_AS !== $type) {
+ throw new Exception\ParseException($this, $tokenStream, 'Unexpected token found.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+
+ if (T_PUBLIC === $type || T_PROTECTED === $type || T_PRIVATE === $type) {
+ if (!$alias) {
+ throw new Exception\ParseException($this, $tokenStream, 'Unexpected token found.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ switch ($type) {
+ case T_PUBLIC:
+ $type = InternalReflectionMethod::IS_PUBLIC;
+ break;
+ case T_PROTECTED:
+ $type = InternalReflectionMethod::IS_PROTECTED;
+ break;
+ case T_PRIVATE:
+ $type = InternalReflectionMethod::IS_PRIVATE;
+ break;
+ default:
+ break;
+ }
+
+ $rightSide[1] = $type;
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+ }
+
+ while (T_STRING === $type || (T_NS_SEPARATOR === $type && !$alias)) {
+ $rightSide[0] .= $tokenStream->getTokenValue();
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+ }
+
+ if (empty($leftSide)) {
+ throw new Exception\ParseException($this, $tokenStream, 'An empty method name was found.', Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ if ($alias) {
+ // Alias
+ if ($pos = strpos($leftSide, '::')) {
+ $methodName = substr($leftSide, $pos + 2);
+ $className = Resolver::resolveClassFQN(substr($leftSide, 0, $pos), $this->aliases, $this->namespaceName);
+ $leftSide = $className . '::' . $methodName;
+
+ $this->traitAliases[$rightSide[0]] = $leftSide;
+ } else {
+ $this->traitAliases[$rightSide[0]] = '(null)::' . $leftSide;
+ }
+
+ $this->traitImports[$leftSide][] = $rightSide;
+ } else {
+ // Insteadof
+ if ($pos = strpos($leftSide, '::')) {
+ $methodName = substr($leftSide, $pos + 2);
+ } else {
+ throw new Exception\ParseException($this, $tokenStream, 'A T_DOUBLE_COLON has to be present when using T_INSTEADOF.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ $this->traitImports[Resolver::resolveClassFQN($rightSide[0], $this->aliases, $this->namespaceName) . '::' . $methodName][] = null;
+ }
+
+ if (',' === $type) {
+ $tokenStream->skipWhitespaces(true);
+ continue;
+ } elseif (';' !== $type) {
+ throw new Exception\ParseException($this, $tokenStream, 'Unexpected token found.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ $type = $tokenStream->skipWhitespaces()->getType();
+ }
+ }
+
+ break;
+ default:
+ $tokenStream->next();
+ break;
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionConstant.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionConstant.php
new file mode 100644
index 0000000..dbd06ad
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionConstant.php
@@ -0,0 +1,392 @@
+getName();
+ if (null !== $this->namespaceName && $this->namespaceName !== ReflectionNamespace::NO_NAMESPACE_NAME) {
+ $name = substr($name, strlen($this->namespaceName) + 1);
+ }
+
+ return $name;
+ }
+
+ /**
+ * Returns the name of the declaring class.
+ *
+ * @return string|null
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->declaringClassName;
+ }
+
+ /**
+ * Returns a reflection of the declaring class.
+ *
+ * @return \TokenReflection\ReflectionClass|null
+ */
+ public function getDeclaringClass()
+ {
+ if (null === $this->declaringClassName) {
+ return null;
+ }
+
+ return $this->getBroker()->getClass($this->declaringClassName);
+ }
+
+ /**
+ * Returns the namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return null === $this->namespaceName || $this->namespaceName === ReflectionNamespace::NO_NAMESPACE_NAME ? '' : $this->namespaceName;
+ }
+
+ /**
+ * Returns if the class is defined within a namespace.
+ *
+ * @return boolean
+ */
+ public function inNamespace()
+ {
+ return '' !== $this->getNamespaceName();
+ }
+
+ /**
+ * Returns the constant value.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ if (is_array($this->valueDefinition)) {
+ $this->value = Resolver::getValueDefinition($this->valueDefinition, $this);
+ $this->valueDefinition = Resolver::getSourceCode($this->valueDefinition);
+ }
+
+ return $this->value;
+ }
+
+ /**
+ * Returns the constant value definition.
+ *
+ * @return string
+ */
+ public function getValueDefinition()
+ {
+ return is_array($this->valueDefinition) ? Resolver::getSourceCode($this->valueDefinition) : $this->valueDefinition;
+ }
+
+ /**
+ * Returns the originaly provided value definition.
+ *
+ * @return string
+ */
+ public function getOriginalValueDefinition()
+ {
+ return $this->valueDefinition;
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf(
+ "Constant [ %s %s ] { %s }\n",
+ strtolower(gettype($this->getValue())),
+ $this->getName(),
+ $this->getValue()
+ );
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string|object|null $class Class name, class instance or null
+ * @param string $constant Constant name
+ * @param boolean $return Return the export instead of outputting it
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If requested parameter doesn't exist.
+ */
+ public static function export(Broker $broker, $class, $constant, $return = false)
+ {
+ $className = is_object($class) ? get_class($class) : $class;
+ $constantName = $constant;
+
+ if (null === $className) {
+ $constant = $broker->getConstant($constantName);
+ if (null === $constant) {
+ throw new Exception\RuntimeException('Constant does not exist.', Exception\RuntimeException::DOES_NOT_EXIST);
+ }
+ } else {
+ $class = $broker->getClass($className);
+ if ($class instanceof Invalid\ReflectionClass) {
+ throw new Exception\RuntimeException('Class is invalid.', Exception\RuntimeException::UNSUPPORTED);
+ } elseif ($class instanceof Dummy\ReflectionClass) {
+ throw new Exception\RuntimeException('Class does not exist.', Exception\RuntimeException::DOES_NOT_EXIST, $class);
+ }
+ $constant = $class->getConstantReflection($constantName);
+ }
+
+ if ($return) {
+ return $constant->__toString();
+ }
+
+ echo $constant->__toString();
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return null === $this->declaringClassName ? $this->aliases : $this->getDeclaringClass()->getNamespaceAliases();
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return null === $this->declaringClassName ? parent::getPrettyName() : sprintf('%s::%s', $this->declaringClassName, $this->name);
+ }
+
+ /**
+ * Returns if the constant definition is valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ return true;
+ }
+
+ /**
+ * Processes the parent reflection object.
+ *
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionElement
+ * @throws \TokenReflection\Exception\ParseException If an invalid parent reflection object was provided.
+ */
+ protected function processParent(IReflection $parent, Stream $tokenStream)
+ {
+ if ($parent instanceof ReflectionFileNamespace) {
+ $this->namespaceName = $parent->getName();
+ $this->aliases = $parent->getNamespaceAliases();
+ } elseif ($parent instanceof ReflectionClass) {
+ $this->declaringClassName = $parent->getName();
+ } else {
+ throw new Exception\ParseException($this, $tokenStream, sprintf('Invalid parent reflection provided: "%s".', get_class($parent)), Exception\ParseException::INVALID_PARENT);
+ }
+
+ return parent::processParent($parent, $tokenStream);
+ }
+
+ /**
+ * Find the appropriate docblock.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection
+ * @return \TokenReflection\ReflectionConstant
+ */
+ protected function parseDocComment(Stream $tokenStream, IReflection $parent)
+ {
+ $position = $tokenStream->key() - 1;
+ while ($position > 0 && !$tokenStream->is(T_CONST, $position)) {
+ $position--;
+ }
+
+ $actual = $tokenStream->key();
+
+ parent::parseDocComment($tokenStream->seek($position), $parent);
+
+ $tokenStream->seek($actual);
+
+ return $this;
+ }
+
+ /**
+ * Parses reflected element metadata from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionConstant
+ */
+ protected function parse(Stream $tokenStream, IReflection $parent)
+ {
+ if ($tokenStream->is(T_CONST)) {
+ $tokenStream->skipWhitespaces(true);
+ }
+
+ if (false === $this->docComment->getDocComment()) {
+ parent::parseDocComment($tokenStream, $parent);
+ }
+
+ return $this
+ ->parseName($tokenStream)
+ ->parseValue($tokenStream, $parent);
+ }
+
+ /**
+ * Parses the constant name.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionConstant
+ * @throws \TokenReflection\Exception\ParseReflection If the constant name could not be determined.
+ */
+ protected function parseName(Stream $tokenStream)
+ {
+ if (!$tokenStream->is(T_STRING)) {
+ throw new Exception\ParseException($this, $tokenStream, 'The constant name could not be determined.', Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ if (null === $this->namespaceName || $this->namespaceName === ReflectionNamespace::NO_NAMESPACE_NAME) {
+ $this->name = $tokenStream->getTokenValue();
+ } else {
+ $this->name = $this->namespaceName . '\\' . $tokenStream->getTokenValue();
+ }
+
+ $tokenStream->skipWhitespaces(true);
+
+ return $this;
+ }
+
+ /**
+ * Parses the constant value.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionConstant
+ * @throws \TokenReflection\Exception\ParseException If the constant value could not be determined.
+ */
+ private function parseValue(Stream $tokenStream, IReflection $parent)
+ {
+ if (!$tokenStream->is('=')) {
+ throw new Exception\ParseException($this, $tokenStream, 'Could not find the definition start.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ $tokenStream->skipWhitespaces(true);
+
+ static $acceptedTokens = array(
+ '-' => true,
+ '+' => true,
+ T_STRING => true,
+ T_NS_SEPARATOR => true,
+ T_CONSTANT_ENCAPSED_STRING => true,
+ T_DNUMBER => true,
+ T_LNUMBER => true,
+ T_DOUBLE_COLON => true,
+ T_CLASS_C => true,
+ T_DIR => true,
+ T_FILE => true,
+ T_FUNC_C => true,
+ T_LINE => true,
+ T_METHOD_C => true,
+ T_NS_C => true,
+ T_TRAIT_C => true
+ );
+
+ while (null !== ($type = $tokenStream->getType())) {
+ if (T_START_HEREDOC === $type) {
+ $this->valueDefinition[] = $tokenStream->current();
+ while (null !== $type && T_END_HEREDOC !== $type) {
+ $tokenStream->next();
+ $this->valueDefinition[] = $tokenStream->current();
+ $type = $tokenStream->getType();
+ };
+ $tokenStream->next();
+ } elseif (isset($acceptedTokens[$type])) {
+ $this->valueDefinition[] = $tokenStream->current();
+ $tokenStream->next();
+ } elseif ($tokenStream->isWhitespace(true)) {
+ $tokenStream->skipWhitespaces(true);
+ } else {
+ break;
+ }
+ }
+
+ if (empty($this->valueDefinition)) {
+ throw new Exception\ParseException($this, $tokenStream, 'Value definition is empty.', Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ $value = $tokenStream->getTokenValue();
+ if (null === $type || (',' !== $value && ';' !== $value)) {
+ throw new Exception\ParseException($this, $tokenStream, 'Invalid value definition.', Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionElement.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionElement.php
new file mode 100644
index 0000000..b0fb331
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionElement.php
@@ -0,0 +1,352 @@
+count()) {
+ throw new Exception\ParseException($this, $tokenStream, 'Reflection token stream must not be empty.', Exception\ParseException::INVALID_ARGUMENT);
+ }
+
+ parent::__construct($tokenStream, $broker, $parent);
+ }
+
+ /**
+ * Parses the token substream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ */
+ final protected function parseStream(Stream $tokenStream, IReflection $parent = null)
+ {
+ $this->fileName = $tokenStream->getFileName();
+
+ $this
+ ->processParent($parent, $tokenStream)
+ ->parseStartLine($tokenStream)
+ ->parseDocComment($tokenStream, $parent)
+ ->parse($tokenStream, $parent)
+ ->parseChildren($tokenStream, $parent)
+ ->parseEndLine($tokenStream);
+ }
+
+ /**
+ * Returns the file name the reflection object is defined in.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->fileName;
+ }
+
+ /**
+ * Returns a file reflection.
+ *
+ * @return \TokenReflection\ReflectionFile
+ * @throws \TokenReflection\Exception\RuntimeException If the file is not stored inside the broker
+ */
+ public function getFileReflection()
+ {
+ return $this->getBroker()->getFile($this->fileName);
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return integer
+ */
+ public function getStartLine()
+ {
+ return $this->startLine;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return integer
+ */
+ public function getEndLine()
+ {
+ return $this->endLine;
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * Alwyas returns null - everything is user defined.
+ *
+ * @return null
+ */
+ public function getExtension()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * Alwyas returns false - everything is user defined.
+ *
+ * @return boolean
+ */
+ public function getExtensionName()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the appropriate source code part.
+ *
+ * @return string
+ */
+ public function getSource()
+ {
+ return $this->broker->getFileTokens($this->getFileName())->getSourcePart($this->startPosition, $this->endPosition);
+ }
+
+ /**
+ * Returns the start position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getStartPosition()
+ {
+ return $this->startPosition;
+ }
+
+ /**
+ * Returns the end position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getEndPosition()
+ {
+ return $this->endPosition;
+ }
+
+ /**
+ * Returns the stack of docblock templates.
+ *
+ * @return array
+ */
+ protected function getDocblockTemplates()
+ {
+ return $this->docblockTemplates;
+ }
+
+ /**
+ * Processes the parent reflection object.
+ *
+ * @param \TokenReflection\Reflection $parent Parent reflection object
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionElement
+ */
+ protected function processParent(IReflection $parent, Stream $tokenStream)
+ {
+ // To be defined in child classes
+ return $this;
+ }
+
+ /**
+ * Find the appropriate docblock.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection
+ * @return \TokenReflection\ReflectionElement
+ */
+ protected function parseDocComment(Stream $tokenStream, IReflection $parent)
+ {
+ if ($this instanceof ReflectionParameter) {
+ $this->docComment = new ReflectionAnnotation($this);
+ return $this;
+ }
+
+ $position = $tokenStream->key();
+
+ if ($tokenStream->is(T_DOC_COMMENT, $position - 1)) {
+ $value = $tokenStream->getTokenValue($position - 1);
+ if (self::DOCBLOCK_TEMPLATE_END !== $value) {
+ $this->docComment = new ReflectionAnnotation($this, $value);
+ $this->startPosition--;
+ }
+ } elseif ($tokenStream->is(T_DOC_COMMENT, $position - 2)) {
+ $value = $tokenStream->getTokenValue($position - 2);
+ if (self::DOCBLOCK_TEMPLATE_END !== $value) {
+ $this->docComment = new ReflectionAnnotation($this, $value);
+ $this->startPosition -= 2;
+ }
+ } elseif ($tokenStream->is(T_COMMENT, $position - 1) && preg_match('~^' . preg_quote(self::DOCBLOCK_TEMPLATE_START, '~') . '~', $tokenStream->getTokenValue($position - 1))) {
+ $this->docComment = new ReflectionAnnotation($this, $tokenStream->getTokenValue($position - 1));
+ $this->startPosition--;
+ } elseif ($tokenStream->is(T_COMMENT, $position - 2) && preg_match('~^' . preg_quote(self::DOCBLOCK_TEMPLATE_START, '~') . '~', $tokenStream->getTokenValue($position - 2))) {
+ $this->docComment = new ReflectionAnnotation($this, $tokenStream->getTokenValue($position - 2));
+ $this->startPosition -= 2;
+ }
+
+ if (null === $this->docComment) {
+ $this->docComment = new ReflectionAnnotation($this);
+ }
+
+ if ($parent instanceof ReflectionElement) {
+ $this->docComment->setTemplates($parent->getDocblockTemplates());
+ }
+
+ return $this;
+ }
+
+ /**
+ * Saves the start line number.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token susbtream
+ * @return \TokenReflection\ReflectionElement
+ */
+ private final function parseStartLine(Stream $tokenStream)
+ {
+ $token = $tokenStream->current();
+ $this->startLine = $token[2];
+
+ $this->startPosition = $tokenStream->key();
+
+ return $this;
+ }
+
+ /**
+ * Saves the end line number.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token susbtream
+ * @return \TokenReflection\ReflectionElement
+ */
+ private final function parseEndLine(Stream $tokenStream)
+ {
+ $token = $tokenStream->current();
+ $this->endLine = $token[2];
+
+ $this->endPosition = $tokenStream->key();
+
+ return $this;
+ }
+
+ /**
+ * Parses reflected element metadata from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionElement
+ */
+ abstract protected function parse(Stream $tokenStream, IReflection $parent);
+
+ /**
+ * Parses the reflection object name.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionElement
+ */
+ abstract protected function parseName(Stream $tokenStream);
+
+ /**
+ * Parses child reflection objects from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\Reflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionElement
+ */
+ protected function parseChildren(Stream $tokenStream, IReflection $parent)
+ {
+ // To be defined in child classes
+ return $this;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFile.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFile.php
new file mode 100644
index 0000000..863b358
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFile.php
@@ -0,0 +1,144 @@
+namespaces;
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @throws \TokenReflection\Exception\RuntimeException If the method is called, because it's unsupported.
+ */
+ public function __toString()
+ {
+ throw new Exception\RuntimeException('Casting to string is not supported.', Exception\RuntimeException::UNSUPPORTED, $this);
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string $argument Reflection object name
+ * @param boolean $return Return the export instead of outputting it
+ * @throws \TokenReflection\Exception\RuntimeException If the method is called, because it's unsupported.
+ */
+ public static function export(Broker $broker, $argument, $return = false)
+ {
+ throw new Exception\RuntimeException('Export is not supported.', Exception\RuntimeException::UNSUPPORTED);
+ }
+
+ /**
+ * Outputs the file source code.
+ *
+ * @return string
+ */
+ public function getSource()
+ {
+ return (string) $this->broker->getFileTokens($this->getName());
+ }
+
+ /**
+ * Parses the token substream and prepares namespace reflections from the file.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionFile
+ */
+ protected function parseStream(Stream $tokenStream, IReflection $parent = null)
+ {
+ $this->name = $tokenStream->getFileName();
+
+ if (1 >= $tokenStream->count()) {
+ // No PHP content
+ $this->docComment = new ReflectionAnnotation($this, null);
+ return $this;
+ }
+
+ $docCommentPosition = null;
+
+ if (!$tokenStream->is(T_OPEN_TAG)) {
+ $this->namespaces[] = new ReflectionFileNamespace($tokenStream, $this->broker, $this);
+ } else {
+ $tokenStream->skipWhitespaces();
+
+ while (null !== ($type = $tokenStream->getType())) {
+ switch ($type) {
+ case T_DOC_COMMENT:
+ if (null === $docCommentPosition) {
+ $docCommentPosition = $tokenStream->key();
+ }
+ case T_WHITESPACE:
+ case T_COMMENT:
+ break;
+ case T_DECLARE:
+ // Intentionally twice call of skipWhitespaces()
+ $tokenStream
+ ->skipWhitespaces()
+ ->findMatchingBracket()
+ ->skipWhitespaces()
+ ->skipWhitespaces();
+ break;
+ case T_NAMESPACE:
+ $docCommentPosition = $docCommentPosition ?: -1;
+ break 2;
+ default:
+ $docCommentPosition = $docCommentPosition ?: -1;
+ $this->namespaces[] = new ReflectionFileNamespace($tokenStream, $this->broker, $this);
+ break 2;
+ }
+
+ $tokenStream->skipWhitespaces();
+ }
+
+ while (null !== ($type = $tokenStream->getType())) {
+ if (T_NAMESPACE === $type) {
+ $this->namespaces[] = new ReflectionFileNamespace($tokenStream, $this->broker, $this);
+ } else {
+ $tokenStream->skipWhitespaces();
+ }
+ }
+ }
+
+ if (null !== $docCommentPosition && !empty($this->namespaces) && $docCommentPosition === $this->namespaces[0]->getStartPosition()) {
+ $docCommentPosition = null;
+ }
+ $this->docComment = new ReflectionAnnotation($this, null !== $docCommentPosition ? $tokenStream->getTokenValue($docCommentPosition) : null);
+
+ return $this;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFileNamespace.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFileNamespace.php
new file mode 100644
index 0000000..6304256
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFileNamespace.php
@@ -0,0 +1,412 @@
+classes;
+ }
+
+ /**
+ * Returns constant reflections.
+ *
+ * @return array
+ */
+ public function getConstants()
+ {
+ return $this->constants;
+ }
+
+ /**
+ * Returns function reflections.
+ *
+ * @return array
+ */
+ public function getFunctions()
+ {
+ return $this->functions;
+ }
+
+ /**
+ * Returns all imported namespaces and aliases.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->aliases;
+ }
+
+ /**
+ * Processes the parent reflection object.
+ *
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionElement
+ * @throws \TokenReflection\Exception\ParseException If an invalid parent reflection object was provided.
+ */
+ protected function processParent(IReflection $parent, Stream $tokenStream)
+ {
+ if (!$parent instanceof ReflectionFile) {
+ throw new Exception\ParseException($this, $tokenStream, 'The parent object has to be an instance of TokenReflection\ReflectionFile.', Exception\ParseException::INVALID_PARENT);
+ }
+
+ return parent::processParent($parent, $tokenStream);
+ }
+
+ /**
+ * Parses reflected element metadata from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionFileNamespace
+ */
+ protected function parse(Stream $tokenStream, IReflection $parent)
+ {
+ return $this->parseName($tokenStream);
+ }
+
+ /**
+ * Find the appropriate docblock.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection
+ * @return \TokenReflection\ReflectionElement
+ */
+ protected function parseDocComment(Stream $tokenStream, IReflection $parent)
+ {
+ if (!$tokenStream->is(T_NAMESPACE)) {
+ $this->docComment = new ReflectionAnnotation($this);
+ return $this;
+ } else {
+ return parent::parseDocComment($tokenStream, $parent);
+ }
+ }
+
+ /**
+ * Parses the namespace name.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionFileNamespace
+ * @throws \TokenReflection\Exception\ParseException If the namespace name could not be determined.
+ */
+ protected function parseName(Stream $tokenStream)
+ {
+ if (!$tokenStream->is(T_NAMESPACE)) {
+ $this->name = ReflectionNamespace::NO_NAMESPACE_NAME;
+ return $this;
+ }
+
+ $tokenStream->skipWhitespaces();
+
+ $name = '';
+ // Iterate over the token stream
+ while (true) {
+ switch ($tokenStream->getType()) {
+ // If the current token is a T_STRING, it is a part of the namespace name
+ case T_STRING:
+ case T_NS_SEPARATOR:
+ $name .= $tokenStream->getTokenValue();
+ break;
+ default:
+ // Stop iterating when other token than string or ns separator found
+ break 2;
+ }
+
+ $tokenStream->skipWhitespaces(true);
+ }
+
+ $name = ltrim($name, '\\');
+
+ if (empty($name)) {
+ $this->name = ReflectionNamespace::NO_NAMESPACE_NAME;
+ } else {
+ $this->name = $name;
+ }
+
+ if (!$tokenStream->is(';') && !$tokenStream->is('{')) {
+ throw new Exception\ParseException($this, $tokenStream, 'Invalid namespace name end, expecting ";" or "{".', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ $tokenStream->skipWhitespaces();
+
+ return $this;
+ }
+
+ /**
+ * Parses child reflection objects from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionFileNamespace
+ * @throws \TokenReflection\Exception\ParseException If child elements could not be parsed.
+ */
+ protected function parseChildren(Stream $tokenStream, IReflection $parent)
+ {
+ static $skipped = array(T_WHITESPACE => true, T_COMMENT => true, T_DOC_COMMENT => true);
+ $depth = 0;
+
+ $firstChild = null;
+
+ while (true) {
+ switch ($tokenStream->getType()) {
+ case T_USE:
+ while (true) {
+ $namespaceName = '';
+ $alias = null;
+
+ $tokenStream->skipWhitespaces(true);
+
+ while (true) {
+ switch ($tokenStream->getType()) {
+ case T_STRING:
+ case T_NS_SEPARATOR:
+ $namespaceName .= $tokenStream->getTokenValue();
+ break;
+ default:
+ break 2;
+ }
+ $tokenStream->skipWhitespaces(true);
+ }
+ $namespaceName = ltrim($namespaceName, '\\');
+
+ if (empty($namespaceName)) {
+ throw new Exception\ParseException($this, $tokenStream, 'Imported namespace name could not be determined.', Exception\ParseException::LOGICAL_ERROR);
+ } elseif ('\\' === substr($namespaceName, -1)) {
+ throw new Exception\ParseException($this, $tokenStream, sprintf('Invalid namespace name "%s".', $namespaceName), Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ if ($tokenStream->is(T_AS)) {
+ // Alias defined
+ $tokenStream->skipWhitespaces(true);
+
+ if (!$tokenStream->is(T_STRING)) {
+ throw new Exception\ParseException($this, $tokenStream, sprintf('The imported namespace "%s" seems aliased but the alias name could not be determined.', $namespaceName), Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ $alias = $tokenStream->getTokenValue();
+
+ $tokenStream->skipWhitespaces(true);
+ } else {
+ // No explicit alias
+ if (false !== ($pos = strrpos($namespaceName, '\\'))) {
+ $alias = substr($namespaceName, $pos + 1);
+ } else {
+ $alias = $namespaceName;
+ }
+ }
+
+ if (isset($this->aliases[$alias])) {
+ throw new Exception\ParseException($this, $tokenStream, sprintf('Namespace alias "%s" already defined.', $alias), Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ $this->aliases[$alias] = $namespaceName;
+
+ $type = $tokenStream->getType();
+ if (';' === $type) {
+ $tokenStream->skipWhitespaces();
+ break 2;
+ } elseif (',' === $type) {
+ // Next namespace in the current "use" definition
+ continue;
+ }
+
+ throw new Exception\ParseException($this, $tokenStream, 'Unexpected token found.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ case T_COMMENT:
+ case T_DOC_COMMENT:
+ $docblock = $tokenStream->getTokenValue();
+ if (preg_match('~^' . preg_quote(self::DOCBLOCK_TEMPLATE_START, '~') . '~', $docblock)) {
+ array_unshift($this->docblockTemplates, new ReflectionAnnotation($this, $docblock));
+ } elseif (self::DOCBLOCK_TEMPLATE_END === $docblock) {
+ array_shift($this->docblockTemplates);
+ }
+ $tokenStream->next();
+ break;
+ case '{':
+ $tokenStream->next();
+ $depth++;
+ break;
+ case '}':
+ if (0 === $depth--) {
+ break 2;
+ }
+
+ $tokenStream->next();
+ break;
+ case null:
+ case T_NAMESPACE:
+ break 2;
+ case T_ABSTRACT:
+ case T_FINAL:
+ case T_CLASS:
+ case T_TRAIT:
+ case T_INTERFACE:
+ $class = new ReflectionClass($tokenStream, $this->getBroker(), $this);
+ $firstChild = $firstChild ?: $class;
+
+ $className = $class->getName();
+ if (isset($this->classes[$className])) {
+ if (!$this->classes[$className] instanceof Invalid\ReflectionClass) {
+ $this->classes[$className] = new Invalid\ReflectionClass($className, $this->classes[$className]->getFileName(), $this->getBroker());
+ }
+
+ if (!$this->classes[$className]->hasReasons()) {
+ $this->classes[$className]->addReason(new Exception\ParseException(
+ $this,
+ $tokenStream,
+ sprintf('Class %s is defined multiple times in the file.', $className),
+ Exception\ParseException::ALREADY_EXISTS
+ ));
+ }
+ } else {
+ $this->classes[$className] = $class;
+ }
+ $tokenStream->next();
+ break;
+ case T_CONST:
+ $tokenStream->skipWhitespaces(true);
+ do {
+ $constant = new ReflectionConstant($tokenStream, $this->getBroker(), $this);
+ $firstChild = $firstChild ?: $constant;
+
+ $constantName = $constant->getName();
+ if (isset($this->constants[$constantName])) {
+ if (!$this->constants[$constantName] instanceof Invalid\ReflectionConstant) {
+ $this->constants[$constantName] = new Invalid\ReflectionConstant($constantName, $this->constants[$constantName]->getFileName(), $this->getBroker());
+ }
+
+ if (!$this->constants[$constantName]->hasReasons()) {
+ $this->constants[$constantName]->addReason(new Exception\ParseException(
+ $this,
+ $tokenStream,
+ sprintf('Constant %s is defined multiple times in the file.', $constantName),
+ Exception\ParseException::ALREADY_EXISTS
+ ));
+ }
+ } else {
+ $this->constants[$constantName] = $constant;
+ }
+ if ($tokenStream->is(',')) {
+ $tokenStream->skipWhitespaces(true);
+ } else {
+ $tokenStream->next();
+ }
+ } while ($tokenStream->is(T_STRING));
+ break;
+ case T_FUNCTION:
+ $position = $tokenStream->key() + 1;
+ while (isset($skipped[$type = $tokenStream->getType($position)])) {
+ $position++;
+ }
+ if ('(' === $type) {
+ // Skipping anonymous functions
+
+ $tokenStream
+ ->seek($position)
+ ->findMatchingBracket()
+ ->skipWhiteSpaces(true);
+
+ if ($tokenStream->is(T_USE)) {
+ $tokenStream
+ ->skipWhitespaces(true)
+ ->findMatchingBracket()
+ ->skipWhitespaces(true);
+ }
+
+ $tokenStream
+ ->findMatchingBracket()
+ ->next();
+
+ continue;
+ }
+
+ $function = new ReflectionFunction($tokenStream, $this->getBroker(), $this);
+ $firstChild = $firstChild ?: $function;
+
+ $functionName = $function->getName();
+ if (isset($this->functions[$functionName])) {
+ if (!$this->functions[$functionName] instanceof Invalid\ReflectionFunction) {
+ $this->functions[$functionName] = new Invalid\ReflectionFunction($functionName, $this->functions[$functionName]->getFileName(), $this->getBroker());
+ }
+
+ if (!$this->functions[$functionName]->hasReasons()) {
+ $this->functions[$functionName]->addReason(new Exception\ParseException(
+ $this,
+ $tokenStream,
+ sprintf('Function %s is defined multiple times in the file.', $functionName),
+ Exception\ParseException::ALREADY_EXISTS
+ ));
+ }
+ } else {
+ $this->functions[$functionName] = $function;
+ }
+ $tokenStream->next();
+ break;
+ default:
+ $tokenStream->next();
+ break;
+ }
+ }
+
+ if ($firstChild) {
+ $this->startPosition = min($this->startPosition, $firstChild->getStartPosition());
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFunction.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFunction.php
new file mode 100644
index 0000000..7ef59af
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFunction.php
@@ -0,0 +1,204 @@
+hasAnnotation('disabled');
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $parameters = '';
+ if ($this->getNumberOfParameters() > 0) {
+ $buffer = '';
+ foreach ($this->getParameters() as $parameter) {
+ $buffer .= "\n " . $parameter->__toString();
+ }
+ $parameters = sprintf(
+ "\n\n - Parameters [%d] {%s\n }",
+ $this->getNumberOfParameters(),
+ $buffer
+ );
+ }
+ return sprintf(
+ "%sFunction [ function %s%s ] {\n @@ %s %d - %d%s\n}\n",
+ $this->getDocComment() ? $this->getDocComment() . "\n" : '',
+ $this->returnsReference() ? '&' : '',
+ $this->getName(),
+ $this->getFileName(),
+ $this->getStartLine(),
+ $this->getEndLine(),
+ $parameters
+ );
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string $function Function name
+ * @param boolean $return Return the export instead of outputting it
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If requested parameter doesn't exist.
+ */
+ public static function export(Broker $broker, $function, $return = false)
+ {
+ $functionName = $function;
+
+ $function = $broker->getFunction($functionName);
+ if (null === $function) {
+ throw new Exception\RuntimeException(sprintf('Function %s() does not exist.', $functionName), Exception\RuntimeException::DOES_NOT_EXIST);
+ }
+
+ if ($return) {
+ return $function->__toString();
+ }
+
+ echo $function->__toString();
+ }
+
+ /**
+ * Calls the function.
+ *
+ * @return mixed
+ */
+ public function invoke()
+ {
+ return $this->invokeArgs(func_get_args());
+ }
+
+ /**
+ * Calls the function.
+ *
+ * @param array $args Function parameter values
+ * @return mixed
+ * @throws \TokenReflection\Exception\RuntimeException If the required function does not exist.
+ */
+ public function invokeArgs(array $args = array())
+ {
+ if (!function_exists($this->getName())) {
+ throw new Exception\RuntimeException('Could not invoke function; function is not defined.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ return call_user_func_array($this->getName(), $args);
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->aliases;
+ }
+
+ /**
+ * Returns the function/method as closure.
+ *
+ * @return \Closure
+ */
+ public function getClosure()
+ {
+ if (!function_exists($this->getName())) {
+ throw new Exception\RuntimeException('Could not invoke function; function is not defined.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $that = $this;
+ return function() use ($that) {
+ return $that->invokeArgs(func_get_args());
+ };
+ }
+
+ /**
+ * Returns the closure scope class.
+ *
+ * @return null
+ */
+ public function getClosureScopeClass()
+ {
+ return null;
+ }
+
+ /**
+ * Returns if the function definition is valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ return true;
+ }
+
+ /**
+ * Processes the parent reflection object.
+ *
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionElement
+ * @throws \TokenReflection\Exception\ParseException If an invalid parent reflection object was provided.
+ */
+ protected function processParent(IReflection $parent, Stream $tokenStream)
+ {
+ if (!$parent instanceof ReflectionFileNamespace) {
+ throw new Exception\ParseException($this, $tokenStream, 'The parent object has to be an instance of TokenReflection\ReflectionFileNamespace.', Exception\ParseException::INVALID_PARENT);
+ }
+
+ $this->namespaceName = $parent->getName();
+ $this->aliases = $parent->getNamespaceAliases();
+ return parent::processParent($parent, $tokenStream);
+ }
+
+ /**
+ * Parses reflected element metadata from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionFunction
+ */
+ protected function parse(Stream $tokenStream, IReflection $parent)
+ {
+ return $this
+ ->parseReturnsReference($tokenStream)
+ ->parseName($tokenStream);
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFunctionBase.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFunctionBase.php
new file mode 100644
index 0000000..786ab1e
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionFunctionBase.php
@@ -0,0 +1,440 @@
+namespaceName && ReflectionNamespace::NO_NAMESPACE_NAME !== $this->namespaceName) {
+ return $this->namespaceName . '\\' . $this->name;
+ }
+
+ return $this->name;
+ }
+
+ /**
+ * Returns the unqualified name (UQN).
+ *
+ * @return string
+ */
+ public function getShortName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return null === $this->namespaceName || $this->namespaceName === ReflectionNamespace::NO_NAMESPACE_NAME ? '' : $this->namespaceName;
+ }
+
+ /**
+ * Returns if the function/method is defined within a namespace.
+ *
+ * @return boolean
+ */
+ public function inNamespace()
+ {
+ return '' !== $this->getNamespaceName();
+ }
+
+ /**
+ * Returns if the function/method is a closure.
+ *
+ * @return boolean
+ */
+ public function isClosure()
+ {
+ return false;
+ }
+
+ /**
+ * Returns this pointer bound to closure.
+ *
+ * @return null
+ */
+ public function getClosureThis()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the closure scope class.
+ *
+ * @return string|null
+ */
+ public function getClosureScopeClass()
+ {
+ return null;
+ }
+
+ /**
+ * Returns if the function/method returns its value as reference.
+ *
+ * @return boolean
+ */
+ public function returnsReference()
+ {
+ return $this->returnsReference;
+ }
+
+ /**
+ * Returns a particular function/method parameter.
+ *
+ * @param integer|string $parameter Parameter name or position
+ * @return \TokenReflection\ReflectionParameter
+ * @throws \TokenReflection\Exception\RuntimeException If there is no parameter of the given name.
+ * @throws \TokenReflection\Exception\RuntimeException If there is no parameter at the given position.
+ */
+ public function getParameter($parameter)
+ {
+ if (is_numeric($parameter)) {
+ if (!isset($this->parameters[$parameter])) {
+ throw new Exception\RuntimeException(sprintf('There is no parameter at position "%d".', $parameter), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+ return $this->parameters[$parameter];
+ } else {
+ foreach ($this->parameters as $reflection) {
+ if ($reflection->getName() === $parameter) {
+ return $reflection;
+ }
+ }
+
+ throw new Exception\RuntimeException(sprintf('There is no parameter "%s".', $parameter), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+ }
+
+ /**
+ * Returns parameters.
+ *
+ * @return array
+ */
+ public function getParameters()
+ {
+ return $this->parameters;
+ }
+
+ /**
+ * Returns the number of parameters.
+ *
+ * @return integer
+ */
+ public function getNumberOfParameters()
+ {
+ return count($this->parameters);
+ }
+
+ /**
+ * Returns the number of required parameters.
+ *
+ * @return integer
+ */
+ public function getNumberOfRequiredParameters()
+ {
+ $count = 0;
+ array_walk($this->parameters, function(ReflectionParameter $parameter) use (&$count) {
+ if (!$parameter->isOptional()) {
+ $count++;
+ }
+ });
+ return $count;
+ }
+
+ /**
+ * Returns static variables.
+ *
+ * @return array
+ */
+ public function getStaticVariables()
+ {
+ if (empty($this->staticVariables) && !empty($this->staticVariablesDefinition)) {
+ foreach ($this->staticVariablesDefinition as $variableName => $variableDefinition) {
+ $this->staticVariables[$variableName] = Resolver::getValueDefinition($variableDefinition, $this);
+ }
+ }
+
+ return $this->staticVariables;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->name . '()';
+ }
+
+ /**
+ * Creates aliases to parameters.
+ *
+ * @throws \TokenReflection\Exception\RuntimeException When called on a ReflectionFunction instance.
+ */
+ protected final function aliasParameters()
+ {
+ if (!$this instanceof ReflectionMethod) {
+ throw new Exception\RuntimeException('Only method parameters can be aliased.', Exception\RuntimeException::UNSUPPORTED, $this);
+ }
+
+ foreach ($this->parameters as $index => $parameter) {
+ $this->parameters[$index] = $parameter->alias($this);
+ }
+ }
+
+ /**
+ * Parses if the function/method returns its value as reference.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionFunctionBase
+ * @throws \TokenReflection\Exception\ParseException If could not be determined if the function\method returns its value by reference.
+ */
+ final protected function parseReturnsReference(Stream $tokenStream)
+ {
+ if (!$tokenStream->is(T_FUNCTION)) {
+ throw new Exception\ParseException($this, $tokenStream, 'Could not find the function keyword.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ $tokenStream->skipWhitespaces(true);
+
+ $type = $tokenStream->getType();
+
+ if ('&' === $type) {
+ $this->returnsReference = true;
+ $tokenStream->skipWhitespaces(true);
+ } elseif (T_STRING !== $type) {
+ throw new Exception\ParseException($this, $tokenStream, 'Unexpected token found.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Parses the function/method name.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionMethod
+ * @throws \TokenReflection\Exception\ParseException If the class name could not be determined.
+ */
+ final protected function parseName(Stream $tokenStream)
+ {
+ $this->name = $tokenStream->getTokenValue();
+
+ $tokenStream->skipWhitespaces(true);
+
+ return $this;
+ }
+
+ /**
+ * Parses child reflection objects from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionElement
+ */
+ final protected function parseChildren(Stream $tokenStream, IReflection $parent)
+ {
+ return $this
+ ->parseParameters($tokenStream)
+ ->parseStaticVariables($tokenStream);
+ }
+
+ /**
+ * Parses function/method parameters.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionFunctionBase
+ * @throws \TokenReflection\Exception\ParseException If parameters could not be parsed.
+ */
+ final protected function parseParameters(Stream $tokenStream)
+ {
+ if (!$tokenStream->is('(')) {
+ throw new Exception\ParseException($this, $tokenStream, 'Could find the start token.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ static $accepted = array(T_NS_SEPARATOR => true, T_STRING => true, T_ARRAY => true, T_CALLABLE => true, T_VARIABLE => true, '&' => true);
+
+ $tokenStream->skipWhitespaces(true);
+
+ while (null !== ($type = $tokenStream->getType()) && ')' !== $type) {
+ if (isset($accepted[$type])) {
+ $parameter = new ReflectionParameter($tokenStream, $this->getBroker(), $this);
+ $this->parameters[] = $parameter;
+ }
+
+ if ($tokenStream->is(')')) {
+ break;
+ }
+
+ $tokenStream->skipWhitespaces(true);
+ }
+
+ $tokenStream->skipWhitespaces();
+
+ return $this;
+ }
+
+ /**
+ * Parses static variables.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionFunctionBase
+ * @throws \TokenReflection\Exception\ParseException If static variables could not be parsed.
+ */
+ final protected function parseStaticVariables(Stream $tokenStream)
+ {
+ $type = $tokenStream->getType();
+ if ('{' === $type) {
+ if ($this->getBroker()->isOptionSet(Broker::OPTION_PARSE_FUNCTION_BODY)) {
+ $tokenStream->skipWhitespaces(true);
+
+ while ('}' !== ($type = $tokenStream->getType())) {
+ switch ($type) {
+ case T_STATIC:
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+ if (T_VARIABLE !== $type) {
+ // Late static binding
+ break;
+ }
+
+ while (T_VARIABLE === $type) {
+ $variableName = $tokenStream->getTokenValue();
+ $variableDefinition = array();
+
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+ if ('=' === $type) {
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+ $level = 0;
+ while ($tokenStream->valid()) {
+ switch ($type) {
+ case '(':
+ case '[':
+ case '{':
+ case T_CURLY_OPEN:
+ case T_DOLLAR_OPEN_CURLY_BRACES:
+ $level++;
+ break;
+ case ')':
+ case ']':
+ case '}':
+ $level--;
+ break;
+ case ';':
+ case ',':
+ if (0 === $level) {
+ break 2;
+ }
+ default:
+ break;
+ }
+
+ $variableDefinition[] = $tokenStream->current();
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+ }
+
+ if (!$tokenStream->valid()) {
+ throw new Exception\ParseException($this, $tokenStream, 'Invalid end of token stream.', Exception\ParseException::READ_BEYOND_EOS);
+ }
+ }
+
+ $this->staticVariablesDefinition[substr($variableName, 1)] = $variableDefinition;
+
+ if (',' === $type) {
+ $type = $tokenStream->skipWhitespaces(true)->getType();
+ } else {
+ break;
+ }
+ }
+
+ break;
+ case T_FUNCTION:
+ // Anonymous function -> skip to its end
+ if (!$tokenStream->find('{')) {
+ throw new Exception\ParseException($this, $tokenStream, 'Could not find beginning of the anonymous function.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+ // Break missing intentionally
+ case '{':
+ case '[':
+ case '(':
+ case T_CURLY_OPEN:
+ case T_DOLLAR_OPEN_CURLY_BRACES:
+ $tokenStream->findMatchingBracket()->skipWhitespaces(true);
+ break;
+ default:
+ $tokenStream->skipWhitespaces();
+ break;
+ }
+ }
+ } else {
+ $tokenStream->findMatchingBracket();
+ }
+ } elseif (';' !== $type) {
+ throw new Exception\ParseException($this, $tokenStream, 'Unexpected token found.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionMethod.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionMethod.php
new file mode 100644
index 0000000..eb70542
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionMethod.php
@@ -0,0 +1,775 @@
+declaringClassName ? null : $this->getBroker()->getClass($this->declaringClassName);
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->declaringClassName;
+ }
+
+ /**
+ * Returns method modifiers.
+ *
+ * @return integer
+ */
+ public function getModifiers()
+ {
+ if (!$this->modifiersComplete && !($this->modifiers & (self::ACCESS_LEVEL_CHANGED | self::IS_IMPLEMENTED_ABSTRACT))) {
+ $declaringClass = $this->getDeclaringClass();
+ $parentClass = $declaringClass->getParentClass();
+ if (false !== $parentClass && $parentClass->hasMethod($this->name)) {
+ $parentClassMethod = $parentClass->getMethod($this->name);
+
+ // Access level changed
+ if (($this->isPublic() || $this->isProtected()) && $parentClassMethod->is(self::ACCESS_LEVEL_CHANGED | InternalReflectionMethod::IS_PRIVATE)) {
+ $this->modifiers |= self::ACCESS_LEVEL_CHANGED;
+ }
+
+ // Implemented abstract
+ if ($parentClassMethod->isAbstract() && !$this->isAbstract()) {
+ $this->modifiers |= self::IS_IMPLEMENTED_ABSTRACT;
+ }
+ } else {
+ // Check if it is an implementation of an interface method
+ foreach ($declaringClass->getInterfaces() as $interface) {
+ if ($interface->hasOwnMethod($this->name)) {
+ $this->modifiers |= self::IS_IMPLEMENTED_ABSTRACT;
+ break;
+ }
+ }
+ }
+
+ // Set if modifiers definition is complete
+ $this->modifiersComplete = $this->isComplete() || (($this->modifiers & self::IS_IMPLEMENTED_ABSTRACT) && ($this->modifiers & self::ACCESS_LEVEL_CHANGED));
+ }
+
+ return $this->modifiers;
+ }
+
+ /**
+ * Returns if the method is abstract.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ return (bool) ($this->modifiers & InternalReflectionMethod::IS_ABSTRACT);
+ }
+
+ /**
+ * Returns if the method is final.
+ *
+ * @return boolean
+ */
+ public function isFinal()
+ {
+ return (bool) ($this->modifiers & InternalReflectionMethod::IS_FINAL);
+ }
+
+ /**
+ * Returns if the method is private.
+ *
+ * @return boolean
+ */
+ public function isPrivate()
+ {
+ return (bool) ($this->modifiers & InternalReflectionMethod::IS_PRIVATE);
+ }
+
+ /**
+ * Returns if the method is protected.
+ *
+ * @return boolean
+ */
+ public function isProtected()
+ {
+ return (bool) ($this->modifiers & InternalReflectionMethod::IS_PROTECTED);
+ }
+
+ /**
+ * Returns if the method is public.
+ *
+ * @return boolean
+ */
+ public function isPublic()
+ {
+ return (bool) ($this->modifiers & InternalReflectionMethod::IS_PUBLIC);
+ }
+
+ /**
+ * Returns if the method is static.
+ *
+ * @return boolean
+ */
+ public function isStatic()
+ {
+ return (bool) ($this->modifiers & InternalReflectionMethod::IS_STATIC);
+ }
+
+ /**
+ * Shortcut for isPublic(), ... methods that allows or-ed modifiers.
+ *
+ * The {@see getModifiers()} method is called only when really necessary making this
+ * a more efficient way of doing
+ *
+ * if ($method->getModifiers() & $filter) {
+ * ...
+ * }
+ *
+ *
+ * @param integer $filter Filter
+ * @return boolean
+ */
+ public function is($filter = null)
+ {
+ // See self::ACCESS_LEVEL_CHANGED | self::IS_IMPLEMENTED_ABSTRACT
+ static $computedModifiers = 0x808;
+
+ if (null === $filter || ($this->modifiers & $filter)) {
+ return true;
+ } elseif (($filter & $computedModifiers) && !$this->modifiersComplete) {
+ return (bool) ($this->getModifiers() & $filter);
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns if the method is a constructor.
+ *
+ * @return boolean
+ */
+ public function isConstructor()
+ {
+ return (bool) ($this->modifiers & self::IS_CONSTRUCTOR);
+ }
+
+ /**
+ * Returns if the method is a destructor.
+ *
+ * @return boolean
+ */
+ public function isDestructor()
+ {
+ return (bool) ($this->modifiers & self::IS_DESTRUCTOR);
+ }
+
+ /**
+ * Returns the method prototype.
+ *
+ * @return \TokenReflection\ReflectionMethod
+ * @throws \TokenReflection\Exception\RuntimeException If the method has no prototype.
+ */
+ public function getPrototype()
+ {
+ if (null === $this->prototype) {
+ $prototype = null;
+
+ $declaring = $this->getDeclaringClass();
+ if (($parent = $declaring->getParentClass()) && $parent->hasMethod($this->name)) {
+ $method = $parent->getMethod($this->name);
+
+ if (!$method->isPrivate()) {
+ try {
+ $prototype = $method->getPrototype();
+ } catch (Exception\RuntimeException $e) {
+ $prototype = $method;
+ }
+ }
+ }
+
+ if (null === $prototype) {
+ foreach ($declaring->getOwnInterfaces() as $interface) {
+ if ($interface->hasMethod($this->name)) {
+ $prototype = $interface->getMethod($this->name);
+ break;
+ }
+ }
+ }
+
+ $this->prototype = $prototype ?: ($this->isComplete() ? false : null);
+ }
+
+ if (empty($this->prototype)) {
+ throw new Exception\RuntimeException('Method has no prototype.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ return $this->prototype;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return sprintf('%s::%s', $this->declaringClassName ?: $this->declaringTraitName, parent::getPrettyName());
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $internal = '';
+ $overwrite = '';
+ $prototype = '';
+
+ $declaringClassParent = $this->getDeclaringClass()->getParentClass();
+ try {
+ $prototype = ', prototype ' . $this->getPrototype()->getDeclaringClassName();
+ } catch (Exception\RuntimeException $e) {
+ if ($declaringClassParent && $declaringClassParent->isInternal()) {
+ $internal = 'internal:' . $parentClass->getExtensionName();
+ }
+ }
+
+ if ($declaringClassParent && $declaringClassParent->hasMethod($this->name)) {
+ $parentMethod = $declaringClassParent->getMethod($this->name);
+ $overwrite = ', overwrites ' . $parentMethod->getDeclaringClassName();
+ }
+
+ if ($this->isConstructor()) {
+ $cdtor = ', ctor';
+ } elseif ($this->isDestructor()) {
+ $cdtor = ', dtor';
+ } else {
+ $cdtor = '';
+ }
+
+ $parameters = '';
+ if ($this->getNumberOfParameters() > 0) {
+ $buffer = '';
+ foreach ($this->getParameters() as $parameter) {
+ $buffer .= "\n " . $parameter->__toString();
+ }
+ $parameters = sprintf(
+ "\n\n - Parameters [%d] {%s\n }",
+ $this->getNumberOfParameters(),
+ $buffer
+ );
+ }
+ // @todo support inherits
+ return sprintf(
+ "%sMethod [ <%s%s%s%s> %s%s%s%s%s%s method %s%s ] {\n @@ %s %d - %d%s\n}\n",
+ $this->getDocComment() ? $this->getDocComment() . "\n" : '',
+ !empty($internal) ? $internal : 'user',
+ $overwrite,
+ $prototype,
+ $cdtor,
+ $this->isAbstract() ? 'abstract ' : '',
+ $this->isFinal() ? 'final ' : '',
+ $this->isStatic() ? 'static ' : '',
+ $this->isPublic() ? 'public' : '',
+ $this->isPrivate() ? 'private' : '',
+ $this->isProtected() ? 'protected' : '',
+ $this->returnsReference() ? '&' : '',
+ $this->getName(),
+ $this->getFileName(),
+ $this->getStartLine(),
+ $this->getEndLine(),
+ $parameters
+ );
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string|object $class Class name or class instance
+ * @param string $method Method name
+ * @param boolean $return Return the export instead of outputting it
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If requested parameter doesn't exist.
+ */
+ public static function export(Broker $broker, $class, $method, $return = false)
+ {
+ $className = is_object($class) ? get_class($class) : $class;
+ $methodName = $method;
+
+ $class = $broker->getClass($className);
+ if ($class instanceof Invalid\ReflectionClass) {
+ throw new Exception\RuntimeException('Class is invalid.', Exception\RuntimeException::UNSUPPORTED);
+ } elseif ($class instanceof Dummy\ReflectionClass) {
+ throw new Exception\RuntimeException(sprintf('Class %s does not exist.', $className), Exception\RuntimeException::DOES_NOT_EXIST);
+ }
+ $method = $class->getMethod($methodName);
+
+ if ($return) {
+ return $method->__toString();
+ }
+
+ echo $method->__toString();
+ }
+
+ /**
+ * Calls the method on an given instance.
+ *
+ * @param object $object Class instance
+ * @param mixed $args
+ * @return mixed
+ */
+ public function invoke($object, $args)
+ {
+ $params = func_get_args();
+ return $this->invokeArgs(array_shift($params), $params);
+ }
+
+ /**
+ * Calls the method on an given object.
+ *
+ * @param object $object Class instance
+ * @param array $args Method parameter values
+ * @return mixed
+ * @throws \TokenReflection\Exception\RuntimeException If it is not possible to invoke the method.
+ */
+ public function invokeArgs($object, array $args = array())
+ {
+ $declaringClass = $this->getDeclaringClass();
+ if (!$declaringClass->isInstance($object)) {
+ throw new Exception\RuntimeException(sprintf('Expected instance of or subclass of "%s".', $this->declaringClassName), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ if ($this->isPublic()) {
+ return call_user_func_array(array($object, $this->getName()), $args);
+ } elseif ($this->isAccessible()) {
+ $refClass = new InternalReflectionClass($object);
+ $refMethod = $refClass->getMethod($this->name);
+
+ $refMethod->setAccessible(true);
+ $value = $refMethod->invokeArgs($object, $args);
+ $refMethod->setAccessible(false);
+
+ return $value;
+ }
+
+ throw new Exception\RuntimeException('Only public methods can be invoked.', Exception\RuntimeException::NOT_ACCESSBILE, $this);
+ }
+
+ /**
+ * Returns if the property is set accessible.
+ *
+ * @return boolean
+ */
+ public function isAccessible()
+ {
+ return $this->accessible;
+ }
+
+ /**
+ * Sets a method to be accessible or not.
+ *
+ * @param boolean $accessible
+ */
+ public function setAccessible($accessible)
+ {
+ $this->accessible = (bool) $accessible;
+ }
+
+ /**
+ * Returns if the definition is complete.
+ *
+ * Technically returns if the declaring class definition is complete.
+ *
+ * @return boolean
+ */
+ private function isComplete()
+ {
+ return $this->getDeclaringClass()->isComplete();
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->getDeclaringClass()->getNamespaceAliases();
+ }
+
+ /**
+ * Returns the function/method as closure.
+ *
+ * @param object $object Object
+ * @return \Closure
+ */
+ public function getClosure($object)
+ {
+ $declaringClass = $this->getDeclaringClass();
+ if (!$declaringClass->isInstance($object)) {
+ throw new Exception\RuntimeException(sprintf('Expected instance of or subclass of "%s".', $this->declaringClassName), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $that = $this;
+ return function() use ($object, $that) {
+ return $that->invokeArgs($object, func_get_args());
+ };
+ }
+
+ /**
+ * Creates a method alias of the given name and access level for the given class.
+ *
+ * @param \TokenReflection\ReflectionClass $parent New parent class
+ * @param string $name New method name
+ * @param integer $accessLevel New access level
+ * @return \TokenReflection\ReflectionMethod
+ * @throws \TokenReflection\Exception\RuntimeException If an invalid method access level was found.
+ */
+ public function alias(ReflectionClass $parent, $name = null, $accessLevel = null)
+ {
+ static $possibleLevels = array(InternalReflectionMethod::IS_PUBLIC => true, InternalReflectionMethod::IS_PROTECTED => true, InternalReflectionMethod::IS_PRIVATE => true);
+
+ $method = clone $this;
+
+ $method->declaringClassName = $parent->getName();
+ if (null !== $name) {
+ $method->originalName = $this->name;
+ $method->name = $name;
+ }
+ if (null !== $accessLevel) {
+ if (!isset($possibleLevels[$accessLevel])) {
+ throw new Exception\RuntimeException(sprintf('Invalid method access level: "%s".', $accessLevel), Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ $method->modifiers &= ~(InternalReflectionMethod::IS_PUBLIC | InternalReflectionMethod::IS_PROTECTED | InternalReflectionMethod::IS_PRIVATE);
+ $method->modifiers |= $accessLevel;
+
+ $method->originalModifiers = $this->getModifiers();
+ }
+
+ foreach ($this->parameters as $parameterName => $parameter) {
+ $method->parameters[$parameterName] = $parameter->alias($method);
+ }
+
+ return $method;
+ }
+
+ /**
+ * Returns the original name when importing from a trait.
+ *
+ * @return string|null
+ */
+ public function getOriginalName()
+ {
+ return $this->originalName;
+ }
+
+ /**
+ * Returns the original method when importing from a trait.
+ *
+ * @return \TokenReflection\IReflectionMethod|null
+ */
+ public function getOriginal()
+ {
+ return $this->original;
+ }
+
+ /**
+ * Returns the original modifiers value when importing from a trait.
+ *
+ * @return integer|null
+ */
+ public function getOriginalModifiers()
+ {
+ return $this->originalModifiers;
+ }
+
+ /**
+ * Returns the defining trait.
+ *
+ * @return \TokenReflection\IReflectionClass|null
+ */
+ public function getDeclaringTrait()
+ {
+ return null === $this->declaringTraitName ? null : $this->getBroker()->getClass($this->declaringTraitName);
+ }
+
+ /**
+ * Returns the declaring trait name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringTraitName()
+ {
+ return $this->declaringTraitName;
+ }
+
+ /**
+ * Processes the parent reflection object.
+ *
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionElement
+ * @throws \TokenReflection\Exception\ParseException If an invalid parent reflection object was provided.
+ */
+ protected function processParent(IReflection $parent, Stream $tokenStream)
+ {
+ if (!$parent instanceof ReflectionClass) {
+ throw new Exception\ParseException($this, $tokenStream, 'The parent object has to be an instance of TokenReflection\ReflectionClass.', Exception\ParseException::INVALID_PARENT);
+ }
+
+ $this->declaringClassName = $parent->getName();
+ if ($parent->isTrait()) {
+ $this->declaringTraitName = $parent->getName();
+ }
+ return parent::processParent($parent, $tokenStream);
+ }
+
+ /**
+ * Parses reflected element metadata from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionMethod
+ * @throws \TokenReflection\Exception\Parse If the class could not be parsed.
+ */
+ protected function parse(Stream $tokenStream, IReflection $parent)
+ {
+ return $this
+ ->parseBaseModifiers($tokenStream)
+ ->parseReturnsReference($tokenStream)
+ ->parseName($tokenStream)
+ ->parseInternalModifiers($parent);
+ }
+
+ /**
+ * Parses base method modifiers (abstract, final, public, ...).
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionMethod
+ */
+ private function parseBaseModifiers(Stream $tokenStream)
+ {
+ while (true) {
+ switch ($tokenStream->getType()) {
+ case T_ABSTRACT:
+ $this->modifiers |= InternalReflectionMethod::IS_ABSTRACT;
+ break;
+ case T_FINAL:
+ $this->modifiers |= InternalReflectionMethod::IS_FINAL;
+ break;
+ case T_PUBLIC:
+ $this->modifiers |= InternalReflectionMethod::IS_PUBLIC;
+ break;
+ case T_PRIVATE:
+ $this->modifiers |= InternalReflectionMethod::IS_PRIVATE;
+ break;
+ case T_PROTECTED:
+ $this->modifiers |= InternalReflectionMethod::IS_PROTECTED;
+ break;
+ case T_STATIC:
+ $this->modifiers |= InternalReflectionMethod::IS_STATIC;
+ break;
+ case T_FUNCTION:
+ case null:
+ break 2;
+ default:
+ break;
+ }
+
+ $tokenStream->skipWhitespaces();
+ }
+
+ if (!($this->modifiers & (InternalReflectionMethod::IS_PRIVATE | InternalReflectionMethod::IS_PROTECTED))) {
+ $this->modifiers |= InternalReflectionMethod::IS_PUBLIC;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Parses internal PHP method modifiers (abstract, final, public, ...).
+ *
+ * @param \TokenReflection\ReflectionClass $class Parent class
+ * @return \TokenReflection\ReflectionMethod
+ */
+ private function parseInternalModifiers(ReflectionClass $class)
+ {
+ $name = strtolower($this->name);
+ // In PHP 5.3.3+ the ctor can be named only __construct in namespaced classes
+ if ('__construct' === $name || ((!$class->inNamespace() || PHP_VERSION_ID < 50303) && strtolower($class->getShortName()) === $name)) {
+ $this->modifiers |= self::IS_CONSTRUCTOR;
+ } elseif ('__destruct' === $name) {
+ $this->modifiers |= self::IS_DESTRUCTOR;
+ } elseif ('__clone' === $name) {
+ $this->modifiers |= self::IS_CLONE;
+ }
+
+ if ($class->isInterface()) {
+ $this->modifiers |= InternalReflectionMethod::IS_ABSTRACT;
+ } else {
+ // Can be called statically, see http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_API.c?revision=309853&view=markup#l1795
+ static $notAllowed = array('__clone' => true, '__tostring' => true, '__get' => true, '__set' => true, '__isset' => true, '__unset' => true);
+ if (!$this->isStatic() && !$this->isConstructor() && !$this->isDestructor() && !isset($notAllowed[$name])) {
+ $this->modifiers |= self::IS_ALLOWED_STATIC;
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionNamespace.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionNamespace.php
new file mode 100644
index 0000000..527ca0e
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionNamespace.php
@@ -0,0 +1,558 @@
+name = $name;
+ $this->broker = $broker;
+ }
+
+ /**
+ * Returns the name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns if the namespace is internal.
+ *
+ * Always false.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the namespace is user defined.
+ *
+ * Always true.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the namespace contains a class of the given name.
+ *
+ * @param string $className Class name
+ * @return boolean
+ */
+ public function hasClass($className)
+ {
+ $className = ltrim($className, '\\');
+ if (false === strpos($className, '\\') && self::NO_NAMESPACE_NAME !== $this->getName()) {
+ $className = $this->getName() . '\\' . $className;
+ }
+
+ return isset($this->classes[$className]);
+ }
+
+ /**
+ * Return a class reflection.
+ *
+ * @param string $className Class name
+ * @return \TokenReflection\ReflectionClass
+ * @throws \TokenReflection\Exception\RuntimeException If the requested class reflection does not exist.
+ */
+ public function getClass($className)
+ {
+ $className = ltrim($className, '\\');
+ if (false === strpos($className, '\\') && self::NO_NAMESPACE_NAME !== $this->getName()) {
+ $className = $this->getName() . '\\' . $className;
+ }
+
+ if (!isset($this->classes[$className])) {
+ throw new Exception\RuntimeException(sprintf('Class "%s" does not exist.', $className), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ return $this->classes[$className];
+ }
+
+ /**
+ * Returns class reflections.
+ *
+ * @return array
+ */
+ public function getClasses()
+ {
+ return $this->classes;
+ }
+
+ /**
+ * Returns class names (FQN).
+ *
+ * @return array
+ */
+ public function getClassNames()
+ {
+ return array_keys($this->classes);
+ }
+
+ /**
+ * Returns class unqualified names (UQN).
+ *
+ * @return array
+ */
+ public function getClassShortNames()
+ {
+ return array_map(function(IReflectionClass $class) {
+ return $class->getShortName();
+ }, $this->classes);
+ }
+
+ /**
+ * Returns if the namespace contains a constant of the given name.
+ *
+ * @param string $constantName Constant name
+ * @return boolean
+ */
+ public function hasConstant($constantName)
+ {
+ $constantName = ltrim($constantName, '\\');
+ if (false === strpos($constantName, '\\') && self::NO_NAMESPACE_NAME !== $this->getName()) {
+ $constantName = $this->getName() . '\\' . $constantName;
+ }
+
+ return isset($this->constants[$constantName]);
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $constantName Constant name
+ * @return \TokenReflection\ReflectionConstant
+ * @throws \TokenReflection\Exception\RuntimeException If the required constant does not exist.
+ */
+ public function getConstant($constantName)
+ {
+ $constantName = ltrim($constantName, '\\');
+ if (false === strpos($constantName, '\\') && self::NO_NAMESPACE_NAME !== $this->getName()) {
+ $constantName = $this->getName() . '\\' . $constantName;
+ }
+
+ if (!isset($this->constants[$constantName])) {
+ throw new Exception\RuntimeException(sprintf('Constant "%s" does not exist.', $constantName), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ return $this->constants[$constantName];
+ }
+
+ /**
+ * Returns constant reflections.
+ *
+ * @return array
+ */
+ public function getConstants()
+ {
+ return $this->constants;
+ }
+
+ /**
+ * Returns constant names (FQN).
+ *
+ * @return array
+ */
+ public function getConstantNames()
+ {
+ return array_keys($this->constants);
+ }
+
+ /**
+ * Returns constant unqualified names (UQN).
+ *
+ * @return array
+ */
+ public function getConstantShortNames()
+ {
+ return array_map(function(IReflectionConstant $constant) {
+ return $constant->getShortName();
+ }, $this->constants);
+ }
+
+ /**
+ * Returns if the namespace contains a function of the given name.
+ *
+ * @param string $functionName Function name
+ * @return boolean
+ */
+ public function hasFunction($functionName)
+ {
+ $functionName = ltrim($functionName, '\\');
+ if (false === strpos($functionName, '\\') && self::NO_NAMESPACE_NAME !== $this->getName()) {
+ $functionName = $this->getName() . '\\' . $functionName;
+ }
+
+ return isset($this->functions[$functionName]);
+ }
+
+ /**
+ * Returns a function reflection.
+ *
+ * @param string $functionName Function name
+ * @return \TokenReflection\ReflectionFunction
+ * @throws \TokenReflection\Exception\RuntimeException If the required function does not exist.
+ */
+ public function getFunction($functionName)
+ {
+ $functionName = ltrim($functionName, '\\');
+ if (false === strpos($functionName, '\\') && self::NO_NAMESPACE_NAME !== $this->getName()) {
+ $functionName = $this->getName() . '\\' . $functionName;
+ }
+
+ if (!isset($this->functions[$functionName])) {
+ throw new Exception\RuntimeException(sprintf('Function "%s" does not exist.', $functionName), Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ return $this->functions[$functionName];
+ }
+
+ /**
+ * Returns function reflections.
+ *
+ * @return array
+ */
+ public function getFunctions()
+ {
+ return $this->functions;
+ }
+
+ /**
+ * Returns function names (FQN).
+ *
+ * @return array
+ */
+ public function getFunctionNames()
+ {
+ return array_keys($this->functions);
+ }
+
+ /**
+ * Returns function unqualified names (UQN).
+ *
+ * @return array
+ */
+ public function getFunctionShortNames()
+ {
+ return array_map(function(IReflectionFunction $function) {
+ return $function->getShortName();
+ }, $this->functions);
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $buffer = '';
+ $count = 0;
+ foreach ($this->getClasses() as $class) {
+ $string = "\n " . trim(str_replace("\n", "\n ", $class->__toString()), ' ');
+ $string = str_replace(" \n - Parameters", "\n - Parameters", $string);
+
+ $buffer .= $string;
+ $count++;
+ }
+ $classes = sprintf("\n\n - Classes [%d] {\n%s }", $count, ltrim($buffer, "\n"));
+
+ $buffer = '';
+ $count = 0;
+ foreach ($this->getConstants() as $constant) {
+ $buffer .= ' ' . $constant->__toString();
+ $count++;
+ }
+ $constants = sprintf("\n\n - Constants [%d] {\n%s }", $count, $buffer);
+
+ $buffer = '';
+ $count = 0;
+ foreach ($this->getFunctions() as $function) {
+ $string = "\n " . trim(str_replace("\n", "\n ", $function->__toString()), ' ');
+ $string = str_replace(" \n - Parameters", "\n - Parameters", $string);
+
+ $buffer .= $string;
+ $count++;
+ }
+ $functions = sprintf("\n\n - Functions [%d] {\n%s }", $count, ltrim($buffer, "\n"));
+
+ return sprintf(
+ "Namespace [ namespace %s ] { %s%s%s\n}\n",
+ $this->getName(),
+ $classes,
+ $constants,
+ $functions
+ );
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string $namespace Namespace name
+ * @param boolean $return Return the export instead of outputting it
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If requested parameter doesn't exist.
+ */
+ public static function export(Broker $broker, $namespace, $return = false)
+ {
+ $namespaceName = $namespace;
+
+ $namespace = $broker->getNamespace($namespaceName);
+ if (null === $namespace) {
+ throw new Exception\RuntimeException(sprintf('Namespace %s does not exist.', $namespaceName), Exception\RuntimeException::DOES_NOT_EXIST);
+ }
+
+ if ($return) {
+ return $namespace->__toString();
+ }
+
+ echo $namespace->__toString();
+ }
+
+ /**
+ * Adds a namespace part from a file.
+ *
+ * @param \TokenReflection\ReflectionFileNamespace $namespace Namespace part
+ * @return \TokenReflection\ReflectionNamespace
+ * @throws \TokenReflection\Exception\FileProcessingException If one of classes, functions or constants form the namespace are already defined
+ */
+ public function addFileNamespace(ReflectionFileNamespace $namespace)
+ {
+ $errors = array();
+
+ foreach ($namespace->getClasses() as $className => $reflection) {
+ if ($reflection instanceof Invalid\ReflectionClass) {
+ $errors = array_merge($errors, $reflection->getReasons());
+ }
+
+ if (isset($this->classes[$className])) {
+ if (!$this->classes[$className] instanceof Invalid\ReflectionClass) {
+ $this->classes[$className] = new Invalid\ReflectionClass($className, $this->classes[$className]->getFileName(), $this->getBroker());
+ }
+
+ $error = new Exception\RuntimeException(
+ sprintf('Class %s was redeclared (previously declared in file %s).', $className, $this->classes[$className]->getFileName()),
+ Exception\RuntimeException::ALREADY_EXISTS,
+ $reflection
+ );
+ $errors[] = $error;
+ $this->classes[$className]->addReason($error);
+
+ if ($reflection instanceof Invalid\ReflectionClass) {
+ foreach ($reflection->getReasons() as $reason) {
+ $this->classes[$className]->addReason($reason);
+ }
+ }
+ } else {
+ $this->classes[$className] = $reflection;
+ }
+ }
+
+ foreach ($namespace->getFunctions() as $functionName => $reflection) {
+ if ($reflection instanceof Invalid\ReflectionFunction) {
+ $errors = array_merge($errors, $reflection->getReasons());
+ }
+
+ if (isset($this->functions[$functionName])) {
+ if (!$this->functions[$functionName] instanceof Invalid\ReflectionFunction) {
+ $this->functions[$functionName] = new Invalid\ReflectionFunction($functionName, $this->functions[$functionName]->getFileName(), $this->getBroker());
+ }
+
+ $error = new Exception\RuntimeException(
+ sprintf('Function %s was redeclared (previousy declared in file %s).', $functionName, $this->functions[$functionName]->getFileName()),
+ Exception\RuntimeException::ALREADY_EXISTS,
+ $reflection
+ );
+ $errors[] = $error;
+ $this->functions[$functionName]->addReason($error);
+
+ if ($reflection instanceof Invalid\ReflectionFunction) {
+ foreach ($reflection->getReasons() as $reason) {
+ $this->functions[$functionName]->addReason($reason);
+ }
+ }
+ } else {
+ $this->functions[$functionName] = $reflection;
+ }
+ }
+
+ foreach ($namespace->getConstants() as $constantName => $reflection) {
+ if ($reflection instanceof Invalid\ReflectionConstant) {
+ $errors = array_merge($errors, $reflection->getReasons());
+ }
+
+ if (isset($this->constants[$constantName])) {
+ if (!$this->constants[$constantName] instanceof Invalid\ReflectionConstant) {
+ $this->constants[$constantName] = new Invalid\ReflectionConstant($constantName, $this->constants[$constantName]->getFileName(), $this->getBroker());
+ }
+
+ $error = new Exception\RuntimeException(
+ sprintf('Constant %s was redeclared (previuosly declared in file %s).', $constantName, $this->constants[$constantName]->getFileName()),
+ Exception\RuntimeException::ALREADY_EXISTS,
+ $reflection
+ );
+ $errors[] = $error;
+ $this->constants[$constantName]->addReason($error);
+
+ if ($reflection instanceof Invalid\ReflectionConstant) {
+ foreach ($reflection->getReasons() as $reason) {
+ $this->constants[$constantName]->addReason($reason);
+ }
+ }
+ } else {
+ $this->constants[$constantName] = $reflection;
+ }
+ }
+
+ if (!empty($errors)) {
+ throw new Exception\FileProcessingException($errors, null);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the appropriate source code part.
+ *
+ * Impossible for namespaces.
+ *
+ * @throws \TokenReflection\Exception\RuntimeException If the method is called, because it's unsupported.
+ */
+ public function getSource()
+ {
+ throw new Exception\RuntimeException('Cannot export source code of a namespace.', Exception\RuntimeException::UNSUPPORTED, $this);
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker|null
+ */
+ public function getBroker()
+ {
+ return $this->broker;
+ }
+
+ /**
+ * Magic __get method.
+ *
+ * @param string $key Variable name
+ * @return mixed
+ */
+ final public function __get($key)
+ {
+ return ReflectionElement::get($this, $key);
+ }
+
+ /**
+ * Magic __isset method.
+ *
+ * @param string $key Variable name
+ * @return boolean
+ */
+ final public function __isset($key)
+ {
+ return ReflectionElement::exists($this, $key);
+ }
+}
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionParameter.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionParameter.php
new file mode 100644
index 0000000..d099458
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionParameter.php
@@ -0,0 +1,639 @@
+declaringClassName ? null : $this->getBroker()->getClass($this->declaringClassName);
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->declaringClassName;
+ }
+
+ /**
+ * Returns the declaring function.
+ *
+ * @return \TokenReflection\ReflectionFunctionBase
+ */
+ public function getDeclaringFunction()
+ {
+ if (null !== $this->declaringClassName) {
+ // Method parameter
+ $class = $this->getBroker()->getClass($this->declaringClassName);
+ if (null !== $class) {
+ return $class->getMethod($this->declaringFunctionName);
+ }
+ } else {
+ // Function parameter
+ return $this->getBroker()->getFunction($this->declaringFunctionName);
+ }
+ }
+
+ /**
+ * Returns the declaring function name.
+ *
+ * @return string
+ */
+ public function getDeclaringFunctionName()
+ {
+ return $this->declaringFunctionName;
+ }
+
+ /**
+ * Returns the default value.
+ *
+ * @return mixed
+ * @throws \TokenReflection\Exception\RuntimeException If the property is not optional.
+ * @throws \TokenReflection\Exception\RuntimeException If the property has no default value.
+ */
+ public function getDefaultValue()
+ {
+ if (!$this->isOptional()) {
+ throw new Exception\RuntimeException('Property is not optional.', Exception\RuntimeException::UNSUPPORTED, $this);
+ }
+
+ if (is_array($this->defaultValueDefinition)) {
+ if (0 === count($this->defaultValueDefinition)) {
+ throw new Exception\RuntimeException('Property has no default value.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $this->defaultValue = Resolver::getValueDefinition($this->defaultValueDefinition, $this);
+ $this->defaultValueDefinition = Resolver::getSourceCode($this->defaultValueDefinition);
+ }
+
+ return $this->defaultValue;
+ }
+
+ /**
+ * Returns the part of the source code defining the parameter default value.
+ *
+ * @return string
+ */
+ public function getDefaultValueDefinition()
+ {
+ return is_array($this->defaultValueDefinition) ? Resolver::getSourceCode($this->defaultValueDefinition) : $this->defaultValueDefinition;
+ }
+
+ /**
+ * Retutns if a default value for the parameter is available.
+ *
+ * @return boolean
+ */
+ public function isDefaultValueAvailable()
+ {
+ return null !== $this->getDefaultValueDefinition();
+ }
+
+ /**
+ * Returns the position within all parameters.
+ *
+ * @return integer
+ */
+ public function getPosition()
+ {
+ return $this->position;
+ }
+
+ /**
+ * Returns if the parameter expects an array.
+ *
+ * @return boolean
+ */
+ public function isArray()
+ {
+ return $this->typeHint === self::ARRAY_TYPE_HINT;
+ }
+
+ /**
+ * Returns if the parameter expects a callback.
+ *
+ * @return boolean
+ */
+ public function isCallable()
+ {
+ return $this->typeHint === self::CALLABLE_TYPE_HINT;
+ }
+
+ /**
+ * Returns the original type hint as defined in the source code.
+ *
+ * @return string|null
+ */
+ public function getOriginalTypeHint()
+ {
+ return !$this->isArray() && !$this->isCallable() ? ltrim($this->originalTypeHint, '\\') : null;
+ }
+
+ /**
+ * Returns reflection of the required class of the value.
+ *
+ * @return \TokenReflection\IReflectionClass|null
+ */
+ public function getClass()
+ {
+ $name = $this->getClassName();
+ if (null === $name) {
+ return null;
+ }
+
+ return $this->getBroker()->getClass($name);
+ }
+
+ /**
+ * Returns the required class name of the value.
+ *
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If the type hint class FQN could not be determined.
+ */
+ public function getClassName()
+ {
+ if ($this->isArray() || $this->isCallable()) {
+ return null;
+ }
+
+ if (null === $this->typeHint && null !== $this->originalTypeHint) {
+ if (null !== $this->declaringClassName) {
+ $parent = $this->getDeclaringClass();
+ if (null === $parent) {
+ throw new Exception\RuntimeException('Could not load class reflection.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+ } else {
+ $parent = $this->getDeclaringFunction();
+ if (null === $parent || !$parent->isTokenized()) {
+ throw new Exception\RuntimeException('Could not load function reflection.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+ }
+
+ $lTypeHint = strtolower($this->originalTypeHint);
+ if ('parent' === $lTypeHint || 'self' === $lTypeHint) {
+ if (null === $this->declaringClassName) {
+ throw new Exception\RuntimeException('Parameter type hint cannot be "self" nor "parent" when not a method.', Exception\RuntimeException::UNSUPPORTED, $this);
+ }
+
+ if ('parent' === $lTypeHint) {
+ if ($parent->isInterface() || null === $parent->getParentClassName()) {
+ throw new Exception\RuntimeException('Class has no parent.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $this->typeHint = $parent->getParentClassName();
+ } else {
+ $this->typeHint = $this->declaringClassName;
+ }
+ } else {
+ $this->typeHint = ltrim(Resolver::resolveClassFQN($this->originalTypeHint, $parent->getNamespaceAliases(), $parent->getNamespaceName()), '\\');
+ }
+ }
+
+ return $this->typeHint;
+ }
+
+ /**
+ * Returns if the the parameter allows NULL.
+ *
+ * @return boolean
+ */
+ public function allowsNull()
+ {
+ if ($this->isArray() || $this->isCallable()) {
+ return 'null' === strtolower($this->getDefaultValueDefinition());
+ }
+
+ return null === $this->originalTypeHint || !empty($this->defaultValueDefinition);
+ }
+
+ /**
+ * Returns if the parameter is optional.
+ *
+ * @return boolean
+ * @throws \TokenReflection\Exception\RuntimeException If it is not possible to determine if the parameter is optional.
+ */
+ public function isOptional()
+ {
+ if (null === $this->isOptional) {
+ $function = $this->getDeclaringFunction();
+ if (null === $function) {
+ throw new Exception\RuntimeException('Could not get the declaring function reflection.', Exception\RuntimeException::DOES_NOT_EXIST, $this);
+ }
+
+ $this->isOptional = true;
+ foreach (array_slice($function->getParameters(), $this->position) as $reflectionParameter) {
+ if (!$reflectionParameter->isDefaultValueAvailable()) {
+ $this->isOptional = false;
+ break;
+ }
+ }
+ }
+
+ return $this->isOptional;
+ }
+
+ /**
+ * Returns if the parameter value is passed by reference.
+ *
+ * @return boolean
+ */
+ public function isPassedByReference()
+ {
+ return $this->passedByReference;
+ }
+
+ /**
+ * Returns if the paramter value can be passed by value.
+ *
+ * @return boolean
+ */
+ public function canBePassedByValue()
+ {
+ return !$this->isPassedByReference();
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return str_replace('()', '($' . $this->name . ')', $this->getDeclaringFunction()->getPrettyName());
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if ($this->getClass()) {
+ $hint = $this->getClassName();
+ } elseif ($this->isArray()) {
+ $hint = self::ARRAY_TYPE_HINT;
+ } elseif ($this->isCallable()) {
+ $hint = self::CALLABLE_TYPE_HINT;
+ } else {
+ $hint = '';
+ }
+
+ if (!empty($hint) && $this->allowsNull()) {
+ $hint .= ' or NULL';
+ }
+
+ if ($this->isDefaultValueAvailable()) {
+ $default = ' = ';
+ if (null === $this->getDefaultValue()) {
+ $default .= 'NULL';
+ } elseif (is_array($this->getDefaultValue())) {
+ $default .= 'Array';
+ } elseif (is_bool($this->getDefaultValue())) {
+ $default .= $this->getDefaultValue() ? 'true' : 'false';
+ } elseif (is_string($this->getDefaultValue())) {
+ $default .= sprintf("'%s'", str_replace("'", "\\'", $this->getDefaultValue()));
+ } else {
+ $default .= $this->getDefaultValue();
+ }
+ } else {
+ $default = '';
+ }
+
+ return sprintf(
+ 'Parameter #%d [ <%s> %s%s$%s%s ]',
+ $this->getPosition(),
+ $this->isOptional() ? 'optional' : 'required',
+ $hint ? $hint . ' ' : '',
+ $this->isPassedByReference() ? '&' : '',
+ $this->getName(),
+ $default
+ );
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string $function Function name
+ * @param string $parameter Parameter name
+ * @param boolean $return Return the export instead of outputting it
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If requested parameter doesn't exist.
+ */
+ public static function export(Broker $broker, $function, $parameter, $return = false)
+ {
+ $functionName = $function;
+ $parameterName = $parameter;
+
+ $function = $broker->getFunction($functionName);
+ if (null === $function) {
+ throw new Exception\RuntimeException(sprintf('Function %s() does not exist.', $functionName), Exception\RuntimeException::DOES_NOT_EXIST);
+ }
+ $parameter = $function->getParameter($parameterName);
+
+ if ($return) {
+ return $parameter->__toString();
+ }
+
+ echo $parameter->__toString();
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->getDeclaringFunction()->getNamespaceAliases();
+ }
+
+ /**
+ * Creates a parameter alias for the given method.
+ *
+ * @param \TokenReflection\ReflectionMethod $parent New parent method
+ * @return \TokenReflection\ReflectionParameter
+ */
+ public function alias(ReflectionMethod $parent)
+ {
+ $parameter = clone $this;
+
+ $parameter->declaringClassName = $parent->getDeclaringClassName();
+ $parameter->declaringFunctionName = $parent->getName();
+
+ return $parameter;
+ }
+
+ /**
+ * Processes the parent reflection object.
+ *
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionElement
+ * @throws \TokenReflection\Exception\ParseException If an invalid parent reflection object was provided.
+ */
+ protected function processParent(IReflection $parent, Stream $tokenStream)
+ {
+ if (!$parent instanceof ReflectionFunctionBase) {
+ throw new Exception\ParseException($this, $tokenStream, 'The parent object has to be an instance of TokenReflection\ReflectionFunctionBase.', Exception\ParseException::INVALID_PARENT);
+ }
+
+ // Declaring function name
+ $this->declaringFunctionName = $parent->getName();
+
+ // Position
+ $this->position = count($parent->getParameters());
+
+ // Declaring class name
+ if ($parent instanceof ReflectionMethod) {
+ $this->declaringClassName = $parent->getDeclaringClassName();
+ }
+
+ return parent::processParent($parent, $tokenStream);
+ }
+
+ /**
+ * Parses reflected element metadata from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionParameter
+ */
+ protected function parse(Stream $tokenStream, IReflection $parent)
+ {
+ return $this
+ ->parseTypeHint($tokenStream)
+ ->parsePassedByReference($tokenStream)
+ ->parseName($tokenStream)
+ ->parseDefaultValue($tokenStream);
+ }
+
+ /**
+ * Parses the type hint.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionParameter
+ * @throws \TokenReflection\Exception\ParseException If the type hint class name could not be determined.
+ */
+ private function parseTypeHint(Stream $tokenStream)
+ {
+ $type = $tokenStream->getType();
+
+ if (T_ARRAY === $type) {
+ $this->typeHint = self::ARRAY_TYPE_HINT;
+ $this->originalTypeHint = self::ARRAY_TYPE_HINT;
+ $tokenStream->skipWhitespaces(true);
+ } elseif (T_CALLABLE === $type) {
+ $this->typeHint = self::CALLABLE_TYPE_HINT;
+ $this->originalTypeHint = self::CALLABLE_TYPE_HINT;
+ $tokenStream->skipWhitespaces(true);
+ } elseif (T_STRING === $type || T_NS_SEPARATOR === $type) {
+ $className = '';
+ do {
+ $className .= $tokenStream->getTokenValue();
+
+ $tokenStream->skipWhitespaces(true);
+ $type = $tokenStream->getType();
+ } while (T_STRING === $type || T_NS_SEPARATOR === $type);
+
+ if ('' === ltrim($className, '\\')) {
+ throw new Exception\ParseException($this, $tokenStream, sprintf('Invalid class name definition: "%s".', $className), Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ $this->originalTypeHint = $className;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Parses if parameter value is passed by reference.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionParameter
+ */
+ private function parsePassedByReference(Stream $tokenStream)
+ {
+ if ($tokenStream->is('&')) {
+ $this->passedByReference = true;
+ $tokenStream->skipWhitespaces(true);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Parses the constant name.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionParameter
+ * @throws \TokenReflection\Exception\ParseException If the parameter name could not be determined.
+ */
+ protected function parseName(Stream $tokenStream)
+ {
+ if (!$tokenStream->is(T_VARIABLE)) {
+ throw new Exception\ParseException($this, $tokenStream, 'The parameter name could not be determined.', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ $this->name = substr($tokenStream->getTokenValue(), 1);
+
+ $tokenStream->skipWhitespaces(true);
+
+ return $this;
+ }
+
+ /**
+ * Parses the parameter default value.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionParameter
+ * @throws \TokenReflection\Exception\ParseException If the default value could not be determined.
+ */
+ private function parseDefaultValue(Stream $tokenStream)
+ {
+ if ($tokenStream->is('=')) {
+ $tokenStream->skipWhitespaces(true);
+
+ $level = 0;
+ while (null !== ($type = $tokenStream->getType())) {
+ switch ($type) {
+ case ')':
+ if (0 === $level) {
+ break 2;
+ }
+ case '}':
+ case ']':
+ $level--;
+ break;
+ case '(':
+ case '{':
+ case '[':
+ $level++;
+ break;
+ case ',':
+ if (0 === $level) {
+ break 2;
+ }
+ break;
+ default:
+ break;
+ }
+
+ $this->defaultValueDefinition[] = $tokenStream->current();
+ $tokenStream->next();
+ }
+
+ if (')' !== $type && ',' !== $type) {
+ throw new Exception\ParseException($this, $tokenStream, 'The property default value is not terminated properly. Expected "," or ")".', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionProperty.php b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionProperty.php
new file mode 100644
index 0000000..f85a8cb
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/ReflectionProperty.php
@@ -0,0 +1,572 @@
+getBroker()->getClass($this->declaringClassName);
+ }
+
+ /**
+ * Returns the name of the declaring class.
+ *
+ * @return string
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->declaringClassName;
+ }
+
+ /**
+ * Returns the property default value.
+ *
+ * @return mixed
+ */
+ public function getDefaultValue()
+ {
+ if (is_array($this->defaultValueDefinition)) {
+ $this->defaultValue = Resolver::getValueDefinition($this->defaultValueDefinition, $this);
+ $this->defaultValueDefinition = Resolver::getSourceCode($this->defaultValueDefinition);
+ }
+
+ return $this->defaultValue;
+ }
+
+ /**
+ * Returns the part of the source code defining the property default value.
+ *
+ * @return string
+ */
+ public function getDefaultValueDefinition()
+ {
+ return is_array($this->defaultValueDefinition) ? Resolver::getSourceCode($this->defaultValueDefinition) : $this->defaultValueDefinition;
+ }
+
+ /**
+ * Returns the property value for a particular class instance.
+ *
+ * @param object $object
+ * @return mixed
+ * @throws \TokenReflection\Exception\RuntimeException If it is not possible to return the property value.
+ */
+ public function getValue($object)
+ {
+ $declaringClass = $this->getDeclaringClass();
+ if (!$declaringClass->isInstance($object)) {
+ throw new Exception\RuntimeException('The given class is not an instance or subclass of the current class.', Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ if ($this->isPublic()) {
+ return $object->{$this->name};
+ } elseif ($this->isAccessible()) {
+ $refClass = new InternalReflectionClass($object);
+ $refProperty = $refClass->getProperty($this->name);
+
+ $refProperty->setAccessible(true);
+ $value = $refProperty->getValue($object);
+ $refProperty->setAccessible(false);
+
+ return $value;
+ }
+
+ throw new Exception\RuntimeException('Only public and accessible properties can return their values.', Exception\RuntimeException::NOT_ACCESSBILE, $this);
+ }
+
+ /**
+ * Returns if the property was created at compile time.
+ *
+ * All properties in the source code are.
+ *
+ * @return boolean
+ */
+ public function isDefault()
+ {
+ return true;
+ }
+
+ /**
+ * Returns property modifiers.
+ *
+ * @return integer
+ */
+ public function getModifiers()
+ {
+ if (false === $this->modifiersComplete) {
+ $declaringClass = $this->getDeclaringClass();
+ $declaringClassParent = $declaringClass->getParentClass();
+
+ if ($declaringClassParent && $declaringClassParent->hasProperty($this->name)) {
+ $property = $declaringClassParent->getProperty($this->name);
+ if (($this->isPublic() && !$property->isPublic()) || ($this->isProtected() && $property->isPrivate())) {
+ $this->modifiers |= self::ACCESS_LEVEL_CHANGED;
+ }
+ }
+
+ $this->modifiersComplete = ($this->modifiers & self::ACCESS_LEVEL_CHANGED) || $declaringClass->isComplete();
+ }
+
+ return $this->modifiers;
+ }
+
+ /**
+ * Returns if the property is private.
+ *
+ * @return boolean
+ */
+ public function isPrivate()
+ {
+ return (bool) ($this->modifiers & InternalReflectionProperty::IS_PRIVATE);
+ }
+
+ /**
+ * Returns if the property is protected.
+ *
+ * @return boolean
+ */
+ public function isProtected()
+ {
+ return (bool) ($this->modifiers & InternalReflectionProperty::IS_PROTECTED);
+ }
+
+ /**
+ * Returns if the property is public.
+ *
+ * @return boolean
+ */
+ public function isPublic()
+ {
+ return (bool) ($this->modifiers & InternalReflectionProperty::IS_PUBLIC);
+ }
+
+ /**
+ * Returns if the poperty is static.
+ *
+ * @return boolean
+ */
+ public function isStatic()
+ {
+ return (bool) ($this->modifiers & InternalReflectionProperty::IS_STATIC);
+ }
+
+ /**
+ * Returns the string representation of the reflection object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf(
+ "Property [ %s%s%s%s%s\$%s ]\n",
+ $this->isStatic() ? '' : ' ',
+ $this->isPublic() ? 'public ' : '',
+ $this->isPrivate() ? 'private ' : '',
+ $this->isProtected() ? 'protected ' : '',
+ $this->isStatic() ? 'static ' : '',
+ $this->getName()
+ );
+ }
+
+ /**
+ * Exports a reflected object.
+ *
+ * @param \TokenReflection\Broker $broker Broker instance
+ * @param string|object $class Class name or class instance
+ * @param string $property Property name
+ * @param boolean $return Return the export instead of outputting it
+ * @return string|null
+ * @throws \TokenReflection\Exception\RuntimeException If requested parameter doesn't exist.
+ */
+ public static function export(Broker $broker, $class, $property, $return = false)
+ {
+ $className = is_object($class) ? get_class($class) : $class;
+ $propertyName = $property;
+
+ $class = $broker->getClass($className);
+ if ($class instanceof Invalid\ReflectionClass) {
+ throw new Exception\RuntimeException('Class is invalid.', Exception\RuntimeException::UNSUPPORTED);
+ } elseif ($class instanceof Dummy\ReflectionClass) {
+ throw new Exception\RuntimeException(sprintf('Class %s does not exist.', $className), Exception\RuntimeException::DOES_NOT_EXIST);
+ }
+ $property = $class->getProperty($propertyName);
+
+ if ($return) {
+ return $property->__toString();
+ }
+
+ echo $property->__toString();
+ }
+
+ /**
+ * Returns if the property is set accessible.
+ *
+ * @return boolean
+ */
+ public function isAccessible()
+ {
+ return $this->accessible;
+ }
+
+ /**
+ * Sets a property to be accessible or not.
+ *
+ * @param boolean $accessible If the property should be accessible.
+ */
+ public function setAccessible($accessible)
+ {
+ $this->accessible = (bool) $accessible;
+ }
+
+ /**
+ * Sets the property default value.
+ *
+ * @param mixed $value
+ */
+ public function setDefaultValue($value)
+ {
+ $this->defaultValue = $value;
+ $this->defaultValueDefinition = var_export($value, true);
+ }
+
+ /**
+ * Sets value of a property for a particular class instance.
+ *
+ * @param object $object Class instance
+ * @param mixed $value Poperty value
+ * @throws \TokenReflection\Exception\RuntimeException If it is not possible to set the property value.
+ */
+ public function setValue($object, $value)
+ {
+ $declaringClass = $this->getDeclaringClass();
+ if (!$declaringClass->isInstance($object)) {
+ throw new Exception\RuntimeException('Instance of or subclass expected.', Exception\RuntimeException::INVALID_ARGUMENT, $this);
+ }
+
+ if ($this->isPublic()) {
+ $object->{$this->name} = $value;
+ } elseif ($this->isAccessible()) {
+ $refClass = new InternalReflectionClass($object);
+ $refProperty = $refClass->getProperty($this->name);
+
+ $refProperty->setAccessible(true);
+ $refProperty->setValue($object, $value);
+ $refProperty->setAccessible(false);
+
+ if ($this->isStatic()) {
+ $this->setDefaultValue($value);
+ }
+ } else {
+ throw new Exception\RuntimeException('Only public and accessible properties can be set.', Exception\RuntimeException::NOT_ACCESSBILE, $this);
+ }
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->getDeclaringClass()->getNamespaceAliases();
+ }
+
+ /**
+ * Creates a property alias for the given class.
+ *
+ * @param \TokenReflection\ReflectionClass $parent New parent class
+ * @return \TokenReflection\ReflectionProperty
+ */
+ public function alias(ReflectionClass $parent)
+ {
+ $property = clone $this;
+ $property->declaringClassName = $parent->getName();
+ return $property;
+ }
+
+ /**
+ * Returns the defining trait.
+ *
+ * @return \TokenReflection\IReflectionClass|null
+ */
+ public function getDeclaringTrait()
+ {
+ return null === $this->declaringTraitName ? null : $this->getBroker()->getClass($this->declaringTraitName);
+ }
+
+ /**
+ * Returns the declaring trait name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringTraitName()
+ {
+ return $this->declaringTraitName;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return sprintf('%s::$%s', $this->declaringClassName ?: $this->declaringTraitName, $this->name);
+ }
+
+ /**
+ * Processes the parent reflection object.
+ *
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionElement
+ * @throws \TokenReflection\Exception\Parse If an invalid parent reflection object was provided.
+ */
+ protected function processParent(IReflection $parent, Stream $tokenStream)
+ {
+ if (!$parent instanceof ReflectionClass) {
+ throw new Exception\ParseException($this, $tokenStream, 'The parent object has to be an instance of TokenReflection\ReflectionClass.', Exception\ParseException::INVALID_PARENT);
+ }
+
+ $this->declaringClassName = $parent->getName();
+ if ($parent->isTrait()) {
+ $this->declaringTraitName = $parent->getName();
+ }
+ return parent::processParent($parent, $tokenStream);
+ }
+
+ /**
+ * Parses reflected element metadata from the token stream.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\IReflection $parent Parent reflection object
+ * @return \TokenReflection\ReflectionProperty
+ */
+ protected function parse(Stream $tokenStream, IReflection $parent)
+ {
+ $this->parseModifiers($tokenStream, $parent);
+
+ if (false === $this->docComment->getDocComment()) {
+ $this->parseDocComment($tokenStream, $parent);
+ }
+
+ return $this->parseName($tokenStream)
+ ->parseDefaultValue($tokenStream);
+ }
+
+ /**
+ * Parses class modifiers (abstract, final) and class type (class, interface).
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @param \TokenReflection\ReflectionClass $class Defining class
+ * @return \TokenReflection\ReflectionClass
+ * @throws \TokenReflection\Exception\ParseException If the modifiers value cannot be determined.
+ */
+ private function parseModifiers(Stream $tokenStream, ReflectionClass $class)
+ {
+ while (true) {
+ switch ($tokenStream->getType()) {
+ case T_PUBLIC:
+ case T_VAR:
+ $this->modifiers |= InternalReflectionProperty::IS_PUBLIC;
+ break;
+ case T_PROTECTED:
+ $this->modifiers |= InternalReflectionProperty::IS_PROTECTED;
+ break;
+ case T_PRIVATE:
+ $this->modifiers |= InternalReflectionProperty::IS_PRIVATE;
+ break;
+ case T_STATIC:
+ $this->modifiers |= InternalReflectionProperty::IS_STATIC;
+ break;
+ default:
+ break 2;
+ }
+
+ $tokenStream->skipWhitespaces(true);
+ }
+
+ if (InternalReflectionProperty::IS_STATIC === $this->modifiers) {
+ $this->modifiers |= InternalReflectionProperty::IS_PUBLIC;
+ } elseif (0 === $this->modifiers) {
+ $parentProperties = $class->getOwnProperties();
+ if (empty($parentProperties)) {
+ throw new Exception\ParseException($this, $tokenStream, 'No access level defined and no previous defining class property present.', Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ $sibling = array_pop($parentProperties);
+ if ($sibling->isPublic()) {
+ $this->modifiers = InternalReflectionProperty::IS_PUBLIC;
+ } elseif ($sibling->isPrivate()) {
+ $this->modifiers = InternalReflectionProperty::IS_PRIVATE;
+ } elseif ($sibling->isProtected()) {
+ $this->modifiers = InternalReflectionProperty::IS_PROTECTED;
+ } else {
+ throw new Exception\ParseException($this, $tokenStream, sprintf('Property sibling "%s" has no access level defined.', $sibling->getName()), Exception\Parse::PARSE_ELEMENT_ERROR);
+ }
+
+ if ($sibling->isStatic()) {
+ $this->modifiers |= InternalReflectionProperty::IS_STATIC;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Parses the property name.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionProperty
+ * @throws \TokenReflection\Exception\ParseException If the property name could not be determined.
+ */
+ protected function parseName(Stream $tokenStream)
+ {
+ if (!$tokenStream->is(T_VARIABLE)) {
+ throw new Exception\ParseException($this, $tokenStream, 'The property name could not be determined.', Exception\ParseException::LOGICAL_ERROR);
+ }
+
+ $this->name = substr($tokenStream->getTokenValue(), 1);
+
+ $tokenStream->skipWhitespaces(true);
+
+ return $this;
+ }
+
+ /**
+ * Parses the propety default value.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
+ * @return \TokenReflection\ReflectionProperty
+ * @throws \TokenReflection\Exception\ParseException If the property default value could not be determined.
+ */
+ private function parseDefaultValue(Stream $tokenStream)
+ {
+ $type = $tokenStream->getType();
+
+ if (';' === $type || ',' === $type) {
+ // No default value
+ return $this;
+ }
+
+ if ('=' === $type) {
+ $tokenStream->skipWhitespaces(true);
+ }
+
+ $level = 0;
+ while (null !== ($type = $tokenStream->getType())) {
+ switch ($type) {
+ case ',':
+ if (0 !== $level) {
+ break;
+ }
+ case ';':
+ break 2;
+ case ')':
+ case ']':
+ case '}':
+ $level--;
+ break;
+ case '(':
+ case '{':
+ case '[':
+ $level++;
+ break;
+ default:
+ break;
+ }
+
+ $this->defaultValueDefinition[] = $tokenStream->current();
+ $tokenStream->next();
+ }
+
+ if (',' !== $type && ';' !== $type) {
+ throw new Exception\ParseException($this, $tokenStream, 'The property default value is not terminated properly. Expected "," or ";".', Exception\ParseException::UNEXPECTED_TOKEN);
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Resolver.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Resolver.php
new file mode 100644
index 0000000..4d97f18
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Resolver.php
@@ -0,0 +1,288 @@
+getNamespaceName();
+ } elseif ($reflection instanceof ReflectionParameter) {
+ $namespace = $reflection->getDeclaringFunction()->getNamespaceName();
+ } elseif ($reflection instanceof ReflectionProperty || $reflection instanceof ReflectionMethod) {
+ $namespace = $reflection->getDeclaringClass()->getNamespaceName();
+ } else {
+ throw new Exception\RuntimeException('Invalid reflection object given.', Exception\RuntimeException::INVALID_ARGUMENT, $reflection);
+ }
+
+ // Process __LINE__ constants; replace with the line number of the corresponding token
+ foreach ($tokens as $index => $token) {
+ if (T_LINE === $token[0]) {
+ $tokens[$index] = array(
+ T_LNUMBER,
+ $token[2],
+ $token[2]
+ );
+ }
+ }
+
+ $source = self::getSourceCode($tokens);
+
+ $constants = self::findConstants($tokens, $reflection);
+ if (!empty($constants)) {
+ foreach (array_reverse($constants, true) as $offset => $constant) {
+ $value = '';
+
+ try {
+ switch ($constant) {
+ case '__LINE__':
+ throw new Exception\RuntimeException('__LINE__ constant cannot be resolved this way.', Exception\RuntimeException::UNSUPPORTED, $reflection);
+ case '__FILE__':
+ $value = $reflection->getFileName();
+ break;
+ case '__DIR__':
+ $value = dirname($reflection->getFileName());
+ break;
+ case '__FUNCTION__':
+ if ($reflection instanceof IReflectionParameter) {
+ $value = $reflection->getDeclaringFunctionName();
+ } elseif ($reflection instanceof IReflectionFunctionBase) {
+ $value = $reflection->getName();
+ }
+ break;
+ case '__CLASS__':
+ if ($reflection instanceof IReflectionConstant || $reflection instanceof IReflectionParameter || $reflection instanceof IReflectionProperty || $reflection instanceof IReflectionMethod) {
+ $value = $reflection->getDeclaringClassName() ?: '';
+ }
+ break;
+ case '__TRAIT__':
+ if ($reflection instanceof IReflectionMethod || $reflection instanceof IReflectionProperty) {
+ $value = $reflection->getDeclaringTraitName() ?: '';
+ } elseif ($reflection instanceof IReflectionParameter) {
+ $method = $reflection->getDeclaringFunction();
+ if ($method instanceof IReflectionMethod) {
+ $value = $method->getDeclaringTraitName() ?: '';
+ }
+ }
+ break;
+ case '__METHOD__':
+ if ($reflection instanceof IReflectionParameter) {
+ if (null !== $reflection->getDeclaringClassName()) {
+ $value = $reflection->getDeclaringClassName() . '::' . $reflection->getDeclaringFunctionName();
+ } else {
+ $value = $reflection->getDeclaringFunctionName();
+ }
+ } elseif ($reflection instanceof IReflectionConstant || $reflection instanceof IReflectionProperty) {
+ $value = $reflection->getDeclaringClassName() ?: '';
+ } elseif ($reflection instanceof IReflectionMethod) {
+ $value = $reflection->getDeclaringClassName() . '::' . $reflection->getName();
+ } elseif ($reflection instanceof IReflectionFunction) {
+ $value = $reflection->getName();
+ }
+ break;
+ case '__NAMESPACE__':
+ if (($reflection instanceof IReflectionConstant && null !== $reflection->getDeclaringClassName()) || $reflection instanceof IReflectionProperty) {
+ $value = $reflection->getDeclaringClass()->getNamespaceName();
+ } elseif ($reflection instanceof IReflectionParameter) {
+ if (null !== $reflection->getDeclaringClassName()) {
+ $value = $reflection->getDeclaringClass()->getNamespaceName();
+ } else {
+ $value = $reflection->getDeclaringFunction()->getNamespaceName();
+ }
+ } elseif ($reflection instanceof IReflectionMethod) {
+ $value = $reflection->getDeclaringClass()->getNamespaceName();
+ } else {
+ $value = $reflection->getNamespaceName();
+ }
+ break;
+ default:
+ if (0 === stripos($constant, 'self::') || 0 === stripos($constant, 'parent::')) {
+ // Handle self:: and parent:: definitions
+
+ if ($reflection instanceof ReflectionConstant) {
+ throw new Exception\RuntimeException('Constants cannot use self:: and parent:: references.', Exception\RuntimeException::UNSUPPORTED, $reflection);
+ } elseif ($reflection instanceof ReflectionParameter && null === $reflection->getDeclaringClassName()) {
+ throw new Exception\RuntimeException('Function parameters cannot use self:: and parent:: references.', Exception\RuntimeException::UNSUPPORTED, $reflection);
+ }
+
+ if (0 === stripos($constant, 'self::')) {
+ $className = $reflection->getDeclaringClassName();
+ } else {
+ $declaringClass = $reflection->getDeclaringClass();
+ $className = $declaringClass->getParentClassName() ?: self::CONSTANT_NOT_FOUND;
+ }
+
+ $constantName = $className . substr($constant, strpos($constant, '::'));
+ } else {
+ $constantName = self::resolveClassFQN($constant, $reflection->getNamespaceAliases(), $namespace);
+ if ($cnt = strspn($constant, '\\')) {
+ $constantName = str_repeat('\\', $cnt) . $constantName;
+ }
+ }
+
+ $reflection = $reflection->getBroker()->getConstant($constantName);
+ $value = $reflection->getValue();
+ }
+ } catch (Exception\RuntimeException $e) {
+ $value = self::CONSTANT_NOT_FOUND;
+ }
+
+ $source = substr_replace($source, var_export($value, true), $offset, strlen($constant));
+ }
+ }
+
+ return self::evaluate(sprintf("return %s;\n", $source));
+ }
+
+ /**
+ * Returns a part of the source code defined by given tokens.
+ *
+ * @param array $tokens Tokens array
+ * @return array
+ */
+ final public static function getSourceCode(array $tokens)
+ {
+ if (empty($tokens)) {
+ return null;
+ }
+
+ $source = '';
+ foreach ($tokens as $token) {
+ $source .= $token[1];
+ }
+ return $source;
+ }
+
+ /**
+ * Finds constant names in the token definition.
+ *
+ * @param array $tokens Tokenized source code
+ * @param \TokenReflection\ReflectionElement $reflection Caller reflection
+ * @return array
+ */
+ final public static function findConstants(array $tokens, ReflectionElement $reflection)
+ {
+ static $accepted = array(
+ T_DOUBLE_COLON => true,
+ T_STRING => true,
+ T_NS_SEPARATOR => true,
+ T_CLASS_C => true,
+ T_DIR => true,
+ T_FILE => true,
+ T_LINE => true,
+ T_FUNC_C => true,
+ T_METHOD_C => true,
+ T_NS_C => true,
+ T_TRAIT_C => true
+ );
+ static $dontResolve = array('true' => true, 'false' => true, 'null' => true);
+
+ // Adding a dummy token to the end
+ $tokens[] = array(null);
+
+ $constants = array();
+ $constant = '';
+ $offset = 0;
+ foreach ($tokens as $token) {
+ if (isset($accepted[$token[0]])) {
+ $constant .= $token[1];
+ } elseif ('' !== $constant) {
+ if (!isset($dontResolve[strtolower($constant)])) {
+ $constants[$offset - strlen($constant)] = $constant;
+ }
+ $constant = '';
+ }
+
+ if (null !== $token[0]) {
+ $offset += strlen($token[1]);
+ }
+ }
+ return $constants;
+ }
+
+ /**
+ * Evaluates a source code.
+ *
+ * @param string $source Source code
+ * @return mixed
+ */
+ final private static function evaluate($source) {
+ return eval($source);
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Stream/FileStream.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Stream/FileStream.php
new file mode 100644
index 0000000..44e3675
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Stream/FileStream.php
@@ -0,0 +1,50 @@
+fileName = Broker::getRealPath($fileName);
+
+ if (false === $this->fileName) {
+ throw new Exception\StreamException($this, 'File does not exist.', Exception\StreamException::DOES_NOT_EXIST);
+ }
+
+ $contents = @file_get_contents($this->fileName);
+ if (false === $contents) {
+ throw new Exception\StreamException($this, 'File is not readable.', Exception\StreamException::NOT_READABLE);
+ }
+
+ $this->processSource($contents);
+ }
+}
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Stream/StreamBase.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Stream/StreamBase.php
new file mode 100644
index 0000000..85bdcee
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Stream/StreamBase.php
@@ -0,0 +1,487 @@
+ true, T_WHITESPACE => true, T_DOC_COMMENT => true, T_INLINE_HTML => true, T_ENCAPSED_AND_WHITESPACE => true, T_CONSTANT_ENCAPSED_STRING => true);
+
+ foreach ($stream as $position => $token) {
+ if (is_array($token)) {
+ if (!NATIVE_TRAITS && T_STRING === $token[0]) {
+ $lValue = strtolower($token[1]);
+ if ('trait' === $lValue) {
+ $token[0] = T_TRAIT;
+ } elseif ('insteadof' === $lValue) {
+ $token[0] = T_INSTEADOF;
+ } elseif ('__TRAIT__' === $token[1]) {
+ $token[0] = T_TRAIT_C;
+ } elseif ('callable' === $lValue) {
+ $token[0] = T_CALLABLE;
+ }
+ }
+
+ $this->tokens[] = $token;
+ } else {
+ $previous = $this->tokens[$position - 1];
+ $line = $previous[2];
+ if (isset($checkLines[$previous[0]])) {
+ $line += substr_count($previous[1], "\n");
+ }
+
+ $this->tokens[] = array($token, $token, $line);
+ }
+ }
+
+ $this->count = count($this->tokens);
+ }
+
+ /**
+ * Returns the file name this is a part of.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->fileName;
+ }
+
+ /**
+ * Returns the original source code.
+ *
+ * @return string
+ */
+ public function getSource()
+ {
+ return $this->getSourcePart();
+ }
+
+ /**
+ * Returns a part of the source code.
+ *
+ * @param mixed $start Start offset
+ * @param mixed $end End offset
+ * @return string
+ */
+ public function getSourcePart($start = null, $end = null)
+ {
+ $start = (int) $start;
+ $end = null === $end ? ($this->count - 1) : (int) $end;
+
+ $source = '';
+ for ($i = $start; $i <= $end; $i++) {
+ $source .= $this->tokens[$i][1];
+ }
+ return $source;
+ }
+
+ /**
+ * Finds the position of the token of the given type.
+ *
+ * @param integer|string $type Token type
+ * @return \TokenReflection\Stream|boolean
+ */
+ public function find($type)
+ {
+ $actual = $this->position;
+ while (isset($this->tokens[$this->position])) {
+ if ($type === $this->tokens[$this->position][0]) {
+ return $this;
+ }
+
+ $this->position++;
+ }
+
+ $this->position = $actual;
+ return false;
+ }
+
+ /**
+ * Returns the position of the token with the matching bracket.
+ *
+ * @return \TokenReflection\Stream
+ * @throws \TokenReflection\Exception\RuntimeException If out of the token stream.
+ * @throws \TokenReflection\Exception\RuntimeException If there is no bracket at the current position.
+ * @throws \TokenReflection\Exception\RuntimeException If the matching bracket could not be found.
+ */
+ public function findMatchingBracket()
+ {
+ static $brackets = array(
+ '(' => ')',
+ '{' => '}',
+ '[' => ']',
+ T_CURLY_OPEN => '}',
+ T_DOLLAR_OPEN_CURLY_BRACES => '}'
+ );
+
+ if (!$this->valid()) {
+ throw new Exception\StreamException($this, 'Out of token stream.', Exception\StreamException::READ_BEYOND_EOS);
+ }
+
+ $position = $this->position;
+
+ $bracket = $this->tokens[$this->position][0];
+
+ if (!isset($brackets[$bracket])) {
+ throw new Exception\StreamException($this, sprintf('There is no usable bracket at position "%d".', $position), Exception\StreamException::DOES_NOT_EXIST);
+ }
+
+ $searching = $brackets[$bracket];
+
+ $level = 0;
+ while (isset($this->tokens[$this->position])) {
+ $type = $this->tokens[$this->position][0];
+ if ($searching === $type) {
+ $level--;
+ } elseif ($bracket === $type || ($searching === '}' && ('{' === $type || T_CURLY_OPEN === $type || T_DOLLAR_OPEN_CURLY_BRACES === $type))) {
+ $level++;
+ }
+
+ if (0 === $level) {
+ return $this;
+ }
+
+ $this->position++;
+ }
+
+ throw new Exception\StreamException($this, sprintf('Could not find the end bracket "%s" of the bracket at position "%d".', $searching, $position), Exception\StreamException::DOES_NOT_EXIST);
+ }
+
+ /**
+ * Skips whitespaces and comments next to the current position.
+ *
+ * @param boolean $skipDocBlocks Skip docblocks as well
+ * @return \TokenReflection\Stream\StreamBase
+ */
+ public function skipWhitespaces($skipDocBlocks = false)
+ {
+ static $skipped = array(T_WHITESPACE => true, T_COMMENT => true, T_DOC_COMMENT => true);
+
+ do {
+ $this->position++;
+ } while (isset($this->tokens[$this->position]) && isset($skipped[$this->tokens[$this->position][0]]) && ($skipDocBlocks || $this->tokens[$this->position][0] !== T_DOC_COMMENT));
+
+ return $this;
+ }
+
+ /**
+ * Returns if the token stream is at a whitespace position.
+ *
+ * @param boolean $docBlock Consider docblocks as whitespaces
+ * @return boolean
+ */
+ public function isWhitespace($docBlock = false)
+ {
+ static $skipped = array(T_WHITESPACE => true, T_COMMENT => true, T_DOC_COMMENT => false);
+
+ if (!$this->valid()) {
+ return false;
+ }
+
+ return $docBlock ? isset($skipped[$this->getType()]) : !empty($skipped[$this->getType()]);
+ }
+
+ /**
+ * Checks if there is a token of the given type at the given position.
+ *
+ * @param integer|string $type Token type
+ * @param integer $position Position; if none given, consider the current iteration position
+ * @return boolean
+ */
+ public function is($type, $position = -1)
+ {
+ return $type === $this->getType($position);
+ }
+
+ /**
+ * Returns the type of a token.
+ *
+ * @param integer $position Token position; if none given, consider the current iteration position
+ * @return string|integer|null
+ */
+ public function getType($position = -1)
+ {
+ if (-1 === $position) {
+ $position = $this->position;
+ }
+
+ return isset($this->tokens[$position]) ? $this->tokens[$position][0] : null;
+ }
+
+ /**
+ * Returns the current token value.
+ *
+ * @param integer $position Token position; if none given, consider the current iteration position
+ * @return stirng
+ */
+ public function getTokenValue($position = -1)
+ {
+ if (-1 === $position) {
+ $position = $this->position;
+ }
+
+ return isset($this->tokens[$position]) ? $this->tokens[$position][1] : null;
+ }
+
+ /**
+ * Returns the token type name.
+ *
+ * @param integer $position Token position; if none given, consider the current iteration position
+ * @return string|null
+ */
+ public function getTokenName($position = -1)
+ {
+ $type = $this->getType($position);
+ if (is_string($type)) {
+ return $type;
+ } elseif (T_TRAIT === $type) {
+ return 'T_TRAIT';
+ } elseif (T_INSTEADOF === $type) {
+ return 'T_INSTEADOF';
+ } elseif (T_CALLABLE === $type) {
+ return 'T_CALLABLE';
+ }
+
+ return token_name($type);
+ }
+
+ /**
+ * Stream serialization.
+ *
+ * @return string
+ */
+ public function serialize()
+ {
+ return serialize(array($this->fileName, $this->tokens));
+ }
+
+ /**
+ * Restores the stream from the serialized state.
+ *
+ * @param string $serialized Serialized form
+ * @throws \TokenReflection\Exception\StreamException On deserialization error.
+ */
+ public function unserialize($serialized)
+ {
+ $data = @unserialize($serialized);
+ if (false === $data) {
+ throw new Exception\StreamException($this, 'Could not deserialize the serialized data.', Exception\StreamException::SERIALIZATION_ERROR);
+ }
+ if (2 !== count($data) || !is_string($data[0]) || !is_array($data[1])) {
+ throw new Exception\StreamException($this, 'Invalid serialization data.', Exception\StreamException::SERIALIZATION_ERROR);
+ }
+
+ $this->fileName = $data[0];
+ $this->tokens = $data[1];
+ $this->count = count($this->tokens);
+ $this->position = 0;
+ }
+
+ /**
+ * Checks of there is a token with the given index.
+ *
+ * @param integer $offset Token index
+ * @return boolean
+ */
+ public function offsetExists($offset)
+ {
+ return isset($this->tokens[$offset]);
+ }
+
+ /**
+ * Removes a token.
+ *
+ * Unsupported.
+ *
+ * @param integer $offset Position
+ * @throws \TokenReflection\Exception\StreamException Unsupported.
+ */
+ public function offsetUnset($offset)
+ {
+ throw new Exception\StreamException($this, 'Removing of tokens from the stream is not supported.', Exception\StreamException::UNSUPPORTED);
+ }
+
+ /**
+ * Returns a token at the given index.
+ *
+ * @param integer $offset Token index
+ * @return mixed
+ */
+ public function offsetGet($offset)
+ {
+ return isset($this->tokens[$offset]) ? $this->tokens[$offset] : null;
+ }
+
+ /**
+ * Sets a value of a particular token.
+ *
+ * Unsupported
+ *
+ * @param integer $offset Position
+ * @param mixed $value Value
+ * @throws \TokenReflection\Exception\StreamException Unsupported.
+ */
+ public function offsetSet($offset, $value)
+ {
+ throw new Exception\StreamException($this, 'Setting token values is not supported.', Exception\StreamException::UNSUPPORTED);
+ }
+
+ /**
+ * Returns the current internal pointer value.
+ *
+ * @return integer
+ */
+ public function key()
+ {
+ return $this->position;
+ }
+
+ /**
+ * Advances the internal pointer.
+ *
+ * @return \TokenReflection\Stream
+ */
+ public function next()
+ {
+ $this->position++;
+ return $this;
+ }
+
+ /**
+ * Sets the internal pointer to zero.
+ *
+ * @return \TokenReflection\Stream
+ */
+ public function rewind()
+ {
+ $this->position = 0;
+ return $this;
+ }
+
+ /**
+ * Returns the current token.
+ *
+ * @return array|null
+ */
+ public function current()
+ {
+ return isset($this->tokens[$this->position]) ? $this->tokens[$this->position] : null;
+ }
+
+ /**
+ * Checks if there is a token on the current position.
+ *
+ * @return boolean
+ */
+ public function valid()
+ {
+ return isset($this->tokens[$this->position]);
+ }
+
+ /**
+ * Returns the number of tokens in the stream.
+ *
+ * @return integer
+ */
+ public function count()
+ {
+ return $this->count;
+ }
+
+ /**
+ * Sets the internal pointer to the given value.
+ *
+ * @param integer $position New position
+ * @return \TokenReflection\Stream
+ */
+ public function seek($position)
+ {
+ $this->position = (int) $position;
+ return $this;
+ }
+
+ /**
+ * Returns the stream source code.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getSource();
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/TokenReflection/Stream/StringStream.php b/vendor/andrewsville/php-token-reflection/TokenReflection/Stream/StringStream.php
new file mode 100644
index 0000000..16f7c2b
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/TokenReflection/Stream/StringStream.php
@@ -0,0 +1,38 @@
+fileName = $fileName;
+ $this->processSource($source);
+ }
+}
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/build.xml b/vendor/andrewsville/php-token-reflection/build.xml
new file mode 100644
index 0000000..933efdd
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/build.xml
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/build/phpcs.xml b/vendor/andrewsville/php-token-reflection/build/phpcs.xml
new file mode 100644
index 0000000..0b2edf2
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/build/phpcs.xml
@@ -0,0 +1,10 @@
+
+
+ TokenReflection coding standard
+
+
+
+
+ 0
+
+
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/build/phpmd.xml b/vendor/andrewsville/php-token-reflection/build/phpmd.xml
new file mode 100644
index 0000000..c6ac54d
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/build/phpmd.xml
@@ -0,0 +1,15 @@
+
+
+
+ TokenReflection PHPMD rule set
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/build/phpunit.xml b/vendor/andrewsville/php-token-reflection/build/phpunit.xml
new file mode 100644
index 0000000..740245b
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/build/phpunit.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ ../tests/TokenReflection
+
+
+
+
+ ../TokenReflection
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/composer.json b/vendor/andrewsville/php-token-reflection/composer.json
new file mode 100644
index 0000000..09ff6ba
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/composer.json
@@ -0,0 +1,29 @@
+{
+ "name": "andrewsville/php-token-reflection",
+ "type": "library",
+ "description": "Library emulating the PHP internal reflection using just the tokenized source code.",
+ "keywords": ["library", "tokenizer", "reflection"],
+ "homepage": "http://andrewsville.github.com/PHP-Token-Reflection/",
+ "license": "BSD-3",
+
+ "authors": [
+ {
+ "name": "Ondřej Nešpor",
+ "homepage": "https://github.com/Andrewsville"
+ },
+ {
+ "name": "Jaroslav Hanslík",
+ "homepage": "https://github.com/kukulich"
+ }
+ ],
+
+ "require": {
+ "php": ">=5.3"
+ },
+
+ "autoload": {
+ "psr-0": {
+ "TokenReflection": "./"
+ }
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/package.xml b/vendor/andrewsville/php-token-reflection/package.xml
new file mode 100644
index 0000000..df6380c
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/package.xml
@@ -0,0 +1,121 @@
+
+
+TokenReflection
+pear.andrewsville.cz
+PHP reflection replacement.
+
+ Reflection library that does not need to load the source code and uses just the tokenized source code. Compatible with the PHP reflection and adds many useful features.
+
+
+ Ondřej Nešpor
+ andrewsville
+ andrew@andrewsville.cz
+ yes
+
+
+ Jaroslav Hanslík
+ kukulich
+ kontakt@kukulich.cz
+ yes
+
+2012-08-25
+
+ 1.3.1
+ 1.0.0
+
+
+ stable
+ stable
+
+New BSD
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5.3.0
+
+
+ 1.4.0
+
+
+ tokenizer
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ConsistencyTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ConsistencyTest.php
new file mode 100644
index 0000000..5b881f4
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ConsistencyTest.php
@@ -0,0 +1,270 @@
+createBroker();
+ $broker->processFile(__DIR__ . '/../data/constant/in-namespace.php');
+ try {
+ $broker->processFile(__DIR__ . '/../data/duplicities/otherfile.php');
+ } catch (Exception\FileProcessingException $e) {
+ // Expected
+ }
+
+ $this->assertNotSame(null, @constant('PHP_INT_MAX'));
+ $constants = array(
+ 'tokenized' => $broker->getConstant('TokenReflection\\Test\\CONSTANT_IN_NAMESPACE'),
+ 'internal' => $broker->getConstant('PHP_INT_MAX'),
+ 'invalid' => $broker->getConstant('DUPLICITIES_CONSTANTS_1')
+ );
+
+ // Test cross-consistency
+ foreach ($constants as $referenceType => $referenceConstant) {
+ foreach ($constants as $type => $constant) {
+ if ($referenceType !== $type) {
+ $this->crossConsistencyTest($referenceConstant, $constant);
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests reflection consistency.
+ */
+ public function testClassReflectionConsistency()
+ {
+ $broker = $this->createBroker();
+ $broker->processFile(__FILE__);
+ try {
+ $broker->processFile(__DIR__ . '/../data/duplicities/otherfile.php');
+ } catch (Exception\FileProcessingException $e) {
+ // Expected
+ }
+
+ $this->assertFalse(class_exists('Foo\\Bar', true));
+ $classes = array(
+ 'tokenized' => $broker->getClass('TokenReflection\\ConsistencyTest'),
+ 'internal' => $broker->getClass('Exception'),
+ 'dummy' => $broker->getClass('Foo\\Bar'),
+ 'invalid' => $broker->getClass('duplicitiesClasses1')
+ );
+
+ // Test consistency with the internal reflection
+ foreach ($classes as $class) {
+ $this->internalConsistencyTest(new \ReflectionClass(new \stdClass()), $class);
+ }
+
+ // Test cross-consistency
+ foreach ($classes as $referenceType => $referenceClass) {
+ foreach ($classes as $type => $class) {
+ if ($referenceType !== $type) {
+ $this->crossConsistencyTest($referenceClass, $class);
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests reflection consistency.
+ */
+ public function testFunctionReflectionConsistency()
+ {
+ $broker = $this->createBroker();
+ $broker->processFile(__DIR__ . '/../data/function/in-namespace.php');
+ try {
+ $broker->processFile(__DIR__ . '/../data/duplicities/otherfile.php');
+ } catch (Exception\FileProcessingException $e) {
+ // Expected
+ }
+
+ $this->assertTrue(function_exists('constant'));
+ $functions = array(
+ 'tokenized' => $broker->getFunction('TokenReflection\\Test\\functionInNamespace'),
+ 'internal' => $broker->getFunction('constant'),
+ 'invalid' => $broker->getFunction('duplicitiesFunctions1')
+ );
+
+ // Test consistency with the internal reflection
+ foreach ($functions as $function) {
+ $this->internalConsistencyTest(new \ReflectionFunction('constant'), $function);
+ }
+
+ // Test cross-consistency
+ foreach ($functions as $referenceType => $referenceFunction) {
+ foreach ($functions as $type => $function) {
+ if ($referenceType !== $type) {
+ $this->crossConsistencyTest($referenceFunction, $function);
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests reflection consistency.
+ */
+ public function testPropertyReflectionConsistency()
+ {
+ $broker = $this->createBroker();
+ $broker->processFile(__DIR__ . '/../data/property/lines.php');
+
+ $this->assertTrue(function_exists('constant'));
+ $properties = array(
+ 'tokenized' => $broker->getClass('TokenReflection_Test_PropertyLines')->getProperty('lines'),
+ 'internal' => $broker->getClass('Exception')->getProperty('message')
+ );
+
+ // Test consistency with the internal reflection
+ foreach ($properties as $property) {
+ $this->internalConsistencyTest(new \ReflectionProperty('Exception', 'message'), $property);
+ }
+
+ // Test cross-consistency
+ foreach ($properties as $referenceType => $referenceProperty) {
+ foreach ($properties as $type => $property) {
+ if ($referenceType !== $type) {
+ $this->crossConsistencyTest($referenceProperty, $property);
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests reflection consistency.
+ */
+ public function testMethodReflectionConsistency()
+ {
+ $broker = $this->createBroker();
+ $broker->processFile(__DIR__ . '/../data/method/access-level.php');
+
+ $methods = array(
+ 'tokenized' => $broker->getClass('TokenReflection_Test_MethodAccessLevelParent')->getMethod('privateNoExtended'),
+ 'internal' => $broker->getClass('Exception')->getMethod('getMessage')
+ );
+
+ // Test consistency with the internal reflection
+ foreach ($methods as $method) {
+ $this->internalConsistencyTest(new \ReflectionMethod('Exception', 'getMessage'), $method);
+ }
+
+ // Test cross-consistency
+ foreach ($methods as $referenceType => $referenceMethod) {
+ foreach ($methods as $type => $method) {
+ if ($referenceType !== $type) {
+ $this->crossConsistencyTest($referenceMethod, $method);
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests reflection consistency.
+ */
+ public function testParameterReflectionConsistency()
+ {
+ $broker = $this->createBroker();
+ $broker->processFile(__DIR__ . '/../data/parameter/optional-false.php');
+
+ $parameters = array(
+ 'tokenized' => $broker->getFunction('tokenReflectionParameterOptionalFalse')->getParameter('one'),
+ 'internal' => $broker->getFunction('constant')->getParameter('const_name')
+ );
+
+ // Test consistency with the internal reflection
+ foreach ($parameters as $parameter) {
+ $this->internalConsistencyTest(new \ReflectionParameter('constant', 'const_name'), $parameter);
+ }
+
+ // Test cross-consistency
+ foreach ($parameters as $referenceType => $referenceParameter) {
+ foreach ($parameters as $type => $parameter) {
+ if ($referenceType !== $type) {
+ $this->crossConsistencyTest($referenceParameter, $parameter);
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests API consistency of two TR reflections.
+ *
+ * @param \TokenReflection\IReflection $reference Reference reflection
+ * @param \TokenReflection\IReflection $token Tested reflection
+ */
+ private function crossConsistencyTest(IReflection $reference, IReflection $token)
+ {
+ $this->performConsistencyTest(new \ReflectionClass($reference), new \ReflectionClass($token));
+ }
+
+ /**
+ * Tests API consistency of an internal reflection and TR.
+ *
+ * @param \Reflector $reference Reference reflection
+ * @param \TokenReflection\IReflection $token Tested reflection
+ */
+ private function internalConsistencyTest(\Reflector $reference, IReflection $token)
+ {
+ $this->performConsistencyTest(new \ReflectionClass($reference), new \ReflectionClass($token));
+ }
+
+ /**
+ * Tests API consistency of two classes.
+ *
+ * @param \ReflectionClass $reference Reference class reflection
+ * @param \ReflectionClass $test Tested class reflection
+ */
+ private function performConsistencyTest(\ReflectionClass $reference, \ReflectionClass $test)
+ {
+ static $skip = array(
+ '*' => array('addReason' => true, 'getReasons' => true, 'hasReasons' => true),
+ 'TokenReflection\\Php\\IReflection' => array('alias' => true, 'getFileReflection' => true, 'getSource' => true, 'getStartPosition' => true, 'getEndPosition' => true),
+ 'TokenReflection\\Php\\ReflectionProperty' => array('setDefaultValue' => true)
+ );
+
+ $methods = $reference->getMethods(\ReflectionMethod::IS_PUBLIC);
+ foreach ($methods as $method) {
+ if ($method->isStatic()) {
+ continue;
+ }
+
+ if (isset($skip['*'][$method->getName()])) {
+ continue;
+ }
+
+ foreach ($skip as $className => $skipping) {
+ if (isset($skipping[$method->getName()]) && ($className === $test->getName() || $test->isSubclassOf($className))) {
+ continue 2;
+ }
+ }
+
+ $this->assertTrue($test->hasMethod($method->getName()), sprintf('%s::%s() (defined in %s)', $test->getName(), $method->getName(), $reference->getName()));
+ }
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/DuplicitiesTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/DuplicitiesTest.php
new file mode 100644
index 0000000..9a0390e
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/DuplicitiesTest.php
@@ -0,0 +1,170 @@
+getBroker();
+ try {
+ $broker->processFile($fileName = $this->getFilePath('constants'));
+
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (Exception\FileProcessingException $e) {
+ // Expected
+ }
+
+ $this->assertTrue($broker->hasConstant('DUPLICITIES_CONSTANTS_1'));
+ $this->assertTrue($broker->hasConstant('DUPLICITIES_CONSTANTS_2'));
+ $this->assertTrue($broker->hasFunction('duplicitiesConstants'));
+ $this->assertTrue($broker->hasClass('duplicitiesConstants'));
+
+ $constant = $broker->getConstant('DUPLICITIES_CONSTANTS_1');
+ $this->assertInstanceOf('TokenReflection\\Invalid\\ReflectionConstant', $constant);
+ $this->assertSame($fileName, $constant->getFileName());
+ $this->assertTrue($constant->hasReasons());
+ }
+
+ /**
+ * Tests duplicit functions.
+ */
+ public function testFunctions()
+ {
+ $broker = $this->getBroker();
+ try {
+ $broker->processFile($fileName = $this->getFilePath('functions'));
+
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (Exception\FileProcessingException $e) {
+ // Expected
+ }
+
+ $this->assertTrue($broker->hasFunction('duplicitiesFunctions1'));
+ $this->assertTrue($broker->hasFunction('duplicitiesFunctions2'));
+ $this->assertTrue($broker->hasClass('duplicitiesFunctions'));
+ $this->assertTrue($broker->hasConstant('DUPLICITIES_FUNCTIONS'));
+
+ $function = $broker->getFunction('duplicitiesFunctions1');
+ $this->assertInstanceOf('TokenReflection\\Invalid\\ReflectionFunction', $function);
+ $this->assertSame($fileName, $function->getFileName());
+ $this->assertTrue($function->hasReasons());
+ }
+
+ /**
+ * Tests duplicit classes.
+ */
+ public function testClasses()
+ {
+ $broker = $this->getBroker();
+ try {
+ $broker->processFile($fileName = $this->getFilePath('classes'));
+
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (Exception\FileProcessingException $e) {
+ // Expected
+ }
+
+ $this->assertTrue($broker->hasClass('duplicitiesClasses1'));
+ $this->assertTrue($broker->hasClass('duplicitiesClasses2'));
+ $this->assertTrue($broker->hasFunction('duplicitiesClasses'));
+ $this->assertTrue($broker->hasConstant('DUPLICITIES_CLASSES'));
+
+ $class = $broker->getClass('duplicitiesClasses1');
+ $this->assertInstanceOf('TokenReflection\\Invalid\\ReflectionClass', $class);
+ $this->assertSame($fileName, $class->getFileName());
+ $this->assertTrue($class->hasReasons());
+ }
+
+ /**
+ * Tests duplicities from an another file.
+ */
+ public function testOtherFile()
+ {
+ $broker = $this->getBroker();
+ try {
+ $broker->processFile($fileName = $this->getFilePath('otherfile'));
+
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (Exception\FileProcessingException $e) {
+ // Expected
+ }
+
+ static $elements = array(
+ 'classes' => array(
+ 'duplicitiesConstants',
+ 'duplicitiesFunctions',
+ 'duplicitiesClasses1',
+ 'duplicitiesClasses2'
+ ),
+ 'functions' => array(
+ 'duplicitiesConstants',
+ 'duplicitiesFunctions1',
+ 'duplicitiesFunctions2',
+ 'duplicitiesClasses'
+ ),
+ 'constants' => array(
+ 'DUPLICITIES_CONSTANTS_1',
+ 'DUPLICITIES_CONSTANTS_2',
+ 'DUPLICITIES_FUNCTIONS',
+ 'DUPLICITIES_CLASSES'
+ )
+ );
+
+ foreach ($elements as $type => $names) {
+ foreach ($names as $name) {
+ switch ($type) {
+ case 'classes':
+ $this->assertTrue($broker->hasClass($name));
+
+ $reflection = $broker->getClass($name);
+ $this->assertInstanceOf('TokenReflection\\Invalid\\ReflectionClass', $reflection);
+ break;
+ case 'functions':
+ $this->assertTrue($broker->hasFunction($name));
+
+ $reflection = $broker->getFunction($name);
+ $this->assertInstanceOf('TokenReflection\\Invalid\\ReflectionFunction', $reflection);
+ break;
+ case 'constants':
+ $this->assertTrue($broker->hasConstant($name));
+
+ $reflection = $broker->getConstant($name);
+ $this->assertInstanceOf('TokenReflection\\Invalid\\ReflectionConstant', $reflection);
+ break;
+ }
+
+ $this->assertTrue($reflection->hasReasons());
+ $this->assertNotSame($fileName, $reflection->getFileName());
+ }
+ }
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ParseErrorTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ParseErrorTest.php
new file mode 100644
index 0000000..c72df3c
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ParseErrorTest.php
@@ -0,0 +1,199 @@
+getBroker());
+ }
+
+ /**
+ * Tests invalid source code handling.
+ *
+ * @param string $testName Test name
+ * @dataProvider invalidClassSourceCodeProvider
+ * @expectedException \TokenReflection\Exception\ParseException
+ */
+ public function testClasses($testName)
+ {
+ $this->performTest($testName);
+ }
+
+ /**
+ * Tests invalid source code handling.
+ *
+ * @param string $testName Test name
+ * @dataProvider invalidConstantSourceCodeProvider
+ * @expectedException \TokenReflection\Exception\ParseException
+ */
+ public function testConstants($testName)
+ {
+ $this->performTest($testName);
+ }
+
+ /**
+ * Tests invalid source code handling.
+ *
+ * @param string $testName Test name
+ * @dataProvider invalidFileSourceCodeProvider
+ * @expectedException \TokenReflection\Exception\ParseException
+ */
+ public function testFiles($testName)
+ {
+ $this->performTest($testName);
+ }
+
+ /**
+ * Tests invalid source code handling.
+ *
+ * @param string $testName Test name
+ * @dataProvider invalidFunctionBaseSourceCodeProvider
+ * @expectedException \TokenReflection\Exception\ParseException
+ */
+ public function testFunctionBases($testName)
+ {
+ $this->performTest($testName);
+ }
+
+ /**
+ * Tests invalid source code handling.
+ *
+ * @param string $testName Test name
+ * @dataProvider invalidParameterSourceCodeProvider
+ * @expectedException \TokenReflection\Exception\ParseException
+ */
+ public function testParameter($testName)
+ {
+ $this->performTest($testName);
+ }
+
+ /**
+ * Tests invalid source code handling.
+ *
+ * @param string $testName Test name
+ * @dataProvider invalidPropertySourceCodeProvider
+ * @expectedException \TokenReflection\Exception\ParseException
+ */
+ public function testProperty($testName)
+ {
+ $this->performTest($testName);
+ }
+
+ /**
+ * Performs a test.
+ *
+ * @param string $testName Test name
+ */
+ private function performTest($testName)
+ {
+ $broker = $this->getBroker();
+ $broker->processFile($this->getFilePath($testName));
+ }
+
+ /**
+ * Provider for invalid class source code handling tests.
+ *
+ * @return array
+ */
+ public function invalidClassSourceCodeProvider()
+ {
+ return $this->prepareTests('invalid-class', 10);
+ }
+
+ /**
+ * Provider for invalid constant source code handling tests.
+ *
+ * @return array
+ */
+ public function invalidConstantSourceCodeProvider()
+ {
+ return $this->prepareTests('invalid-constant', 4);
+ }
+
+ /**
+ * Provider for invalid file source code handling tests.
+ *
+ * @return array
+ */
+ public function invalidFileSourceCodeProvider()
+ {
+ return $this->prepareTests('invalid-file', 7);
+ }
+
+ /**
+ * Provider for invalid function/method source code handling tests.
+ *
+ * @return array
+ */
+ public function invalidFunctionBaseSourceCodeProvider()
+ {
+ return $this->prepareTests('invalid-functionbase', 3);
+ }
+
+ /**
+ * Provider for invalid function/method source code handling tests.
+ *
+ * @return array
+ */
+ public function invalidParameterSourceCodeProvider()
+ {
+ return $this->prepareTests('invalid-parameter', 3);
+ }
+
+ /**
+ * Provider for invalid function/method source code handling tests.
+ *
+ * @return array
+ */
+ public function invalidPropertySourceCodeProvider()
+ {
+ return $this->prepareTests('invalid-property', 3);
+ }
+
+ /**
+ * Prepares test names.
+ *
+ * @param string $prefix Test name prefix
+ * @param integer $count Test count
+ * @return array
+ */
+ private function prepareTests($prefix, $count)
+ {
+ return array_map(function($i) use ($prefix) {
+ return array($prefix . '-' . $i);
+ }, range(1, $count));
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/PharTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/PharTest.php
new file mode 100644
index 0000000..c29256b
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/PharTest.php
@@ -0,0 +1,263 @@
+markTestSkipped('Not testing PHAR support on Travis CI.');
+ }
+
+ if (!extension_loaded('phar')) {
+ $this->markTestSkipped('The phar extension is required');
+ }
+
+ if (ini_get('phar.readonly')) {
+ $this->markTestSkipped('The phar extension must not be set to read-only.');
+ }
+ }
+
+ /**
+ * Compares items parsed from filesystem and from a PHAR archive.
+ *
+ * @param \TokenReflection\Broker $filesystem Filesystem TR broker
+ * @param \TokenReflection\Broker $phar PHAR TR broker
+ * @param integer $format PHAR archive format
+ * @param integer $compression PHAR archive compression
+ * @param integer $wholeArchive Whole archive compressed
+ */
+ private function archiveTest(Broker $filesystem, Broker $phar, $format, $compression, $wholeArchive)
+ {
+ $fsConstants = $filesystem->getConstants();
+ $pharConstants = $phar->getConstants();
+ $this->assertSame(count($fsConstants), count($pharConstants));
+ foreach (array_keys($fsConstants) as $name) {
+ $this->assertArrayHasKey($name, $pharConstants);
+ }
+
+ $fsClasses = $filesystem->getClasses();
+ $pharClasses = $phar->getClasses();
+ $this->assertSame(count($fsClasses), count($pharClasses));
+ foreach (array_keys($fsClasses) as $name) {
+ $this->assertArrayHasKey($name, $pharClasses);
+ }
+
+ $fsFunctions = $filesystem->getFunctions();
+ $pharFunctions = $phar->getFunctions();
+ $this->assertSame(count($fsFunctions), count($pharFunctions));
+ foreach (array_keys($fsFunctions) as $name) {
+ $this->assertArrayHasKey($name, $pharFunctions);
+ }
+ }
+
+ /**
+ * Tests the PHAR file format.
+ */
+ public function testPharArchive()
+ {
+ foreach ($this->prepareData() as $testData) {
+ list($metadata, $filesystem, $phar) = $testData;
+
+ $this->archiveTest($filesystem, $phar, $metadata['format'], $metadata['compression'], $metadata['wholeArchive']);
+ }
+ }
+
+ /**
+ * Tests the zipped PHAR file format.
+ */
+ public function testZippedPharArchive()
+ {
+ if (!extension_loaded('zip')) {
+ $this->markTestSkipped('The zip extension is required to run this test.');
+ }
+
+ foreach ($this->prepareData(Phar::ZIP) as $testData) {
+ list($metadata, $filesystem, $phar) = $testData;
+
+ $this->archiveTest($filesystem, $phar, $metadata['format'], $metadata['compression'], $metadata['wholeArchive']);
+ }
+ }
+
+ /**
+ * Tests the gzipped PHAR file format.
+ */
+ public function testGZippedPharArchive()
+ {
+ if (!extension_loaded('zlib')) {
+ $this->markTestSkipped('The zlib extension is required to run this test.');
+ }
+
+ $testData = array_merge(
+ $this->prepareData(Phar::PHAR, Phar::GZ, false),
+ $this->prepareData(Phar::TAR, Phar::GZ, false),
+ $this->prepareData(Phar::PHAR, Phar::GZ, true),
+ $this->prepareData(Phar::TAR, Phar::GZ, true)
+ );
+
+ foreach ($testData as $testItem) {
+ list($metadata, $filesystem, $phar) = $testItem;
+
+ $this->archiveTest($filesystem, $phar, $metadata['format'], $metadata['compression'], $metadata['wholeArchive']);
+ }
+ }
+
+ /**
+ * Tests the bzipped PHAR file format.
+ */
+ public function testBZippedPharArchive()
+ {
+ if (!extension_loaded('bz2')) {
+ $this->markTestSkipped('The zlib extension is required to run this test.');
+ }
+
+ $testData = array_merge(
+ $this->prepareData(Phar::PHAR, Phar::BZ2, false),
+ $this->prepareData(Phar::TAR, Phar::BZ2, false),
+ $this->prepareData(Phar::PHAR, Phar::BZ2, true),
+ $this->prepareData(Phar::TAR, Phar::BZ2, true)
+ );
+
+ foreach ($testData as $testItem) {
+ list($metadata, $filesystem, $phar) = $testItem;
+
+ $this->archiveTest($filesystem, $phar, $metadata['format'], $metadata['compression'], $metadata['wholeArchive']);
+ }
+ }
+
+ /**
+ * Prepares the temporary storage and returns its path.
+ *
+ * @return string
+ */
+ private function prepareTemporaryStorage()
+ {
+ $dirName = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('tr_phar_test');
+ if (!mkdir($dirName)) {
+ $this->fail('Could not create the temporary storage.');
+ }
+
+ return $dirName;
+ }
+
+ /**
+ * Cleans up the temporary storage.
+ *
+ * @param string $path Storage path
+ */
+ private function cleanUpTemporaryStorage($path)
+ {
+ $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
+ foreach ($iterator as $item) {
+ if ($item->isFile()) {
+ unlink($item->getPathName());
+ } elseif ($item->isDir() && !$item->isDot()) {
+ rmdir($item->getPathName());
+ }
+ }
+
+ rmdir($path);
+ }
+
+ /**
+ * Data preparer.
+ *
+ * Returns pairs of TokenReflection\Broker where one parses a directory of given type
+ * and the second one parses a PHAR archive that was created from the same directory.
+ *
+ * @param integer $format Archive format
+ * @param integer $compression Archive compression
+ * @param boolean $wholeArchive Use compression for the whole archive
+ * @return array
+ */
+ private function prepareData($format = Phar::PHAR, $compression = Phar::NONE, $wholeArchive = true)
+ {
+ $dirName = $this->prepareTemporaryStorage();
+
+ $directory = realpath(__DIR__ . '/../data/');
+ $iterator = new \DirectoryIterator($directory);
+
+ static $skip = array('broker' => true, 'parseerror' => true, 'duplicities' => true);
+
+ $data = array();
+ foreach ($iterator as $item) {
+ if (isset($skip[$item->getFileName()])) {
+ continue;
+ }
+
+ if ($item->isDir() && !$item->isDot()) {
+ $ext = '.phar';
+ $fileName = $dirName . DIRECTORY_SEPARATOR . uniqid($format . $compression);
+
+ $phar = new Phar($fileName . $ext);
+ $phar->buildFromDirectory($item->getPathName());
+
+ if ($format !== Phar::PHAR) {
+ if ($format === Phar::TAR) {
+ $ext .= '.tar';
+ } elseif ($format === Phar::ZIP) {
+ $ext .= '.zip';
+ }
+
+ $phar->convertToExecutable($format, $wholeArchive ? $compression : Phar::NONE, $ext);
+ }
+ if ($compression !== Phar::NONE && !$wholeArchive) {
+ $phar->compressFiles($compression);
+ }
+
+ unset($phar);
+
+ $dataItem = array(
+ array(
+ 'format' => $format,
+ 'compression' => $compression,
+ 'wholeArchive' => $wholeArchive,
+ )
+ );
+
+ $broker = new Broker(new Broker\Backend\Memory(), 0);
+ $broker->processDirectory($item->getPathName());
+ $dataItem[] = $broker;
+
+ $broker2 = new Broker(new Broker\Backend\Memory(), 0);
+ $broker2->process($fileName . $ext);
+ $dataItem[] = $broker2;
+
+ $data[] = $dataItem;
+ }
+ }
+
+ $this->cleanUpTemporaryStorage($dirName);
+
+ return $data;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionAnnotationTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionAnnotationTest.php
new file mode 100644
index 0000000..420aa16
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionAnnotationTest.php
@@ -0,0 +1,50 @@
+getBroker();
+ $broker->processString('assertTrue($broker->hasClass('AnnotationInvalidTemplate'));
+ $class = $broker->getClass('AnnotationInvalidTemplate');
+
+ $a = new ReflectionAnnotation($class);
+ $a->setTemplates(array(new \Exception()));
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionBrokerTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionBrokerTest.php
new file mode 100644
index 0000000..8974baa
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionBrokerTest.php
@@ -0,0 +1,292 @@
+getFileTokenReflection('empty');
+ }
+
+ /**
+ * Tests filenames filtering.
+ *
+ * @dataProvider filenameFilterProvider
+ * @param string|array $filters Filename filter(s)
+ * @param array $fileNames Filtered filenames
+ */
+ public function testFilenameFiltering($filters, array $fileNames)
+ {
+ $broker = new Broker(new Broker\Backend\Memory());
+ $files = $broker->processDirectory(realpath(__DIR__ . '/../data/class'), $filters, true);
+
+ $brokerFileNames = array();
+ foreach ($files as $file) {
+ $brokerFileNames[] = basename($file->getName());
+ }
+
+ $this->compareFileLists($fileNames, $brokerFileNames);
+ }
+
+ /**
+ * Tests directory and filename filtering.
+ *
+ * @dataProvider directoryFilterProvider
+ * @param string|array $filters Filename filter(s)
+ * @param array $fileNames Filtered filenames
+ */
+ public function testDirectoryFiltering($filters, array $fileNames)
+ {
+ $broker = new Broker(new Broker\Backend\Memory());
+ $files = $broker->processDirectory(realpath(__DIR__ . '/../data'), $filters, true);
+
+ $brokerFileNames = array();
+ foreach ($files as $file) {
+ $brokerFileNames[] = basename($file->getName());
+ }
+
+ $this->compareFileLists($fileNames, $brokerFileNames);
+ }
+
+ /**
+ * Tests an exception thrown when a file could not be processed.
+ *
+ * @expectedException \TokenReflection\Exception\BrokerException
+ */
+ public function testFileProcessingError()
+ {
+ $file = __DIR__ . DIRECTORY_SEPARATOR . '~#nonexistent#~';
+
+ if (is_file($file)) {
+ $this->markTestSkipped(sprintf('File %s exists.', $file));
+ }
+
+ $this->getBroker()->processFile($file);
+ }
+
+ /**
+ * Tests an exception thrown when a file could not be processed.
+ *
+ * @expectedException \TokenReflection\Exception\BrokerException
+ */
+ public function testDirectoryProcessingError()
+ {
+ $file = __DIR__ . DIRECTORY_SEPARATOR . '~#nonexistent#~' . DIRECTORY_SEPARATOR . '~#nonexistent#~';
+
+ if (is_dir($file)) {
+ $this->markTestSkipped(sprintf('Directory %s exists.', $file));
+ }
+
+ $this->getBroker()->processDirectory($file);
+ }
+
+ /**
+ * Tests an exception thrown when a file could not be processed.
+ *
+ * @expectedException \TokenReflection\Exception\BrokerException
+ */
+ public function testPharProcessingError()
+ {
+ $file = __DIR__ . DIRECTORY_SEPARATOR . '~#nonexistent#~';
+
+ if (is_file($file)) {
+ $this->markTestSkipped(sprintf('File %s exists.', $file));
+ }
+
+ $this->getBroker()->processPhar($file);
+ }
+
+ /**
+ * Tests an exception thrown when a file could not be processed.
+ *
+ * @expectedException \TokenReflection\Exception\BrokerException
+ */
+ public function testProcessingError()
+ {
+ $file = __DIR__ . DIRECTORY_SEPARATOR . '~#nonexistent#~';
+
+ if (is_file($file)) {
+ $this->markTestSkipped(sprintf('File %s exists.', $file));
+ }
+
+ $this->getBroker()->process($file);
+ }
+
+ /**
+ * Compares a filename list to an expected one.
+ *
+ * PhpUnit does not seem to let one compare two arrays without having to
+ * have elements in the same order (which is not important at all here).
+ *
+ * @param array $expected Expected filenames list
+ * @param array $actual Actual filenames list
+ */
+ private function compareFileLists(array $expected, array $actual)
+ {
+ $this->assertSame(count($expected), count($actual));
+ foreach ($expected as $fileName) {
+ $this->assertTrue(in_array($fileName, $actual));
+ }
+ }
+
+ /**
+ * Filename filters provider.
+ *
+ * @return array
+ */
+ public function filenameFilterProvider()
+ {
+ return array(
+ array(
+ '*.php',
+ array(
+ 'abstract.php',
+ 'abstract-implicit.php',
+ 'constants.php',
+ 'doc-comment.php',
+ 'doc-comment-copydoc.php',
+ 'doc-comment-inheritance.php',
+ 'doc-comment-many-lines.php',
+ 'double-properties.php',
+ 'final.php',
+ 'in-namespace.php',
+ 'instances.php',
+ 'interface.php',
+ 'interfaces.php',
+ 'iterator.php',
+ 'lines.php',
+ 'methods.php',
+ 'modifiers.php',
+ 'new-instance-without-constructor.php',
+ 'no-abstract.php',
+ 'no-constants.php',
+ 'no-doc-comment.php',
+ 'no-final.php',
+ 'no-interface.php',
+ 'no-interfaces.php',
+ 'no-iterator.php',
+ 'no-methods.php',
+ 'no-namespace.php',
+ 'no-parent.php',
+ 'no-properties.php',
+ 'parent.php',
+ 'pretty-names.php',
+ 'private-clone.php',
+ 'private-constructor.php',
+ 'properties.php',
+ 'public-clone.php',
+ 'public-constructor.php',
+ 'traits.php',
+ 'user-defined.php'
+ )
+ ),
+ array(
+ '*no-*.php',
+ array(
+ 'no-abstract.php',
+ 'no-constants.php',
+ 'no-doc-comment.php',
+ 'no-final.php',
+ 'no-interface.php',
+ 'no-interfaces.php',
+ 'no-iterator.php',
+ 'no-methods.php',
+ 'no-namespace.php',
+ 'no-parent.php',
+ 'no-properties.php'
+ )
+ ),
+ array(
+ '*-constructor.php',
+ array(
+ 'new-instance-without-constructor.php',
+ 'private-constructor.php',
+ 'public-constructor.php'
+ )
+ ),
+ );
+ }
+
+ /**
+ * Filename filters provider.
+ *
+ * @return array
+ */
+ public function directoryFilterProvider()
+ {
+ return array(
+ array(
+ '*constant' . DIRECTORY_SEPARATOR . '*.php',
+ array(
+ 'doc-comment.php',
+ 'doc-comment-copydoc.php',
+ 'heredoc.php',
+ 'in-namespace.php',
+ 'interfaces.php',
+ 'lines.php',
+ 'magic.php',
+ 'magic54.php',
+ 'no-comment.php',
+ 'no-namespace.php',
+ 'overriding.php',
+ 'pretty-names.php',
+ 'type-boolean.php',
+ 'type-constant.php',
+ 'type-float.php',
+ 'type-float-negative.php',
+ 'type-integer.php',
+ 'type-integer-negative.php',
+ 'type-null.php',
+ 'type-string.php',
+ 'value-definitions.php'
+ )
+ ),
+ array(
+ '*doc-comment.php',
+ array(
+ 'doc-comment.php',
+ 'doc-comment.php',
+ 'doc-comment.php',
+ 'doc-comment.php',
+ 'doc-comment.php',
+ 'doc-comment.php',
+ 'doc-comment.php',
+ 'no-doc-comment.php'
+ )
+ ),
+ array(
+ 'foo.php',
+ array()
+ )
+ );
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionClassTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionClassTest.php
new file mode 100644
index 0000000..c32a411
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionClassTest.php
@@ -0,0 +1,1495 @@
+getBroker();
+
+ foreach ($classNames as $className) {
+ $this->assertFalse($broker->hasClass($className));
+
+ $class = $broker->getClass($className);
+ $this->assertInstanceOf('TokenReflection\Dummy\ReflectionClass', $class);
+
+ $nameParts = explode('\\', $className);
+ if (1 === count($nameParts)) {
+ $shortName = $nameParts[0];
+ $namespaceName = '';
+ } else {
+ $shortName = array_pop($nameParts);
+ $namespaceName = implode('\\', $nameParts);
+ }
+
+ $this->assertSame($className, $class->getName());
+ $this->assertSame($className, $class->getPrettyName());
+ $this->assertSame($shortName, $class->getShortName());
+ $this->assertSame($namespaceName, $class->getNamespaceName());
+
+ if (empty($namespaceName)) {
+ $this->assertFalse($class->inNamespace());
+ } else {
+ $this->assertTrue($class->inNamespace());
+ }
+
+ $this->assertNull($class->getExtension());
+ $this->assertFalse($class->getExtensionName());
+
+ $this->assertNull($class->getFileName());
+ $this->assertNull($class->getEndLine());
+ $this->assertNull($class->getStartLine());
+
+ $this->assertFalse($class->getDocComment());
+ $this->assertSame(array(), $class->getAnnotations());
+ $this->assertFalse($class->hasAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertNull($class->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+
+ $this->assertSame(0, $class->getModifiers());
+
+ $this->assertFalse($class->isAbstract());
+ $this->assertFalse($class->isFinal());
+ $this->assertFalse($class->isInternal());
+ $this->assertFalse($class->isInterface());
+ $this->assertFalse($class->isException());
+ $this->assertFalse($class->isInstantiable());
+ $this->assertFalse($class->isCloneable());
+ $this->assertFalse($class->isIterateable());
+ $this->assertFalse($class->isInternal());
+ $this->assertFalse($class->isUserDefined());
+ $this->assertFalse($class->isTokenized());
+ $this->assertFalse($class->isComplete());
+
+ $this->assertFalse($class->isTrait());
+ $this->assertSame(array(), $class->getTraits());
+ $this->assertSame(array(), $class->getTraitNames());
+ $this->assertSame(array(), $class->getOwnTraits());
+ $this->assertSame(array(), $class->getOwnTraitNames());
+ $this->assertSame(array(), $class->getTraitAliases());
+ $this->assertFalse($class->usesTrait('Any'));
+
+ $this->assertFalse($class->isSubclassOf('Any'));
+ $this->assertFalse($class->getParentClass());
+ $this->assertNull($class->getParentClassName());
+ $this->assertSame(array(), $class->getParentClasses());
+ $this->assertSame(array(), $class->getParentClassNameList());
+
+ $this->assertFalse($class->implementsInterface('Traversable'));
+ $this->assertFalse($class->implementsInterface($broker->getClass('Traversable')));
+ $this->assertSame(array(), $class->getInterfaces());
+ $this->assertSame(array(), $class->getOwnInterfaces());
+ $this->assertSame(array(), $class->getInterfaceNames());
+ $this->assertSame(array(), $class->getOwnInterfaceNames());
+
+ $this->assertNull($class->getConstructor());
+ $this->assertNull($class->getDestructor());
+
+ $this->assertFalse($class->hasMethod('Any'));
+ $this->assertFalse($class->hasOwnMethod('Any'));
+ $this->assertFalse($class->hasTraitMethod('Any'));
+ $this->assertSame(array(), $class->getMethods());
+ $this->assertSame(array(), $class->getOwnMethods());
+ $this->assertSame(array(), $class->getTraitMethods());
+
+ $this->assertFalse($class->hasConstant('Any'));
+ $this->assertFalse($class->hasOwnConstant('Any'));
+ $this->assertSame(array(), $class->getConstants());
+ $this->assertSame(array(), $class->getOwnConstants());
+ $this->assertSame(array(), $class->getConstantReflections());
+ $this->assertSame(array(), $class->getOwnConstantReflections());
+
+ $this->assertSame(array(), $class->getDefaultProperties());
+ $this->assertFalse($class->hasProperty('Any'));
+ $this->assertFalse($class->hasOwnProperty('Any'));
+ $this->assertFalse($class->hasTraitProperty('Any'));
+ $this->assertSame(array(), $class->getProperties());
+ $this->assertSame(array(), $class->getOwnProperties());
+ $this->assertSame(array(), $class->getTraitProperties());
+ $this->assertSame(array(), $class->getStaticProperties());
+
+ $this->assertSame(array(), $class->getDirectSubclasses());
+ $this->assertSame(array(), $class->getDirectSubclassNames());
+ $this->assertSame(array(), $class->getDirectImplementers());
+ $this->assertSame(array(), $class->getDirectImplementerNames());
+ $this->assertSame(array(), $class->getIndirectSubclasses());
+ $this->assertSame(array(), $class->getIndirectSubclassNames());
+ $this->assertSame(array(), $class->getIndirectImplementers());
+ $this->assertSame(array(), $class->getIndirectImplementerNames());
+
+ $this->assertFalse($class->isInstance(new \Exception()));
+
+ $this->assertSame('', $class->getSource());
+
+ $this->assertSame($broker, $class->getBroker());
+ }
+ }
+
+ /**
+ * Tests an exception thrown when providing an invalid object.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyClassImplementsInterface1()
+ {
+ $this->getDummyClassReflection()->implementsInterface(new \Exception());
+ }
+
+ /**
+ * Tests an exception thrown when providing an invalid object.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyClassImplementsInterface2()
+ {
+ $this->getDummyClassReflection()->implementsInterface($this->getBroker()->getClass('Exception'));
+ }
+
+ /**
+ * Tests an exception thrown when getting a method from a dummy class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyClassGetMethod()
+ {
+ $this->getDummyClassReflection()->getMethod('any');
+ }
+
+ /**
+ * Tests an exception thrown when getting a property from a dummy class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyClassGetProperty()
+ {
+ $this->getDummyClassReflection()->getProperty('any');
+ }
+
+ /**
+ * Tests an exception thrown when getting a static property from a dummy class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyClassGetStaticProperty()
+ {
+ $this->getDummyClassReflection()->getStaticPropertyValue('any', null);
+ }
+
+ /**
+ * Tests an exception thrown when setting a static property from a dummy class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyClassSetStaticProperty()
+ {
+ $this->getDummyClassReflection()->setStaticPropertyValue('foo', 'bar');
+ }
+
+ /**
+ * Tests an exception thrown when getting a constant value from a dummy class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyClassGetConstantValue()
+ {
+ $this->getDummyClassReflection()->getConstant('any');
+ }
+
+ /**
+ * Tests an exception thrown when getting a constant reflection from a dummy class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyClassGetConstantReflection()
+ {
+ $this->getDummyClassReflection()->getConstantReflection('any');
+ }
+
+ /**
+ * Tests an exception thrown when providing an invalid argument to isInstance() method.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyClassIsInstance()
+ {
+ $this->getDummyClassReflection()->isInstance(true);
+ }
+
+ /**
+ * Tests an exception thrown when trying to instantiate a non existent class.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyNewInstanceWithoutConstructor()
+ {
+ $this->getDummyClassReflection()->newInstanceWithoutConstructor();
+ }
+
+ /**
+ * Tests an exception thrown when trying to instantiate a non existent class.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyNewInstance()
+ {
+ $this->getDummyClassReflection()->newInstance(null);
+ }
+
+ /**
+ * Tests an exception thrown when trying to instantiate a non existent class.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testDummyNewInstanceArgs()
+ {
+ $this->getDummyClassReflection()->newInstanceArgs();
+ }
+
+ /**
+ * Tests an exception thrown when providing an invalid object.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassIsSubclassOf()
+ {
+ $this->getInternalClassReflection()->isSubclassOf(new \Exception());
+ }
+
+ /**
+ * Tests an exception thrown when providing an invalid object.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassImplementsInterface1()
+ {
+ $this->getInternalClassReflection()->implementsInterface(new \Exception());
+ }
+
+ /**
+ * Tests an exception thrown when providing an invalid object.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassImplementsInterface2()
+ {
+ $this->getInternalClassReflection()->implementsInterface($this->getBroker()->getClass('Exception'));
+ }
+
+ /**
+ * Tests an exception thrown when providing an invalid class name.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassImplementsInterface3()
+ {
+ $this->getInternalClassReflection()->implementsInterface('Exception');
+ }
+
+ /**
+ * Tests an exception thrown when getting a method from an internal class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassGetMethod()
+ {
+ $this->getDummyClassReflection()->getMethod('~non-existent~');
+ }
+
+ /**
+ * Tests an exception thrown when getting a property from an internal class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassGetProperty()
+ {
+ $this->getDummyClassReflection()->getProperty('~non-existent~');
+ }
+
+ /**
+ * Tests an exception thrown when getting a static property from an internal class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassGetStaticProperty()
+ {
+ $this->getDummyClassReflection()->getStaticPropertyValue('~non-existent~', null);
+ }
+
+ /**
+ * Tests an exception thrown when setting a static property from an internal class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassSetStaticProperty()
+ {
+ $this->getDummyClassReflection()->setStaticPropertyValue('~non', 'existent~');
+ }
+
+ /**
+ * Tests an exception thrown when getting a constant value from an internal class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassGetConstantValue()
+ {
+ $this->getDummyClassReflection()->getConstant('~non-existent~');
+ }
+
+ /**
+ * Tests an exception thrown when getting a constant reflection from an internal class reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassGetConstantReflection()
+ {
+ $this->getDummyClassReflection()->getConstantReflection('~non-existent~');
+ }
+
+ /**
+ * Tests an exception thrown when providing an invalid object.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassUsesTrait1()
+ {
+ $this->getInternalClassReflection()->usesTrait(new \Exception());
+ }
+
+ /**
+ * Tests an exception thrown when providing an invalid object.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassUsesTrait2()
+ {
+ $this->getInternalClassReflection()->usesTrait($this->getBroker()->getClass('Exception'));
+ }
+
+ /**
+ * Tests an exception thrown when providing an invalid class name.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassUsesTrait3()
+ {
+ $this->getInternalClassReflection()->usesTrait('Exception');
+ }
+
+ /**
+ * Tests an exception thrown when it is impossible to create an instance without invoking the constructor.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassNewInstanceWithoutConstructor1()
+ {
+ $this->getInternalClassReflection()->newInstanceWithoutConstructor();
+ }
+
+ /**
+ * Tests an exception thrown when it is impossible to create an instance without invoking the constructor.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassNewInstanceWithoutConstructor2()
+ {
+ $reflection = new Php\ReflectionClass('TokenReflection\Exception\RuntimeException', $this->getBroker());
+ $reflection->newInstanceWithoutConstructor();
+ }
+
+ /**
+ * Tests an exception thrown when trying to create the reflection from a PHP internal reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalClassReflectionCreate()
+ {
+ Php\ReflectionClass::create(new \ReflectionFunction('create_function'), $this->getBroker());
+ }
+
+ /**
+ * Tests getting of class constants.
+ */
+ public function testConstants()
+ {
+ $rfl = $this->getClassReflection('constants');
+
+ $this->assertSame($rfl->internal->hasConstant('STRING'), $rfl->token->hasConstant('STRING'));
+ $this->assertTrue($rfl->token->hasConstant('STRING'));
+ $this->assertTrue($rfl->token->hasOwnConstant('STRING'));
+ $this->assertSame($rfl->internal->hasConstant('NONEXISTENT'), $rfl->token->hasConstant('NONEXISTENT'));
+ $this->assertFalse($rfl->token->hasConstant('NONEXISTENT'));
+ $this->assertFalse($rfl->token->hasOwnConstant('NONEXISTENT'));
+ $this->assertFalse($rfl->token->hasOwnConstant('PARENT'));
+
+ $this->assertSame($rfl->internal->getConstant('STRING'), $rfl->token->getConstant('STRING'));
+ $this->assertSame('string', $rfl->token->getConstant('STRING'));
+ $this->assertSame($rfl->internal->getConstant('NONEXISTENT'), $rfl->token->getConstant('NONEXISTENT'));
+ $this->assertFalse($rfl->token->getConstant('NONEXISTENT'));
+ $this->assertSame($rfl->internal->getConstants(), $rfl->token->getConstants());
+ $this->assertSame(array('STRING' => 'string', 'INTEGER' => 1, 'FLOAT' => 1.1, 'BOOLEAN' => true, 'PARENT' => 'parent'), $rfl->token->getConstants());
+ $this->assertSame(array('STRING' => 'string', 'INTEGER' => 1, 'FLOAT' => 1.1, 'BOOLEAN' => true), $rfl->token->getOwnConstants());
+ $this->assertSame(range(0, 3), array_keys($rfl->token->getOwnConstantReflections()));
+ foreach ($rfl->token->getOwnConstantReflections() as $constant) {
+ $this->assertInstanceOf('TokenReflection\ReflectionConstant', $constant);
+ }
+
+ $rfl = $this->getClassReflection('noConstants');
+
+ $this->assertSame($rfl->internal->hasConstant('NONEXISTENT'), $rfl->token->hasConstant('NONEXISTENT'));
+ $this->assertFalse($rfl->token->hasConstant('NONEXISTENT'));
+ $this->assertFalse($rfl->token->hasOwnConstant('NONEXISTENT'));
+
+ $this->assertSame($rfl->internal->getConstant('NONEXISTENT'), $rfl->token->getConstant('NONEXISTENT'));
+ $this->assertFalse($rfl->token->getConstant('NONEXISTENT'));
+ $this->assertSame($rfl->internal->getConstants(), $rfl->token->getConstants());
+ $this->assertSame(array(), $rfl->token->getConstants());
+ $this->assertSame(array(), $rfl->token->getOwnConstants());
+ $this->assertSame(array(), $rfl->token->getOwnConstantReflections());
+
+ $token = $this->getBroker()->getClass('RecursiveDirectoryIterator');
+ $this->assertTrue($token->hasConstant('CURRENT_AS_PATHNAME'));
+ $this->assertFalse($token->hasOwnConstant('CURRENT_AS_PATHNAME'));
+ $this->assertSame(0, count($token->getOwnConstants()));
+ $this->assertSame(0, count($token->getOwnConstantReflections()));
+ $this->assertSame('FilesystemIterator', $token->getConstantReflection('CURRENT_AS_PATHNAME')->getDeclaringClassName());
+ }
+
+ /**
+ * Tests getting of class properties.
+ */
+ public function testProperties()
+ {
+ $rfl = $this->getClassReflection('properties');
+
+ $filters = array(\ReflectionProperty::IS_STATIC, \ReflectionProperty::IS_PUBLIC, \ReflectionProperty::IS_PROTECTED, \ReflectionProperty::IS_PRIVATE);
+ foreach ($this->getFilterCombinations($filters) as $filter) {
+ $this->assertSame(array_keys($rfl->internal->getProperties($filter)), array_keys($rfl->token->getProperties($filter)));
+ foreach ($rfl->token->getProperties($filter) as $property) {
+ $this->assertInstanceOf('TokenReflection\ReflectionProperty', $property);
+ }
+ foreach ($rfl->token->getOwnProperties($filter) as $property) {
+ $this->assertInstanceOf('TokenReflection\ReflectionProperty', $property);
+ }
+ }
+
+ $this->assertSame($rfl->internal->getDefaultProperties(), $rfl->token->getDefaultProperties());
+ $this->assertSame(array('publicStatic' => true, 'privateStatic' => 'something', 'protectedStatic' => 1, 'public' => false, 'private' => '', 'protected' => 0), $rfl->token->getDefaultProperties());
+
+ $this->assertSame($rfl->internal->getStaticProperties(), $rfl->token->getStaticProperties());
+ $this->assertSame(array('publicStatic' => true, 'privateStatic' => 'something', 'protectedStatic' => 1), $rfl->token->getStaticProperties());
+
+ $properties = array('public', 'publicStatic', 'protectedStatic', 'protectedStatic', 'private', 'privateStatic');
+ foreach ($properties as $property) {
+ $this->assertSame($rfl->internal->hasProperty($property), $rfl->token->hasProperty($property));
+ $this->assertTrue($rfl->token->hasProperty($property));
+
+ $this->assertInstanceOf('TokenReflection\ReflectionProperty', $rfl->token->getProperty($property));
+ }
+
+ $properties = array('public', 'publicStatic', 'private', 'privateStatic');
+ foreach ($properties as $property) {
+ $this->assertTrue($rfl->token->hasOwnProperty($property));
+ }
+ $properties = array('protectedStatic', 'protectedStatic');
+ foreach ($properties as $property) {
+ $this->assertFalse($rfl->token->hasOwnProperty($property));
+ }
+
+ $this->assertFalse($rfl->token->hasProperty('nonExistent'));
+ try {
+ $rfl->token->getProperty('nonExistent');
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ $this->assertSame($rfl->internal->getStaticPropertyValue('publicStatic'), $rfl->token->getStaticPropertyValue('publicStatic'));
+ $this->assertTrue($rfl->token->getStaticPropertyValue('publicStatic'));
+
+ try {
+ $rfl->token->getStaticPropertyValue('protectedStatic');
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ try {
+ $rfl->token->getStaticPropertyValue('privateStatic');
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ $this->assertSame($rfl->internal->setStaticPropertyValue('publicStatic', false), $rfl->token->setStaticPropertyValue('publicStatic', false));
+ $this->assertNull($rfl->token->setStaticPropertyValue('publicStatic', false));
+ $this->assertSame($rfl->internal->getStaticPropertyValue('publicStatic'), $rfl->token->getStaticPropertyValue('publicStatic'));
+ $this->assertFalse($rfl->token->getStaticPropertyValue('publicStatic'));
+
+ try {
+ $rfl->token->setStaticPropertyValue('protectedStatic', 0);
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ try {
+ $rfl->token->setStaticPropertyValue('privateStatic', '');
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ $rfl = $this->getClassReflection('noProperties');
+
+ $this->assertSame($rfl->internal->getDefaultProperties(), $rfl->token->getDefaultProperties());
+ $this->assertSame(array(), $rfl->token->getDefaultProperties());
+ $this->assertSame($rfl->internal->getProperties(), $rfl->token->getProperties());
+ $this->assertSame(array(), $rfl->token->getProperties());
+ $this->assertSame(array(), $rfl->token->getOwnProperties());
+ $this->assertSame($rfl->internal->getStaticProperties(), $rfl->token->getStaticProperties());
+ $this->assertSame(array(), $rfl->token->getStaticProperties());
+
+ $this->assertSame($rfl->internal->hasProperty('nonExistent'), $rfl->token->hasProperty('nonExistent'));
+ $this->assertFalse($rfl->token->hasProperty('nonExistent'));
+ $this->assertFalse($rfl->token->hasOwnProperty('nonExistent'));
+
+ try {
+ $rfl->token->getProperty('nonExistent');
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ try {
+ $rfl->token->getStaticPropertyValue('nonExistent');
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ try {
+ $rfl->token->setStaticPropertyValue('property', 'property');
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ $rfl = $this->getClassReflection('doubleProperties');
+
+ $filters = array(\ReflectionProperty::IS_STATIC, \ReflectionProperty::IS_PUBLIC, \ReflectionProperty::IS_PROTECTED, \ReflectionProperty::IS_PRIVATE);
+ foreach ($this->getFilterCombinations($filters) as $filter) {
+ $this->assertSame(array_keys($rfl->internal->getProperties($filter)), array_keys($rfl->token->getProperties($filter)), $filter);
+ foreach ($rfl->token->getProperties($filter) as $property) {
+ $this->assertInstanceOf('TokenReflection\ReflectionProperty', $property);
+ }
+ foreach ($rfl->token->getOwnProperties($filter) as $property) {
+ $this->assertInstanceOf('TokenReflection\ReflectionProperty', $property);
+ }
+ }
+
+ $this->assertSame($rfl->internal->getDefaultProperties(), $rfl->token->getDefaultProperties());
+ $this->assertSame(array('protectedOne' => 1, 'protectedTwo' => 0, 'publicOne' => true, 'publicTwo' => false, 'privateOne' => 'something', 'privateTwo' => ''), $rfl->token->getDefaultProperties());
+
+ $this->assertSame($rfl->internal->getStaticProperties(), $rfl->token->getStaticProperties());
+ $this->assertSame(array('protectedOne' => 1, 'protectedTwo' => 0), $rfl->token->getStaticProperties());
+
+ $properties = array('publicOne', 'publicTwo', 'protectedOne', 'protectedTwo', 'privateOne', 'privateTwo');
+ foreach ($properties as $property) {
+ $this->assertSame($rfl->internal->hasProperty($property), $rfl->token->hasProperty($property));
+ $this->assertTrue($rfl->token->hasProperty($property));
+
+ $this->assertInstanceOf('TokenReflection\ReflectionProperty', $rfl->token->getProperty($property));
+ }
+ }
+
+ /**
+ * Tests if class is instantiable or cloneable.
+ */
+ public function testInstantiableCloneable()
+ {
+ $rfl = $this->getClassReflection('publicConstructor');
+ $this->assertSame($rfl->internal->isInstantiable(), $rfl->token->isInstantiable());
+ $this->assertTrue($rfl->token->isInstantiable());
+ if (PHP_VERSION_ID >= 50400) {
+ $this->assertSame($rfl->internal->isCloneable(), $rfl->token->isCloneable());
+ }
+ $this->assertTrue($rfl->token->isCloneable());
+
+ $rfl = $this->getClassReflection('privateConstructor');
+ $this->assertSame($rfl->internal->isInstantiable(), $rfl->token->isInstantiable());
+ $this->assertFalse($rfl->token->isInstantiable());
+ if (PHP_VERSION_ID >= 50400) {
+ $this->assertSame($rfl->internal->isCloneable(), $rfl->token->isCloneable());
+ }
+ $this->assertTrue($rfl->token->isCloneable());
+
+ $rfl = $this->getClassReflection('publicClone');
+ if (PHP_VERSION_ID >= 50400) {
+ $this->assertSame($rfl->internal->isCloneable(), $rfl->token->isCloneable());
+ }
+ $this->assertTrue($rfl->token->isCloneable());
+
+ $rfl = $this->getClassReflection('privateClone');
+ if (PHP_VERSION_ID >= 50400) {
+ $this->assertSame($rfl->internal->isCloneable(), $rfl->token->isCloneable());
+ }
+ $this->assertFalse($rfl->token->isCloneable());
+ }
+
+ /**
+ * Tests class modifiers.
+ */
+ public function testModifiers()
+ {
+ static $classes = array(
+ 'TokenReflection_Test_ClassModifiersIface1',
+ 'TokenReflection_Test_ClassModifiersIface2',
+ 'TokenReflection_Test_ClassModifiersIface3',
+ 'TokenReflection_Test_ClassModifiersIface4',
+ 'TokenReflection_Test_ClassModifiersClass1',
+ 'TokenReflection_Test_ClassModifiersClass2',
+ 'TokenReflection_Test_ClassModifiersClass3',
+ 'TokenReflection_Test_ClassModifiersClass4',
+ 'TokenReflection_Test_ClassModifiersClass5',
+ 'TokenReflection_Test_ClassModifiersClass6',
+ 'TokenReflection_Test_ClassModifiersClass7',
+ 'TokenReflection_Test_ClassModifiersClass8',
+ );
+
+ require_once $this->getFilePath('modifiers');
+ $this->getBroker()->process($this->getFilePath('modifiers'));
+
+ foreach ($classes as $className) {
+ $token = $this->getBroker()->getClass($className);
+ $internal = new \ReflectionClass($className);
+
+ $this->assertSame($internal->getModifiers(), $token->getModifiers(), $className);
+ }
+ }
+
+ /**
+ * Tests getting of class methods.
+ */
+ public function testMethods()
+ {
+ $rfl = $this->getClassReflection('methods');
+
+ $filters = array(\ReflectionMethod::IS_STATIC, \ReflectionMethod::IS_PUBLIC, \ReflectionMethod::IS_PROTECTED, \ReflectionMethod::IS_PRIVATE, \ReflectionMethod::IS_ABSTRACT, \ReflectionMethod::IS_FINAL);
+ foreach ($this->getFilterCombinations($filters) as $filter) {
+ $this->assertSame(array_keys($rfl->internal->getMethods($filter)), array_keys($rfl->token->getMethods($filter)));
+ foreach ($rfl->token->getMethods($filter) as $method) {
+ $this->assertInstanceOf('TokenReflection\ReflectionMethod', $method);
+ }
+ foreach ($rfl->token->getOwnMethods($filter) as $method) {
+ $this->assertInstanceOf('TokenReflection\ReflectionMethod', $method);
+ }
+ }
+
+ $methods = array('__construct', '__destruct', 'publicFinalFunction', 'publicStaticFunction', 'protectedStaticFunction', 'privateStaticFunction', 'publicFunction', 'protectedFunction', 'privateFunction');
+ foreach ($methods as $method) {
+ $this->assertSame($rfl->internal->hasMethod($method), $rfl->token->hasMethod($method));
+ $this->assertTrue($rfl->token->hasMethod($method));
+
+ $this->assertInstanceOf('TokenReflection\ReflectionMethod', $rfl->token->getMethod($method));
+ }
+
+ $methods = array('__construct', '__destruct', 'publicFinalFunction', 'publicStaticFunction', 'privateStaticFunction', 'publicFunction', 'privateFunction');
+ foreach ($methods as $method) {
+ $this->assertTrue($rfl->token->hasOwnMethod($method));
+ }
+ $methods = array('protectedStaticFunction', 'protectedFunction');
+ foreach ($methods as $method) {
+ $this->assertFalse($rfl->token->hasOwnMethod($method));
+ }
+
+ $this->assertInstanceOf('TokenReflection\ReflectionMethod', $rfl->token->getConstructor());
+ $this->assertInstanceOf('TokenReflection\ReflectionMethod', $rfl->token->getDestructor());
+
+ $this->assertFalse($rfl->token->hasMethod('nonExistent'));
+ try {
+ $rfl->token->getMethod('nonExistent');
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ $rfl = $this->getClassReflection('noMethods');
+
+ $this->assertSame($rfl->internal->getMethods(), $rfl->token->getMethods());
+ $this->assertSame(array(), $rfl->token->getMethods());
+ $this->assertSame(array(), $rfl->token->getOwnMethods());
+
+ try {
+ $rfl->token->getMethod('nonExistent');
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ $this->assertSame($rfl->internal->hasMethod('nonExistent'), $rfl->token->hasMethod('nonExistent'));
+ $this->assertFalse($rfl->token->hasMethod('nonExistent'));
+ $this->assertFalse($rfl->token->hasOwnMethod('nonExistent'));
+
+ $this->assertSame($rfl->internal->getConstructor(), $rfl->token->getConstructor());
+ $this->assertNull($rfl->token->getConstructor());
+ $this->assertNull($rfl->token->getDestructor());
+ }
+
+ /**
+ * Tests getting of start and end line.
+ */
+ public function testLines()
+ {
+ $rfl = $this->getClassReflection('lines');
+ $this->assertSame($rfl->internal->getStartLine(), $rfl->token->getStartLine());
+ $this->assertSame(3, $rfl->token->getStartLine());
+ $this->assertSame($rfl->internal->getEndLine(), $rfl->token->getEndLine());
+ $this->assertSame(5, $rfl->token->getEndLine());
+ }
+
+ /**
+ * Tests if class is instance of a object and tests creating new instances.
+ */
+ public function testInstances()
+ {
+ $rfl = $this->getClassReflection('instances');
+
+ $this->assertSame($rfl->internal->isInstance(new \TokenReflection_Test_ClassInstances(1)), $rfl->token->isInstance(new \TokenReflection_Test_ClassInstances(1)));
+ $this->assertTrue($rfl->token->isInstance(new \TokenReflection_Test_ClassInstances(1)));
+ $this->assertSame($rfl->internal->isInstance(new \TokenReflection_Test_ClassInstancesChild(1)), $rfl->token->isInstance(new \TokenReflection_Test_ClassInstancesChild(1)));
+ $this->assertTrue($rfl->token->isInstance(new \TokenReflection_Test_ClassInstancesChild(1)));
+ $this->assertSame($rfl->internal->isInstance(new \Exception()), $rfl->token->isInstance(new \Exception()));
+ $this->assertFalse($rfl->token->isInstance(new \Exception()));
+
+ $this->assertEquals($rfl->internal->newInstance(1), $rfl->token->newInstance(1));
+ $this->assertInstanceOf($this->getClassName('instances'), $rfl->token->newInstance(1));
+ $this->assertEquals($rfl->internal->newInstanceArgs(array(1)), $rfl->token->newInstanceArgs(array(1)));
+ $this->assertInstanceOf($this->getClassName('instances'), $rfl->token->newInstanceArgs(array(1)));
+ }
+
+ /**
+ * Tests if class is abstract.
+ */
+ public function testAbstract()
+ {
+ $rfl = $this->getClassReflection('abstract');
+ $this->assertSame($rfl->internal->isAbstract(), $rfl->token->isAbstract());
+ $this->assertTrue($rfl->token->isAbstract());
+ $this->assertSame($rfl->internal->isInstantiable(), $rfl->token->isInstantiable());
+ $this->assertFalse($rfl->token->isInstantiable());
+ $this->assertSame($rfl->internal->getModifiers(), $rfl->token->getModifiers());
+ $this->assertSame(InternalReflectionClass::IS_EXPLICIT_ABSTRACT, $rfl->token->getModifiers());
+
+ $rfl = $this->getClassReflection('abstractImplicit');
+ $this->assertSame($rfl->internal->isAbstract(), $rfl->token->isAbstract());
+ $this->assertTrue($rfl->token->isAbstract());
+ $this->assertSame($rfl->internal->isInstantiable(), $rfl->token->isInstantiable());
+ $this->assertFalse($rfl->token->isInstantiable());
+ $this->assertSame($rfl->internal->getModifiers(), $rfl->token->getModifiers());
+ $this->assertSame(InternalReflectionClass::IS_IMPLICIT_ABSTRACT | InternalReflectionClass::IS_EXPLICIT_ABSTRACT, $rfl->token->getModifiers());
+
+ $rfl = $this->getClassReflection('noAbstract');
+ $this->assertSame($rfl->internal->isAbstract(), $rfl->token->isAbstract());
+ $this->assertFalse($rfl->token->isAbstract());
+ $this->assertSame($rfl->internal->isInstantiable(), $rfl->token->isInstantiable());
+ $this->assertTrue($rfl->token->isInstantiable());
+ $this->assertSame($rfl->internal->getModifiers(), $rfl->token->getModifiers());
+ $this->assertSame(0, $rfl->token->getModifiers());
+ }
+
+ /**
+ * Tests if class is final.
+ */
+ public function testFinal()
+ {
+ $rfl = $this->getClassReflection('final');
+ $this->assertSame($rfl->internal->isFinal(), $rfl->token->isFinal());
+ $this->assertTrue($rfl->token->isFinal());
+ $this->assertSame($rfl->internal->getModifiers(), $rfl->token->getModifiers());
+ $this->assertSame(InternalReflectionClass::IS_FINAL, $rfl->token->getModifiers());
+
+ $rfl = $this->getClassReflection('noFinal');
+ $this->assertSame($rfl->internal->isFinal(), $rfl->token->isFinal());
+ $this->assertFalse($rfl->token->isFinal());
+ $this->assertSame($rfl->internal->getModifiers(), $rfl->token->getModifiers());
+ $this->assertSame(0, $rfl->token->getModifiers());
+ }
+
+ /**
+ * Tests if class is an interface.
+ */
+ public function testInterface()
+ {
+ $rfl = $this->getClassReflection('interface');
+ $this->assertSame($rfl->internal->isInterface(), $rfl->token->isInterface());
+ $this->assertTrue($rfl->token->isInterface());
+ $this->assertSame($rfl->internal->isInstantiable(), $rfl->token->isInstantiable());
+ $this->assertFalse($rfl->token->isInstantiable());
+
+ $rfl = $this->getClassReflection('noInterface');
+ $this->assertSame($rfl->internal->isInterface(), $rfl->token->isInterface());
+ $this->assertFalse($rfl->token->isInterface());
+ $this->assertSame($rfl->internal->isInstantiable(), $rfl->token->isInstantiable());
+ $this->assertTrue($rfl->token->isInstantiable());
+ }
+
+ /**
+ * Tests if class implements interfaces.
+ */
+ public function testInterfaces()
+ {
+ $rfl = $this->getClassReflection('interfaces');
+
+ $this->assertSame($rfl->internal->getModifiers(), $rfl->token->getModifiers());
+ $this->assertSame($rfl->internal->getInterfaceNames(), $rfl->token->getInterfaceNames());
+ $this->assertSame(array('Traversable', 'Iterator', 'Countable', 'ArrayAccess', 'Serializable'), $rfl->token->getInterfaceNames());
+ $this->assertSame(array('Countable', 'ArrayAccess', 'Serializable'), $rfl->token->getOwnInterfaceNames());
+ $this->assertSame(array_keys($rfl->internal->getInterfaces()), array_keys($rfl->token->getInterfaces()));
+ $this->assertSame(array('Traversable', 'Iterator', 'Countable', 'ArrayAccess', 'Serializable'), array_keys($rfl->token->getInterfaces()));
+ $this->assertSame(array('Countable', 'ArrayAccess', 'Serializable'), array_keys($rfl->token->getOwnInterfaces()));
+ foreach ($rfl->token->getInterfaces() as $interface) {
+ $this->assertInstanceOf('TokenReflection\Php\ReflectionClass', $interface);
+ }
+ foreach ($rfl->token->getOwnInterfaces() as $interface) {
+ $this->assertInstanceOf('TokenReflection\Php\ReflectionClass', $interface);
+ }
+ $this->assertSame($rfl->internal->implementsInterface('Countable'), $rfl->token->implementsInterface('Countable'));
+ $this->assertTrue($rfl->token->implementsInterface('Countable'));
+ $this->assertTrue($rfl->token->implementsInterface(new InternalReflectionClass('Countable')));
+
+ $token = $this->getBroker()->getClass('Iterator');
+ $this->assertSame(array('Traversable'), array_keys($token->getInterfaces()));
+ $this->assertSame(array('Traversable'), $token->getInterfaceNames());
+ $this->assertSame(array('Traversable'), array_keys($token->getOwnInterfaces()));
+ $this->assertSame(array('Traversable'), $token->getOwnInterfaceNames());
+
+ $rfl = $this->getClassReflection('noInterfaces');
+ $this->assertSame($rfl->internal->getModifiers(), $rfl->token->getModifiers());
+ $this->assertSame($rfl->internal->getInterfaceNames(), $rfl->token->getInterfaceNames());
+ $this->assertSame(array(), $rfl->token->getOwnInterfaceNames());
+ $this->assertSame(array(), $rfl->token->getInterfaceNames());
+ $this->assertSame($rfl->internal->getInterfaces(), $rfl->token->getInterfaces());
+ $this->assertSame(array(), $rfl->token->getInterfaces());
+ $this->assertSame(array(), $rfl->token->getOwnInterfaces());
+ $this->assertSame($rfl->internal->implementsInterface('Countable'), $rfl->token->implementsInterface('Countable'));
+ $this->assertFalse($rfl->token->implementsInterface('Countable'));
+ $this->assertFalse($rfl->token->implementsInterface(new InternalReflectionClass('Countable')));
+ }
+
+ /**
+ * Tests if class is iterator.
+ */
+ public function testIterator()
+ {
+ $rfl = $this->getClassReflection('iterator');
+ $this->assertSame($rfl->internal->isIterateable(), $rfl->token->isIterateable());
+ $this->assertTrue($rfl->token->isIterateable());
+
+ $rfl = $this->getClassReflection('noIterator');
+ $this->assertSame($rfl->internal->isIterateable(), $rfl->token->isIterateable());
+ $this->assertFalse($rfl->token->isIterateable());
+ }
+
+ /**
+ * Tests if class has parent.
+ */
+ public function testParent()
+ {
+ $rfl = $this->getClassReflection('parent');
+ foreach (array('TokenReflection_Test_ClassGrandGrandParent', 'TokenReflection_Test_ClassGrandParent') as $parent) {
+ $this->assertSame($rfl->internal->isSubclassOf($parent), $rfl->token->isSubclassOf($parent));
+ $this->assertTrue($rfl->token->isSubclassOf($parent));
+ $this->assertTrue($rfl->token->isSubclassOf($this->getBroker()->getClass($parent)));
+ }
+ foreach (array('TokenReflection_Test_ClassParent', 'Exception', 'DateTime') as $parent) {
+ $this->assertSame($rfl->internal->isSubclassOf($parent), $rfl->token->isSubclassOf($parent));
+ $this->assertFalse($rfl->token->isSubclassOf($parent));
+ }
+ $this->assertInstanceOf('TokenReflection\ReflectionClass', $rfl->token->getParentClass());
+ $this->assertSame('TokenReflection_Test_ClassGrandParent', $rfl->token->getParentClassName());
+
+ $this->assertSame(3, count($rfl->token->getParentClasses()));
+ foreach ($rfl->token->getParentClasses() as $class) {
+ $this->assertInstanceOf('TokenReflection\IReflectionClass', $class);
+ }
+ $this->assertSame(array('TokenReflection_Test_ClassGrandParent', 'TokenReflection_Test_ClassGrandGrandParent', 'ReflectionClass'), $rfl->token->getParentClassNameList());
+
+ $rfl = $this->getClassReflection('noParent');
+ $this->assertSame($rfl->internal->isSubclassOf('Exception'), $rfl->token->isSubclassOf('Exception'));
+ $this->assertFalse($rfl->token->isSubclassOf('Exception'));
+ $this->assertFalse($rfl->token->isSubclassOf(new InternalReflectionClass('Exception')));
+
+ $this->assertSame($rfl->internal->getParentClass(), $rfl->token->getParentClass());
+ $this->assertFalse($rfl->token->getParentClass());
+ $this->assertSame(array(), $rfl->token->getParentClasses());
+ $this->assertSame(array(), $rfl->token->getParentClassNameList());
+ }
+
+ /**
+ * Tests if class is user defined or internal.
+ */
+ public function testUserDefined()
+ {
+ $rfl = $this->getClassReflection('userDefined');
+
+ $this->assertSame($rfl->internal->isUserDefined(), $rfl->token->isUserDefined());
+ $this->assertTrue($rfl->token->isUserDefined());
+ $this->assertSame($rfl->internal->getFileName(), $rfl->token->getFileName());
+ $this->assertSame($this->getFilePath('userDefined'), $rfl->token->getFileName());
+ $this->assertSame($rfl->internal->isInternal(), $rfl->token->isInternal());
+ $this->assertFalse($rfl->token->isInternal());
+
+ $this->assertSame($rfl->internal->getExtension(), $rfl->token->getExtension());
+ $this->assertNull($rfl->token->getExtension());
+ $this->assertSame($rfl->internal->getExtensionName(), $rfl->token->getExtensionName());
+ $this->assertFalse($rfl->token->getExtensionName());
+
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionClass('Exception');
+ $rfl->token = $this->getBroker()->getClass('Exception');
+
+ $this->assertSame($rfl->internal->isUserDefined(), $rfl->token->isUserDefined());
+ $this->assertFalse($rfl->token->isUserDefined());
+ $this->assertSame($rfl->internal->getFileName(), $rfl->token->getFileName());
+ $this->assertFalse($rfl->token->getFileName());
+ $this->assertSame($rfl->internal->isInternal(), $rfl->token->isInternal());
+ $this->assertTrue($rfl->token->isInternal());
+
+ $this->assertInstanceOf('TokenReflection\Php\ReflectionExtension', $rfl->token->getExtension());
+ $this->assertSame($rfl->internal->getExtensionName(), $rfl->token->getExtensionName());
+ $this->assertSame('Core', $rfl->token->getExtensionName());
+ }
+
+ /**
+ * Tests getting of documentation comment.
+ */
+ public function testDocComment()
+ {
+ $rfl = $this->getClassReflection('docComment');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame("/**\n * TokenReflection_Test_ClassDocComment.\n *\n * @copyright Copyright (c) 2011\n * @author author\n * @see http://php.net\n */", $rfl->token->getDocComment());
+
+ $rfl = $this->getClassReflection('noDocComment');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertFalse($rfl->token->getDocComment());
+ }
+
+ /**
+ * Test getting of documentation comment, when after docComment many line breaks.
+ */
+ public function testDocCommentManyLines()
+ {
+ $rfl = $this->getClassReflection('docCommentManyLines');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame("/**\n * TokenReflection_Test_ClassDocCommentManyLines.\n *\n * @copyright Copyright (c) 2011\n * @author author\n * @see http://php.net\n */", $rfl->token->getDocComment());
+
+ $rfl = $this->getClassReflection('noDocComment');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertFalse($rfl->token->getDocComment());
+ }
+
+ /**
+ * Tests getting of inherited documentation comment.
+ */
+ public function testDocCommentInheritance()
+ {
+ require_once $this->getFilePath('docCommentInheritance');
+ $this->getBroker()->processFile($this->getFilePath('docCommentInheritance'));
+
+ $parent = new \stdClass();
+ $parent->internal = new InternalReflectionClass('TokenReflection_Test_ClassDocCommentInheritanceParent');
+ $parent->token = $this->getBroker()->getClass('TokenReflection_Test_ClassDocCommentInheritanceParent');
+ $this->assertSame($parent->internal->getDocComment(), $parent->token->getDocComment());
+
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionClass('TokenReflection_Test_ClassDocCommentInheritanceExplicit');
+ $rfl->token = $this->getBroker()->getClass('TokenReflection_Test_ClassDocCommentInheritanceExplicit');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame('My Short description.', $rfl->token->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertSame('Long description. Phew, that was long.', $rfl->token->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionClass('TokenReflection_Test_ClassDocCommentInheritanceImplicit');
+ $rfl->token = $this->getBroker()->getClass('TokenReflection_Test_ClassDocCommentInheritanceImplicit');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame($parent->token->getAnnotations(), $rfl->token->getAnnotations());
+ }
+
+ /**
+ * Tests getting of copydoc documentation comment.
+ */
+ public function testDocCommentCopydoc()
+ {
+ require_once $this->getFilePath('docCommentCopydoc');
+ $this->getBroker()->processFile($this->getFilePath('docCommentCopydoc'));
+
+ $parent = new \stdClass();
+ $parent->internal = new InternalReflectionClass('TokenReflection_Test_ClassDocCommentCopydocParent');
+ $parent->token = $this->getBroker()->getClass('TokenReflection_Test_ClassDocCommentCopydocParent');
+ $this->assertSame($parent->internal->getDocComment(), $parent->token->getDocComment());
+
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionClass('TokenReflection_Test_ClassDocCommentCopydocFound');
+ $rfl->token = $this->getBroker()->getClass('TokenReflection_Test_ClassDocCommentCopydocFound');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame('Short description.', $rfl->token->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertSame('Long description.', $rfl->token->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionClass('TokenReflection_Test_ClassDocCommentCopydocOverwritten');
+ $rfl->token = $this->getBroker()->getClass('TokenReflection_Test_ClassDocCommentCopydocOverwritten');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame('Whatever.', $rfl->token->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertSame('Long description.', $rfl->token->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+ $this->assertSame(array('None'), $rfl->token->getAnnotation('license'));
+ $this->assertSame(array('Another author'), $rfl->token->getAnnotation('author'));
+
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionClass('TokenReflection_Test_ClassDocCommentCopydocDouble');
+ $rfl->token = $this->getBroker()->getClass('TokenReflection_Test_ClassDocCommentCopydocDouble');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame('Short description.', $rfl->token->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertSame('Long description.', $rfl->token->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+ $this->assertSame(array('None'), $rfl->token->getAnnotation('license'));
+ $this->assertSame(array('Author'), $rfl->token->getAnnotation('author'));
+
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionClass('TokenReflection_Test_ClassDocCommentCopydocRecursive');
+ $rfl->token = $this->getBroker()->getClass('TokenReflection_Test_ClassDocCommentCopydocRecursive');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame('Short description.', $rfl->token->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertSame('Long description.', $rfl->token->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+ $this->assertSame(array('None'), $rfl->token->getAnnotation('license'));
+ $this->assertSame(array('Author'), $rfl->token->getAnnotation('author'));
+
+ static $emptys = array(
+ 'TokenReflection_Test_ClassDocCommentCopydocNotFound',
+ 'TokenReflection_Test_ClassDocCommentCopydocCircle11',
+ 'TokenReflection_Test_ClassDocCommentCopydocCircle12',
+ 'TokenReflection_Test_ClassDocCommentCopydocCircle21',
+ 'TokenReflection_Test_ClassDocCommentCopydocCircle22',
+ 'TokenReflection_Test_ClassDocCommentCopydocCircle23',
+ 'TokenReflection_Test_ClassDocCommentCopydocCircleSelf'
+ );
+ foreach ($emptys as $empty) {
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionClass($empty);
+ $rfl->token = $this->getBroker()->getClass($empty);
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame(array(), $rfl->token->getAnnotations());
+ }
+ }
+
+ /**
+ * Tests if class is defined in namespace.
+ */
+ public function testInNamespace()
+ {
+ require_once $this->getFilePath('inNamespace');
+ $this->getBroker()->processFile($this->getFilePath('inNamespace'));
+
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionClass('TokenReflection\Test\ClassInNamespace');
+ $rfl->token = $this->getBroker()->getClass('TokenReflection\Test\ClassInNamespace');
+
+ $this->assertSame($rfl->internal->inNamespace(), $rfl->token->inNamespace());
+ $this->assertTrue($rfl->token->inNamespace());
+ $this->assertSame($rfl->internal->getNamespaceName(), $rfl->token->getNamespaceName());
+ $this->assertSame('TokenReflection\Test', $rfl->token->getNamespaceName());
+ $this->assertSame($rfl->internal->getName(), $rfl->token->getName());
+ $this->assertSame('TokenReflection\Test\ClassInNamespace', $rfl->token->getName());
+ $this->assertSame($rfl->internal->getShortName(), $rfl->token->getShortName());
+ $this->assertSame('ClassInNamespace', $rfl->token->getShortName());
+
+ $rfl = $this->getClassReflection('noNamespace');
+ $this->assertSame($rfl->internal->inNamespace(), $rfl->token->inNamespace());
+ $this->assertFalse($rfl->token->inNamespace());
+ $this->assertSame($rfl->internal->getNamespaceName(), $rfl->token->getNamespaceName());
+ $this->assertSame('', $rfl->token->getNamespaceName());
+ $this->assertSame($rfl->internal->getName(), $rfl->token->getName());
+ $this->assertSame($this->getClassName('noNamespace'), $rfl->token->getName());
+ $this->assertSame($rfl->internal->getShortName(), $rfl->token->getShortName());
+ $this->assertSame($this->getClassName('noNamespace'), $rfl->token->getShortName());
+ }
+
+ /**
+ * Tests getting of property source code.
+ */
+ public function testPropertyGetSource()
+ {
+ static $expected = array(
+ 'publicStatic' => 'public static $publicStatic = true;',
+ 'privateStatic' => 'private static $privateStatic = \'something\';',
+ 'protectedStatic' => 'protected static $protectedStatic = 1;',
+ 'public' => 'public $public = false;',
+ 'protected' => 'protected $protected = 0;',
+ 'private' => 'private $private = \'\';'
+ );
+
+ $rfl = $this->getClassReflection('properties')->token;
+ foreach ($expected as $propertyName => $source) {
+ $this->assertSame($source, $rfl->getProperty($propertyName)->getSource());
+ }
+ }
+
+ /**
+ * Tests getting of method source code.
+ */
+ public function testMethodGetSource()
+ {
+ static $expected = array(
+ 'protectedStaticFunction' => "protected static function protectedStaticFunction(\$one = true)\n {\n }",
+ 'protectedFunction' => "protected function protectedFunction(\$two = false)\n {\n }",
+ 'publicStaticFunction' => "public static function publicStaticFunction(\$five = 1.1)\n {\n }"
+ );
+
+ $rfl = $this->getClassReflection('methods')->token;
+ foreach ($expected as $methodName => $source) {
+ $this->assertSame($source, $rfl->getMethod($methodName)->getSource());
+ }
+ }
+
+ /**
+ * Tests getting of constant source code.
+ */
+ public function testConstantGetSource()
+ {
+ static $expected = array(
+ 'PARENT' => 'PARENT = \'parent\';',
+ 'STRING' => 'STRING = \'string\';',
+ 'FLOAT' => 'FLOAT = 1.1;',
+ 'BOOLEAN' => 'BOOLEAN = true;'
+ );
+
+ $rfl = $this->getClassReflection('constants')->token;
+ foreach ($expected as $constantName => $source) {
+ $this->assertSame($source, $rfl->getConstantReflection($constantName)->getSource());
+ }
+ }
+
+ /**
+ * Tests getting of class source code.
+ */
+ public function testClassGetSource()
+ {
+ static $expected = array(
+ 'methods' => "class TokenReflection_Test_ClassMethods extends TokenReflection_Test_ClassMethodsParent\n{\n public function __construct(\$three)\n {\n }\n\n public function __destruct()\n {\n }\n\n public final function publicFinalFunction(\$four = 1)\n {\n }\n\n public static function publicStaticFunction(\$five = 1.1)\n {\n }\n\n private static function privateStaticFunction(\$six = 'string', \$seven = null)\n {\n }\n\n public function publicFunction(array \$eight = array())\n {\n }\n\n private function privateFunction(Foo \$nine = null)\n {\n }\n}",
+ 'constants' => "class TokenReflection_Test_ClassConstants extends TokenReflection_Test_ClassConstantsParent\n{\n const STRING = 'string';\n const INTEGER = 1;\n const FLOAT = 1.1;\n const BOOLEAN = true;\n}",
+ 'docComment' => "/**\n * TokenReflection_Test_ClassDocComment.\n *\n * @copyright Copyright (c) 2011\n * @author author\n * @see http://php.net\n */\nclass TokenReflection_Test_ClassDocComment\n{\n}"
+ );
+
+ foreach ($expected as $className => $source) {
+ $this->assertSame(
+ $source,
+ $this->getClassReflection($className)->token->getSource()
+ );
+ }
+ }
+
+ /**
+ * Tests export.
+ */
+ public function testToString()
+ {
+ $tests = array(
+ 'lines', 'docComment', 'noDocComment',
+ 'constants', 'noConstants', 'properties', 'noProperties', 'doubleProperties',
+ 'publicConstructor', 'privateConstructor', 'publicClone', 'privateClone',
+ 'methods', 'noMethods', 'instances', 'abstract', 'abstractImplicit', 'noAbstract', 'final', 'noFinal',
+ 'interface', 'noInterface', 'interfaces', 'noInterfaces',
+ 'iterator', 'noIterator', 'parent', 'noParent',
+ 'userDefined', 'noNamespace',
+ );
+ if (PHP_VERSION_ID >= 50400) {
+ // Test traits only on PHP >= 5.4
+ $tests[] = 'traits';
+ }
+
+ foreach ($tests as $test) {
+ $rfl = $this->getClassReflection($test);
+ $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
+ $this->assertSame(InternalReflectionClass::export($this->getClassName($test), true), ReflectionClass::export($this->getBroker(), $this->getClassName($test), true));
+
+ // Test loading from a string
+ $rfl = $this->getClassReflection($test, true);
+ $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
+ }
+
+ $this->assertSame(InternalReflectionClass::export('ReflectionClass', true), ReflectionClass::export($this->getBroker(), 'ReflectionClass', true));
+ $this->assertSame(InternalReflectionClass::export(new InternalReflectionClass('ReflectionClass'), true), ReflectionClass::export($this->getBroker(), new InternalReflectionClass('ReflectionClass'), true));
+ }
+
+ /**
+ * Tests traits support comparing with the internal reflection.
+ *
+ * For PHP 5.4+ only.
+ */
+ public function testTraits()
+ {
+ if (PHP_VERSION_ID < 50400) {
+ $this->markTestSkipped('Requires PHP 5.4 or higher.');
+ }
+
+ static $classes = array(
+ 'TokenReflection_Test_ClassTraitsTrait1',
+ 'TokenReflection_Test_ClassTraitsTrait2',
+ 'TokenReflection_Test_ClassTraitsTrait3',
+ 'TokenReflection_Test_ClassTraitsTrait4',
+ 'TokenReflection_Test_ClassTraits',
+ 'TokenReflection_Test_ClassTraits2',
+ 'TokenReflection_Test_ClassTraits3',
+ 'TokenReflection_Test_ClassTraits4'
+ );
+
+ require_once $this->getFilePath('traits');
+ $this->getBroker()->process($this->getFilePath('traits'));
+
+ foreach ($classes as $className) {
+ $token = $this->getBroker()->getClass($className);
+ $internal = new \ReflectionClass($className);
+
+ $this->assertSame($internal->isTrait(), $token->isTrait(), $className);
+ $this->assertSame($internal->getTraitAliases(), $token->getTraitAliases(), $className);
+ $this->assertSame($internal->getTraitNames(), $token->getTraitNames(), $className);
+ $this->assertSame(count($internal->getTraits()), count($token->getTraits()), $className);
+ foreach ($internal->getTraits() as $trait) {
+ $this->assertTrue($token->usesTrait($trait->getName()), $className);
+ }
+ }
+ }
+
+ /**
+ * Tests traits support comparing with expected values.
+ */
+ public function testTraits2()
+ {
+ static $expected = array(
+ 'TokenReflection_Test_ClassTraitsTrait1' => array(true, array(), array(), array(), 0, 0),
+ 'TokenReflection_Test_ClassTraitsTrait2' => array(true, array('t2privatef' => '(null)::privatef'), array('TokenReflection_Test_ClassTraitsTrait1'), array('TokenReflection_Test_ClassTraitsTrait1'), 6, 3),
+ 'TokenReflection_Test_ClassTraitsTrait3' => array(true, array(), array(), array(), 0, 0),
+ 'TokenReflection_Test_ClassTraitsTrait4' => array(true, array(), array(), array(), 0, 0),
+ 'TokenReflection_Test_ClassTraits' => array(false, array('privatef2' => '(null)::publicf', 'publicf3' => '(null)::protectedf', 'publicfOriginal' => '(null)::publicf'), array('TokenReflection_Test_ClassTraitsTrait1'), array('TokenReflection_Test_ClassTraitsTrait1'), 6, 6),
+ 'TokenReflection_Test_ClassTraits2' => array(false, array(), array('TokenReflection_Test_ClassTraitsTrait2'), array('TokenReflection_Test_ClassTraitsTrait2'), 6, 3),
+ 'TokenReflection_Test_ClassTraits3' => array(false, array(), array('TokenReflection_Test_ClassTraitsTrait1'), array('TokenReflection_Test_ClassTraitsTrait1'), 6, 2),
+ 'TokenReflection_Test_ClassTraits4' => array(false, array(), array('TokenReflection_Test_ClassTraitsTrait3', 'TokenReflection_Test_ClassTraitsTrait4'), array('TokenReflection_Test_ClassTraitsTrait3', 'TokenReflection_Test_ClassTraitsTrait4'), 2, 1)
+ );
+
+ $this->getBroker()->process($this->getFilePath('traits'));
+ foreach ($expected as $className => $definition) {
+ $reflection = $this->getBroker()->getClass($className);
+
+ $this->assertSame($definition[0], $reflection->isTrait(), $className);
+ $this->assertSame($definition[1], $reflection->getTraitAliases(), $className);
+ $this->assertSame($definition[2], $reflection->getTraitNames(), $className);
+ $this->assertSame(count($definition[2]), count($reflection->getTraits()), $className);
+ foreach ($definition[2] as $traitName) {
+ $this->assertTrue($reflection->usesTrait($traitName), $className);
+ }
+
+ $this->assertSame($definition[3], $reflection->getOwnTraitNames(), $className);
+ $this->assertSame(count($definition[3]), count($reflection->getOwnTraits()), $className);
+ foreach ($definition[3] as $traitName) {
+ $this->assertTrue($reflection->usesTrait($traitName), $className);
+ }
+
+ foreach ($reflection->getTraitProperties() as $property) {
+ $this->assertTrue($reflection->hasProperty($property->getName()), $className);
+ $this->assertNotNull($property->getDeclaringTraitName(), $className);
+ }
+ $this->assertSame($definition[4], count($reflection->getTraitProperties()), $className);
+
+ foreach ($reflection->getTraitMethods() as $method) {
+ $this->assertTrue($reflection->hasMethod($method->getName()), $className);
+ $this->assertNotNull($method->getDeclaringTraitName(), $className);
+ }
+ $this->assertSame($definition[5], count($reflection->getTraitMethods()), $className);
+ }
+ }
+
+ /**
+ * Tests creating class instances without calling the constructor.
+ */
+ public function testNewInstanceWithoutConstructor()
+ {
+ require_once $this->getFilePath('newInstanceWithoutConstructor');
+ $this->getBroker()->process($this->getFilePath('newInstanceWithoutConstructor'));
+
+ $token = $this->getBroker()->getClass('TokenReflection_Test_NewInstanceWithoutConstructor1');
+ $this->assertInstanceOf('TokenReflection\ReflectionClass', $token);
+
+ try {
+ $token->newInstanceWithoutConstructor();
+ $this->fail('TokenReflection\Exception\RuntimeException expected.');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+
+ if ($e->getCode() !== Exception\RuntimeException::UNSUPPORTED) {
+ throw $e;
+ }
+ }
+
+ if (PHP_VERSION_ID >= 50400) {
+ // Try the internal reflection
+ $internal = new \ReflectionClass('TokenReflection_Test_NewInstanceWithoutConstructor1');
+ try {
+ $internal->newInstanceWithoutConstructor();
+ $this->fail('ReflectionException expected.');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('ReflectionException', $e);
+ }
+ }
+
+ $token = $this->getBroker()->getClass('Exception');
+ $this->assertInstanceOf('TokenReflection\Php\ReflectionClass', $token);
+
+ try {
+ $token->newInstanceWithoutConstructor();
+ $this->fail('TokenReflection\Exception\RuntimeException expected.');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+
+ if ($e->getCode() !== Exception\RuntimeException::UNSUPPORTED) {
+ throw $e;
+ }
+ }
+
+ if (PHP_VERSION_ID >= 50400) {
+ // Try the internal reflection
+ $internal = new \ReflectionClass('Exception');
+ try {
+ $internal->newInstanceWithoutConstructor();
+ $this->fail('ReflectionException expected.');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('ReflectionException', $e);
+ }
+ }
+
+ $token = $this->getBroker()->getClass('TokenReflection_Test_NewInstanceWithoutConstructor2');
+ $internal = new \ReflectionClass('TokenReflection_Test_NewInstanceWithoutConstructor2');
+ $this->assertInstanceOf('TokenReflection\ReflectionClass', $token);
+
+ $instance = $token->newInstanceWithoutConstructor();
+ $this->assertFalse($instance->check);
+
+ $instance2 = $token->newInstanceArgs();
+ $this->assertTrue($instance2->check);
+
+ if (PHP_VERSION_ID >= 50400) {
+ // Try the internal reflection
+ $this->assertEquals($internal->newInstanceWithoutConstructor(), $token->newInstanceWithoutConstructor());
+ }
+ }
+
+ /**
+ * Tests returning pretty class names.
+ */
+ public function testPrettyNames()
+ {
+ static $names = array(
+ 'ns1\\TokenReflection_Test_ClassPrettyNames',
+ 'ns2\\ns3\\ns4\\TokenReflection_Test_ClassPrettyNames2',
+ 'TokenReflection_Test_ClassPrettyNames3'
+ );
+
+ $broker = $this->getBroker();
+ $broker->processFile($this->getFilePath('pretty-names'));
+
+ foreach ($names as $name) {
+ $this->assertTrue($broker->hasClass($name), $name);
+
+ $rfl = $broker->getClass($name);
+ $this->assertSame($rfl->getName(), $rfl->getPrettyName(), $name);
+ }
+ }
+
+ /**
+ * Returns an internal class reflection.
+ *
+ * @return \TokenReflection\Php\ReflectionClass
+ */
+ private function getInternalClassReflection()
+ {
+ return $this->getBroker()->getClass('Exception');
+ }
+
+ /**
+ * Returns a non existent class reflection.
+ *
+ * @return \TokenReflection\Dummy\ReflectionClass
+ */
+ private function getDummyClassReflection()
+ {
+ static $className = 'foo_bar';
+
+ if (class_exists($className, false)) {
+ $this->markTestSkipped(sprintf('Class %s exists.', $className));
+ }
+
+ return $this->getBroker()->getClass($className);
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionConstantTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionConstantTest.php
new file mode 100644
index 0000000..9bf3be4
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionConstantTest.php
@@ -0,0 +1,764 @@
+getConstantTokenReflection('lines');
+
+ $this->assertSame(5, $token->getStartLine());
+ $this->assertSame(5, $token->getEndLine());
+ }
+
+ /**
+ * Tests getting of documentation comment.
+ */
+ public function testComment()
+ {
+ $rfl = $this->getClassReflection('docComment');
+ foreach (array_keys($rfl->internal->getConstants()) as $constant) {
+ $this->assertTrue($rfl->token->hasConstant($constant), $constant);
+ $this->assertFalse(false === $rfl->token->getConstantReflection($constant)->getDocComment(), $constant);
+ }
+
+ $token = $this->getConstantTokenReflection('noComment');
+ $this->assertFalse($token->getDocComment());
+ }
+
+ /**
+ * Tests heredoc defined value.
+ */
+ public function testHeredoc()
+ {
+ $rfl = $this->getClassReflection('heredoc');
+
+ $this->assertSame($rfl->internal->getConstant('HEREDOC'), $rfl->token->getConstant('HEREDOC'));
+ $this->assertSame('constant value', $rfl->token->getConstant('HEREDOC'));
+
+ $this->assertSame($rfl->internal->getConstant('NOWDOC'), $rfl->token->getConstant('NOWDOC'));
+ $this->assertSame('constant value', $rfl->token->getConstant('NOWDOC'));
+ }
+
+ /**
+ * Tests getting of copydoc documentation comment.
+ */
+ public function testCommentCopydoc()
+ {
+ static $constants = array('DOC_COMMENT', 'DOC_COMMENT_COPY', 'DOC_COMMENT_COPY2');
+
+ $broker = $this->getBroker();
+ $broker->processFile($this->getFilePath('docCommentCopydoc'));
+
+ $this->assertTrue($broker->hasClass('TokenReflection_Test_ConstantDocCommentCopydoc'));
+ $reflection = $broker->getClass('TokenReflection_Test_ConstantDocCommentCopydoc');
+ foreach ($constants as $constant) {
+ $this->assertSame('This is a constant.', $reflection->getConstantReflection($constant)->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION), $constant);
+ }
+
+ $this->assertSame('This is another constant.', $reflection->getConstantReflection('DOC_COMMENT_COPY_CLASS')->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertSame(null, $reflection->getConstantReflection('DOC_COMMENT_COPY_NO')->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+
+ static $topLevelConstants = array(
+ 'CONSTANT_DOC_COMMENT_COPYDOC' => 'Comment.',
+ 'CONSTANT_DOC_COMMENT_COPYDOC2' => 'Comment.',
+ 'CONSTANT_DOC_COMMENT_COPYDOC3' => null,
+ );
+ foreach ($topLevelConstants as $constantName => $shortDescription) {
+ $this->assertTrue($broker->hasConstant($constantName), $constantName);
+ $this->assertSame($shortDescription, $broker->getConstant($constantName)->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION), $constantName);
+ }
+ }
+
+ /**
+ * Tests different types of constant value.
+ */
+ public function testTypes()
+ {
+ $constants = array('string' => 'string', 'integer' => 1, 'integerNegative' => -1, 'float' => 1.1, 'floatNegative' => -1.1, 'boolean' => true, 'null' => null, 'constant' => E_NOTICE);
+ foreach ($constants as $type => $value) {
+ $test = 'type' . ucfirst($type);
+ $token = $this->getConstantTokenReflection($test);
+ $this->assertSame($this->getClassInternalReflection($test)->getConstant($this->getConstantName($test)), $token->getValue());
+ $this->assertSame($value, $token->getValue());
+ }
+ }
+
+ /**
+ * Tests if constant is defined in namespace or in class.
+ */
+ public function testInNamespace()
+ {
+ $this->getBroker()->processFile($this->getFilePath('inNamespace'));
+ $token = $this->getBroker()->getConstant('TokenReflection\Test\CONSTANT_IN_NAMESPACE');
+
+ $this->assertInstanceOf('TokenReflection\ReflectionConstant', $token);
+ $this->assertSame('constant-in-namespace', $token->getValue());
+
+ $this->assertTrue($token->inNamespace());
+ $this->assertSame('TokenReflection\\Test\\CONSTANT_IN_NAMESPACE', $token->getName());
+ $this->assertSame('CONSTANT_IN_NAMESPACE', $token->getShortName());
+
+ $this->assertNull($token->getDeclaringClassName());
+ $this->assertNull($token->getDeclaringClass());
+
+ $token = $this->getConstantTokenReflection('noNamespace');
+
+ $this->assertFalse($token->inNamespace());
+ $this->assertSame('NO_NAMESPACE', $token->getName());
+ $this->assertSame('NO_NAMESPACE', $token->getShortName());
+
+ $this->assertSame('TokenReflection_Test_ConstantNoNamespace', $token->getDeclaringClassName());
+ $this->assertSame('TokenReflection_Test_ConstantNoNamespace', $token->getDeclaringClass()->getName());
+ $this->assertInstanceOf('TokenReflection\ReflectionClass', $token->getDeclaringClass());
+ }
+
+ /**
+ * Tests export.
+ */
+ public function testToString()
+ {
+ $tests = array(
+ 'noNamespace' => "Constant [ string NO_NAMESPACE ] { no-namespace }\n",
+ 'typeString' => "Constant [ string TYPE_STRING ] { string }\n",
+ 'typeInteger' => "Constant [ integer TYPE_INTEGER ] { 1 }\n",
+ 'typeIntegerNegative' => "Constant [ integer TYPE_INTEGER_NEGATIVE ] { -1 }\n",
+ 'typeFloat' => "Constant [ double TYPE_FLOAT ] { 1.1 }\n",
+ 'typeFloatNegative' => "Constant [ double TYPE_FLOAT_NEGATIVE ] { -1.1 }\n",
+ 'typeBoolean' => "Constant [ boolean TYPE_BOOLEAN ] { 1 }\n",
+ 'typeNull' => "Constant [ null TYPE_NULL ] { }\n"
+ );
+ foreach ($tests as $test => $expected) {
+ $this->assertSame($expected, $this->getConstantTokenReflection($test)->__toString());
+ $this->assertSame($expected, ReflectionConstant::export($this->getBroker(), $this->getClassName($test), $this->getConstantName($test), true));
+
+ // Test loading from a string
+ $this->assertSame($expected, $this->getConstantTokenReflection($test, true)->__toString());
+ }
+
+ $this->assertSame("Constant [ integer E_NOTICE ] { 8 }\n", ReflectionConstant::export($this->getBroker(), null, 'E_NOTICE', true));
+ }
+
+ /**
+ * Tests magic constants.
+ */
+ public function testMagicConstants()
+ {
+ $broker = new Broker(new Broker\Backend\Memory());
+ $broker->process($this->getFilePath('magic'));
+
+ require_once ($this->getFilePath('magic'));
+
+ $internal_constants = get_defined_constants(true);
+ $internal_constants = $internal_constants['user'];
+
+ $token_constants = $broker->getConstants();
+ $this->assertSame(14, count($token_constants));
+
+ foreach ($token_constants as $name => $reflection) {
+ $this->assertTrue(isset($internal_constants[$name]));
+ $this->assertSame($internal_constants[$name], $reflection->getValue(), $name);
+ }
+
+ $token_functions = $broker->getFunctions();
+ $this->assertSame(2, count($token_functions));
+
+ foreach ($token_functions as $name => $token_function) {
+ $this->assertTrue(function_exists($name));
+
+ $function = new \ReflectionFunction($name);
+
+ // Parameters
+ $this->assertGreaterThan(0, $function->getNumberOfParameters(), sprintf('%s()', $name));
+ $this->assertSame($function->getNumberOfParameters(), count($function->getParameters()), sprintf('%s()', $name));
+
+ foreach ($function->getParameters() as $parameter) {
+ $parameter_name = $parameter->getName();
+ $token_parameter = $token_function->getParameter($parameter->getPosition());
+
+ $this->assertTrue($parameter->isDefaultValueAvailable(), sprintf('%s(%s)', $name, $parameter_name));
+ $this->assertSame($parameter->isDefaultValueAvailable(), $token_parameter->isDefaultValueAvailable(), sprintf('%s(%s)', $name, $parameter_name));
+
+ $this->assertSame($parameter->getDefaultValue(), $token_parameter->getDefaultValue(), sprintf('%s(%s)', $name, $parameter_name));
+ }
+
+ // Static variables
+ $internal_variables = $function->getStaticVariables();
+ $this->assertGreaterThan(0, count($internal_variables), sprintf('%s()', $name));
+
+ $token_variables = $token_function->getStaticVariables();
+ $this->assertSame(count($internal_variables), count($token_variables), sprintf('%s()', $name));
+
+ foreach ($internal_variables as $variable_name => $variable_value) {
+ $this->assertTrue(isset($token_variables[$variable_name]), sprintf('%s()::%s', $name, $variable_name));
+ $this->assertSame($variable_value, $token_variables[$variable_name], sprintf('%s()::%s', $name, $variable_name));
+ }
+ }
+
+ $classes = array(
+ 'TokenReflection_Test_ConstantMagic',
+ 'ns\\TokenReflection_Test_ConstantMagic',
+ 'ns2\\TokenReflection_Test_ConstantMagic',
+ 'ns3\\TokenReflection_Test_ConstantMagic'
+ );
+ foreach ($classes as $class) {
+ $this->assertTrue(class_exists($class, false), $class);
+
+ $token = $broker->getClass($class);
+ $internal = new \ReflectionClass($class);
+ $instance = new $class();
+
+ // Constants
+ $this->assertSame(7, count($internal->getConstants()));
+ $this->assertSame(count($internal->getConstants()), count($token->getConstantReflections()), $class);
+
+ foreach ($internal->getConstants() as $name => $value) {
+ $this->assertTrue($token->hasConstant($name), sprintf('%s::%s', $class, $name));
+ $this->assertSame($value, $token->getConstantReflection($name)->getValue(), sprintf('%s::%s', $class, $name));
+ $this->assertSame($value, $token->getConstant($name), sprintf('%s::%s', $class, $name));
+ }
+
+ // Properties
+ $this->assertSame(14, count($internal->getProperties()));
+ $this->assertSame(count($internal->getProperties()), count($token->getProperties()), $class);
+
+ foreach ($internal->getProperties() as $reflection) {
+ $name = $reflection->getName();
+
+ $this->assertTrue($token->hasProperty($name), sprintf('%s::$%s', $class, $name));
+ $this->assertSame($reflection->isStatic(), $token->getProperty($name)->isStatic());
+
+ if ($reflection->isStatic()) {
+ $this->assertSame($internal->getStaticPropertyValue($name), $token->getStaticPropertyValue($name), sprintf('%s::$%s', $class, $name));
+ } else {
+ $this->assertSame($reflection->getValue($instance), $token->getProperty($name)->getValue($instance), sprintf('%s::$%s', $class, $name));
+ $this->assertSame($reflection->getValue($instance), $token->getProperty($name)->getDefaultValue(), sprintf('%s::$%s', $class, $name));
+ }
+ }
+
+ // Methods
+ $this->assertGreaterThanOrEqual(1, count($internal->getMethods()));
+ $this->assertSame(count($internal->getMethods()), count($token->getMethods()), $class);
+
+ foreach ($internal->getMethods() as $method) {
+ $name = $method->getName();
+
+ $this->assertTrue($token->hasMethod($name), sprintf('%s::%s()', $class, $name));
+
+ $token_method = $token->getMethod($name);
+
+ // Parameters
+ $this->assertGreaterThan(0, $method->getNumberOfParameters(), sprintf('%s::%s()', $class, $name));
+ $this->assertSame($method->getNumberOfParameters(), count($method->getParameters()), sprintf('%s::%s()', $class, $name));
+
+ foreach ($method->getParameters() as $parameter) {
+ $parameter_name = $parameter->getName();
+ $token_parameter = $token_method->getParameter($parameter->getPosition());
+
+ $this->assertTrue($parameter->isDefaultValueAvailable(), sprintf('%s::%s(%s)', $class, $name, $parameter_name));
+ $this->assertSame($parameter->isDefaultValueAvailable(), $token_parameter->isDefaultValueAvailable(), sprintf('%s::%s(%s)', $class, $name, $parameter_name));
+
+ $this->assertSame($parameter->getDefaultValue(), $token_parameter->getDefaultValue(), sprintf('%s::%s(%s)', $class, $name, $parameter_name));
+ }
+
+ // Static variables
+ $internal_variables = $method->getStaticVariables();
+ $this->assertGreaterThan(0, count($internal_variables), sprintf('%s::%s()', $class, $name));
+
+ $token_variables = $token_method->getStaticVariables();
+ $this->assertSame(count($internal_variables), count($token_variables), sprintf('%s::%s()', $class, $name));
+
+ foreach ($internal_variables as $variable_name => $variable_value) {
+ $this->assertTrue(isset($token_variables[$variable_name]), sprintf('%s::%s()::%s', $class, $name, $variable_name));
+ $this->assertSame($variable_value, $token_variables[$variable_name], sprintf('%s::%s()::%s', $class, $name, $variable_name));
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests the __TRAIT__ magic constant.
+ *
+ * For PHP >= 5.4 only.
+ */
+ public function testMagicConstants54()
+ {
+ if (PHP_VERSION_ID < 50400) {
+ $this->markTestSkipped('PHP >= 5.4 only');
+ }
+
+ $broker = new Broker(new Broker\Backend\Memory());
+ $broker->process($this->getFilePath('magic54'));
+
+ require_once ($this->getFilePath('magic54'));
+
+ $internal_constants = get_defined_constants(true);
+ $internal_constants = $internal_constants['user'];
+
+ $token_constants = $broker->getConstants();
+ $this->assertSame(2, count($token_constants));
+
+ foreach ($token_constants as $name => $reflection) {
+ $this->assertTrue(isset($internal_constants[$name]));
+ $this->assertSame($internal_constants[$name], $reflection->getValue(), $name);
+ }
+
+ $token_functions = $broker->getFunctions();
+ $this->assertSame(2, count($token_functions));
+
+ foreach ($token_functions as $name => $token_function) {
+ $this->assertTrue(function_exists($name));
+
+ $function = new \ReflectionFunction($name);
+
+ // Parameters
+ $this->assertGreaterThan(0, $function->getNumberOfParameters(), sprintf('%s()', $name));
+ $this->assertSame($function->getNumberOfParameters(), count($function->getParameters()), sprintf('%s()', $name));
+
+ foreach ($function->getParameters() as $parameter) {
+ $parameter_name = $parameter->getName();
+ $token_parameter = $token_function->getParameter($parameter->getPosition());
+
+ $this->assertTrue($parameter->isDefaultValueAvailable(), sprintf('%s(%s)', $name, $parameter_name));
+ $this->assertSame($parameter->isDefaultValueAvailable(), $token_parameter->isDefaultValueAvailable(), sprintf('%s(%s)', $name, $parameter_name));
+
+ $this->assertSame($parameter->getDefaultValue(), $token_parameter->getDefaultValue(), sprintf('%s(%s)', $name, $parameter_name));
+ }
+
+ // Static variables
+ $internal_variables = $function->getStaticVariables();
+ $this->assertGreaterThan(0, count($internal_variables), sprintf('%s()', $name));
+
+ $token_variables = $token_function->getStaticVariables();
+ $this->assertSame(count($internal_variables), count($token_variables), sprintf('%s()', $name));
+
+ foreach ($internal_variables as $variable_name => $variable_value) {
+ $this->assertTrue(isset($token_variables[$variable_name]), sprintf('%s()::%s', $name, $variable_name));
+ $this->assertSame($variable_value, $token_variables[$variable_name], sprintf('%s()::%s', $name, $variable_name));
+ }
+ }
+
+ $classes = array(
+ 'TokenReflection_Test_ConstantMagic54Trait',
+ 'TokenReflection_Test_ConstantMagic54',
+ 'TokenReflection_Test_ConstantMagic54WithTrait',
+ 'ns\\TokenReflection_Test_ConstantMagic54Trait',
+ 'ns\\TokenReflection_Test_ConstantMagic54',
+ 'ns\\TokenReflection_Test_ConstantMagic54WithTrait',
+ 'ns2\\TokenReflection_Test_ConstantMagic54',
+ 'ns2\\TokenReflection_Test_ConstantMagic54WithTrait',
+ 'ns3\\TokenReflection_Test_ConstantMagic54',
+ 'ns3\\TokenReflection_Test_ConstantMagic54WithTrait'
+ );
+ foreach ($classes as $class) {
+ $token = $broker->getClass($class);
+ $internal = new \ReflectionClass($class);
+
+ $this->assertSame($internal->isTrait(), $token->isTrait());
+
+ if (!$internal->isTrait()) {
+ $instance = new $class();
+ }
+
+ // Constants
+ if ($internal->isTrait()) {
+ $this->assertSame(0, count($internal->getConstants()));
+ } else {
+ $this->assertSame(1, count($internal->getConstants()));
+ }
+
+ $this->assertSame(count($internal->getConstants()), count($token->getConstantReflections()), $class);
+
+ foreach ($internal->getConstants() as $name => $value) {
+ $this->assertTrue($token->hasConstant($name), sprintf('%s::%s', $class, $name));
+ $this->assertSame($value, $token->getConstantReflection($name)->getValue(), sprintf('%s::%s', $class, $name));
+ $this->assertSame($value, $token->getConstant($name), sprintf('%s::%s', $class, $name));
+ }
+
+ // Properties
+ $this->assertGreaterThan(0, count($internal->getProperties()));
+ $this->assertSame(count($internal->getProperties()), count($token->getProperties()), $class);
+
+ foreach ($internal->getProperties() as $reflection) {
+ $name = $reflection->getName();
+
+ $this->assertTrue($token->hasProperty($name), sprintf('%s::$%s', $class, $name));
+ $this->assertSame($reflection->isStatic(), $token->getProperty($name)->isStatic());
+
+ if ($reflection->isStatic()) {
+ $this->assertSame($internal->getStaticPropertyValue($name), $token->getStaticPropertyValue($name), sprintf('%s::$%s', $class, $name));
+ } elseif (!$internal->isTrait()) {
+ $this->assertSame($reflection->getValue($instance), $token->getProperty($name)->getValue($instance), sprintf('%s::$%s', $class, $name));
+ $this->assertSame($reflection->getValue($instance), $token->getProperty($name)->getDefaultValue(), sprintf('%s::$%s', $class, $name));
+ }
+ }
+
+ // Methods
+ $this->assertGreaterThanOrEqual(1, count($internal->getMethods()));
+ $this->assertSame(count($internal->getMethods()), count($token->getMethods()), $class);
+
+ foreach ($internal->getMethods() as $method) {
+ $name = $method->getName();
+
+ $this->assertTrue($token->hasMethod($name), sprintf('%s::%s()', $class, $name));
+
+ $token_method = $token->getMethod($name);
+
+ // Parameters
+ $this->assertGreaterThan(0, $method->getNumberOfParameters(), sprintf('%s::%s()', $class, $name));
+ $this->assertSame($method->getNumberOfParameters(), count($method->getParameters()), sprintf('%s::%s()', $class, $name));
+
+ foreach ($method->getParameters() as $parameter) {
+ $parameter_name = $parameter->getName();
+ $token_parameter = $token_method->getParameter($parameter->getPosition());
+
+ $this->assertTrue($parameter->isDefaultValueAvailable(), sprintf('%s::%s(%s)', $class, $name, $parameter_name));
+ $this->assertSame($parameter->isDefaultValueAvailable(), $token_parameter->isDefaultValueAvailable(), sprintf('%s::%s(%s)', $class, $name, $parameter_name));
+
+ $this->assertSame($parameter->getDefaultValue(), $token_parameter->getDefaultValue(), sprintf('%s::%s(%s)', $class, $name, $parameter_name));
+ }
+
+ // Static variables
+ $internal_variables = $method->getStaticVariables();
+
+ $token_variables = $token_method->getStaticVariables();
+ $this->assertSame(count($internal_variables), count($token_variables), sprintf('%s::%s()', $class, $name));
+
+ foreach ($internal_variables as $variable_name => $variable_value) {
+ $this->assertTrue(isset($token_variables[$variable_name]), sprintf('%s::%s()::%s', $class, $name, $variable_name));
+ $this->assertSame($variable_value, $token_variables[$variable_name], sprintf('%s::%s()::%s', $class, $name, $variable_name));
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests the __TRAIT__ magic constant.
+ *
+ * For PHP < 5.4 only.
+ */
+ public function testMagicConstants54using53()
+ {
+ if (PHP_VERSION_ID >= 50400) {
+ $this->markTestSkipped('PHP < 5.4 only');
+ }
+
+ $broker = new Broker(new Broker\Backend\Memory());
+ $broker->process($this->getFilePath('magic54'));
+
+ $token_constants = $broker->getConstants();
+ static $expected_constants = array('CONST_TRAIT' => '', 'ns\CONST_TRAIT' => '');
+
+ $this->assertSame(count($expected_constants), count($token_constants));
+ foreach ($token_constants as $name => $reflection) {
+ $this->assertArrayHasKey($name, $expected_constants);
+ $this->assertSame($expected_constants[$name], $reflection->getValue());
+ }
+
+ $token_functions = $broker->getFunctions();
+ static $expected_functions = array(
+ 'constantMagic54' => array(
+ array('trait' => ''),
+ array('trait' => '')
+ ),
+ 'ns\\constantMagic54' => array(
+ array('trait' => ''),
+ array('trait' => '')
+ )
+ );
+
+ $this->assertSame(count($expected_functions), count($token_functions));
+ foreach ($token_functions as $name => $token_function) {
+ $this->assertArrayHasKey($name, $expected_functions);
+
+ // Parameters
+ $this->assertSame(count($expected_functions[$name][0]), $token_function->getNumberOfParameters(), sprintf('%s()', $name));
+ $this->assertSame($token_function->getNumberOfParameters(), count($token_function->getParameters()), sprintf('%s()', $name));
+
+ foreach ($token_function->getParameters() as $parameter) {
+ $parameter_name = $parameter->getName();
+
+ $this->assertArrayHasKey($parameter_name, $expected_functions[$name][0]);
+ $this->assertTrue($parameter->isDefaultValueAvailable(), sprintf('%s(%s)', $name, $parameter_name));
+ $this->assertSame($expected_functions[$name][0][$parameter_name], $parameter->getDefaultValue(), sprintf('%s(%s)', $name, $parameter_name));
+ }
+
+ // Static variables
+ $token_variables = $token_function->getStaticVariables();
+ $this->assertSame(count($expected_functions[$name][1]), count($token_variables), sprintf('%s()', $name));
+
+ foreach ($token_variables as $variable_name => $variable_value) {
+ $this->assertArrayHasKey($variable_name, $expected_functions[$name][1]);
+ $this->assertSame($expected_functions[$name][1][$variable_name], $variable_value);
+ }
+ }
+
+ $token_classes = $broker->getClasses();
+ static $expected_classes = array(
+ 'TokenReflection_Test_ConstantMagic54Trait' => array(
+ true,
+ array(),
+ array('t_trait' => array(false, 'TokenReflection_Test_ConstantMagic54Trait'), 't_strait' => array(true, 'TokenReflection_Test_ConstantMagic54Trait')),
+ array('t_foo' => array(array('trait' => 'TokenReflection_Test_ConstantMagic54Trait'), array('trait' => 'TokenReflection_Test_ConstantMagic54Trait')))
+ ),
+ 'TokenReflection_Test_ConstantMagic54' => array(
+ false,
+ array('CONST_TRAIT' => ''),
+ array('trait' => array(false, ''), 'strait' => array(true, '')),
+ array('foo' => array(array('trait' => ''), array('trait' => '')))
+ ),
+ 'TokenReflection_Test_ConstantMagic54WithTrait' => array(
+ false,
+ array('CONST_TRAIT' => ''),
+ array('t_trait' => array(false, 'TokenReflection_Test_ConstantMagic54Trait'), 't_strait' => array(true, 'TokenReflection_Test_ConstantMagic54Trait'), 'trait' => array(false, ''), 'strait' => array(true, ''), 'trait2' => array(false, ''), 'strait2' => array(true, '')),
+ array('foo' => array(array('trait' => ''), array('trait' => '')), 'bar' => array(array('trait' => ''), array('trait' => '')), 't_foo' => array(array('trait' => 'TokenReflection_Test_ConstantMagic54Trait'), array('trait' => 'TokenReflection_Test_ConstantMagic54Trait'))),
+ ),
+ 'ns\\TokenReflection_Test_ConstantMagic54Trait' => array(
+ true,
+ array(),
+ array('t_trait' => array(false, 'ns\\TokenReflection_Test_ConstantMagic54Trait'), 't_strait' => array(true, 'ns\\TokenReflection_Test_ConstantMagic54Trait')),
+ array('t_foo' => array(array('trait' => 'ns\\TokenReflection_Test_ConstantMagic54Trait'), array('trait' => 'ns\\TokenReflection_Test_ConstantMagic54Trait')))
+ ),
+ 'ns\\TokenReflection_Test_ConstantMagic54' => array(
+ false,
+ array('CONST_TRAIT' => ''),
+ array('trait' => array(false, ''), 'strait' => array(true, '')),
+ array('foo' => array(array('trait' => ''), array('trait' => '')))
+ ),
+ 'ns\\TokenReflection_Test_ConstantMagic54WithTrait' => array(
+ false,
+ array('CONST_TRAIT' => ''),
+ array('t_trait' => array(false, 'ns\\TokenReflection_Test_ConstantMagic54Trait'), 't_strait' => array(true, 'ns\\TokenReflection_Test_ConstantMagic54Trait'), 'trait' => array(false, ''), 'strait' => array(true, ''), 'trait2' => array(false, ''), 'strait2' => array(true, '')),
+ array('foo' => array(array('trait' => ''), array('trait' => '')), 'bar' => array(array('trait' => ''), array('trait' => '')), 't_foo' => array(array('trait' => 'ns\\TokenReflection_Test_ConstantMagic54Trait'), array('trait' => 'ns\\TokenReflection_Test_ConstantMagic54Trait'))),
+ ),
+ 'ns2\\TokenReflection_Test_ConstantMagic54' => array(
+ false,
+ array('CONST_TRAIT' => ''),
+ array('trait' => array(false, ''), 'strait' => array(true, '')),
+ array('foo' => array(array('trait' => ''), array('trait' => '')))
+ ),
+ 'ns2\\TokenReflection_Test_ConstantMagic54WithTrait' => array(
+ false,
+ array('CONST_TRAIT' => ''),
+ array('t_trait' => array(false, 'TokenReflection_Test_ConstantMagic54Trait'), 't_strait' => array(true, 'TokenReflection_Test_ConstantMagic54Trait'), 'trait' => array(false, ''), 'strait' => array(true, ''), 'trait2' => array(false, ''), 'strait2' => array(true, '')),
+ array('foo' => array(array('trait' => ''), array('trait' => '')), 'bar' => array(array('trait' => ''), array('trait' => '')), 't_foo' => array(array('trait' => 'TokenReflection_Test_ConstantMagic54Trait'), array('trait' => 'TokenReflection_Test_ConstantMagic54Trait'))),
+ ),
+ 'ns3\\TokenReflection_Test_ConstantMagic54' => array(
+ false,
+ array('CONST_TRAIT' => ''),
+ array('trait' => array(false, ''), 'strait' => array(true, '')),
+ array('foo' => array(array('trait' => ''), array('trait' => '')))
+ ),
+ 'ns3\\TokenReflection_Test_ConstantMagic54WithTrait' => array(
+ false,
+ array('CONST_TRAIT' => ''),
+ array('t_trait' => array(false, 'ns\\TokenReflection_Test_ConstantMagic54Trait'), 't_strait' => array(true, 'ns\\TokenReflection_Test_ConstantMagic54Trait'), 'trait' => array(false, ''), 'strait' => array(true, ''), 'trait2' => array(false, ''), 'strait2' => array(true, '')),
+ array('foo' => array(array('trait' => ''), array('trait' => '')), 'bar' => array(array('trait' => ''), array('trait' => '')), 't_foo' => array(array('trait' => 'ns\\TokenReflection_Test_ConstantMagic54Trait'), array('trait' => 'ns\\TokenReflection_Test_ConstantMagic54Trait'))),
+ ),
+ );
+
+ $this->assertSame(count($expected_classes), count($token_classes));
+ foreach ($token_classes as $name => $token) {
+ $this->assertTrue(isset($expected_classes[$name]), $name);
+
+ $this->assertSame($expected_classes[$name][0], $token->isTrait(), $name);
+
+ // Constants
+ $this->assertSame(count($expected_classes[$name][1]), count($token->getConstants()), $name);
+ foreach ($token->getConstants() as $constant_name => $value) {
+ $this->assertArrayHasKey($constant_name, $expected_classes[$name][1], sprintf('%s::%s', $name, $constant_name));
+ $this->assertSame($expected_classes[$name][1][$constant_name], $value, sprintf('%s::%s', $name, $constant_name));
+ }
+
+
+ // Properties
+ $this->assertSame(count($expected_classes[$name][2]), count($token->getProperties()), $name);
+ foreach ($token->getProperties() as $reflection) {
+ $property_name = $reflection->getName();
+
+ $this->assertArrayHasKey($property_name, $expected_classes[$name][2], sprintf('%s::$%s', $name, $property_name));
+ $this->assertSame($expected_classes[$name][2][$property_name][0], $token->getProperty($property_name)->isStatic(), sprintf('%s::$%s', $name, $property_name));
+
+ if ($reflection->isStatic()) {
+ $this->assertSame($expected_classes[$name][2][$property_name][1], $token->getStaticPropertyValue($property_name), sprintf('%s::$%s', $name, $property_name));
+ } else {
+ $this->assertSame($expected_classes[$name][2][$property_name][1], $token->getProperty($property_name)->getDefaultValue(), sprintf('%s::$%s', $name, $property_name));
+ }
+ }
+
+ // Methods
+ $this->assertSame(count($expected_classes[$name][3]), count($token->getMethods()), $name);
+ foreach ($token->getMethods() as $method) {
+ $method_name = $method->getName();
+
+ $this->assertArrayHasKey($method_name, $expected_classes[$name][3], sprintf('%s::%s()', $name, $method_name));
+
+ // Parameters
+ $this->assertSame(count($expected_classes[$name][3][$method_name][0]), $method->getNumberOfParameters(), sprintf('%s::%s()', $name, $method_name));
+ $this->assertSame($method->getNumberOfParameters(), count($method->getParameters()), sprintf('%s::%s()', $name, $method_name));
+
+ foreach ($method->getParameters() as $parameter) {
+ $parameter_name = $parameter->getName();
+
+ $this->assertArrayHasKey($parameter_name, $expected_classes[$name][3][$method_name][0], sprintf('%s::%s(%s)', $name, $method_name, $parameter_name));
+
+ $this->assertTrue($parameter->isDefaultValueAvailable(), sprintf('%s::%s(%s)', $name, $method_name, $parameter_name));
+ $this->assertSame($expected_classes[$name][3][$method_name][0][$parameter_name], $parameter->getDefaultValue(), sprintf('%s::%s(%s)', $name, $method_name, $parameter_name));
+ }
+
+ // Static variables
+ $token_variables = $method->getStaticVariables();
+ $this->assertSame(count($expected_classes[$name][3][$method_name][1]), count($token_variables), sprintf('%s::%s()', $name, $method_name));
+
+ foreach ($token_variables as $variable_name => $variable_value) {
+ $this->assertArrayHasKey($variable_name, $expected_classes[$name][3][$method_name][1], sprintf('%s::%s()::%s', $name, $method_name, $variable_name));
+ $this->assertSame($expected_classes[$name][3][$method_name][1][$variable_name], $variable_value, sprintf('%s::%s()::%s', $name, $method_name, $variable_name));
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests returning pretty constant names.
+ */
+ public function testPrettyNames()
+ {
+ static $names = array(
+ 'ns1\\CONST_PRETTY_NAMES_1',
+ 'CONST_PRETTY_NAMES_1',
+ 'ns1\\ConstPrettyNames::INTERNAL',
+ 'ConstPrettyNames::INTERNAL',
+ );
+
+ $broker = $this->getBroker();
+ $broker->processFile($this->getFilePath('pretty-names'));
+
+ foreach ($names as $name) {
+ $this->assertTrue($broker->hasConstant($name), $name);
+
+ $rfl = $broker->getConstant($name);
+ $this->assertSame($name, $rfl->getPrettyName(), $name);
+ }
+ }
+
+ /**
+ * Tests an exception thrown when trying to get instance of TokenReflection\Php\ReflectionConstant and providing an invalid parent reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalConstantConstructor()
+ {
+ new Php\ReflectionConstant('foo', 'bar', $this->getBroker(), new Php\ReflectionClass('Exception', $this->getBroker()));
+ }
+
+ /**
+ * Tests an exception thrown when trying to export an constant.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalConstantExport1()
+ {
+ Php\ReflectionConstant::export($this->getBroker(), null, '~non-existent~', true);
+ }
+
+ /**
+ * Tests an exception thrown when trying to export an constant.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalConstantExport2()
+ {
+ Php\ReflectionConstant::export($this->getBroker(), '~non-existent~', '~non-existent~', true);
+ }
+
+ /**
+ * Tests various constant (mis)definitions.
+ */
+ public function testValueDefinitions()
+ {
+ static $expected = array(
+ 'VALUE_DEFINITION1' => true,
+ 'VALUE_DEFINITION2' => true,
+ 'VALUE_DEFINITION3' => true,
+ 'VALUE_DEFINITION4' => true,
+ 'VALUE_DEFINITION5' => true,
+ 'VALUE_DEFINITION6' => true,
+ 'VALUE_DEFINITION7' => true
+ );
+
+ $broker = $this->getBroker();
+ $broker->processFile($this->getFilePath('valueDefinitions'));
+
+ foreach ($expected as $name => $value) {
+ $this->assertTrue($broker->hasConstant($name), $name);
+
+ $rfl = $broker->getConstant($name);
+ $this->assertSame($value, $rfl->getValue(), $name);
+ }
+ }
+
+ /**
+ * Tests constants defined in interfaces.
+ */
+ public function testInterfaces()
+ {
+ $broker = new Broker(new Broker\Backend\Memory());
+ $broker->process($this->getFilePath('interfaces'));
+
+ $class1 = $broker->getClass('TokenReflection_Test_ConstantInterfaceClass');
+ $this->assertTrue($class1->hasConstant('FIRST'));
+
+ $class2 = $broker->getClass('TokenReflection_Test_ConstantInterfaceClass2');
+ $this->assertTrue($class2->hasConstant('FIRST'));
+ $this->assertTrue($class2->hasConstant('SECOND'));
+ }
+
+ /**
+ * Tests constants overriding.
+ *
+ * (btw that sucks even more than eval)
+ */
+ public function testOverriding()
+ {
+ $token = $this->getClassTokenReflection('overriding');
+
+ $this->assertTrue($token->hasConstant('FOO'));
+ $constant = $token->getConstantReflection('FOO');
+ $this->assertSame('notbar', $constant->getValue());
+ $this->assertSame('TokenReflection_Test_ConstantOverriding', $constant->getDeclaringClassName());
+
+ $this->assertTrue($token->getParentClass()->hasConstant('FOO'));
+ $constant = $token->getParentClass()->getConstantReflection('FOO');
+ $this->assertSame('bar', $constant->getValue());
+ $this->assertSame('TokenReflection_Test_ConstantOverridingBase', $constant->getDeclaringClassName());
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionExtensionTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionExtensionTest.php
new file mode 100644
index 0000000..36020d6
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionExtensionTest.php
@@ -0,0 +1,41 @@
+getBroker());
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionFileTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionFileTest.php
new file mode 100644
index 0000000..75fa319
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionFileTest.php
@@ -0,0 +1,103 @@
+getFilePath('docComment');
+ $this->getBroker()->processFile($fileName);
+
+ $this->assertTrue($this->getBroker()->hasFile($fileName));
+
+ $fileReflection = $this->getBroker()->getFile($fileName);
+ $this->assertInstanceOf('\TokenReflection\ReflectionFile', $fileReflection);
+
+ $this->assertSame($this->getFilePath('docComment'), $fileReflection->getPrettyName());
+
+ $this->assertTrue($fileReflection->hasAnnotation('package'));
+ $this->assertTrue($fileReflection->hasAnnotation('author'));
+ $this->assertFalse($fileReflection->hasAnnotation('licence'));
+
+ $this->assertSame(array('package name'), $fileReflection->getAnnotation('package'));
+ $this->assertSame(array('author name'), $fileReflection->getAnnotation('author'));
+ }
+
+ /**
+ * Tests file level docblocks.
+ */
+ public function testNoDocComment()
+ {
+ $fileName = $this->getFilePath('noDocComment');
+ $this->getBroker()->processFile($fileName);
+
+ $this->assertTrue($this->getBroker()->hasFile($fileName));
+
+ $fileReflection = $this->getBroker()->getFile($fileName);
+ $this->assertInstanceOf('\TokenReflection\ReflectionFile', $fileReflection);
+
+ $this->assertSame($this->getFilePath('noDocComment'), $fileReflection->getPrettyName());
+
+ $this->assertFalse($fileReflection->hasAnnotation('package'));
+ $this->assertFalse($fileReflection->hasAnnotation('author'));
+ $this->assertFalse($fileReflection->getDocComment());
+ }
+
+ /**
+ * Tests returning file reflections.
+ */
+ public function testReturningFileReflection()
+ {
+ $fileName = $this->getFilePath('docComment');
+ $rfl = $this->getClassReflection('docComment');
+
+ $this->assertTrue($this->getBroker()->hasFile($fileName));
+
+ $this->assertSame($rfl->token->getFileName(), $rfl->token->getFileReflection()->getName());
+ $this->assertSame($this->getBroker()->getFile($fileName), $rfl->token->getFileReflection());
+ }
+
+ /**
+ * Tests throwing exceptions when requesting reflections of files that were not processed.
+ *
+ * @expectedException \TokenReflection\Exception\BrokerException
+ */
+ public function testExceptionReturningFileReflection()
+ {
+ $broker = $this->getBroker();
+
+ $this->assertFalse($broker->hasFile('#non~Existent#'));
+ $broker->getFile('#non~Existent#');
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionFunctionTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionFunctionTest.php
new file mode 100644
index 0000000..98e1ae1
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionFunctionTest.php
@@ -0,0 +1,375 @@
+getFunctionReflection('lines');
+ $this->assertSame($rfl->internal->getStartLine(), $rfl->token->getStartLine());
+ $this->assertSame(3, $rfl->token->getStartLine());
+ $this->assertSame($rfl->internal->getEndLine(), $rfl->token->getEndLine());
+ $this->assertSame(5, $rfl->token->getEndLine());
+ }
+
+ /**
+ * Tests getting of documentation comment.
+ */
+ public function testComment()
+ {
+ $rfl = $this->getFunctionReflection('docComment');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame("/**\n * This is a function.\n */", $rfl->token->getDocComment());
+
+ $rfl = $this->getFunctionReflection('noComment');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertFalse($rfl->token->getDocComment());
+ }
+
+ /**
+ * Tests getting of copydoc documentation comment.
+ */
+ public function testCommentCopydoc()
+ {
+ static $functions = array(
+ 'tokenReflectionFunctionDocCommentCopydoc' => 'This is a function.',
+ 'tokenReflectionFunctionDocCommentCopydoc2' => 'This is a function.',
+ 'tokenReflectionFunctionDocCommentCopydoc3' => 'This is a function.',
+ 'tokenReflectionFunctionDocCommentCopydoc4' => null,
+ 'tokenReflectionFunctionDocCommentCopydoc5' => null,
+ );
+
+ $broker = $this->getBroker();
+ $broker->processFile($this->getFilePath('docCommentCopydoc'));
+
+ foreach ($functions as $functionName => $shortDescription) {
+ $this->assertTrue($broker->hasFunction($functionName), $functionName);
+ $this->assertSame($shortDescription, $broker->getFunction($functionName)->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION), $functionName);
+ }
+ }
+
+ /**
+ * Tests getting of static variables.
+ */
+ public function testStaticVariables()
+ {
+ $rfl = $this->getFunctionReflection('staticVariables');
+
+ $this->assertSame($rfl->internal->getStaticVariables(), $rfl->token->getStaticVariables());
+ $this->assertSame(
+ array(
+ 'string' => 'string',
+ 'integer' => 1,
+ 'float' => 1.1,
+ 'boolean' => true,
+ 'null' => null,
+ 'array' => array(1 => 1),
+ 'array2' => array(1 => 1, 2 => 2),
+ 'constant' => 'constant value'
+ ),
+ $rfl->token->getStaticVariables()
+ );
+ }
+
+ /**
+ * Tests if function is a closure.
+ */
+ public function testClosure()
+ {
+ $rfl = $this->getFunctionReflection('noClosure');
+ $this->assertSame($rfl->internal->isClosure(), $rfl->token->isClosure());
+ $this->assertFalse($rfl->token->isClosure());
+ }
+
+ /**
+ * Tests if function is a closure.
+ */
+ public function testGetClosure()
+ {
+ $broker = $this->getBroker();
+ $broker->processFile($this->getFilePath('getClosure'));
+ require_once $this->getFilePath('getClosure');
+
+ $function = $broker->getFunction('tokenReflectionFunctionGetClosure1');
+ $this->assertNull($function->getClosureScopeClass());
+ $closure = $function->getClosure();
+ $this->assertInstanceOf('Closure', $closure);
+
+ static $data1 = array(1 => 1, 4 => 2, 9 => 3);
+ foreach ($data1 as $result => $input) {
+ $this->assertSame($result, $closure($input));
+ }
+
+ $function = $broker->getFunction('tokenReflectionFunctionGetClosure2');
+ $this->assertNull($function->getClosureScopeClass());
+ $closure = $function->getClosure();
+ $this->assertInstanceOf('Closure', $closure);
+
+ static $data2 = array(-1 => 1, -2 => 2, -3 => 3);
+ foreach ($data2 as $result => $input) {
+ $this->assertSame($result, $closure($input));
+ }
+
+ static $data3 = array(-1 => array(2, -.5), 1 => array(-100, -.01), 8 => array(2, 4));
+ foreach ($data3 as $result => $input) {
+ list($a, $b) = $input;
+ $this->assertEquals($result, $closure($a, $b));
+ }
+ }
+
+ /**
+ * Tests if function is deprecated.
+ */
+ public function testDeprecated()
+ {
+ $rfl = $this->getFunctionReflection('noDeprecated');
+ $this->assertSame($rfl->internal->isDeprecated(), $rfl->token->isDeprecated());
+ $this->assertFalse($rfl->token->isDeprecated());
+ }
+
+ /**
+ * Tests if function is disabled.
+ */
+ public function testDisabled()
+ {
+ $rfl = $this->getFunctionReflection('noDisabled');
+ $this->assertSame($rfl->internal->isDisabled(), $rfl->token->isDisabled());
+ $this->assertFalse($rfl->token->isDisabled());
+ }
+
+ /**
+ * Tests if function is user defined or internal.
+ */
+ public function testUserDefined()
+ {
+ $rfl = $this->getFunctionReflection('userDefined');
+
+ $this->assertSame($rfl->internal->isUserDefined(), $rfl->token->isUserDefined());
+ $this->assertTrue($rfl->token->isUserDefined());
+ $this->assertSame($rfl->internal->getFileName(), $rfl->token->getFileName());
+ $this->assertSame($this->getFilePath('userDefined'), $rfl->token->getFileName());
+ $this->assertSame($rfl->internal->isInternal(), $rfl->token->isInternal());
+ $this->assertFalse($rfl->token->isInternal());
+
+ $this->assertSame($rfl->internal->getExtension(), $rfl->token->getExtension());
+ $this->assertNull($rfl->token->getExtension());
+ $this->assertSame($rfl->internal->getExtensionName(), $rfl->token->getExtensionName());
+ $this->assertFalse($rfl->token->getExtensionName());
+
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionFunction('get_class');
+ $rfl->token = $this->getBroker()->getFunction('get_class');
+
+ $this->assertSame($rfl->internal->isUserDefined(), $rfl->token->isUserDefined());
+ $this->assertFalse($rfl->token->isUserDefined());
+ $this->assertSame($rfl->internal->getFileName(), $rfl->token->getFileName());
+ $this->assertFalse($rfl->token->getFileName());
+ $this->assertSame($rfl->internal->isInternal(), $rfl->token->isInternal());
+ $this->assertTrue($rfl->token->isInternal());
+
+ $this->assertInstanceOf('TokenReflection\Php\ReflectionExtension', $rfl->token->getExtension());
+ $this->assertSame($rfl->internal->getExtensionName(), $rfl->token->getExtensionName());
+ $this->assertSame('Core', $rfl->token->getExtensionName());
+ }
+
+ /**
+ * Tests if function is defined in namespace.
+ */
+ public function testInNamespace()
+ {
+ require_once $this->getFilePath('inNamespace');
+ $this->getBroker()->processFile($this->getFilePath('inNamespace'));
+
+ $rfl = new \stdClass();
+ $rfl->internal = new InternalReflectionFunction('TokenReflection\Test\functionInNamespace');
+ $rfl->token = $this->getBroker()->getFunction('TokenReflection\Test\functionInNamespace');
+
+ $this->assertSame($rfl->internal->inNamespace(), $rfl->token->inNamespace());
+ $this->assertTrue($rfl->token->inNamespace());
+ $this->assertSame($rfl->internal->getNamespaceName(), $rfl->token->getNamespaceName());
+ $this->assertSame('TokenReflection\Test', $rfl->token->getNamespaceName());
+ $this->assertSame($rfl->internal->getName(), $rfl->token->getName());
+ $this->assertSame('TokenReflection\Test\functionInNamespace', $rfl->token->getName());
+ $this->assertSame($rfl->internal->getShortName(), $rfl->token->getShortName());
+ $this->assertSame('functionInNamespace', $rfl->token->getShortName());
+
+ $rfl = $this->getFunctionReflection('noNamespace');
+ $this->assertSame($rfl->internal->inNamespace(), $rfl->token->inNamespace());
+ $this->assertFalse($rfl->token->inNamespace());
+ $this->assertSame($rfl->internal->getNamespaceName(), $rfl->token->getNamespaceName());
+ $this->assertSame('', $rfl->token->getNamespaceName());
+ $this->assertSame($rfl->internal->getName(), $rfl->token->getName());
+ $this->assertSame($this->getFunctionName('noNamespace'), $rfl->token->getName());
+ $this->assertSame($rfl->internal->getShortName(), $rfl->token->getShortName());
+ $this->assertSame($this->getFunctionName('noNamespace'), $rfl->token->getShortName());
+ }
+
+ /**
+ * Tests if function returns reference.
+ */
+ public function testReference()
+ {
+ $rfl = $this->getFunctionReflection('reference');
+ $this->assertSame($rfl->internal->returnsReference(), $rfl->token->returnsReference());
+ $this->assertTrue($rfl->token->returnsReference());
+
+ $rfl = $this->getFunctionReflection('noReference');
+ $this->assertSame($rfl->internal->returnsReference(), $rfl->token->returnsReference());
+ $this->assertFalse($rfl->token->returnsReference());
+ }
+
+ /**
+ * Tests getting of function parameters.
+ */
+ public function testParameters()
+ {
+ $rfl = $this->getFunctionReflection('parameters');
+ $this->assertSame($rfl->internal->getNumberOfParameters(), $rfl->token->getNumberOfParameters());
+ $this->assertSame(3, $rfl->token->getNumberOfParameters());
+ $this->assertSame($rfl->internal->getNumberOfRequiredParameters(), $rfl->token->getNumberOfRequiredParameters());
+ $this->assertSame(2, $rfl->token->getNumberOfRequiredParameters());
+
+ $this->assertSame(array_keys($rfl->internal->getParameters()), array_keys($rfl->token->getParameters()));
+ $internalParameters = $rfl->internal->getParameters();
+ $tokenParameters = $rfl->token->getParameters();
+ for ($i = 0; $i < count($internalParameters); $i++) {
+ $this->assertSame($internalParameters[$i]->getName(), $tokenParameters[$i]->getName());
+ $this->assertInstanceOf('TokenReflection\ReflectionParameter', $tokenParameters[$i]);
+ }
+
+ $rfl = $this->getFunctionReflection('noParameters');
+ $this->assertSame($rfl->internal->getNumberOfParameters(), $rfl->token->getNumberOfParameters());
+ $this->assertSame(0, $rfl->token->getNumberOfParameters());
+ $this->assertSame($rfl->internal->getNumberOfRequiredParameters(), $rfl->token->getNumberOfRequiredParameters());
+ $this->assertSame(0, $rfl->token->getNumberOfRequiredParameters());
+ $this->assertSame($rfl->internal->getParameters(), $rfl->token->getParameters());
+ $this->assertSame(array(), $rfl->token->getParameters());
+ }
+
+ /**
+ * Tests function invoking.
+ */
+ public function testInvoke()
+ {
+ $rfl = $this->getFunctionReflection('invoke');
+ $this->assertSame($rfl->internal->invoke(1, 2), $rfl->token->invoke(1, 2));
+ $this->assertSame(3, $rfl->token->invoke(1, 2));
+ $this->assertSame($rfl->internal->invokeArgs(array(1, 2)), $rfl->token->invokeArgs(array(1, 2)));
+ $this->assertSame(3, $rfl->token->invokeArgs(array(1, 2)));
+ }
+
+ /**
+ * Tests export.
+ */
+ public function testToString()
+ {
+ $tests = array(
+ 'lines', 'docComment', 'noComment',
+ 'invoke', 'noParameters', 'parameters', 'reference', 'noReference', 'noNamespace', 'userDefined', 'noClosure'
+ );
+ foreach ($tests as $test) {
+ $rfl = $this->getFunctionReflection($test);
+ $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
+ $this->assertSame(InternalReflectionFunction::export($this->getFunctionName($test), true), ReflectionFunction::export($this->getBroker(), $this->getFunctionName($test), true));
+
+ // Test loading from a string
+ $rfl = $this->getFunctionReflection($test, true);
+ $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
+ }
+
+ $this->assertSame(InternalReflectionFunction::export('strpos', true), ReflectionFunction::export($this->getBroker(), 'strpos', true));
+ }
+
+ /**
+ * Tests new PHP 5.4 features.
+ */
+ public function test54features()
+ {
+ if (PHP_VERSION_ID < 50400) {
+ $this->markTestSkipped('Tested only on PHP 5.4+');
+ }
+
+ $rfl = $this->getFunctionReflection('54features');
+
+ $this->assertSame($rfl->internal->getStaticVariables(), $rfl->token->getStaticVariables());
+ $this->assertSame(
+ array(
+ 'one' => array(),
+ 'two' => array(array(1), '2', array(array(array(array(true))))),
+ 'three' => 21
+ ),
+ $rfl->token->getStaticVariables()
+ );
+ }
+
+ /**
+ * Tests an exception thrown when trying to create the reflection from a PHP internal reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalFunctionReflectionCreate()
+ {
+ Php\ReflectionExtension::create(new \ReflectionClass('Exception'), $this->getBroker());
+ }
+
+ /**
+ * Tests an exception thrown when trying to get a non-existent parameter.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalFunctionGetParameter1()
+ {
+ $this->getInternalFunctionReflection()->getParameter('~non-existent~');
+ }
+
+ /**
+ * Tests an exception thrown when trying to get a non-existent parameter.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalFunctionGetParameter2()
+ {
+ $this->getInternalFunctionReflection()->getParameter(999);
+ }
+
+ /**
+ * Returns an internal function reflection.
+ *
+ * @return \TokenReflection\Php\ReflectionFunction
+ */
+ private function getInternalFunctionReflection()
+ {
+ return $this->getBroker()->getFunction('create_function');
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionMethodTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionMethodTest.php
new file mode 100644
index 0000000..88aa619
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionMethodTest.php
@@ -0,0 +1,600 @@
+getMethodReflection('lines');
+ $this->assertSame($rfl->internal->getStartLine(), $rfl->token->getStartLine());
+ $this->assertSame(5, $rfl->token->getStartLine());
+ $this->assertSame($rfl->internal->getEndLine(), $rfl->token->getEndLine());
+ $this->assertSame(7, $rfl->token->getEndLine());
+ }
+
+ /**
+ * Tests getting of documentation comment.
+ */
+ public function testComment()
+ {
+ $rfl = $this->getMethodReflection('docComment');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertSame("/**\n\t * This is a method.\n\t */", $rfl->token->getDocComment());
+
+ $rfl = $this->getMethodReflection('noComment');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertFalse($rfl->token->getDocComment());
+ }
+
+ /**
+ * Tests getting of copydoc documentation comment.
+ */
+ public function testCommentCopydoc()
+ {
+ static $methods = array(
+ 'method' => 'This is a method.',
+ 'method2' => 'This is a method.',
+ 'method3' => 'This is a method.',
+ 'method4' => 'This is a method.',
+ 'method5' => 'This is a method.',
+ 'method6' => null,
+ 'method7' => null
+ );
+
+ $class = $this->getClassTokenReflection('docCommentCopydoc');
+ foreach ($methods as $methodName => $shortDescription) {
+ $this->assertTrue($class->hasMethod($methodName), $methodName);
+ $this->assertSame($shortDescription, $class->getMethod($methodName)->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION), $methodName);
+ }
+ }
+
+ /**
+ * Tests getting of inherited documentation comment.
+ */
+ public function testDocCommentInheritance()
+ {
+ $this->getBroker()->processFile($this->getFilePath('docCommentInheritance'));
+
+ $grandParent = new \stdClass();
+ $grandParent->token = $this->getBroker()->getClass('TokenReflection_Test_MethodDocCommentInheritanceGrandParent');
+
+ $parent = new \stdClass();
+ $parent->token = $this->getBroker()->getClass('TokenReflection_Test_MethodDocCommentInheritanceParent');
+
+ $rfl = new \stdClass();
+ $rfl->token = $this->getBroker()->getClass('TokenReflection_Test_MethodDocCommentInheritance');
+
+ $this->assertSame($parent->token->getMethod('method1')->getAnnotations(), $rfl->token->getMethod('method1')->getAnnotations());
+ $this->assertSame('Private1 short. Protected1 short.', $rfl->token->getMethod('method1')->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertSame('Protected1 long. Private1 long.', $rfl->token->getMethod('method1')->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+
+ $this->assertSame($parent->token->getMethod('method2')->getAnnotations(), $rfl->token->getMethod('method2')->getAnnotations());
+ $this->assertSame($grandParent->token->getMethod('method2')->getAnnotations(), $rfl->token->getMethod('method2')->getAnnotations());
+
+ $this->assertSame('Public3 Protected3 short.', $rfl->token->getMethod('method3')->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertNull($rfl->token->getMethod('method3')->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+
+ $this->assertSame(array(), $rfl->token->getMethod('method4')->getAnnotations());
+ $this->assertNull($rfl->token->getMethod('method4')->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+
+ $this->assertSame($grandParent->token->getMethod('method1')->getAnnotation('throws'), $parent->token->getMethod('method1')->getAnnotation('throws'));
+ $this->assertSame($grandParent->token->getMethod('method1')->getAnnotation('throws'), $rfl->token->getMethod('method1')->getAnnotation('throws'));
+ $this->assertSame(array('Exception'), $grandParent->token->getMethod('method1')->getAnnotation('throws'));
+ $this->assertSame(array('string'), $parent->token->getMethod('method1')->getAnnotation('return'));
+
+ $this->assertSame($grandParent->token->getMethod('method2')->getAnnotation('return'), $parent->token->getMethod('method2')->getAnnotation('return'));
+ $this->assertSame($parent->token->getMethod('method2')->getAnnotation('return'), $rfl->token->getMethod('method2')->getAnnotation('return'));
+ $this->assertSame(array('mixed'), $parent->token->getMethod('method2')->getAnnotation('return'));
+
+ $this->assertSame($parent->token->getMethod('method3')->getAnnotation('return'), $rfl->token->getMethod('method3')->getAnnotation('return'));
+ $this->assertSame(array('boolean'), $rfl->token->getMethod('method3')->getAnnotation('return'));
+ }
+
+ /**
+ * Tests getting of static variables.
+ */
+ public function testStaticVariables()
+ {
+ static $testName = 'staticVariables';
+
+ $rfl = $this->getMethodReflection($testName);
+
+ $this->assertSame($rfl->internal->getStaticVariables(), $rfl->token->getStaticVariables());
+ $this->assertSame(
+ array(
+ 'string' => 'string',
+ 'integer' => 1,
+ 'float' => 1.1,
+ 'boolean' => true,
+ 'null' => null,
+ 'array' => array(1 => 1),
+ 'array2' => array(1 => 1, 2 => 2),
+ 'constants' => array('self constant', 'parent constant')
+ ),
+ $rfl->token->getStaticVariables()
+ );
+
+ // The same test with parsing method bodies turned off
+ $broker = new Broker(new Broker\Backend\Memory(), Broker::OPTION_DEFAULT & ~Broker::OPTION_PARSE_FUNCTION_BODY);
+ $broker->processFile($this->getFilePath($testName));
+ $reflection = $broker->getClass($this->getClassName($testName))->getMethod($this->getMethodName($testName));
+ $this->assertSame(array(), $reflection->getStaticVariables());
+ }
+
+ /**
+ * Tests if method is a closure.
+ */
+ public function testClosure()
+ {
+ $rfl = $this->getMethodReflection('noClosure');
+ $this->assertSame($rfl->internal->isClosure(), $rfl->token->isClosure());
+ $this->assertFalse($rfl->token->isClosure());
+ }
+
+ /**
+ * Tests if method is deprecated.
+ */
+ public function testDeprecated()
+ {
+ $rfl = $this->getMethodReflection('noDeprecated');
+ $this->assertSame($rfl->internal->isDeprecated(), $rfl->token->isDeprecated());
+ $this->assertFalse($rfl->token->isDeprecated());
+ }
+
+ /**
+ * Tests if method is constructor or destructor.
+ */
+ public function testConstructorDestructor()
+ {
+ $rfl = $this->getClassReflection('constructorDestructor');
+
+ $internal = $rfl->internal->getMethod('__construct');
+ $token = $rfl->token->getMethod('__construct');
+
+ $this->assertSame($internal->isConstructor(), $token->isConstructor());
+ $this->assertTrue($token->isConstructor());
+ $this->assertSame($internal->isDestructor(), $token->isDestructor());
+ $this->assertFalse($token->isDestructor());
+
+ $internal = $rfl->internal->getMethod('__destruct');
+ $token = $rfl->token->getMethod('__destruct');
+
+ $this->assertSame($internal->isConstructor(), $token->isConstructor());
+ $this->assertFalse($token->isConstructor());
+ $this->assertSame($internal->isDestructor(), $token->isDestructor());
+ $this->assertTrue($token->isDestructor());
+
+ $rfl = $this->getClassReflection('namedConstructor');
+
+ $internal = $rfl->internal->getMethod($this->getClassName('namedConstructor'));
+ $token = $rfl->token->getMethod($this->getClassName('namedConstructor'));
+
+ $this->assertSame($internal->isConstructor(), $token->isConstructor());
+ $this->assertTrue($token->isConstructor());
+
+ require_once $this->getFilePath('namedConstructorInNamespace');
+ $this->getBroker()->processFile($this->getFilePath('namedConstructorInNamespace'));
+
+ $class = new \ReflectionClass('TokenReflection\Test\MethodNamedConstructor');
+ $internal = $class->getMethod('MethodNamedConstructor');
+ $token = $this->getBroker()->getClass('TokenReflection\Test\MethodNamedConstructor')->getMethod('MethodNamedConstructor');
+
+ $this->assertSame($internal->isConstructor(), $token->isConstructor());
+ if (PHP_VERSION_ID >= 50303) {
+ $this->assertFalse($token->isConstructor());
+ } else {
+ $this->assertTrue($token->isConstructor());
+ }
+ }
+
+ /**
+ * Tests if method can clone.
+ */
+ public function testClone()
+ {
+ if (PHP_VERSION_ID >= 50400) {
+ // @todo investigate http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_compile.h?revision=306938&view=markup#l199
+ $this->markTestSkipped();
+ }
+
+ $rfl = $this->getClassReflection('clone');
+
+ $this->assertSame($rfl->internal->getMethod('__clone')->getModifiers(), $rfl->token->getMethod('__clone')->getModifiers());
+ $this->assertSame($rfl->internal->getMethod('noClone')->getModifiers(), $rfl->token->getMethod('noClone')->getModifiers());
+ }
+
+ /**
+ * Tests getting of declaring class.
+ */
+ public function testDeclaringClass()
+ {
+ $rfl = $this->getClassReflection('declaringClass');
+
+ foreach (array('parent' => 'Parent', 'child' => '', 'parentOverlay' => '') as $method => $class) {
+ $internal = $rfl->internal->getMethod($method);
+ $token = $rfl->token->getMethod($method);
+
+ $this->assertSame($internal->getDeclaringClass()->getName(), $token->getDeclaringClass()->getName());
+ $this->assertSame('TokenReflection_Test_MethodDeclaringClass' . $class, $token->getDeclaringClass()->getName());
+ $this->assertSame('TokenReflection_Test_MethodDeclaringClass' . $class, $token->getDeclaringClassName());
+ $this->assertInstanceOf('TokenReflection\ReflectionClass', $token->getDeclaringClass());
+ }
+ }
+
+ /**
+ * Tests all method modifiers.
+ */
+ public function testModifiers()
+ {
+ static $classes = array(
+ 'TokenReflection_Test_MethodModifiersIface',
+ 'TokenReflection_Test_MethodModifiersParent',
+ 'TokenReflection_Test_MethodModifiers',
+ 'TokenReflection_Test_MethodModifiersChild',
+ 'TokenReflection_Test_MethodModifiersChild2',
+ 'TokenReflection_Test_MethodModifiersChild3',
+ 'TokenReflection_Test_MethodModifiersChild4'
+ );
+
+ require_once $this->getFilePath('modifiers');
+ $this->getBroker()->process($this->getFilePath('modifiers'));
+
+ foreach ($classes as $className) {
+ $token = $this->getBroker()->getClass($className);
+ $internal = new \ReflectionClass($className);
+
+ foreach ($internal->getMethods() as $method) {
+ $this->assertTrue($token->hasMethod($method->getName()), sprintf('%s::%s()', $className, $method->getName()));
+ if (PHP_VERSION_ID >= 50400) {
+ // @todo investigate http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_compile.h?revision=306938&view=markup#l199
+ continue;
+ }
+ $this->assertSame($method->getModifiers(), $token->getMethod($method->getName())->getModifiers(), sprintf('%s::%s()', $className, $method->getName()));
+ }
+ }
+ }
+
+ /**
+ * Tests if method is user defined or internal.
+ */
+ public function testUserDefined()
+ {
+ $rfl = $this->getMethodReflection('userDefined');
+
+ $this->assertSame($rfl->internal->isUserDefined(), $rfl->token->isUserDefined());
+ $this->assertTrue($rfl->token->isUserDefined());
+ $this->assertSame($rfl->internal->getFileName(), $rfl->token->getFileName());
+ $this->assertSame($this->getFilePath('userDefined'), $rfl->token->getFileName());
+ $this->assertSame($rfl->internal->isInternal(), $rfl->token->isInternal());
+ $this->assertFalse($rfl->token->isInternal());
+
+ $this->assertSame($rfl->internal->getExtension(), $rfl->token->getExtension());
+ $this->assertNull($rfl->token->getExtension());
+ $this->assertSame($rfl->internal->getExtensionName(), $rfl->token->getExtensionName());
+ $this->assertFalse($rfl->token->getExtensionName());
+
+ $rfl = new \stdClass();
+ $class = new \ReflectionClass('Exception');
+ $rfl->internal = $class->getMethod('getMessage');
+ $rfl->token = $this->getBroker()->getClass('Exception')->getMethod('getMessage');
+
+ $this->assertSame($rfl->internal->isUserDefined(), $rfl->token->isUserDefined());
+ $this->assertFalse($rfl->token->isUserDefined());
+ $this->assertSame($rfl->internal->getFileName(), $rfl->token->getFileName());
+ $this->assertFalse($rfl->token->getFileName());
+ $this->assertSame($rfl->internal->isInternal(), $rfl->token->isInternal());
+ $this->assertTrue($rfl->token->isInternal());
+
+ $this->assertEquals($rfl->internal->getExtension(), $rfl->token->getExtension());
+ $this->assertSame($rfl->internal->getExtensionName(), $rfl->token->getExtensionName());
+ $this->assertSame('Core', $rfl->token->getExtensionName());
+ }
+
+ /**
+ * Tests if method is defined in class in namespace.
+ */
+ public function testInNamespace()
+ {
+ require_once $this->getFilePath('inNamespace');
+ $this->getBroker()->processFile($this->getFilePath('inNamespace'));
+
+ $rfl = new \stdClass();
+ $class = new \ReflectionClass('TokenReflection\Test\MethodInNamespace');
+ $rfl->internal = $class->getMethod('inNamespace');
+ $rfl->token = $this->getBroker()->getClass('TokenReflection\Test\MethodInNamespace')->getMethod('inNamespace');
+
+ $this->assertSame($rfl->internal->inNamespace(), $rfl->token->inNamespace());
+ $this->assertFalse($rfl->token->inNamespace());
+ $this->assertSame($rfl->internal->getNamespaceName(), $rfl->token->getNamespaceName());
+ $this->assertSame('', $rfl->token->getNamespaceName());
+ $this->assertSame($rfl->internal->getName(), $rfl->token->getName());
+ $this->assertSame('inNamespace', $rfl->token->getName());
+ $this->assertSame($rfl->internal->getShortName(), $rfl->token->getShortName());
+ $this->assertSame('inNamespace', $rfl->token->getShortName());
+
+ $rfl = $this->getMethodReflection('noNamespace');
+ $this->assertSame($rfl->internal->inNamespace(), $rfl->token->inNamespace());
+ $this->assertFalse($rfl->token->inNamespace());
+ $this->assertSame($rfl->internal->getNamespaceName(), $rfl->token->getNamespaceName());
+ $this->assertSame('', $rfl->token->getNamespaceName());
+ $this->assertSame($rfl->internal->getName(), $rfl->token->getName());
+ $this->assertSame($this->getMethodName('noNamespace'), $rfl->token->getName());
+ $this->assertSame($rfl->internal->getShortName(), $rfl->token->getShortName());
+ $this->assertSame($this->getMethodName('noNamespace'), $rfl->token->getShortName());
+ }
+
+ /**
+ * Tests if method returns reference.
+ */
+ public function testReference()
+ {
+ $rfl = $this->getMethodReflection('reference');
+ $this->assertSame($rfl->internal->returnsReference(), $rfl->token->returnsReference());
+ $this->assertTrue($rfl->token->returnsReference());
+
+ $rfl = $this->getMethodReflection('noReference');
+ $this->assertSame($rfl->internal->returnsReference(), $rfl->token->returnsReference());
+ $this->assertFalse($rfl->token->returnsReference());
+ }
+
+ /**
+ * Tests getting of method parameters.
+ */
+ public function testParameters()
+ {
+ $rfl = $this->getMethodReflection('parameters');
+ $this->assertSame($rfl->internal->getNumberOfParameters(), $rfl->token->getNumberOfParameters());
+ $this->assertSame(3, $rfl->token->getNumberOfParameters());
+ $this->assertSame($rfl->internal->getNumberOfRequiredParameters(), $rfl->token->getNumberOfRequiredParameters());
+ $this->assertSame(2, $rfl->token->getNumberOfRequiredParameters());
+
+ $this->assertSame(array_keys($rfl->internal->getParameters()), array_keys($rfl->token->getParameters()));
+ $internalParameters = $rfl->internal->getParameters();
+ $tokenParameters = $rfl->token->getParameters();
+ for ($i = 0; $i < count($internalParameters); $i++) {
+ $this->assertSame($internalParameters[$i]->getName(), $tokenParameters[$i]->getName());
+ $this->assertInstanceOf('TokenReflection\ReflectionParameter', $tokenParameters[$i]);
+ }
+
+ $rfl = $this->getMethodReflection('noParameters');
+ $this->assertSame($rfl->internal->getNumberOfParameters(), $rfl->token->getNumberOfParameters());
+ $this->assertSame(0, $rfl->token->getNumberOfParameters());
+ $this->assertSame($rfl->internal->getNumberOfRequiredParameters(), $rfl->token->getNumberOfRequiredParameters());
+ $this->assertSame(0, $rfl->token->getNumberOfRequiredParameters());
+ $this->assertSame($rfl->internal->getParameters(), $rfl->token->getParameters());
+ $this->assertSame(array(), $rfl->token->getParameters());
+ }
+
+ /**
+ * Tests method invoking.
+ */
+ public function testInvoke()
+ {
+ $rfl = $this->getClassReflection('invoke');
+
+ $className = $this->getClassName('invoke');
+ $object = new $className();
+
+ $internal = $rfl->internal->getMethod('publicInvoke');
+ $token = $rfl->token->getMethod('publicInvoke');
+
+ $this->assertSame($internal->invoke($object, 1, 2), $token->invoke($object, 1, 2));
+ $this->assertSame(3, $token->invoke($object, 1, 2));
+ $this->assertSame($internal->invokeArgs($object, array(1, 2)), $token->invokeArgs($object, array(1, 2)));
+ $this->assertSame(3, $token->invokeArgs($object, array(1, 2)));
+
+ if (PHP_VERSION_ID >= 50302) {
+ $this->assertSame($internal->setAccessible(false), $token->setAccessible(false));
+ $this->assertSame($internal->invoke($object, 1, 2), $token->invoke($object, 1, 2));
+ }
+
+ try {
+ $token->invoke(new \Exception(), 1, 2);
+ $this->fail('Expected exception TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ try {
+ $token->invokeArgs(new \Exception(), array(1, 2));
+ $this->fail('Expected exception TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ $internal = $rfl->internal->getMethod('protectedInvoke');
+ $token = $rfl->token->getMethod('protectedInvoke');
+
+ try {
+ $token->invoke($object, 1, 2);
+ $this->fail('Expected exception TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ try {
+ $token->invokeArgs($object, array(1, 2));
+ $this->fail('Expected exception TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ if (PHP_VERSION_ID >= 50302) {
+ $this->assertSame($internal->setAccessible(true), $token->setAccessible(true));
+ $this->assertSame($internal->invoke($object, 1, 2), $token->invoke($object, 1, 2));
+ $this->assertSame(3, $token->invoke($object, 1, 2));
+ $this->assertSame($internal->invokeArgs($object, array(1, 2)), $token->invokeArgs($object, array(1, 2)));
+ $this->assertSame(3, $token->invokeArgs($object, array(1, 2)));
+ }
+ }
+
+ /**
+ * Tests if method has a prototype.
+ */
+ public function testPrototype()
+ {
+ $rfl = $this->getMethodReflection('prototype');
+ $this->assertSame($rfl->internal->getPrototype()->getName(), $rfl->internal->getPrototype()->getName());
+ $this->assertSame($rfl->internal->getPrototype()->getDeclaringClass()->getName(), $rfl->internal->getPrototype()->getDeclaringClass()->getName());
+ $this->assertInstanceOf('TokenReflection\ReflectionMethod', $rfl->token->getPrototype());
+
+ $rfl = $this->getMethodReflection('noPrototype');
+
+ try {
+ $rfl->token->getPrototype();
+ $this->fail('Expected exception TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+ }
+
+ /**
+ * Tests export.
+ */
+ public function testToString()
+ {
+ $tests = array(
+ 'lines', 'docComment', 'noComment',
+ 'prototype', 'noPrototype', 'parameters', 'reference', 'noReference', 'noClosure', 'noNamespace', 'userDefined', 'shadow'
+ );
+ foreach ($tests as $test) {
+ $rfl = $this->getMethodReflection($test);
+ $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
+ $this->assertSame(InternalReflectionMethod::export($this->getClassName($test), $test, true), ReflectionMethod::export($this->getBroker(), $this->getClassName($test), $test, true));
+
+ $rfl = $this->getMethodReflection($test, true);
+ $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
+ $this->assertSame(InternalReflectionMethod::export($this->getClassName($test), $test, true), ReflectionMethod::export($this->getBroker(), $this->getClassName($test), $test, true));
+ }
+
+ $tests = array(
+ 'constructorDestructor' => array('__construct', '__destruct'),
+ 'clone' => array('__clone', 'noClone'),
+ 'declaringClass' => array('parent', 'child', 'parentOverlay'),
+ 'invoke' => array('publicInvoke', 'protectedInvoke'),
+ 'accessLevel' => array('privateExtended', 'privateNoExtended', 'protectedExtended', 'protectedNoExtended'),
+ 'modifiers' => array('publicAbstract', 'publicFinal', 'publicStatic', 'publicNoStatic', 'protectedAbstract', 'protectedFinal', 'protectedStatic', 'protectedNoStatic', 'privateFinal', 'privateStatic', 'privateNoStatic')
+ );
+ foreach ($tests as $class => $classTests) {
+ $rfl = $this->getClassReflection($class);
+ $rfl_fromString = $this->getClassReflection($class, true);
+ foreach ($classTests as $method) {
+ // @todo inherits not supported yet
+ $this->assertSame(preg_replace('~, inherits [\w]+~', '', $rfl->internal->getMethod($method)->__toString()), $rfl->token->getMethod($method)->__toString());
+ $this->assertSame(preg_replace('~, inherits [\w]+~', '', InternalReflectionMethod::export($this->getClassName($class), $method, true)), ReflectionMethod::export($this->getBroker(), $this->getClassName($class), $method, true));
+ $this->assertSame(preg_replace('~, inherits [\w]+~', '', $rfl_fromString->internal->getMethod($method)->__toString()), $rfl_fromString->token->getMethod($method)->__toString());
+ }
+ }
+
+ $this->assertSame(InternalReflectionMethod::export('ReflectionMethod', 'isFinal', true), ReflectionMethod::export($this->getBroker(), 'ReflectionMethod', 'isFinal', true));
+ $this->assertSame(InternalReflectionMethod::export(new InternalReflectionMethod('ReflectionMethod', 'isFinal'), 'isFinal', true), ReflectionMethod::export($this->getBroker(), new InternalReflectionMethod('ReflectionMethod', 'isFinal'), 'isFinal', true));
+ }
+
+ /**
+ * Tests new PHP 5.4 features.
+ */
+ public function test54features()
+ {
+ if (PHP_VERSION_ID < 50400) {
+ $this->markTestSkipped('Tested only on PHP 5.4+');
+ }
+
+ $rfl = $this->getMethodReflection('features54');
+
+ $this->assertSame($rfl->internal->getStaticVariables(), $rfl->token->getStaticVariables());
+ $this->assertSame(
+ array(
+ 'one' => array(),
+ 'two' => array(array(1), '2', array(array(array(array(true))))),
+ 'three' => 21
+ ),
+ $rfl->token->getStaticVariables()
+ );
+ }
+
+ /**
+ * Tests an exception thrown when trying to create the reflection from a PHP internal reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalMethodReflectionCreate()
+ {
+ Php\ReflectionExtension::create(new \ReflectionClass('Exception'), $this->getBroker());
+ }
+
+ /**
+ * Tests an exception thrown when trying to get a non-existent parameter.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalMethodGetParameter1()
+ {
+ $this->getInternalMethodReflection()->getParameter('~non-existent~');
+ }
+
+ /**
+ * Tests an exception thrown when trying to get a non-existent parameter.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalMethodGetParameter2()
+ {
+ $this->getInternalMethodReflection()->getParameter(999);
+ }
+
+ /**
+ * Returns an internal method reflection.
+ *
+ * @return \TokenReflection\Php\ReflectionMethod
+ */
+ private function getInternalMethodReflection()
+ {
+ return $this->getBroker()->getClass('Exception')->getConstructor();
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionParameterTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionParameterTest.php
new file mode 100644
index 0000000..fc76480
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionParameterTest.php
@@ -0,0 +1,289 @@
+getFunctionReflection('position');
+ $internalParameters = $rfl->internal->getParameters();
+ $tokenParameters = $rfl->token->getParameters();
+ for ($i = 0; $i < 3; $i++) {
+ $internal = $internalParameters[$i];
+ $token = $tokenParameters[$i];
+
+ $this->assertSame($internal->getPosition(), $token->getPosition());
+ $this->assertSame($i, $token->getPosition());
+ }
+ }
+
+ /**
+ * Tests if parameter allows null.
+ */
+ public function testAllowsNull()
+ {
+ foreach (array('Class', 'Array') as $type) {
+ $rfl = $this->getParameterReflection('null' . $type);
+ $this->assertSame($rfl->internal->allowsNull(), $rfl->token->allowsNull());
+ $this->assertTrue($rfl->token->allowsNull());
+
+ $rfl = $this->getParameterReflection('noNull' . $type);
+ $this->assertSame($rfl->internal->allowsNull(), $rfl->token->allowsNull());
+ $this->assertFalse($rfl->token->allowsNull());
+ }
+ }
+
+ /**
+ * Tests if parameters is optional.
+ */
+ public function testOptional()
+ {
+ $types = array('null' => null, 'true' => true, 'false' => false, 'array' => array(), 'string' => 'string', 'integer' => 1, 'float' => 1.1, 'constant' => E_NOTICE);
+ $definitions = array('null' => 'null', 'true' => 'true', 'false' => 'false', 'array' => 'array()', 'string' => "'string'", 'integer' => '1', 'float' => '1.1', 'constant' => 'E_NOTICE');
+ foreach ($types as $type => $value) {
+ $rfl = $this->getParameterReflection('optional' . ucfirst($type));
+ $this->assertSame($rfl->internal->isOptional(), $rfl->token->isOptional());
+ $this->assertTrue($rfl->token->isOptional());
+ $this->assertSame($rfl->internal->isDefaultValueAvailable(), $rfl->token->isDefaultValueAvailable());
+ $this->assertTrue($rfl->token->isDefaultValueAvailable());
+ $this->assertSame($rfl->internal->getDefaultValue(), $rfl->token->getDefaultValue());
+ $this->assertSame($value, $rfl->token->getDefaultValue());
+ $this->assertSame($definitions[$type], $rfl->token->getDefaultValueDefinition());
+ }
+
+ $rfl = $this->getParameterReflection('noOptional');
+ $this->assertSame($rfl->internal->isOptional(), $rfl->token->isOptional());
+ $this->assertFalse($rfl->token->isOptional());
+ $this->assertSame($rfl->internal->isDefaultValueAvailable(), $rfl->token->isDefaultValueAvailable());
+ $this->assertFalse($rfl->token->isDefaultValueAvailable());
+
+ try {
+ $rfl->token->getDefaultValue();
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+ }
+
+ /**
+ * Tests if parameter has array type hint.
+ */
+ public function testArray()
+ {
+ $rfl = $this->getParameterReflection('array');
+ $this->assertSame($rfl->internal->isArray(), $rfl->token->isArray());
+ $this->assertTrue($rfl->token->isArray());
+
+ $rfl = $this->getParameterReflection('noArray');
+ $this->assertSame($rfl->internal->isArray(), $rfl->token->isArray());
+ $this->assertFalse($rfl->token->isArray());
+ }
+
+ /**
+ * Tests if parameter has callback type hint.
+ */
+ public function testCallable()
+ {
+ if (PHP_VERSION_ID < 50400) {
+ $this->markTestSkipped('Requires PHP 5.4 or higher.');
+ }
+
+ $rfl = $this->getParameterReflection('callable');
+ $this->assertSame($rfl->internal->isCallable(), $rfl->token->isCallable());
+ $this->assertTrue($rfl->token->isCallable());
+
+ $rfl = $this->getParameterReflection('noCallable');
+ $this->assertSame($rfl->internal->isCallable(), $rfl->token->isCallable());
+ $this->assertFalse($rfl->token->isCallable());
+ }
+
+ /**
+ * Tests if parameter has class type hint.
+ */
+ public function testClass()
+ {
+ $rfl = $this->getParameterReflection('class');
+ $this->assertSame($rfl->internal->getClass()->getName(), $rfl->token->getClass()->getName());
+ $this->assertSame('Exception', $rfl->token->getClass()->getName());
+ $this->assertSame('Exception', $rfl->token->getClassName());
+ $this->assertInstanceOf('TokenReflection\IReflectionClass', $rfl->token->getClass());
+
+ $rfl = $this->getParameterReflection('noClass');
+ $this->assertSame($rfl->internal->getClass(), $rfl->token->getClass());
+ $this->assertNull($rfl->token->getClass());
+ $this->assertNull($rfl->token->getClassName());
+ }
+
+ /**
+ * Tests if parameter is passed by reference.
+ */
+ public function testReference()
+ {
+ $rfl = $this->getParameterReflection('reference');
+ $this->assertSame($rfl->internal->isPassedByReference(), $rfl->token->isPassedByReference());
+ $this->assertTrue($rfl->token->isPassedByReference());
+
+ $rfl = $this->getParameterReflection('noReference');
+ $this->assertSame($rfl->internal->isPassedByReference(), $rfl->token->isPassedByReference());
+ $this->assertFalse($rfl->token->isPassedByReference());
+ }
+
+ /**
+ * Tests getting of declaring method or function.
+ */
+ public function testDeclaring()
+ {
+ $rfl = $this->getParameterReflection('declaringFunction');
+ $this->assertSame($rfl->internal->getDeclaringFunction()->getName(), $rfl->token->getDeclaringFunction()->getName());
+ $this->assertSame($this->getFunctionName('declaringFunction'), $rfl->token->getDeclaringFunction()->getName());
+ $this->assertSame($this->getFunctionName('declaringFunction'), $rfl->token->getDeclaringFunctionName());
+ $this->assertInstanceOf('TokenReflection\ReflectionFunction', $rfl->token->getDeclaringFunction());
+
+ $this->assertSame($rfl->internal->getDeclaringClass(), $rfl->token->getDeclaringClass());
+ $this->assertNull($rfl->token->getDeclaringClass());
+ $this->assertNull($rfl->token->getDeclaringClassName());
+
+ $rfl = $this->getMethodReflection('declaringMethod');
+ $internalParameters = $rfl->internal->getParameters();
+ $internal = $internalParameters[0];
+ $tokenParameters = $rfl->token->getParameters();
+ $token = $tokenParameters[0];
+
+ $this->assertSame($internal->getDeclaringFunction()->getName(), $token->getDeclaringFunction()->getName());
+ $this->assertSame($this->getMethodName('declaringMethod'), $token->getDeclaringFunction()->getName());
+ $this->assertSame($this->getMethodName('declaringMethod'), $token->getDeclaringFunctionName());
+ $this->assertInstanceOf('TokenReflection\ReflectionMethod', $token->getDeclaringFunction());
+
+ $this->assertSame($internal->getDeclaringClass()->getName(), $token->getDeclaringClass()->getName());
+ $this->assertSame($this->getClassName('declaringMethod'), $token->getDeclaringClass()->getName());
+ $this->assertSame($this->getClassName('declaringMethod'), $token->getDeclaringClassName());
+ $this->assertInstanceOf('TokenReflection\ReflectionClass', $token->getDeclaringClass());
+ }
+
+ /**
+ * Tests export.
+ */
+ public function testToString()
+ {
+ $tests = array(
+ 'declaringFunction', 'reference', 'noReference', 'class', 'noClass', 'array', 'noArray',
+ 'nullClass', 'noNullClass', 'nullArray', 'noNullArray', 'noOptional',
+ 'optionalNull', 'optionalTrue', 'optionalFalse', 'optionalArray', 'optionalString', 'optionalInteger', 'optionalFloat', 'optionalConstant'
+ );
+ foreach ($tests as $test) {
+ $rfl = $this->getParameterReflection($test);
+ $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
+ $this->assertSame(InternalReflectionParameter::export($this->getFunctionName($test), 0, true), ReflectionParameter::export($this->getBroker(), $this->getFunctionName($test), 0, true));
+
+ // Test loading from a string
+ $rfl = $this->getParameterReflection($test, true);
+ $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
+ }
+
+ $this->assertSame(InternalReflectionParameter::export('strpos', 0, true), ReflectionParameter::export($this->getBroker(), 'strpos', 0, true));
+ }
+
+ /**
+ * Tests getting of inherited documentation comment.
+ */
+ public function testDocCommentInheritance()
+ {
+ $this->getBroker()->processFile($this->getFilePath('docCommentInheritance'));
+
+ $grandParent = new \stdClass();
+ $grandParent->token = $this->getBroker()->getClass('TokenReflection_Test_ParameterDocCommentInheritanceGrandParent')->getMethod('m');
+
+ $parent = new \stdClass();
+ $parent->token = $this->getBroker()->getClass('TokenReflection_Test_ParameterDocCommentInheritanceParent')->getMethod('m');
+
+ $rfl = new \stdClass();
+ $rfl->token = $this->getBroker()->getClass('TokenReflection_Test_ParameterDocCommentInheritance')->getMethod('m');
+
+ $this->assertNotNull($grandParent->token);
+ $this->assertNotNull($parent->token);
+ $this->assertNotNull($rfl->token);
+
+ $this->assertSame($grandParent->token->getAnnotation('param'), $parent->token->getAnnotation('param'));
+ $this->assertSame(count($grandParent->token->getAnnotation('param')), count($rfl->token->getAnnotation('param')));
+ }
+
+ /**
+ * Tests new PHP 5.4 features.
+ */
+ public function test54features()
+ {
+ if (PHP_VERSION_ID < 50400) {
+ $this->markTestSkipped('Tested only on PHP 5.4+');
+ }
+
+ $rfl = $this->getFunctionReflection('54features');
+
+ $this->assertSame(3, $rfl->internal->getNumberOfParameters());
+ foreach ($rfl->internal->getParameters() as $internal){
+ $token = $rfl->token->getParameter($internal->getPosition());
+ $this->assertSame($internal->getDefaultValue(), $token->getDefaultValue());
+ }
+ }
+
+ /**
+ * Tests an exception thrown when trying to create the reflection from a PHP internal reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalParameterReflectionCreate()
+ {
+ Php\ReflectionParameter::create(new \ReflectionClass('Exception'), $this->getBroker());
+ }
+
+ /**
+ * Tests various constant (mis)definitions.
+ */
+ public function testValueDefinitions()
+ {
+ $rfl = $this->getClassReflection('valueDefinitions');
+
+ $this->assertTrue($rfl->internal->hasMethod('method'));
+ $internalMethod = $rfl->internal->getMethod('method');
+
+ $this->assertTrue($rfl->token->hasMethod('method'));
+ $tokenMethod = $rfl->token->getMethod('method');
+
+ foreach ($internalMethod->getParameters() as $parameter) {
+ $this->assertSame($parameter->getDefaultValue(), $tokenMethod->getParameter($parameter->getName())->getDefaultValue());
+ }
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionPropertyTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionPropertyTest.php
new file mode 100644
index 0000000..fb35522
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/ReflectionPropertyTest.php
@@ -0,0 +1,436 @@
+getPropertyTokenReflection('lines');
+
+ $this->assertSame(5, $token->getStartLine());
+ $this->assertSame(5, $token->getEndLine());
+ }
+
+ /**
+ * Tests getting of documentation comment.
+ */
+ public function testComment()
+ {
+ $rfl = $this->getClassReflection('docComment');
+ foreach ($rfl->internal->getProperties() as $property) {
+ $this->assertFalse(false === $property->getDocComment(), $property->getName());
+ $this->assertTrue($rfl->token->hasProperty($property->getName()), $property->getName());
+ $this->assertSame($property->getDocComment(), $rfl->token->getProperty($property->getName())->getDocComment(), $property->getName());
+ }
+
+ $propertyName = 'docComment';
+ $this->assertTrue($rfl->token->hasProperty($propertyName));
+
+ /** @var \TokenReflection\ReflectionProperty */
+ $tokenProperty = $rfl->token->getProperty($propertyName);
+ $this->assertTrue($tokenProperty->hasAnnotation('var'));
+ $this->assertSame(array("String It is a string\n\tand this comment has multiple\n\tlines."), $tokenProperty->getAnnotation('var'));
+
+ $rfl = $this->getPropertyReflection('noComment');
+ $this->assertSame($rfl->internal->getDocComment(), $rfl->token->getDocComment());
+ $this->assertFalse($rfl->token->getDocComment());
+ }
+
+ /**
+ * Tests heredoc defined value.
+ */
+ public function testHeredoc()
+ {
+ $token = $this->getClassTokenReflection('heredoc');
+
+ $this->assertTrue($token->hasOwnProperty('heredoc'));
+ $property = $token->getProperty('heredoc');
+ $this->assertTrue($property->isDefault());
+ $this->assertSame('property value', $property->getDefaultValue());
+
+ $this->assertTrue($token->hasOwnProperty('nowdoc'));
+ $property = $token->getProperty('nowdoc');
+ $this->assertTrue($property->isDefault());
+ $this->assertSame('property value', $property->getDefaultValue());
+ }
+
+ /**
+ * Tests getting of copydoc documentation comment.
+ */
+ public function testCommentCopydoc()
+ {
+ static $properties = array(
+ 'property' => 'This is a property.',
+ 'property2' => 'This is a property.',
+ 'property3' => 'This is a property.',
+ 'property4' => 'This is a property.',
+ 'property5' => null,
+ 'property6' => null,
+ 'property7' => null
+ );
+
+ $class = $this->getClassTokenReflection('docCommentCopydoc');
+ foreach ($properties as $propertyName => $shortDescription) {
+ $this->assertTrue($class->hasProperty($propertyName), $propertyName);
+ $this->assertSame($shortDescription, $class->getProperty($propertyName)->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION), $propertyName);
+ }
+ }
+
+ /**
+ * Tests getting of inherited documentation comment.
+ */
+ public function testDocCommentInheritance()
+ {
+ require_once $this->getFilePath('docCommentInheritance');
+ $this->getBroker()->processFile($this->getFilePath('docCommentInheritance'));
+
+ $grandParent = new \stdClass();
+ $grandParent->token = $this->getBroker()->getClass('TokenReflection_Test_PropertyDocCommentInheritanceGrandParent');
+
+ $parent = new \stdClass();
+ $parent->token = $this->getBroker()->getClass('TokenReflection_Test_PropertyDocCommentInheritanceParent');
+
+ $rfl = new \stdClass();
+ $rfl->token = $this->getBroker()->getClass('TokenReflection_Test_PropertyDocCommentInheritance');
+
+ $this->assertSame($parent->token->getProperty('param1')->getAnnotations(), $rfl->token->getProperty('param1')->getAnnotations());
+ $this->assertSame('Private1 short. Protected1 short.', $rfl->token->getProperty('param1')->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertSame('Protected1 long. Private1 long.', $rfl->token->getProperty('param1')->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+
+ $this->assertSame($parent->token->getProperty('param2')->getAnnotations(), $rfl->token->getProperty('param2')->getAnnotations());
+ $this->assertSame($grandParent->token->getProperty('param2')->getAnnotations(), $rfl->token->getProperty('param2')->getAnnotations());
+
+ $this->assertSame('Public3 Protected3 short.', $rfl->token->getProperty('param3')->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertNull($rfl->token->getProperty('param3')->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+
+ $this->assertSame('Protected4 short.', $rfl->token->getProperty('param4')->getAnnotation(ReflectionAnnotation::SHORT_DESCRIPTION));
+ $this->assertNull($rfl->token->getProperty('param4')->getAnnotation(ReflectionAnnotation::LONG_DESCRIPTION));
+ $this->assertSame(array('boolean'), $rfl->token->getProperty('param4')->getAnnotation('var'));
+ }
+
+ /**
+ * Tests getting of documentation comment from templates.
+ */
+ public function testCommentTemplate()
+ {
+ static $expected = array(
+ 'public1' => array( // Template definition
+ ReflectionAnnotation::SHORT_DESCRIPTION => 'Short description.',
+ ReflectionAnnotation::LONG_DESCRIPTION => 'Long description.',
+ 'var' => array('string')
+ ),
+ 'public2' => array( // No own docblock -> using template
+ ReflectionAnnotation::LONG_DESCRIPTION => 'Long description.',
+ 'var' => array('string')
+ ),
+ 'public3' => array( // Another template to the stack plus using the previuos template
+ ReflectionAnnotation::SHORT_DESCRIPTION => 'Another short description.',
+ ReflectionAnnotation::LONG_DESCRIPTION => "Long description.\nAnother long description.",
+ 'var' => array('array', 'string')
+ ),
+ 'public4' => array( // Own short description, inheriting the rest from the two templates
+ ReflectionAnnotation::SHORT_DESCRIPTION => 'Own short description.',
+ ReflectionAnnotation::LONG_DESCRIPTION => "Long description.\nAnother long description.",
+ 'var' => array('array', 'string')
+ ),
+ // Template end -> remove the second template from the stack
+ 'public5' => array(
+ ReflectionAnnotation::SHORT_DESCRIPTION => 'Another own short description.',
+ ReflectionAnnotation::LONG_DESCRIPTION => "Long description.\nOwn long description.",
+ 'var' => array('integer', 'string')
+ ),
+ // Template end -> remove the first template from the stack
+ 'public6' => array(
+ // No annotations
+ ),
+ 'public7' => array(
+ ReflectionAnnotation::SHORT_DESCRIPTION => 'Outside of template.',
+ 'var' => array('boolean')
+ ),
+ );
+
+ $rfl = $this->getClassReflection('docCommentTemplate')->token;
+
+ foreach ($expected as $name => $annotations) {
+ $property = $rfl->getProperty($name);
+ $this->assertSame($annotations, $property->getAnnotations());
+ if (empty($annotations)) {
+ $this->assertFalse($property->getDocComment());
+ }
+ }
+ }
+
+ /**
+ * Test property accessibility.
+ */
+ public function testAccessible()
+ {
+ $rfl = $this->getClassReflection('accessible');
+ $className = $this->getClassName('accessible');
+ $object = new $className();
+
+ foreach (array('protected', 'private') as $property) {
+ $internal = $rfl->internal->getProperty($property);
+ $token = $rfl->token->getProperty($property);
+
+ try {
+ $token->getValue($object);
+ $this->fail('Expected exception \TokenReflection\Exception\RuntimeException.');
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Correctly thrown exception
+ $this->assertInstanceOf('TokenReflection\Exception\RuntimeException', $e);
+ }
+
+ $this->assertSame($internal->setAccessible(true), $token->setAccessible(true));
+ $this->assertNull($token->setAccessible(true));
+
+ $this->assertSame($internal->getValue($object), $token->getValue($object));
+ $this->assertTrue($token->getValue($object));
+
+ $this->assertSame($internal->setValue($object, false), $token->setValue($object, false));
+ $this->assertNull($token->setValue($object, false));
+
+ $this->assertSame($internal->getValue($object), $token->getValue($object));
+ $this->assertFalse($token->getValue($object));
+ }
+
+ $internal = $rfl->internal->getProperty('public');
+ $token = $rfl->token->getProperty('public');
+
+ $this->assertSame($internal->getValue($object), $token->getValue($object));
+ $this->assertTrue($token->getValue($object));
+
+ $this->assertSame($internal->setValue($object, false), $token->setValue($object, false));
+ $this->assertNull($token->setValue($object, false));
+
+ $this->assertSame($internal->getValue($object), $token->getValue($object));
+ $this->assertFalse($token->getValue($object));
+
+ $this->assertSame($internal->setAccessible(false), $token->setAccessible(false));
+ $this->assertNull($token->setAccessible(false));
+ $this->assertSame($internal->getValue($object), $token->getValue($object));
+ }
+
+ /**
+ * Tests getting of declaring class.
+ */
+ public function testDeclaringClass()
+ {
+ $rfl = $this->getClassReflection('declaringClass');
+
+ foreach (array('parent' => 'Parent', 'child' => '', 'parentOverlay' => '') as $property => $class) {
+ $internal = $rfl->internal->getProperty($property);
+ $token = $rfl->token->getProperty($property);
+
+ $this->assertSame($internal->getDeclaringClass()->getName(), $token->getDeclaringClass()->getName());
+ $this->assertSame('TokenReflection_Test_PropertyDeclaringClass' . $class, $token->getDeclaringClass()->getName());
+ $this->assertSame('TokenReflection_Test_PropertyDeclaringClass' . $class, $token->getDeclaringClassName());
+ $this->assertInstanceOf('TokenReflection\ReflectionClass', $token->getDeclaringClass());
+ }
+ }
+
+ /**
+ * Tests getting of default value.
+ */
+ public function testDefault()
+ {
+ $token = $this->getPropertyTokenReflection('default');
+ $this->assertTrue($token->isDefault());
+ $this->assertSame('default', $token->getDefaultValue());
+ $this->assertSame("'default'", $token->getDefaultValueDefinition());
+
+ $token = $this->getPropertyTokenReflection('noDefault');
+ $this->assertTrue($token->isDefault());
+ $this->assertNull($token->getDefaultValue());
+ }
+
+ /**
+ * Tests all property modifiers.
+ */
+ public function testModifiers()
+ {
+ $rfl = $this->getClassReflection('modifiers');
+
+ foreach (array('public', 'protected', 'private') as $name) {
+ $method = 'is' . ucfirst($name);
+ $opposite = 'no' . ucfirst($name);
+ $staticName = $name . 'Static';
+
+ $internal = $rfl->internal->getProperty($name);
+ $token = $rfl->token->getProperty($name);
+
+ $this->assertSame($internal->$method(), $internal->$method());
+ $this->assertTrue($token->$method());
+ $this->assertSame($internal->isStatic(), $internal->isStatic());
+ $this->assertFalse($token->isStatic());
+ $this->assertSame($internal->getModifiers(), $token->getModifiers());
+ $this->assertSame(constant('\ReflectionProperty::IS_' . strtoupper($name)), $token->getModifiers());
+
+ $internal = $rfl->internal->getProperty($opposite);
+ $token = $rfl->token->getProperty($opposite);
+
+ $this->assertSame($internal->$method(), $internal->$method());
+ $this->assertFalse($token->$method());
+ $this->assertSame($internal->getModifiers(), $token->getModifiers());
+
+ $internal = $rfl->internal->getProperty($staticName);
+ $token = $rfl->token->getProperty($staticName);
+
+ $this->assertSame($internal->$method(), $internal->$method());
+ $this->assertTrue($token->$method());
+ $this->assertSame($internal->isStatic(), $internal->isStatic());
+ $this->assertTrue($token->isStatic());
+ $this->assertSame($internal->getModifiers(), $token->getModifiers());
+ $this->assertSame(InternalReflectionProperty::IS_STATIC | constant('\ReflectionProperty::IS_' . strtoupper($name)), $token->getModifiers());
+ }
+ }
+
+ /**
+ * Tests different types of property value.
+ */
+ public function testTypes()
+ {
+ $constants = array('string' => 'string', 'integer' => 1, 'float' => 1.1, 'boolean' => true, 'null' => null, 'array' => array(1 => 1));
+ foreach ($constants as $type => $value) {
+ $test = 'type' . ucfirst($type);
+
+ $rfl = $this->getPropertyReflection($test);
+ $className = $this->getClassName($test);
+ $object = new $className();
+
+ $this->assertSame($rfl->internal->getValue($object), $rfl->token->getValue($object));
+ $this->assertSame($value, $rfl->token->getValue($object));
+ }
+ }
+
+ /**
+ * Tests export.
+ */
+ public function testToString()
+ {
+ $tests = array(
+ 'lines', 'docComment', 'noComment',
+ 'default', 'typeNull', 'typeArray', 'typeString', 'typeInteger', 'typeFloat'
+ );
+ foreach ($tests as $test) {
+ $rfl = $this->getPropertyReflection($test);
+ $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
+ $this->assertSame(InternalReflectionProperty::export($this->getClassName($test), $test, true), ReflectionProperty::export($this->getBroker(), $this->getClassName($test), $test, true));
+
+ // Test loading from a string
+ $rfl = $this->getPropertyReflection($test, true);
+ $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
+ }
+
+ $rfl = $this->getClassReflection('modifiers');
+ $rfl_fromString = $this->getClassReflection('modifiers');
+ foreach (array('public', 'protected', 'private') as $name) {
+ $internal = $rfl->internal->getProperty($name);
+ $token = $rfl->token->getProperty($name);
+ $this->assertSame($internal->__toString(), $token->__toString());
+ $this->assertSame(InternalReflectionProperty::export($this->getClassName('modifiers'), $name, true), ReflectionProperty::export($this->getBroker(), $this->getClassName('modifiers'), $name, true));
+
+ // Test loading from a string
+ $this->assertSame($internal->__toString(), $rfl_fromString->token->getProperty($name)->__toString());
+ }
+
+ $this->assertSame(InternalReflectionProperty::export('ReflectionProperty', 'name', true), ReflectionProperty::export($this->getBroker(), 'ReflectionProperty', 'name', true));
+ $this->assertSame(InternalReflectionProperty::export(new InternalReflectionProperty('ReflectionProperty', 'name'), 'name', true), ReflectionProperty::export($this->getBroker(), new InternalReflectionProperty('ReflectionProperty', 'name'), 'name', true));
+ }
+
+ /**
+ * Tests new PHP 5.4 features.
+ */
+ public function test54features()
+ {
+ if (PHP_VERSION_ID < 50400) {
+ $this->markTestSkipped('Tested only on PHP 5.4+');
+ }
+
+ $tests = array('public', 'protected', 'private');
+
+ $rfl = $this->getClassReflection('54features');
+ $class = $rfl->internal->newInstance();
+
+ foreach ($tests as $test) {
+ $this->assertTrue($rfl->internal->hasProperty($test));
+ $this->assertTrue($rfl->token->hasProperty($test));
+
+ $internal = $rfl->internal->getProperty($test);
+ $token = $rfl->token->getProperty($test);
+
+ $internal->setAccessible(true);
+ $token->setAccessible(true);
+
+ $this->assertSame($internal->getValue($class), $token->getValue($class));
+ $this->assertSame($internal->getValue($class), $token->getDefaultValue());
+ }
+ }
+
+ /**
+ * Tests an exception thrown when trying to create the reflection from a PHP internal reflection.
+ *
+ * @expectedException \TokenReflection\Exception\RuntimeException
+ */
+ public function testInternalPropertyReflectionCreate()
+ {
+ Php\ReflectionProperty::create(new \ReflectionClass('Exception'), $this->getBroker());
+ }
+
+ /**
+ * Tests various constant (mis)definitions.
+ */
+ public function testValueDefinitions()
+ {
+ static $expected = array(
+ 'property1' => true,
+ 'property2' => true,
+ 'property3' => true,
+ 'property4' => true,
+ 'property5' => true,
+ 'property6' => true,
+ 'property7' => true,
+ 'property8' => true
+ );
+
+ $rfl = $this->getClassTokenReflection('valueDefinitions');
+
+ foreach ($expected as $name => $value) {
+ $this->assertTrue($rfl->hasProperty($name), $name);
+ $this->assertSame($value, $rfl->getProperty($name)->getDefaultValue(), $name);
+ }
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/SourceCodeTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/SourceCodeTest.php
new file mode 100644
index 0000000..314ddce
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/SourceCodeTest.php
@@ -0,0 +1,56 @@
+createBroker();
+ $broker->processDirectory(__DIR__ . '/../../TokenReflection');
+
+ $classes = $broker->getClasses();
+ $this->assertGreaterThan(0, count($classes));
+
+ foreach ($classes as $class) {
+ $this->assertNotSame(false, $class->getDocComment(), $class->getPrettyName());
+
+ foreach ($class->getMethods() as $method) {
+ if (!$method->isInternal()) {
+ $this->assertNotSame(false, $method->getDocComment(), $method->getPrettyName());
+ }
+ }
+ foreach ($class->getProperties() as $property) {
+ if (!$property->isInternal()) {
+ $this->assertNotSame(false, $property->getDocComment(), $property->getPrettyName());
+ }
+ }
+ foreach ($class->getConstantReflections() as $constant) {
+ if (!$constant->isInternal()) {
+ $this->assertNotSame(false, $constant->getDocComment(), $constant->getPrettyName());
+ }
+ }
+ }
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/StreamTest.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/StreamTest.php
new file mode 100644
index 0000000..e32916a
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/StreamTest.php
@@ -0,0 +1,131 @@
+getFileStream('invalid-stream');
+ unset($stream[666]);
+ }
+
+ /**
+ * Tests the (im)possibility to set a token in a token stream.
+ *
+ * @expectedException \TokenReflection\Exception\StreamException
+ */
+ public function testSetException()
+ {
+ $stream = $this->getFileStream('invalid-stream');
+ $stream[0] = null;
+ }
+
+ /**
+ * Tests an exception thrown when calling findMatchingBracket and the current token is not a bracket.
+ *
+ * @expectedException \TokenReflection\Exception\StreamException
+ */
+ public function testFindMatchingBracketException1()
+ {
+ $this->getFileStream('invalid-stream')->findMatchingBracket();
+ }
+
+ /**
+ * Tests an exception thrown when no matching bracket could be found.
+ *
+ * @expectedException \TokenReflection\Exception\StreamException
+ */
+ public function testFindMatchingBracketException2()
+ {
+ $stream = $this->getFileStream('invalid-stream');
+ $this->assertInstanceOf('\TokenReflection\Stream\FileStream', $stream->find('{'));
+
+ $stream->findMatchingBracket();
+ }
+
+ /**
+ * Tests an exception thrown when calling findMatchingBracket and being beyond the end of the token.
+ *
+ * @expectedException \TokenReflection\Exception\StreamException
+ */
+ public function testFindMatchingBracketException3()
+ {
+ $stream = $this->getFileStream('invalid-stream');
+ $stream->seek(count($stream));
+
+ $this->assertFalse($stream->valid());
+ $stream->findMatchingBracket();
+ }
+
+ /**
+ * Tests an exception thrown when trying to load a non existent file.
+ *
+ * @expectedException \TokenReflection\Exception\StreamException
+ */
+ public function testOpeningNonExistentFileException1()
+ {
+ $file = __DIR__ . DIRECTORY_SEPARATOR . '~#nonexistent#~';
+
+ if (is_file($file)) {
+ $this->markTestSkipped(sprintf('File %s exists.', $file));
+ }
+ $stream = new Stream\FileStream($file);
+ }
+
+ /**
+ * Tests an exception thrown when trying to load a non existent file.
+ *
+ * @expectedException \TokenReflection\Exception\StreamException
+ */
+ public function testOpeningNonExistentFileException2()
+ {
+ $file = __DIR__ . DIRECTORY_SEPARATOR . '~#nonexistent#~' . DIRECTORY_SEPARATOR . '~#nonexistent#~';
+
+ if (is_file($file)) {
+ $this->markTestSkipped(sprintf('File %s exists.', $file));
+ }
+ $stream = new Stream\FileStream($file);
+ }
+
+ /**
+ * Returns a file token stream.
+ *
+ * @param string $name File name
+ * @return \TokenReflection\Stream\FileStream
+ */
+ private function getFileStream($name)
+ {
+ return new Stream\FileStream($this->getFilePath($name));
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/TokenReflection/Test.php b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/Test.php
new file mode 100644
index 0000000..223fe3b
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/TokenReflection/Test.php
@@ -0,0 +1,390 @@
+getBroker()->processFile($this->getFilePath($test), true);
+ }
+
+ /**
+ * Returns class reflections.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \stdClass
+ */
+ protected function getClassReflection($test, $fromString = false)
+ {
+ $reflection = new \stdClass();
+ $reflection->internal = $this->getClassInternalReflection($test);
+ $reflection->token = $this->getClassTokenReflection($test, $fromString);
+ return $reflection;
+ }
+
+ /**
+ * Returns method reflections.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \stdClass
+ */
+ protected function getMethodReflection($test, $fromString = false)
+ {
+ $reflection = new \stdClass();
+ $reflection->internal = $this->getMethodInternalReflection($test);
+ $reflection->token = $this->getMethodTokenReflection($test, $fromString);
+ return $reflection;
+ }
+
+ /**
+ * Returns property reflections.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \stdClass
+ */
+ protected function getPropertyReflection($test, $fromString = false)
+ {
+ $reflection = new \stdClass();
+ $reflection->internal = $this->getPropertyInternalReflection($test);
+ $reflection->token = $this->getPropertyTokenReflection($test, $fromString);
+ return $reflection;
+ }
+
+ /**
+ * Returns function reflections.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \stdClass
+ */
+ protected function getFunctionReflection($test, $fromString = false)
+ {
+ $reflection = new \stdClass();
+ $reflection->internal = $this->getFunctionInternalReflection($test);
+ $reflection->token = $this->getFunctionTokenReflection($test, $fromString);
+ return $reflection;
+ }
+
+ /**
+ * Returns parameter reflections.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \stdClass
+ */
+ protected function getParameterReflection($test, $fromString = false)
+ {
+ $reflection = new \stdClass();
+ $reflection->internal = $this->getParameterInternalReflection($test);
+ $reflection->token = $this->getParameterTokenReflection($test, $fromString);
+ return $reflection;
+ }
+
+ /**
+ * Returns internal class reflection.
+ *
+ * @param string $test
+ * @return \ReflectionClass
+ */
+ protected function getClassInternalReflection($test)
+ {
+ require_once $this->getFilePath($test);
+ return new \ReflectionClass($this->getClassName($test));
+ }
+
+ /**
+ * Returns internal method reflection.
+ *
+ * @param string $test
+ * @return \ReflectionMethod
+ */
+ protected function getMethodInternalReflection($test)
+ {
+ return $this->getClassInternalReflection($test)->getMethod($this->getMethodName($test));
+ }
+
+ /**
+ * Returns internal property reflection.
+ *
+ * @param string $test
+ * @return \ReflectionProperty
+ */
+ protected function getPropertyInternalReflection($test)
+ {
+ return $this->getClassInternalReflection($test)->getProperty($this->getPropertyName($test));
+ }
+
+ /**
+ * Returns internal function reflection.
+ *
+ * @param string $test
+ * @return \ReflectionFunction
+ */
+ protected function getFunctionInternalReflection($test)
+ {
+ require_once $this->getFilePath($test);
+ return new \ReflectionFunction($this->getFunctionName($test));
+ }
+
+ /**
+ * Returns internal parameter reflection.
+ *
+ * @param string $test
+ * @return \ReflectionParameter
+ */
+ protected function getParameterInternalReflection($test)
+ {
+ require_once $this->getFilePath($test);
+ $function = new \ReflectionFunction($this->getFunctionName($test));
+ $parameters = $function->getParameters();
+ return $parameters[0];
+ }
+
+ /**
+ * Returns tokenized class reflection.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \TokenReflection\ReflectionClass
+ */
+ protected function getClassTokenReflection($test, $fromString = false)
+ {
+ $broker = $this->getBroker();
+ if ($fromString) {
+ $source = file_get_contents($fileName = $this->getFilePath($test));
+ $broker->processString($source, $fileName);
+ } else {
+ $broker->processFile($this->getFilePath($test));
+ }
+ return $broker->getClass($this->getClassName($test));
+ }
+
+ /**
+ * Returns tokenized method reflection.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \TokenReflection\ReflectionMethod
+ */
+ protected function getMethodTokenReflection($test, $fromString = false)
+ {
+ return $this->getClassTokenReflection($test, $fromString)->getMethod($this->getMethodName($test));
+ }
+
+ /**
+ * Returns tokenized property reflection.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \TokenReflection\ReflectionProperty
+ */
+ protected function getPropertyTokenReflection($test, $fromString = false)
+ {
+ return $this->getClassTokenReflection($test, $fromString)->getProperty($this->getPropertyName($test));
+ }
+
+ /**
+ * Returns tokenized constant reflection.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \TokenReflection\ReflectionConstant
+ */
+ protected function getConstantTokenReflection($test, $fromString = false)
+ {
+ return $this->getClassTokenReflection($test, $fromString)->getConstantReflection($this->getConstantName($test));
+ }
+
+ /**
+ * Returns tokenized function reflection.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \TokenReflection\ReflectionFunction
+ */
+ protected function getFunctionTokenReflection($test, $fromString = false)
+ {
+ $broker = $this->getBroker();
+ if ($fromString) {
+ $source = file_get_contents($fileName = $this->getFilePath($test));
+ $broker->processString($source, $fileName);
+ } else {
+ $broker->processFile($this->getFilePath($test));
+ }
+ return $broker->getFunction($this->getFunctionName($test));
+ }
+
+ /**
+ * Returns tokenized parameter reflection.
+ *
+ * @param string $test
+ * @param boolean $fromString
+ * @return \TokenReflection\ReflectionParameter
+ */
+ protected function getParameterTokenReflection($test, $fromString = false)
+ {
+ $broker = $this->getBroker();
+ if ($fromString) {
+ $source = file_get_contents($fileName = $this->getFilePath($test));
+ $broker->processString($source, $fileName);
+ } else {
+ $broker->processFile($this->getFilePath($test));
+ }
+ $parameters = $broker->getFunction($this->getFunctionName($test))->getParameters();
+ return $parameters[0];
+ }
+
+ /**
+ * Returns test file path.
+ *
+ * @param string $test
+ * @return string
+ */
+ protected function getFilePath($test)
+ {
+ $file = preg_replace_callback('~[A-Z]~', function($matches) {
+ return '-' . strtolower($matches[0]);
+ }, $test);
+ return realpath(__DIR__ . '/../data/' . $this->type . '/' . $file . '.php');
+ }
+
+ /**
+ * Returns test class name.
+ *
+ * @param string $test
+ * @return string
+ */
+ protected function getClassName($test)
+ {
+ return 'TokenReflection_Test_' . ucfirst($this->type) . ucfirst($test);
+ }
+
+ /**
+ * Returns test method name.
+ *
+ * @param string $test
+ * @return string
+ */
+ protected function getMethodName($test)
+ {
+ return $test;
+ }
+
+ /**
+ * Returns test property name.
+ *
+ * @param string $test
+ * @return string
+ */
+ protected function getPropertyName($test)
+ {
+ return $test;
+ }
+
+ /**
+ * Returns test constant name.
+ *
+ * @param string $test
+ * @return string
+ */
+ protected function getConstantName($test)
+ {
+ return strtoupper(preg_replace_callback('~[A-Z]~', function($matches) {
+ return '_' . $matches[0];
+ }, $test));
+ }
+
+ /**
+ * Returns test function name.
+ *
+ * @param string $test
+ * @return string
+ */
+ protected function getFunctionName($test)
+ {
+ return 'tokenReflection' . ucfirst($this->type) . ucfirst($test);
+ }
+
+ /**
+ * Returns a new broker instance.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function createBroker()
+ {
+ return new Broker(new Broker\Backend\Memory());
+ }
+
+ /**
+ * Returns broker instance.
+ *
+ * @return \TokenReflection\Broker
+ */
+ protected function getBroker()
+ {
+ static $broker = null;
+ if (null === $broker) {
+ $broker = $this->createBroker();
+ }
+ return $broker;
+ }
+
+ /**
+ * Returns all filters combinations.
+ *
+ * @param array $filters
+ * @return array
+ */
+ protected function getFilterCombinations(array $filters)
+ {
+ $combinations = array();
+
+ for ($i = 0; $i < pow(2, count($filters)); $i++) {
+ $combination = 0;
+ for ($j = 0; $j < count($filters); $j++) {
+ if ($i % pow(2, $j + 1) < pow(2, $j)) {
+ $combination |= $filters[$j];
+ }
+ }
+
+ $combinations[] = $combination;
+ }
+
+ return $combinations;
+ }
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/bootstrap.php b/vendor/andrewsville/php-token-reflection/tests/bootstrap.php
new file mode 100644
index 0000000..ff8c13f
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/bootstrap.php
@@ -0,0 +1,29 @@
+private = $private;
+ }
+}
+
+class TokenReflection_Test_ClassInstancesChild extends TokenReflection_Test_ClassInstances
+{
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/data/class/interface.php b/vendor/andrewsville/php-token-reflection/tests/data/class/interface.php
new file mode 100644
index 0000000..ea4cb0c
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/data/class/interface.php
@@ -0,0 +1,5 @@
+check = true;
+ }
+
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/data/class/no-abstract.php b/vendor/andrewsville/php-token-reflection/tests/data/class/no-abstract.php
new file mode 100644
index 0000000..09992dc
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/data/class/no-abstract.php
@@ -0,0 +1,5 @@
+ 1);
+ static $array2 = array(1 => 1, 2 => 2);
+ static $constant = TOKENREFLECTION_FUNCTION_STATIC_VARIABLE_VALUE;
+}
diff --git a/vendor/andrewsville/php-token-reflection/tests/data/function/user-defined.php b/vendor/andrewsville/php-token-reflection/tests/data/function/user-defined.php
new file mode 100644
index 0000000..c906c4c
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/data/function/user-defined.php
@@ -0,0 +1,5 @@
+ 1);
+ static $array2 = array(1 => 1, 2 => 2);
+ static $constants = array(
+ TokenReflection_Test_MethodStaticVariables::SELF,
+ TokenReflection_Test_MethodStaticVariablesParent::PARENT
+ );
+ }
+}
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/tests/data/method/user-defined.php b/vendor/andrewsville/php-token-reflection/tests/data/method/user-defined.php
new file mode 100644
index 0000000..0c0cb42
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/data/method/user-defined.php
@@ -0,0 +1,8 @@
+ 1);
+}
\ No newline at end of file
diff --git a/vendor/andrewsville/php-token-reflection/tests/data/property/type-boolean.php b/vendor/andrewsville/php-token-reflection/tests/data/property/type-boolean.php
new file mode 100644
index 0000000..20f2bf3
--- /dev/null
+++ b/vendor/andrewsville/php-token-reflection/tests/data/property/type-boolean.php
@@ -0,0 +1,6 @@
+generator = $generator;
+ $this->cacheTokenStreams = $cacheTokenStreams;
+ }
+
+ /**
+ * Destructor.
+ *
+ * Deletes all cached token streams.
+ */
+ public function __destruct()
+ {
+ foreach ($this->fileCache as $file) {
+ unlink($file);
+ }
+ }
+
+ /**
+ * Adds a file to the backend storage.
+ *
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token stream
+ * @param \TokenReflection\ReflectionFile $file File reflection object
+ * @return \TokenReflection\Broker\Backend\Memory
+ */
+ public function addFile(TokenReflection\Stream\StreamBase $tokenStream, TokenReflection\ReflectionFile $file)
+ {
+ if ($this->cacheTokenStreams) {
+ $this->fileCache[$file->getName()] = $cacheFile = tempnam(sys_get_temp_dir(), 'trc');
+ file_put_contents($cacheFile, serialize($tokenStream));
+ }
+
+ parent::addFile($tokenStream, $file);
+
+ return $this;
+ }
+
+ /**
+ * Returns an array of tokens for a particular file.
+ *
+ * @param string $fileName File name
+ * @return \TokenReflection\Stream
+ * @throws \RuntimeException If the token stream could not be returned.
+ */
+ public function getFileTokens($fileName)
+ {
+ try {
+ if (!$this->isFileProcessed($fileName)) {
+ throw new InvalidArgumentException('File was not processed');
+ }
+
+ $realName = Broker::getRealPath($fileName);
+ if (!isset($this->fileCache[$realName])) {
+ throw new InvalidArgumentException('File is not in the cache');
+ }
+
+ $data = @file_get_contents($this->fileCache[$realName]);
+ if (false === $data) {
+ throw new RuntimeException('Cached file is not readable');
+ }
+ $file = @unserialize($data);
+ if (false === $file) {
+ throw new RuntimeException('Stream could not be loaded from cache');
+ }
+
+ return $file;
+ } catch (\Exception $e) {
+ throw new RuntimeException(sprintf('Could not return token stream for file %s', $fileName), 0, $e);
+ }
+ }
+
+ /**
+ * Prepares and returns used class lists.
+ *
+ * @return array
+ */
+ protected function parseClassLists()
+ {
+ $allClasses = array(
+ self::TOKENIZED_CLASSES => array(),
+ self::INTERNAL_CLASSES => array(),
+ self::NONEXISTENT_CLASSES => array()
+ );
+
+ $declared = array_flip(array_merge(get_declared_classes(), get_declared_interfaces()));
+
+ foreach ($this->getNamespaces() as $namespace) {
+ foreach ($namespace->getClasses() as $name => $trClass) {
+ $class = new ReflectionClass($trClass, $this->generator);
+ $allClasses[self::TOKENIZED_CLASSES][$name] = $class;
+ if (!$class->isDocumented()) {
+ continue;
+ }
+
+ foreach (array_merge($trClass->getParentClasses(), $trClass->getInterfaces()) as $parentName => $parent) {
+ if ($parent->isInternal()) {
+ if (!isset($allClasses[self::INTERNAL_CLASSES][$parentName])) {
+ $allClasses[self::INTERNAL_CLASSES][$parentName] = $parent;
+ }
+ } elseif (!$parent->isTokenized()) {
+ if (!isset($allClasses[self::NONEXISTENT_CLASSES][$parentName])) {
+ $allClasses[self::NONEXISTENT_CLASSES][$parentName] = $parent;
+ }
+ }
+ }
+
+ $this->generator->checkMemory();
+ }
+ }
+
+ foreach ($allClasses[self::TOKENIZED_CLASSES] as $class) {
+ if (!$class->isDocumented()) {
+ continue;
+ }
+
+ foreach ($class->getOwnMethods() as $method) {
+ $allClasses = $this->processFunction($declared, $allClasses, $method);
+ }
+
+ foreach ($class->getOwnProperties() as $property) {
+ $annotations = $property->getAnnotations();
+
+ if (!isset($annotations['var'])) {
+ continue;
+ }
+
+ foreach ($annotations['var'] as $doc) {
+ foreach (explode('|', preg_replace('~\\s.*~', '', $doc)) as $name) {
+ if ($name = rtrim($name, '[]')) {
+ $name = Resolver::resolveClassFQN($name, $class->getNamespaceAliases(), $class->getNamespaceName());
+ $allClasses = $this->addClass($declared, $allClasses, $name);
+ }
+ }
+ }
+ }
+
+ $this->generator->checkMemory();
+ }
+
+ foreach ($this->getFunctions() as $function) {
+ $allClasses = $this->processFunction($declared, $allClasses, $function);
+ }
+
+ array_walk_recursive($allClasses, function(&$reflection, $name, Generator $generator) {
+ if (!$reflection instanceof ReflectionClass) {
+ $reflection = new ReflectionClass($reflection, $generator);
+ }
+ }, $this->generator);
+
+ return $allClasses;
+ }
+
+ /**
+ * Processes a function/method and adds classes from annotations to the overall class array.
+ *
+ * @param array $declared Array of declared classes
+ * @param array $allClasses Array with all classes parsed so far
+ * @param \ApiGen\ReflectionFunction|\TokenReflection\IReflectionFunctionBase $function Function/method reflection
+ * @return array
+ */
+ private function processFunction(array $declared, array $allClasses, $function)
+ {
+ static $parsedAnnotations = array('param', 'return', 'throws');
+
+ $annotations = $function->getAnnotations();
+ foreach ($parsedAnnotations as $annotation) {
+ if (!isset($annotations[$annotation])) {
+ continue;
+ }
+
+ foreach ($annotations[$annotation] as $doc) {
+ foreach (explode('|', preg_replace('~\\s.*~', '', $doc)) as $name) {
+ if ($name) {
+ $name = Resolver::resolveClassFQN(rtrim($name, '[]'), $function->getNamespaceAliases(), $function->getNamespaceName());
+ $allClasses = $this->addClass($declared, $allClasses, $name);
+ }
+ }
+ }
+ }
+
+ foreach ($function->getParameters() as $param) {
+ if ($hint = $param->getClassName()) {
+ $allClasses = $this->addClass($declared, $allClasses, $hint);
+ }
+ }
+
+ return $allClasses;
+ }
+
+ /**
+ * Adds a class to list of classes.
+ *
+ * @param array $declared Array of declared classes
+ * @param array $allClasses Array with all classes parsed so far
+ * @param string $name Class name
+ * @return array
+ */
+ private function addClass(array $declared, array $allClasses, $name)
+ {
+ $name = ltrim($name, '\\');
+
+ if (!isset($declared[$name]) || isset($allClasses[self::TOKENIZED_CLASSES][$name])
+ || isset($allClasses[self::INTERNAL_CLASSES][$name]) || isset($allClasses[self::NONEXISTENT_CLASSES][$name])
+ ) {
+ return $allClasses;
+ }
+
+ $parameterClass = $this->getBroker()->getClass($name);
+ if ($parameterClass->isInternal()) {
+ $allClasses[self::INTERNAL_CLASSES][$name] = $parameterClass;
+ foreach (array_merge($parameterClass->getInterfaces(), $parameterClass->getParentClasses()) as $parentClass) {
+ if (!isset($allClasses[self::INTERNAL_CLASSES][$parentName = $parentClass->getName()])) {
+ $allClasses[self::INTERNAL_CLASSES][$parentName] = $parentClass;
+ }
+ }
+ } elseif (!$parameterClass->isTokenized() && !isset($allClasses[self::NONEXISTENT_CLASSES][$name])) {
+ $allClasses[self::NONEXISTENT_CLASSES][$name] = $parameterClass;
+ }
+
+ return $allClasses;
+ }
+
+ /**
+ * Returns all constants from all namespaces.
+ *
+ * @return array
+ */
+ public function getConstants()
+ {
+ $generator = $this->generator;
+ return array_map(function(IReflectionConstant $constant) use ($generator) {
+ return new ReflectionConstant($constant, $generator);
+ }, parent::getConstants());
+ }
+
+ /**
+ * Returns all functions from all namespaces.
+ *
+ * @return array
+ */
+ public function getFunctions()
+ {
+ $generator = $this->generator;
+ return array_map(function(IReflectionFunction $function) use ($generator) {
+ return new ReflectionFunction($function, $generator);
+ }, parent::getFunctions());
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/Config.php b/vendor/apigen/apigen/ApiGen/Config.php
new file mode 100644
index 0000000..b98a437
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/Config.php
@@ -0,0 +1,596 @@
+ '',
+ 'source' => array(),
+ 'destination' => '',
+ 'extensions' => array('php'),
+ 'exclude' => array(),
+ 'skipDocPath' => array(),
+ 'skipDocPrefix' => array(),
+ 'charset' => array('auto'),
+ 'main' => '',
+ 'title' => '',
+ 'baseUrl' => '',
+ 'googleCseId' => '',
+ 'googleAnalytics' => '',
+ 'templateConfig' => '',
+ 'allowedHtml' => array('b', 'i', 'a', 'ul', 'ol', 'li', 'p', 'br', 'var', 'samp', 'kbd', 'tt'),
+ 'groups' => 'auto',
+ 'autocomplete' => array('classes', 'constants', 'functions'),
+ 'accessLevels' => array('public', 'protected'),
+ 'internal' => false,
+ 'php' => true,
+ 'tree' => true,
+ 'deprecated' => false,
+ 'todo' => false,
+ 'download' => false,
+ 'sourceCode' => true,
+ 'report' => '',
+ 'undocumented' => '',
+ 'wipeout' => true,
+ 'quiet' => false,
+ 'progressbar' => true,
+ 'colors' => true,
+ 'updateCheck' => true,
+ 'debug' => false
+ );
+
+ /**
+ * File or directory path options.
+ *
+ * @var array
+ */
+ private static $pathOptions = array(
+ 'config',
+ 'source',
+ 'destination',
+ 'templateConfig',
+ 'report'
+ );
+
+ /**
+ * Possible values for options.
+ *
+ * @var array
+ */
+ private static $possibleOptionsValues = array(
+ 'groups' => array('auto', 'namespaces', 'packages', 'none'),
+ 'autocomplete' => array('classes', 'constants', 'functions', 'methods', 'properties', 'classconstants'),
+ 'accessLevels' => array('public', 'protected', 'private')
+ );
+
+ /**
+ * Initializes default configuration.
+ */
+ public function __construct()
+ {
+ $templateDir = self::isInstalledByPear() ? '@data_dir@' . DIRECTORY_SEPARATOR . 'ApiGen' : realpath(__DIR__ . DIRECTORY_SEPARATOR . '..');
+ self::$defaultConfig['templateConfig'] = $templateDir . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'default' . DIRECTORY_SEPARATOR . 'config.neon';
+ self::$defaultConfig['colors'] = 'WIN' === substr(PHP_OS, 0, 3) ? false : (function_exists('posix_isatty') && defined('STDOUT') ? posix_isatty(STDOUT) : true);
+ $this->config = self::$defaultConfig;
+ }
+
+ /**
+ * Processes command line options.
+ *
+ * @param array $options
+ * @return \ApiGen\Config
+ */
+ public function processCliOptions(array $options)
+ {
+ while ($option = current($options)) {
+ if (preg_match('~^--([a-z][-a-z]*[a-z])(?:=(.+))?$~', $option, $matches) || preg_match('~^-([a-z])=?(.*)~', $option, $matches)) {
+ $name = $matches[1];
+
+ if (!empty($matches[2])) {
+ $value = $matches[2];
+ } else {
+ $next = next($options);
+ if (false === $next || '-' === $next{0}) {
+ prev($options);
+ $value = '';
+ } else {
+ $value = $next;
+ }
+ }
+
+ $this->options[$name][] = $value;
+ }
+
+ next($options);
+ }
+ $this->options = array_map(function($value) {
+ return 1 === count($value) ? $value[0] : $value;
+ }, $this->options);
+
+ // Compatibility with ApiGen 1.0
+ foreach (array('config', 'source', 'destination') as $option) {
+ if (isset($this->options[$option{0}]) && !isset($this->options[$option])) {
+ $this->options[$option] = $this->options[$option{0}];
+ }
+ unset($this->options[$option{0}]);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Prepares configuration.
+ *
+ * @return \ApiGen\Config
+ * @throws \ApiGen\ConfigException If something in configuration is wrong.
+ */
+ public function prepare()
+ {
+ // Command line options
+ $cli = array();
+ $translator = array();
+ foreach ($this->options as $option => $value) {
+ $converted = preg_replace_callback('~-([a-z])~', function($matches) {
+ return strtoupper($matches[1]);
+ }, $option);
+
+ $cli[$converted] = $value;
+ $translator[$converted] = $option;
+ }
+
+ $unknownOptions = array_keys(array_diff_key($cli, self::$defaultConfig));
+ if (!empty($unknownOptions)) {
+ $originalOptions = array_map(function($option) {
+ return (1 === strlen($option) ? '-' : '--') . $option;
+ }, array_values(array_diff_key($translator, self::$defaultConfig)));
+
+ $message = count($unknownOptions) > 1
+ ? sprintf('Unknown command line options "%s"', implode('", "', $originalOptions))
+ : sprintf('Unknown command line option "%s"', $originalOptions[0]);
+ throw new ConfigException($message);
+ }
+
+ // Config file
+ $neon = array();
+ if (empty($this->options) && $this->defaultConfigExists()) {
+ $this->options['config'] = $this->getDefaultConfigPath();
+ }
+ if (isset($this->options['config']) && is_file($this->options['config'])) {
+ $neon = Neon::decode(file_get_contents($this->options['config']));
+ foreach (self::$pathOptions as $option) {
+ if (!empty($neon[$option])) {
+ if (is_array($neon[$option])) {
+ foreach ($neon[$option] as $key => $value) {
+ $neon[$option][$key] = $this->getAbsolutePath($value);
+ }
+ } else {
+ $neon[$option] = $this->getAbsolutePath($neon[$option]);
+ }
+ }
+ }
+
+ $unknownOptions = array_keys(array_diff_key($neon, self::$defaultConfig));
+ if (!empty($unknownOptions)) {
+ $message = count($unknownOptions) > 1
+ ? sprintf('Unknown config file options "%s"', implode('", "', $unknownOptions))
+ : sprintf('Unknown config file option "%s"', $unknownOptions[0]);
+ throw new ConfigException($message);
+ }
+ }
+
+ // Merge options
+ $this->config = array_merge(self::$defaultConfig, $neon, $cli);
+
+ // Compatibility with old option name "undocumented"
+ if (!isset($this->config['report']) && isset($this->config['undocumented'])) {
+ $this->config['report'] = $this->config['undocumented'];
+ unset($this->config['undocumented']);
+ }
+
+ foreach (self::$defaultConfig as $option => $valueDefinition) {
+ if (is_array($this->config[$option]) && !is_array($valueDefinition)) {
+ throw new ConfigException(sprintf('Option "%s" must be set only once', $option));
+ }
+
+ if (is_bool($this->config[$option]) && !is_bool($valueDefinition)) {
+ throw new ConfigException(sprintf('Option "%s" expects value', $option));
+ }
+
+ if (is_bool($valueDefinition) && !is_bool($this->config[$option])) {
+ // Boolean option
+ $value = strtolower($this->config[$option]);
+ if ('on' === $value || 'yes' === $value || 'true' === $value || '' === $value) {
+ $value = true;
+ } elseif ('off' === $value || 'no' === $value || 'false' === $value) {
+ $value = false;
+ }
+ $this->config[$option] = (bool) $value;
+ } elseif (is_array($valueDefinition)) {
+ // Array option
+ $this->config[$option] = array_unique((array) $this->config[$option]);
+ foreach ($this->config[$option] as $key => $value) {
+ $value = explode(',', $value);
+ while (count($value) > 1) {
+ array_push($this->config[$option], array_shift($value));
+ }
+ $this->config[$option][$key] = array_shift($value);
+ }
+ $this->config[$option] = array_filter($this->config[$option]);
+ }
+
+ // Check posssible values
+ if (!empty(self::$possibleOptionsValues[$option])) {
+ $values = self::$possibleOptionsValues[$option];
+
+ if (is_array($valueDefinition)) {
+ $this->config[$option] = array_filter($this->config[$option], function($value) use ($values) {
+ return in_array($value, $values);
+ });
+ } elseif (!in_array($this->config[$option], $values)) {
+ $this->config[$option] = '';
+ }
+ }
+ }
+
+ // Unify character sets
+ $this->config['charset'] = array_map('strtoupper', $this->config['charset']);
+
+ // Process options that specify a filesystem path
+ foreach (self::$pathOptions as $option) {
+ if (is_array($this->config[$option])) {
+ array_walk($this->config[$option], function(&$value) {
+ if (file_exists($value)) {
+ $value = realpath($value);
+ }
+ });
+ usort($this->config[$option], 'strcasecmp');
+ } else {
+ if (file_exists($this->config[$option])) {
+ $this->config[$option] = realpath($this->config[$option]);
+ }
+ }
+ }
+
+ // Unify directory separators
+ foreach (array('exclude', 'skipDocPath') as $option) {
+ $this->config[$option] = array_map(function($mask) {
+ return str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $mask);
+ }, $this->config[$option]);
+ usort($this->config[$option], 'strcasecmp');
+ }
+
+ // Unify prefixes
+ $this->config['skipDocPrefix'] = array_map(function($prefix) {
+ return ltrim($prefix, '\\');
+ }, $this->config['skipDocPrefix']);
+ usort($this->config['skipDocPrefix'], 'strcasecmp');
+
+ // Base url without slash at the end
+ $this->config['baseUrl'] = rtrim($this->config['baseUrl'], '/');
+
+ // No progressbar in quiet mode
+ if ($this->config['quiet']) {
+ $this->config['progressbar'] = false;
+ }
+
+ // Check
+ $this->check();
+
+ // Default template config
+ $this->config['template'] = array(
+ 'require' => array(),
+ 'resources' => array(),
+ 'templates' => array(
+ 'common' => array(),
+ 'optional' => array()
+ )
+ );
+
+ // Merge template config
+ $this->config = array_merge_recursive($this->config, array('template' => Neon::decode(file_get_contents($fileName = $this->config['templateConfig']))));
+ $this->config['template']['config'] = realpath($fileName);
+
+ // Check template
+ $this->checkTemplate();
+
+ return $this;
+ }
+
+ /**
+ * Checks configuration.
+ *
+ * @return \ApiGen\Config
+ * @throws \ApiGen\ConfigException If something in configuration is wrong.
+ */
+ private function check()
+ {
+ if (!empty($this->config['config']) && !is_file($this->config['config'])) {
+ throw new ConfigException(sprintf('Config file "%s" doesn\'t exist', $this->config['config']));
+ }
+
+ if (empty($this->config['source'])) {
+ throw new ConfigException('Source is not set');
+ }
+ foreach ($this->config['source'] as $source) {
+ if (!file_exists($source)) {
+ throw new ConfigException(sprintf('Source "%s" doesn\'t exist', $source));
+ }
+ }
+
+ if (empty($this->config['destination'])) {
+ throw new ConfigException('Destination is not set');
+ }
+
+ foreach ($this->config['extensions'] as $extension) {
+ if (!preg_match('~^[a-z\\d]+$~i', $extension)) {
+ throw new ConfigException(sprintf('Invalid file extension "%s"', $extension));
+ }
+ }
+
+ if (!is_file($this->config['templateConfig'])) {
+ throw new ConfigException(sprintf('Template config "%s" doesn\'t exist', $this->config['templateConfig']));
+ }
+
+ if (!empty($this->config['googleCseId']) && !preg_match('~^\d{21}:[-a-z0-9_]{11}$~', $this->config['googleCseId'])) {
+ throw new ConfigException(sprintf('Invalid Google Custom Search ID "%s"', $this->config['googleCseId']));
+ }
+
+ if (!empty($this->config['googleAnalytics']) && !preg_match('~^UA\\-\\d+\\-\\d+$~', $this->config['googleAnalytics'])) {
+ throw new ConfigException(sprintf('Invalid Google Analytics tracking code "%s"', $this->config['googleAnalytics']));
+ }
+
+ if (empty($this->config['groups'])) {
+ throw new ConfigException('No supported groups value given');
+ }
+
+ if (empty($this->config['autocomplete'])) {
+ throw new ConfigException('No supported autocomplete value given');
+ }
+
+ if (empty($this->config['accessLevels'])) {
+ throw new ConfigException('No supported access level given');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Checks template configuration.
+ *
+ * @return \ApiGen\Config
+ * @throws \ApiGen\ConfigException If something in template configuration is wrong.
+ */
+ private function checkTemplate()
+ {
+ $require = $this->config['template']['require'];
+ if (isset($require['min']) && !preg_match('~^\\d+(?:\\.\\d+){0,2}$~', $require['min'])) {
+ throw new ConfigException(sprintf('Invalid minimal version definition "%s"', $require['min']));
+ }
+ if (isset($require['max']) && !preg_match('~^\\d+(?:\\.\\d+){0,2}$~', $require['max'])) {
+ throw new ConfigException(sprintf('Invalid maximal version definition "%s"', $require['max']));
+ }
+
+ $isMinOk = function($min) {
+ $min .= str_repeat('.0', 2 - substr_count($min, '.'));
+ return version_compare($min, Generator::VERSION, '<=');
+ };
+ $isMaxOk = function($max) {
+ $max .= str_repeat('.0', 2 - substr_count($max, '.'));
+ return version_compare($max, Generator::VERSION, '>=');
+ };
+
+ if (isset($require['min'], $require['max']) && (!$isMinOk($require['min']) || !$isMaxOk($require['max']))) {
+ throw new ConfigException(sprintf('The template requires version from "%s" to "%s", you are using version "%s"', $require['min'], $require['max'], Generator::VERSION));
+ } elseif (isset($require['min']) && !$isMinOk($require['min'])) {
+ throw new ConfigException(sprintf('The template requires version "%s" or newer, you are using version "%s"', $require['min'], Generator::VERSION));
+ } elseif (isset($require['max']) && !$isMaxOk($require['max'])) {
+ throw new ConfigException(sprintf('The template requires version "%s" or older, you are using version "%s"', $require['max'], Generator::VERSION));
+ }
+
+ foreach (array('main', 'optional') as $section) {
+ foreach ($this->config['template']['templates'][$section] as $type => $config) {
+ if (!isset($config['filename'])) {
+ throw new ConfigException(sprintf('Filename for "%s" is not defined', $type));
+ }
+ if (!isset($config['template'])) {
+ throw new ConfigException(sprintf('Template for "%s" is not defined', $type));
+ }
+ if (!is_file(dirname($this->config['templateConfig']) . DIRECTORY_SEPARATOR . $config['template'])) {
+ throw new ConfigException(sprintf('Template for "%s" doesn\'t exist', $type));
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns default configuration file path.
+ *
+ * @return string
+ */
+ private function getDefaultConfigPath()
+ {
+ return getcwd() . DIRECTORY_SEPARATOR . 'apigen.neon';
+ }
+
+ /**
+ * Checks if default configuration file exists.
+ *
+ * @return boolean
+ */
+ private function defaultConfigExists()
+ {
+ return is_file($this->getDefaultConfigPath());
+ }
+
+ /**
+ * Returns absolute path.
+ *
+ * @param string $path Path
+ * @return string
+ */
+ private function getAbsolutePath($path)
+ {
+ if (preg_match('~/|[a-z]:~Ai', $path)) {
+ return $path;
+ }
+
+ return dirname($this->options['config']) . DIRECTORY_SEPARATOR . $path;
+ }
+
+ /**
+ * Checks if a configuration option exists.
+ *
+ * @param string $name Option name
+ * @return boolean
+ */
+ public function __isset($name)
+ {
+ return isset($this->config[$name]);
+ }
+
+ /**
+ * Returns a configuration option value.
+ *
+ * @param string $name Option name
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ return isset($this->config[$name]) ? $this->config[$name] : null;
+ }
+
+ /**
+ * If the user requests help.
+ *
+ * @return boolean
+ */
+ public function isHelpRequested()
+ {
+ if (empty($this->options) && !$this->defaultConfigExists()) {
+ return true;
+ }
+
+ if (isset($this->options['h']) || isset($this->options['help'])) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns help.
+ *
+ * @return string
+ */
+ public function getHelp()
+ {
+ return <<<"HELP"
+Usage:
+ apigen @option@--config@c <@value@path@c> [options]
+ apigen @option@--source@c <@value@dir@c|@value@file@c> @option@--destination@c <@value@dir@c> [options]
+
+Options:
+ @option@--config@c|@option@-c@c <@value@file@c> Config file
+ @option@--source@c|@option@-s@c <@value@dir@c|@value@file@c> Source file or directory to parse (can be used multiple times)
+ @option@--destination@c|@option@-d@c <@value@dir@c> Directory where to save the generated documentation
+ @option@--extensions@c <@value@list@c> List of allowed file extensions, default "@value@php@c"
+ @option@--exclude@c <@value@mask@c> Mask (case sensitive) to exclude file or directory from processing (can be used multiple times)
+ @option@--skip-doc-path@c <@value@mask@c> Don't generate documentation for elements from file or directory with this (case sensitive) mask (can be used multiple times)
+ @option@--skip-doc-prefix@c <@value@value@c> Don't generate documentation for elements with this (case sensitive) name prefix (can be used multiple times)
+ @option@--charset@c <@value@list@c> Character set of source files, default "@value@auto@c"
+ @option@--main@c <@value@value@c> Main project name prefix
+ @option@--title@c <@value@value@c> Title of generated documentation
+ @option@--base-url@c <@value@value@c> Documentation base URL
+ @option@--google-cse-id@c <@value@value@c> Google Custom Search ID
+ @option@--google-analytics@c <@value@value@c> Google Analytics tracking code
+ @option@--template-config@c <@value@file@c> Template config file, default "@value@{$this->config['templateConfig']}@c"
+ @option@--allowed-html@c <@value@list@c> List of allowed HTML tags in documentation, default "@value@b,i,a,ul,ol,li,p,br,var,samp,kbd,tt@c"
+ @option@--groups@c <@value@value@c> How should elements be grouped in the menu. Possible options are "auto", "namespaces", "packages" and "none". Default value is "@value@auto@c" (namespaces if available, packages otherwise)
+ @option@--autocomplete@c <@value@list@c> Element types for search input autocomplete. Default value is "@value@classes,constants,functions@c"
+ @option@--access-levels@c <@value@list@c> Generate documentation for methods and properties with given access level, default "@value@public,protected@c"
+ @option@--internal@c <@value@yes@c|@value@no@c> Generate documentation for elements marked as internal and display internal documentation parts, default "@value@no@c"
+ @option@--php@c <@value@yes@c|@value@no@c> Generate documentation for PHP internal classes, default "@value@yes@c"
+ @option@--tree@c <@value@yes@c|@value@no@c> Generate tree view of classes, interfaces, traits and exceptions, default "@value@yes@c"
+ @option@--deprecated@c <@value@yes@c|@value@no@c> Generate documentation for deprecated elements, default "@value@no@c"
+ @option@--todo@c <@value@yes@c|@value@no@c> Generate documentation of tasks, default "@value@no@c"
+ @option@--source-code@c <@value@yes@c|@value@no@c> Generate highlighted source code files, default "@value@yes@c"
+ @option@--download@c <@value@yes@c|@value@no@c> Add a link to download documentation as a ZIP archive, default "@value@no@c"
+ @option@--report@c <@value@file@c> Save a checkstyle report of poorly documented elements into a file
+ @option@--wipeout@c <@value@yes@c|@value@no@c> Wipe out the destination directory first, default "@value@yes@c"
+ @option@--quiet@c <@value@yes@c|@value@no@c> Don't display scaning and generating messages, default "@value@no@c"
+ @option@--progressbar@c <@value@yes@c|@value@no@c> Display progressbars, default "@value@yes@c"
+ @option@--colors@c <@value@yes@c|@value@no@c> Use colors, default "@value@no@c" on Windows, "@value@yes@c" on other systems
+ @option@--update-check@c <@value@yes@c|@value@no@c> Check for update, default "@value@yes@c"
+ @option@--debug@c <@value@yes@c|@value@no@c> Display additional information in case of an error, default "@value@no@c"
+ @option@--help@c|@option@-h@c Display this help
+
+Only source and destination directories are required - either set explicitly or using a config file. Configuration parameters passed via command line have precedence over parameters from a config file.
+
+Boolean options (those with possible values @value@yes@c|@value@no@c) do not have to have their values defined explicitly. Using @option@--debug@c and @option@--debug@c=@value@yes@c is exactly the same.
+
+Some options can have multiple values. You can do so either by using them multiple times or by separating values by a comma. That means that writing @option@--source@c=@value@file1.php@c @option@--source@c=@value@file2.php@c or @option@--source@c=@value@file1.php,file2.php@c is exactly the same.
+
+Files or directories specified by @option@--exclude@c will not be processed at all.
+Elements from files within @option@--skip-doc-path@c or with @option@--skip-doc-prefix@c will be parsed but will not have their documentation generated. However if classes have any child classes, the full class tree will be generated and their inherited methods, properties and constants will be displayed (but will not be clickable).
+
+HELP;
+ }
+
+ /**
+ * Checks if ApiGen is installed by PEAR.
+ *
+ * @return boolean
+ */
+ public static function isInstalledByPear()
+ {
+ return false === strpos('@data_dir@', '@data_dir');
+ }
+
+ /**
+ * Checks if ApiGen is installed from downloaded archive.
+ *
+ * @return boolean
+ */
+ public static function isInstalledByDownload()
+ {
+ return !self::isInstalledByPear();
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ConfigException.php b/vendor/apigen/apigen/ApiGen/ConfigException.php
new file mode 100644
index 0000000..0770911
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ConfigException.php
@@ -0,0 +1,25 @@
+ '[%s] %\' 6.2f%% %\' 3dMB',
+ 'width' => 80,
+ 'bar' => 64,
+ 'current' => 0,
+ 'maximum' => 1
+ );
+
+ /**
+ * Sets configuration.
+ *
+ * @param array $config
+ */
+ public function __construct(Config $config)
+ {
+ $this->config = $config;
+ $this->parsedClasses = new \ArrayObject();
+ $this->parsedConstants = new \ArrayObject();
+ $this->parsedFunctions = new \ArrayObject();
+ }
+
+ /**
+ * Scans and parses PHP files.
+ *
+ * @return array
+ * @throws \RuntimeException If no PHP files have been found.
+ */
+ public function parse()
+ {
+ $files = array();
+
+ $flags = \RecursiveDirectoryIterator::CURRENT_AS_FILEINFO | \RecursiveDirectoryIterator::SKIP_DOTS;
+ if (defined('\\RecursiveDirectoryIterator::FOLLOW_SYMLINKS')) {
+ // Available from PHP 5.3.1
+ $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS;
+ }
+
+ foreach ($this->config->source as $source) {
+ $entries = array();
+ if (is_dir($source)) {
+ foreach (new \RecursiveIteratorIterator(new SourceFilesFilterIterator(new \RecursiveDirectoryIterator($source, $flags), $this->config->exclude)) as $entry) {
+ if (!$entry->isFile()) {
+ continue;
+ }
+ $entries[] = $entry;
+ }
+ } elseif ($this->isPhar($source)) {
+ if (!extension_loaded('phar')) {
+ throw new RuntimeException('Phar extension is not loaded');
+ }
+ foreach (new \RecursiveIteratorIterator(new \Phar($source, $flags)) as $entry) {
+ if (!$entry->isFile()) {
+ continue;
+ }
+ $entries[] = $entry;
+ }
+ } else {
+ $entries[] = new \SplFileInfo($source);
+ }
+
+ $regexp = '~\\.' . implode('|', $this->config->extensions) . '$~i';
+ foreach ($entries as $entry) {
+ if (!preg_match($regexp, $entry->getFilename())) {
+ continue;
+ }
+
+ $pathName = $this->normalizePath($entry->getPathName());
+ $files[$pathName] = $entry->getSize();
+ if (false !== $entry->getRealPath() && $pathName !== $entry->getRealPath()) {
+ $this->symlinks[$entry->getRealPath()] = $pathName;
+ }
+ }
+ }
+
+ if (empty($files)) {
+ throw new RuntimeException('No PHP files found');
+ }
+
+ if ($this->config->progressbar) {
+ $this->prepareProgressBar(array_sum($files));
+ }
+
+ $broker = new Broker(new Backend($this, !empty($this->config->report)), Broker::OPTION_DEFAULT & ~(Broker::OPTION_PARSE_FUNCTION_BODY | Broker::OPTION_SAVE_TOKEN_STREAM));
+
+ $errors = array();
+
+ foreach ($files as $fileName => $size) {
+ $content = file_get_contents($fileName);
+ $charset = $this->detectCharset($content);
+ $this->charsets[$fileName] = $charset;
+ $content = $this->toUtf($content, $charset);
+
+ try {
+ $broker->processString($content, $fileName);
+ } catch (\Exception $e) {
+ $errors[] = $e;
+ }
+
+ $this->incrementProgressBar($size);
+ $this->checkMemory();
+ }
+
+ // Classes
+ $this->parsedClasses->exchangeArray($broker->getClasses(Backend::TOKENIZED_CLASSES | Backend::INTERNAL_CLASSES | Backend::NONEXISTENT_CLASSES));
+ $this->parsedClasses->uksort('strcasecmp');
+
+ // Constants
+ $this->parsedConstants->exchangeArray($broker->getConstants());
+ $this->parsedConstants->uksort('strcasecmp');
+
+ // Functions
+ $this->parsedFunctions->exchangeArray($broker->getFunctions());
+ $this->parsedFunctions->uksort('strcasecmp');
+
+ $documentedCounter = function($count, $element) {
+ return $count += (int) $element->isDocumented();
+ };
+
+ return (object) array(
+ 'classes' => count($broker->getClasses(Backend::TOKENIZED_CLASSES)),
+ 'constants' => count($this->parsedConstants),
+ 'functions' => count($this->parsedFunctions),
+ 'internalClasses' => count($broker->getClasses(Backend::INTERNAL_CLASSES)),
+ 'documentedClasses' => array_reduce($broker->getClasses(Backend::TOKENIZED_CLASSES), $documentedCounter),
+ 'documentedConstants' => array_reduce($this->parsedConstants->getArrayCopy(), $documentedCounter),
+ 'documentedFunctions' => array_reduce($this->parsedFunctions->getArrayCopy(), $documentedCounter),
+ 'documentedInternalClasses' => array_reduce($broker->getClasses(Backend::INTERNAL_CLASSES), $documentedCounter),
+ 'errors' => $errors
+ );
+ }
+
+ /**
+ * Returns configuration.
+ *
+ * @return mixed
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Returns parsed class list.
+ *
+ * @return \ArrayObject
+ */
+ public function getParsedClasses()
+ {
+ return $this->parsedClasses;
+ }
+
+ /**
+ * Returns parsed constant list.
+ *
+ * @return \ArrayObject
+ */
+ public function getParsedConstants()
+ {
+ return $this->parsedConstants;
+ }
+
+ /**
+ * Returns parsed function list.
+ *
+ * @return \ArrayObject
+ */
+ public function getParsedFunctions()
+ {
+ return $this->parsedFunctions;
+ }
+
+ /**
+ * Wipes out the destination directory.
+ *
+ * @return boolean
+ */
+ public function wipeOutDestination()
+ {
+ foreach ($this->getGeneratedFiles() as $path) {
+ if (is_file($path) && !@unlink($path)) {
+ return false;
+ }
+ }
+
+ $archive = $this->getArchivePath();
+ if (is_file($archive) && !@unlink($archive)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Generates API documentation.
+ *
+ * @throws \RuntimeException If destination directory is not writable.
+ */
+ public function generate()
+ {
+ @mkdir($this->config->destination, 0755, true);
+ if (!is_dir($this->config->destination) || !is_writable($this->config->destination)) {
+ throw new RuntimeException(sprintf('Directory "%s" isn\'t writable', $this->config->destination));
+ }
+
+ // Copy resources
+ foreach ($this->config->template['resources'] as $resourceSource => $resourceDestination) {
+ // File
+ $resourcePath = $this->getTemplateDir() . DIRECTORY_SEPARATOR . $resourceSource;
+ if (is_file($resourcePath)) {
+ copy($resourcePath, $this->forceDir($this->config->destination . DIRECTORY_SEPARATOR . $resourceDestination));
+ continue;
+ }
+
+ // Dir
+ $iterator = Nette\Utils\Finder::findFiles('*')->from($resourcePath)->getIterator();
+ foreach ($iterator as $item) {
+ copy($item->getPathName(), $this->forceDir($this->config->destination . DIRECTORY_SEPARATOR . $resourceDestination . DIRECTORY_SEPARATOR . $iterator->getSubPathName()));
+ }
+ }
+
+ // Categorize by packages and namespaces
+ $this->categorize();
+
+ // Prepare progressbar
+ if ($this->config->progressbar) {
+ $max = count($this->packages)
+ + count($this->namespaces)
+ + count($this->classes)
+ + count($this->interfaces)
+ + count($this->traits)
+ + count($this->exceptions)
+ + count($this->constants)
+ + count($this->functions)
+ + count($this->config->template['templates']['common'])
+ + (int) !empty($this->config->report)
+ + (int) $this->config->tree
+ + (int) $this->config->deprecated
+ + (int) $this->config->todo
+ + (int) $this->config->download
+ + (int) $this->isSitemapEnabled()
+ + (int) $this->isOpensearchEnabled()
+ + (int) $this->isRobotsEnabled();
+
+ if ($this->config->sourceCode) {
+ $tokenizedFilter = function(ReflectionClass $class) {
+ return $class->isTokenized();
+ };
+ $max += count(array_filter($this->classes, $tokenizedFilter))
+ + count(array_filter($this->interfaces, $tokenizedFilter))
+ + count(array_filter($this->traits, $tokenizedFilter))
+ + count(array_filter($this->exceptions, $tokenizedFilter))
+ + count($this->constants)
+ + count($this->functions);
+ unset($tokenizedFilter);
+ }
+
+ $this->prepareProgressBar($max);
+ }
+
+ // Prepare template
+ $tmp = $this->config->destination . DIRECTORY_SEPARATOR . 'tmp';
+ $this->deleteDir($tmp);
+ @mkdir($tmp, 0755, true);
+ $template = new Template($this);
+ $template->setCacheStorage(new Nette\Caching\Storages\PhpFileStorage($tmp));
+ $template->generator = self::NAME;
+ $template->version = self::VERSION;
+ $template->config = $this->config;
+ $template->basePath = dirname($this->config->templateConfig);
+
+ $this->registerCustomTemplateMacros($template);
+
+ // Common files
+ $this->generateCommon($template);
+
+ // Optional files
+ $this->generateOptional($template);
+
+ // List of poorly documented elements
+ if (!empty($this->config->report)) {
+ $this->generateReport();
+ }
+
+ // List of deprecated elements
+ if ($this->config->deprecated) {
+ $this->generateDeprecated($template);
+ }
+
+ // List of tasks
+ if ($this->config->todo) {
+ $this->generateTodo($template);
+ }
+
+ // Classes/interfaces/traits/exceptions tree
+ if ($this->config->tree) {
+ $this->generateTree($template);
+ }
+
+ // Generate packages summary
+ $this->generatePackages($template);
+
+ // Generate namespaces summary
+ $this->generateNamespaces($template);
+
+ // Generate classes, interfaces, traits, exceptions, constants and functions files
+ $this->generateElements($template);
+
+ // Generate ZIP archive
+ if ($this->config->download) {
+ $this->generateArchive();
+ }
+
+ // Delete temporary directory
+ $this->deleteDir($tmp);
+ }
+
+ /**
+ * Loads template-specific macro and helper libraries.
+ *
+ * @param \ApiGen\Template $template Template instance
+ */
+ private function registerCustomTemplateMacros(Template $template)
+ {
+ $latte = new Nette\Latte\Engine();
+
+ if (!empty($this->config->template['options']['extensions'])) {
+ $this->output("Loading custom template macro and helper libraries\n");
+ $broker = new Broker(new Broker\Backend\Memory(), 0);
+
+ $baseDir = dirname($this->config->template['config']);
+ foreach ((array) $this->config->template['options']['extensions'] as $fileName) {
+ $pathName = $baseDir . DIRECTORY_SEPARATOR . $fileName;
+ if (is_file($pathName)) {
+ try {
+ $reflectionFile = $broker->processFile($pathName, true);
+
+ foreach ($reflectionFile->getNamespaces() as $namespace) {
+ foreach ($namespace->getClasses() as $class) {
+ if ($class->isSubclassOf('ApiGen\\MacroSet')) {
+ // Macro set
+
+ include $pathName;
+ call_user_func(array($class->getName(), 'install'), $latte->compiler);
+
+ $this->output(sprintf(" %s (macro set)\n", $class->getName()));
+ } elseif ($class->implementsInterface('ApiGen\\IHelperSet')) {
+ // Helpers set
+
+ include $pathName;
+ $className = $class->getName();
+ $template->registerHelperLoader(callback(new $className($template), 'loader'));
+
+ $this->output(sprintf(" %s (helper set)\n", $class->getName()));
+ }
+ }
+ }
+ } catch (\Exception $e) {
+ throw new \Exception(sprintf('Could not load macros and helpers from file "%s"', $pathName), 0, $e);
+ }
+ } else {
+ throw new \Exception(sprintf('Helper file "%s" does not exist.', $pathName));
+ }
+ }
+ }
+
+ $template->registerFilter($latte);
+ }
+
+ /**
+ * Categorizes by packages and namespaces.
+ *
+ * @return \ApiGen\Generator
+ */
+ private function categorize()
+ {
+ foreach (array('classes', 'constants', 'functions') as $type) {
+ foreach ($this->{'parsed' . ucfirst($type)} as $elementName => $element) {
+ if (!$element->isDocumented()) {
+ continue;
+ }
+
+ $packageName = $element->getPseudoPackageName();
+ $namespaceName = $element->getPseudoNamespaceName();
+
+ if ($element instanceof ReflectionConstant) {
+ $this->constants[$elementName] = $element;
+ $this->packages[$packageName]['constants'][$elementName] = $element;
+ $this->namespaces[$namespaceName]['constants'][$element->getShortName()] = $element;
+ } elseif ($element instanceof ReflectionFunction) {
+ $this->functions[$elementName] = $element;
+ $this->packages[$packageName]['functions'][$elementName] = $element;
+ $this->namespaces[$namespaceName]['functions'][$element->getShortName()] = $element;
+ } elseif ($element->isInterface()) {
+ $this->interfaces[$elementName] = $element;
+ $this->packages[$packageName]['interfaces'][$elementName] = $element;
+ $this->namespaces[$namespaceName]['interfaces'][$element->getShortName()] = $element;
+ } elseif ($element->isTrait()) {
+ $this->traits[$elementName] = $element;
+ $this->packages[$packageName]['traits'][$elementName] = $element;
+ $this->namespaces[$namespaceName]['traits'][$element->getShortName()] = $element;
+ } elseif ($element->isException()) {
+ $this->exceptions[$elementName] = $element;
+ $this->packages[$packageName]['exceptions'][$elementName] = $element;
+ $this->namespaces[$namespaceName]['exceptions'][$element->getShortName()] = $element;
+ } else {
+ $this->classes[$elementName] = $element;
+ $this->packages[$packageName]['classes'][$elementName] = $element;
+ $this->namespaces[$namespaceName]['classes'][$element->getShortName()] = $element;
+ }
+ }
+ }
+
+ // Select only packages or namespaces
+ $userPackagesCount = count(array_diff(array_keys($this->packages), array('PHP', 'None')));
+ $userNamespacesCount = count(array_diff(array_keys($this->namespaces), array('PHP', 'None')));
+
+ $namespacesEnabled = ('auto' === $this->config->groups && ($userNamespacesCount > 0 || 0 === $userPackagesCount)) || 'namespaces' === $this->config->groups;
+ $packagesEnabled = ('auto' === $this->config->groups && !$namespacesEnabled) || 'packages' === $this->config->groups;
+
+ if ($namespacesEnabled) {
+ $this->packages = array();
+ $this->namespaces = $this->sortGroups($this->namespaces);
+ } elseif ($packagesEnabled) {
+ $this->namespaces = array();
+ $this->packages = $this->sortGroups($this->packages);
+ } else {
+ $this->namespaces = array();
+ $this->packages = array();
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sorts and filters groups.
+ *
+ * @param array $groups
+ * @return array
+ */
+ private function sortGroups(array $groups)
+ {
+ // Don't generate only 'None' groups
+ if (1 === count($groups) && isset($groups['None'])) {
+ return array();
+ }
+
+ $emptyList = array('classes' => array(), 'interfaces' => array(), 'traits' => array(), 'exceptions' => array(), 'constants' => array(), 'functions' => array());
+
+ $groupNames = array_keys($groups);
+ $lowerGroupNames = array_flip(array_map(function($y) {
+ return strtolower($y);
+ }, $groupNames));
+
+ foreach ($groupNames as $groupName) {
+ // Add missing parent groups
+ $parent = '';
+ foreach (explode('\\', $groupName) as $part) {
+ $parent = ltrim($parent . '\\' . $part, '\\');
+ if (!isset($lowerGroupNames[strtolower($parent)])) {
+ $groups[$parent] = $emptyList;
+ }
+ }
+
+ // Add missing element types
+ foreach ($this->getElementTypes() as $type) {
+ if (!isset($groups[$groupName][$type])) {
+ $groups[$groupName][$type] = array();
+ }
+ }
+ }
+
+ $main = $this->config->main;
+ uksort($groups, function($one, $two) use ($main) {
+ // \ as separator has to be first
+ $one = str_replace('\\', ' ', $one);
+ $two = str_replace('\\', ' ', $two);
+
+ if ($main) {
+ if (0 === strpos($one, $main) && 0 !== strpos($two, $main)) {
+ return -1;
+ } elseif (0 !== strpos($one, $main) && 0 === strpos($two, $main)) {
+ return 1;
+ }
+ }
+
+ return strcasecmp($one, $two);
+ });
+
+ return $groups;
+ }
+
+ /**
+ * Generates common files.
+ *
+ * @param \ApiGen\Template $template Template
+ * @return \ApiGen\Generator
+ */
+ private function generateCommon(Template $template)
+ {
+ $template->namespace = null;
+ $template->namespaces = array_keys($this->namespaces);
+ $template->package = null;
+ $template->packages = array_keys($this->packages);
+ $template->class = null;
+ $template->classes = array_filter($this->classes, $this->getMainFilter());
+ $template->interfaces = array_filter($this->interfaces, $this->getMainFilter());
+ $template->traits = array_filter($this->traits, $this->getMainFilter());
+ $template->exceptions = array_filter($this->exceptions, $this->getMainFilter());
+ $template->constant = null;
+ $template->constants = array_filter($this->constants, $this->getMainFilter());
+ $template->function = null;
+ $template->functions = array_filter($this->functions, $this->getMainFilter());
+ $template->archive = basename($this->getArchivePath());
+
+ // Elements for autocomplete
+ $elements = array();
+ $autocomplete = array_flip($this->config->autocomplete);
+ foreach ($this->getElementTypes() as $type) {
+ foreach ($this->$type as $element) {
+ if ($element instanceof ReflectionClass) {
+ if (isset($autocomplete['classes'])) {
+ $elements[] = array('c', $element->getPrettyName());
+ }
+ if (isset($autocomplete['methods'])) {
+ foreach ($element->getOwnMethods() as $method) {
+ $elements[] = array('m', $method->getPrettyName());
+ }
+ foreach ($element->getOwnMagicMethods() as $method) {
+ $elements[] = array('mm', $method->getPrettyName());
+ }
+ }
+ if (isset($autocomplete['properties'])) {
+ foreach ($element->getOwnProperties() as $property) {
+ $elements[] = array('p', $property->getPrettyName());
+ }
+ foreach ($element->getOwnMagicProperties() as $property) {
+ $elements[] = array('mp', $property->getPrettyName());
+ }
+ }
+ if (isset($autocomplete['classconstants'])) {
+ foreach ($element->getOwnConstants() as $constant) {
+ $elements[] = array('cc', $constant->getPrettyName());
+ }
+ }
+ } elseif ($element instanceof ReflectionConstant && isset($autocomplete['constants'])) {
+ $elements[] = array('co', $element->getPrettyName());
+ } elseif ($element instanceof ReflectionFunction && isset($autocomplete['functions'])) {
+ $elements[] = array('f', $element->getPrettyName());
+ }
+ }
+ }
+ usort($elements, function($one, $two) {
+ return strcasecmp($one[1], $two[1]);
+ });
+ $template->elements = $elements;
+
+ foreach ($this->config->template['templates']['common'] as $source => $destination) {
+ $template
+ ->setFile($this->getTemplateDir() . DIRECTORY_SEPARATOR . $source)
+ ->save($this->forceDir($this->config->destination . DIRECTORY_SEPARATOR . $destination));
+
+ $this->incrementProgressBar();
+ }
+
+ unset($template->elements);
+
+ $this->checkMemory();
+
+ return $this;
+ }
+
+ /**
+ * Generates optional files.
+ *
+ * @param \ApiGen\Template $template Template
+ * @return \ApiGen\Generator
+ */
+ private function generateOptional(Template $template)
+ {
+ if ($this->isSitemapEnabled()) {
+ $template
+ ->setFile($this->getTemplatePath('sitemap', 'optional'))
+ ->save($this->forceDir($this->getTemplateFileName('sitemap', 'optional')));
+ $this->incrementProgressBar();
+ }
+ if ($this->isOpensearchEnabled()) {
+ $template
+ ->setFile($this->getTemplatePath('opensearch', 'optional'))
+ ->save($this->forceDir($this->getTemplateFileName('opensearch', 'optional')));
+ $this->incrementProgressBar();
+ }
+ if ($this->isRobotsEnabled()) {
+ $template
+ ->setFile($this->getTemplatePath('robots', 'optional'))
+ ->save($this->forceDir($this->getTemplateFileName('robots', 'optional')));
+ $this->incrementProgressBar();
+ }
+
+ $this->checkMemory();
+
+ return $this;
+ }
+
+ /**
+ * Generates list of poorly documented elements.
+ *
+ * @return \ApiGen\Generator
+ * @throws \RuntimeException If file isn't writable.
+ */
+ private function generateReport()
+ {
+ // Function for element labels
+ $that = $this;
+ $labeler = function($element) use ($that) {
+ if ($element instanceof ReflectionClass) {
+ if ($element->isInterface()) {
+ $label = 'interface';
+ } elseif ($element->isTrait()) {
+ $label = 'trait';
+ } elseif ($element->isException()) {
+ $label = 'exception';
+ } else {
+ $label = 'class';
+ }
+ } elseif ($element instanceof ReflectionMethod) {
+ $label = 'method';
+ } elseif ($element instanceof ReflectionFunction) {
+ $label = 'function';
+ } elseif ($element instanceof ReflectionConstant) {
+ $label = 'constant';
+ } elseif ($element instanceof ReflectionProperty) {
+ $label = 'property';
+ } elseif ($element instanceof ReflectionParameter) {
+ $label = 'parameter';
+ }
+ return sprintf('%s %s', $label, $element->getPrettyName());
+ };
+
+ $list = array();
+ foreach ($this->getElementTypes() as $type) {
+ foreach ($this->$type as $parentElement) {
+ $fileName = $this->unPharPath($parentElement->getFileName());
+
+ if (!$parentElement->isValid()) {
+ $list[$fileName][] = array('error', 0, sprintf('Duplicate %s', $labeler($parentElement)));
+ continue;
+ }
+
+ // Skip elements not from the main project
+ if (!$parentElement->isMain()) {
+ continue;
+ }
+
+ // Internal elements don't have documentation
+ if ($parentElement->isInternal()) {
+ continue;
+ }
+
+ $elements = array($parentElement);
+ if ($parentElement instanceof ReflectionClass) {
+ $elements = array_merge(
+ $elements,
+ array_values($parentElement->getOwnMethods()),
+ array_values($parentElement->getOwnConstants()),
+ array_values($parentElement->getOwnProperties())
+ );
+ }
+
+ $tokens = $parentElement->getBroker()->getFileTokens($parentElement->getFileName());
+
+ foreach ($elements as $element) {
+ $line = $element->getStartLine();
+ $label = $labeler($element);
+
+ $annotations = $element->getAnnotations();
+
+ // Documentation
+ if (empty($element->longDescription)) {
+ if (empty($annotations)) {
+ $list[$fileName][] = array('error', $line, sprintf('Missing documentation of %s', $label));
+ continue;
+ }
+ // Description
+ $list[$fileName][] = array('error', $line, sprintf('Missing description of %s', $label));
+ }
+
+ // Documentation of method
+ if ($element instanceof ReflectionMethod || $element instanceof ReflectionFunction) {
+ // Parameters
+ $unlimited = false;
+ foreach ($element->getParameters() as $no => $parameter) {
+ if (!isset($annotations['param'][$no])) {
+ $list[$fileName][] = array('error', $line, sprintf('Missing documentation of %s', $labeler($parameter)));
+ continue;
+ }
+
+ if (!preg_match('~^[\\w\\\\]+(?:\\[\\])?(?:\\|[\\w\\\\]+(?:\\[\\])?)*(?:\\s+\\$' . $parameter->getName() . ($parameter->isUnlimited() ? ',\\.{3}' : '') . ')?(?:\\s+.+)?$~s', $annotations['param'][$no])) {
+ $list[$fileName][] = array('warning', $line, sprintf('Invalid documentation "%s" of %s', $annotations['param'][$no], $labeler($parameter)));
+ }
+
+ if ($unlimited && $parameter->isUnlimited()) {
+ $list[$fileName][] = array('warning', $line, sprintf('More than one unlimited parameters of %s', $labeler($element)));
+ } elseif ($parameter->isUnlimited()) {
+ $unlimited = true;
+ }
+
+ unset($annotations['param'][$no]);
+ }
+ if (isset($annotations['param'])) {
+ foreach ($annotations['param'] as $annotation) {
+ $list[$fileName][] = array('warning', $line, sprintf('Existing documentation "%s" of nonexistent parameter of %s', $annotation, $label));
+ }
+ }
+
+ // Return values
+ $return = false;
+ $tokens->seek($element->getStartPosition())
+ ->find(T_FUNCTION);
+ while ($tokens->next() && $tokens->key() < $element->getEndPosition()) {
+ $type = $tokens->getType();
+ if (T_FUNCTION === $type) {
+ // Skip annonymous functions
+ $tokens->find('{')->findMatchingBracket();
+ } elseif (T_RETURN === $type && !$tokens->skipWhitespaces()->is(';')) {
+ // Skip return without return value
+ $return = true;
+ break;
+ }
+ }
+ if ($return && !isset($annotations['return'])) {
+ $list[$fileName][] = array('error', $line, sprintf('Missing documentation of return value of %s', $label));
+ } elseif (isset($annotations['return'])) {
+ if (!$return && 'void' !== $annotations['return'][0] && ($element instanceof ReflectionFunction || (!$parentElement->isInterface() && !$element->isAbstract()))) {
+ $list[$fileName][] = array('warning', $line, sprintf('Existing documentation "%s" of nonexistent return value of %s', $annotations['return'][0], $label));
+ } elseif (!preg_match('~^[\\w\\\\]+(?:\\[\\])?(?:\\|[\\w\\\\]+(?:\\[\\])?)*(?:\\s+.+)?$~s', $annotations['return'][0])) {
+ $list[$fileName][] = array('warning', $line, sprintf('Invalid documentation "%s" of return value of %s', $annotations['return'][0], $label));
+ }
+ }
+ if (isset($annotations['return'][1])) {
+ $list[$fileName][] = array('warning', $line, sprintf('Duplicate documentation "%s" of return value of %s', $annotations['return'][1], $label));
+ }
+
+ // Throwing exceptions
+ $throw = false;
+ $tokens->seek($element->getStartPosition())
+ ->find(T_FUNCTION);
+ while ($tokens->next() && $tokens->key() < $element->getEndPosition()) {
+ $type = $tokens->getType();
+ if (T_TRY === $type) {
+ // Skip try
+ $tokens->find('{')->findMatchingBracket();
+ } elseif (T_THROW === $type) {
+ $throw = true;
+ break;
+ }
+ }
+ if ($throw && !isset($annotations['throws'])) {
+ $list[$fileName][] = array('error', $line, sprintf('Missing documentation of throwing an exception of %s', $label));
+ } elseif (isset($annotations['throws']) && !preg_match('~^[\\w\\\\]+(?:\\|[\\w\\\\]+)*(?:\\s+.+)?$~s', $annotations['throws'][0])) {
+ $list[$fileName][] = array('warning', $line, sprintf('Invalid documentation "%s" of throwing an exception of %s', $annotations['throws'][0], $label));
+ }
+ }
+
+ // Data type of constants & properties
+ if ($element instanceof ReflectionProperty || $element instanceof ReflectionConstant) {
+ if (!isset($annotations['var'])) {
+ $list[$fileName][] = array('error', $line, sprintf('Missing documentation of the data type of %s', $label));
+ } elseif (!preg_match('~^[\\w\\\\]+(?:\\[\\])?(?:\\|[\\w\\\\]+(?:\\[\\])?)*(?:\\s+.+)?$~s', $annotations['var'][0])) {
+ $list[$fileName][] = array('warning', $line, sprintf('Invalid documentation "%s" of the data type of %s', $annotations['var'][0], $label));
+ }
+
+ if (isset($annotations['var'][1])) {
+ $list[$fileName][] = array('warning', $line, sprintf('Duplicate documentation "%s" of the data type of %s', $annotations['var'][1], $label));
+ }
+ }
+ }
+ unset($tokens);
+ }
+ }
+ uksort($list, 'strcasecmp');
+
+ $file = @fopen($this->config->report, 'w');
+ if (false === $file) {
+ throw new RuntimeException(sprintf('File "%s" isn\'t writable', $this->config->report));
+ }
+ fwrite($file, sprintf('%s', "\n"));
+ fwrite($file, sprintf('%s', "\n"));
+ foreach ($list as $fileName => $reports) {
+ fwrite($file, sprintf('%s%s', "\t", $fileName, "\n"));
+
+ // Sort by line
+ usort($reports, function($one, $two) {
+ return strnatcmp($one[1], $two[1]);
+ });
+
+ foreach ($reports as $report) {
+ list($severity, $line, $message) = $report;
+ $message = preg_replace('~\\s+~u', ' ', $message);
+ fwrite($file, sprintf('%s%s', "\t\t", $severity, $line, htmlspecialchars($message), "\n"));
+ }
+
+ fwrite($file, sprintf('%s%s', "\t", "\n"));
+ }
+ fwrite($file, sprintf('%s', "\n"));
+ fclose($file);
+
+ $this->incrementProgressBar();
+ $this->checkMemory();
+
+ return $this;
+ }
+
+ /**
+ * Generates list of deprecated elements.
+ *
+ * @param \ApiGen\Template $template Template
+ * @return \ApiGen\Generator
+ * @throws \RuntimeException If template is not set.
+ */
+ private function generateDeprecated(Template $template)
+ {
+ $this->prepareTemplate('deprecated');
+
+ $deprecatedFilter = function($element) {
+ return $element->isDeprecated();
+ };
+
+ $template->deprecatedMethods = array();
+ $template->deprecatedConstants = array();
+ $template->deprecatedProperties = array();
+ foreach (array_reverse($this->getElementTypes()) as $type) {
+ $template->{'deprecated' . ucfirst($type)} = array_filter(array_filter($this->$type, $this->getMainFilter()), $deprecatedFilter);
+
+ if ('constants' === $type || 'functions' === $type) {
+ continue;
+ }
+
+ foreach ($this->$type as $class) {
+ if (!$class->isMain()) {
+ continue;
+ }
+
+ if ($class->isDeprecated()) {
+ continue;
+ }
+
+ $template->deprecatedMethods = array_merge($template->deprecatedMethods, array_values(array_filter($class->getOwnMethods(), $deprecatedFilter)));
+ $template->deprecatedConstants = array_merge($template->deprecatedConstants, array_values(array_filter($class->getOwnConstants(), $deprecatedFilter)));
+ $template->deprecatedProperties = array_merge($template->deprecatedProperties, array_values(array_filter($class->getOwnProperties(), $deprecatedFilter)));
+ }
+ }
+ usort($template->deprecatedMethods, array($this, 'sortMethods'));
+ usort($template->deprecatedConstants, array($this, 'sortConstants'));
+ usort($template->deprecatedFunctions, array($this, 'sortFunctions'));
+ usort($template->deprecatedProperties, array($this, 'sortProperties'));
+
+ $template
+ ->setFile($this->getTemplatePath('deprecated'))
+ ->save($this->forceDir($this->getTemplateFileName('deprecated')));
+
+ foreach ($this->getElementTypes() as $type) {
+ unset($template->{'deprecated' . ucfirst($type)});
+ }
+ unset($template->deprecatedMethods);
+ unset($template->deprecatedProperties);
+
+ $this->incrementProgressBar();
+ $this->checkMemory();
+
+ return $this;
+ }
+
+ /**
+ * Generates list of tasks.
+ *
+ * @param \ApiGen\Template $template Template
+ * @return \ApiGen\Generator
+ * @throws \RuntimeException If template is not set.
+ */
+ private function generateTodo(Template $template)
+ {
+ $this->prepareTemplate('todo');
+
+ $todoFilter = function($element) {
+ return $element->hasAnnotation('todo');
+ };
+
+ $template->todoMethods = array();
+ $template->todoConstants = array();
+ $template->todoProperties = array();
+ foreach (array_reverse($this->getElementTypes()) as $type) {
+ $template->{'todo' . ucfirst($type)} = array_filter(array_filter($this->$type, $this->getMainFilter()), $todoFilter);
+
+ if ('constants' === $type || 'functions' === $type) {
+ continue;
+ }
+
+ foreach ($this->$type as $class) {
+ if (!$class->isMain()) {
+ continue;
+ }
+
+ $template->todoMethods = array_merge($template->todoMethods, array_values(array_filter($class->getOwnMethods(), $todoFilter)));
+ $template->todoConstants = array_merge($template->todoConstants, array_values(array_filter($class->getOwnConstants(), $todoFilter)));
+ $template->todoProperties = array_merge($template->todoProperties, array_values(array_filter($class->getOwnProperties(), $todoFilter)));
+ }
+ }
+ usort($template->todoMethods, array($this, 'sortMethods'));
+ usort($template->todoConstants, array($this, 'sortConstants'));
+ usort($template->todoFunctions, array($this, 'sortFunctions'));
+ usort($template->todoProperties, array($this, 'sortProperties'));
+
+ $template
+ ->setFile($this->getTemplatePath('todo'))
+ ->save($this->forceDir($this->getTemplateFileName('todo')));
+
+ foreach ($this->getElementTypes() as $type) {
+ unset($template->{'todo' . ucfirst($type)});
+ }
+ unset($template->todoMethods);
+ unset($template->todoProperties);
+
+ $this->incrementProgressBar();
+ $this->checkMemory();
+
+ return $this;
+ }
+
+ /**
+ * Generates classes/interfaces/traits/exceptions tree.
+ *
+ * @param \ApiGen\Template $template Template
+ * @return \ApiGen\Generator
+ * @throws \RuntimeException If template is not set.
+ */
+ private function generateTree(Template $template)
+ {
+ $this->prepareTemplate('tree');
+
+ $classTree = array();
+ $interfaceTree = array();
+ $traitTree = array();
+ $exceptionTree = array();
+
+ $processed = array();
+ foreach ($this->parsedClasses as $className => $reflection) {
+ if (!$reflection->isMain() || !$reflection->isDocumented() || isset($processed[$className])) {
+ continue;
+ }
+
+ if (null === $reflection->getParentClassName()) {
+ // No parent classes
+ if ($reflection->isInterface()) {
+ $t = &$interfaceTree;
+ } elseif ($reflection->isTrait()) {
+ $t = &$traitTree;
+ } elseif ($reflection->isException()) {
+ $t = &$exceptionTree;
+ } else {
+ $t = &$classTree;
+ }
+ } else {
+ foreach (array_values(array_reverse($reflection->getParentClasses())) as $level => $parent) {
+ if (0 === $level) {
+ // The topmost parent decides about the reflection type
+ if ($parent->isInterface()) {
+ $t = &$interfaceTree;
+ } elseif ($parent->isTrait()) {
+ $t = &$traitTree;
+ } elseif ($parent->isException()) {
+ $t = &$exceptionTree;
+ } else {
+ $t = &$classTree;
+ }
+ }
+ $parentName = $parent->getName();
+
+ if (!isset($t[$parentName])) {
+ $t[$parentName] = array();
+ $processed[$parentName] = true;
+ ksort($t, SORT_STRING);
+ }
+
+ $t = &$t[$parentName];
+ }
+ }
+ $t[$className] = array();
+ ksort($t, SORT_STRING);
+ $processed[$className] = true;
+ unset($t);
+ }
+
+ $template->classTree = new Tree($classTree, $this->parsedClasses);
+ $template->interfaceTree = new Tree($interfaceTree, $this->parsedClasses);
+ $template->traitTree = new Tree($traitTree, $this->parsedClasses);
+ $template->exceptionTree = new Tree($exceptionTree, $this->parsedClasses);
+
+ $template
+ ->setFile($this->getTemplatePath('tree'))
+ ->save($this->forceDir($this->getTemplateFileName('tree')));
+
+ unset($template->classTree);
+ unset($template->interfaceTree);
+ unset($template->traitTree);
+ unset($template->exceptionTree);
+
+ $this->incrementProgressBar();
+ $this->checkMemory();
+
+ return $this;
+ }
+
+ /**
+ * Generates packages summary.
+ *
+ * @param \ApiGen\Template $template Template
+ * @return \ApiGen\Generator
+ * @throws \RuntimeException If template is not set.
+ */
+ private function generatePackages(Template $template)
+ {
+ if (empty($this->packages)) {
+ return $this;
+ }
+
+ $this->prepareTemplate('package');
+
+ $template->namespace = null;
+
+ foreach ($this->packages as $packageName => $package) {
+ $template->package = $packageName;
+ $template->subpackages = array_filter($template->packages, function($subpackageName) use ($packageName) {
+ return (bool) preg_match('~^' . preg_quote($packageName) . '\\\\[^\\\\]+$~', $subpackageName);
+ });
+ $template->classes = $package['classes'];
+ $template->interfaces = $package['interfaces'];
+ $template->traits = $package['traits'];
+ $template->exceptions = $package['exceptions'];
+ $template->constants = $package['constants'];
+ $template->functions = $package['functions'];
+ $template
+ ->setFile($this->getTemplatePath('package'))
+ ->save($this->config->destination . DIRECTORY_SEPARATOR . $template->getPackageUrl($packageName));
+
+ $this->incrementProgressBar();
+ }
+ unset($template->subpackages);
+
+ $this->checkMemory();
+
+ return $this;
+ }
+
+ /**
+ * Generates namespaces summary.
+ *
+ * @param \ApiGen\Template $template Template
+ * @return \ApiGen\Generator
+ * @throws \RuntimeException If template is not set.
+ */
+ private function generateNamespaces(Template $template)
+ {
+ if (empty($this->namespaces)) {
+ return $this;
+ }
+
+ $this->prepareTemplate('namespace');
+
+ $template->package = null;
+
+ foreach ($this->namespaces as $namespaceName => $namespace) {
+ $template->namespace = $namespaceName;
+ $template->subnamespaces = array_filter($template->namespaces, function($subnamespaceName) use ($namespaceName) {
+ return (bool) preg_match('~^' . preg_quote($namespaceName) . '\\\\[^\\\\]+$~', $subnamespaceName);
+ });
+ $template->classes = $namespace['classes'];
+ $template->interfaces = $namespace['interfaces'];
+ $template->traits = $namespace['traits'];
+ $template->exceptions = $namespace['exceptions'];
+ $template->constants = $namespace['constants'];
+ $template->functions = $namespace['functions'];
+ $template
+ ->setFile($this->getTemplatePath('namespace'))
+ ->save($this->config->destination . DIRECTORY_SEPARATOR . $template->getNamespaceUrl($namespaceName));
+
+ $this->incrementProgressBar();
+ }
+ unset($template->subnamespaces);
+
+ $this->checkMemory();
+
+ return $this;
+ }
+
+ /**
+ * Generate classes, interfaces, traits, exceptions, constants and functions files.
+ *
+ * @param Template $template Template
+ * @return \ApiGen\Generator
+ * @throws \RuntimeException If template is not set.
+ */
+ private function generateElements(Template $template)
+ {
+ if (!empty($this->classes) || !empty($this->interfaces) || !empty($this->traits) || !empty($this->exceptions)) {
+ $this->prepareTemplate('class');
+ }
+ if (!empty($this->constants)) {
+ $this->prepareTemplate('constant');
+ }
+ if (!empty($this->functions)) {
+ $this->prepareTemplate('function');
+ }
+ if ($this->config->sourceCode) {
+ $this->prepareTemplate('source');
+
+ $fshl = new FSHL\Highlighter(new FSHL\Output\Html(), FSHL\Highlighter::OPTION_TAB_INDENT | FSHL\Highlighter::OPTION_LINE_COUNTER);
+ $fshl->setLexer(new FSHL\Lexer\Php());
+ }
+
+ // Add @usedby annotation
+ foreach ($this->getElementTypes() as $type) {
+ foreach ($this->$type as $parentElement) {
+ $elements = array($parentElement);
+ if ($parentElement instanceof ReflectionClass) {
+ $elements = array_merge(
+ $elements,
+ array_values($parentElement->getOwnMethods()),
+ array_values($parentElement->getOwnConstants()),
+ array_values($parentElement->getOwnProperties())
+ );
+ }
+ foreach ($elements as $element) {
+ $uses = $element->getAnnotation('uses');
+ if (null === $uses) {
+ continue;
+ }
+ foreach ($uses as $value) {
+ list($link, $description) = preg_split('~\s+|$~', $value, 2);
+ $resolved = $this->resolveElement($link, $element);
+ if (null !== $resolved) {
+ $resolved->addAnnotation('usedby', $element->getPrettyName() . ' ' . $description);
+ }
+ }
+ }
+ }
+ }
+
+ $template->package = null;
+ $template->namespace = null;
+ $template->classes = $this->classes;
+ $template->interfaces = $this->interfaces;
+ $template->traits = $this->traits;
+ $template->exceptions = $this->exceptions;
+ $template->constants = $this->constants;
+ $template->functions = $this->functions;
+ foreach ($this->getElementTypes() as $type) {
+ foreach ($this->$type as $element) {
+ if (!empty($this->namespaces)) {
+ $template->namespace = $namespaceName = $element->getPseudoNamespaceName();
+ $template->classes = $this->namespaces[$namespaceName]['classes'];
+ $template->interfaces = $this->namespaces[$namespaceName]['interfaces'];
+ $template->traits = $this->namespaces[$namespaceName]['traits'];
+ $template->exceptions = $this->namespaces[$namespaceName]['exceptions'];
+ $template->constants = $this->namespaces[$namespaceName]['constants'];
+ $template->functions = $this->namespaces[$namespaceName]['functions'];
+ } elseif (!empty($this->packages)) {
+ $template->package = $packageName = $element->getPseudoPackageName();
+ $template->classes = $this->packages[$packageName]['classes'];
+ $template->interfaces = $this->packages[$packageName]['interfaces'];
+ $template->traits = $this->packages[$packageName]['traits'];
+ $template->exceptions = $this->packages[$packageName]['exceptions'];
+ $template->constants = $this->packages[$packageName]['constants'];
+ $template->functions = $this->packages[$packageName]['functions'];
+ }
+
+ $template->class = null;
+ $template->constant = null;
+ $template->function = null;
+ if ($element instanceof ReflectionClass) {
+ // Class
+ $template->tree = array_merge(array_reverse($element->getParentClasses()), array($element));
+
+ $template->directSubClasses = $element->getDirectSubClasses();
+ uksort($template->directSubClasses, 'strcasecmp');
+ $template->indirectSubClasses = $element->getIndirectSubClasses();
+ uksort($template->indirectSubClasses, 'strcasecmp');
+
+ $template->directImplementers = $element->getDirectImplementers();
+ uksort($template->directImplementers, 'strcasecmp');
+ $template->indirectImplementers = $element->getIndirectImplementers();
+ uksort($template->indirectImplementers, 'strcasecmp');
+
+ $template->directUsers = $element->getDirectUsers();
+ uksort($template->directUsers, 'strcasecmp');
+ $template->indirectUsers = $element->getIndirectUsers();
+ uksort($template->indirectUsers, 'strcasecmp');
+
+ $template->class = $element;
+
+ $template
+ ->setFile($this->getTemplatePath('class'))
+ ->save($this->config->destination . DIRECTORY_SEPARATOR . $template->getClassUrl($element));
+ } elseif ($element instanceof ReflectionConstant) {
+ // Constant
+ $template->constant = $element;
+
+ $template
+ ->setFile($this->getTemplatePath('constant'))
+ ->save($this->config->destination . DIRECTORY_SEPARATOR . $template->getConstantUrl($element));
+ } elseif ($element instanceof ReflectionFunction) {
+ // Function
+ $template->function = $element;
+
+ $template
+ ->setFile($this->getTemplatePath('function'))
+ ->save($this->config->destination . DIRECTORY_SEPARATOR . $template->getFunctionUrl($element));
+ }
+
+ $this->incrementProgressBar();
+
+ // Generate source codes
+ if ($this->config->sourceCode && $element->isTokenized()) {
+ $template->fileName = $this->getRelativePath($element->getFileName());
+ $template->source = $fshl->highlight($this->toUtf(file_get_contents($element->getFileName()), $this->charsets[$element->getFileName()]));
+ $template
+ ->setFile($this->getTemplatePath('source'))
+ ->save($this->config->destination . DIRECTORY_SEPARATOR . $template->getSourceUrl($element, false));
+
+ $this->incrementProgressBar();
+ }
+
+ $this->checkMemory();
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Creates ZIP archive.
+ *
+ * @return \ApiGen\Generator
+ * @throws \RuntimeException If something went wrong.
+ */
+ private function generateArchive()
+ {
+ if (!extension_loaded('zip')) {
+ throw new RuntimeException('Extension zip is not loaded');
+ }
+
+ $archive = new \ZipArchive();
+ if (true !== $archive->open($this->getArchivePath(), \ZipArchive::CREATE)) {
+ throw new RuntimeException('Could not open ZIP archive');
+ }
+
+ $archive->setArchiveComment(trim(sprintf('%s API documentation generated by %s %s on %s', $this->config->title, self::NAME, self::VERSION, date('Y-m-d H:i:s'))));
+
+ $directory = Nette\Utils\Strings::webalize(trim(sprintf('%s API documentation', $this->config->title)), null, false);
+ $destinationLength = strlen($this->config->destination);
+ foreach ($this->getGeneratedFiles() as $file) {
+ if (is_file($file)) {
+ $archive->addFile($file, $directory . DIRECTORY_SEPARATOR . substr($file, $destinationLength + 1));
+ }
+ }
+
+ if (false === $archive->close()) {
+ throw new RuntimeException('Could not save ZIP archive');
+ }
+
+ $this->incrementProgressBar();
+ $this->checkMemory();
+
+ return $this;
+ }
+
+ /**
+ * Tries to resolve string as class, interface or exception name.
+ *
+ * @param string $className Class name description
+ * @param string $namespace Namespace name
+ * @return \ApiGen\ReflectionClass
+ */
+ public function getClass($className, $namespace = '')
+ {
+ if (isset($this->parsedClasses[$namespace . '\\' . $className])) {
+ $class = $this->parsedClasses[$namespace . '\\' . $className];
+ } elseif (isset($this->parsedClasses[ltrim($className, '\\')])) {
+ $class = $this->parsedClasses[ltrim($className, '\\')];
+ } else {
+ return null;
+ }
+
+ // Class is not "documented"
+ if (!$class->isDocumented()) {
+ return null;
+ }
+
+ return $class;
+ }
+
+ /**
+ * Tries to resolve type as constant name.
+ *
+ * @param string $constantName Constant name
+ * @param string $namespace Namespace name
+ * @return \ApiGen\ReflectionConstant
+ */
+ public function getConstant($constantName, $namespace = '')
+ {
+ if (isset($this->parsedConstants[$namespace . '\\' . $constantName])) {
+ $constant = $this->parsedConstants[$namespace . '\\' . $constantName];
+ } elseif (isset($this->parsedConstants[ltrim($constantName, '\\')])) {
+ $constant = $this->parsedConstants[ltrim($constantName, '\\')];
+ } else {
+ return null;
+ }
+
+ // Constant is not "documented"
+ if (!$constant->isDocumented()) {
+ return null;
+ }
+
+ return $constant;
+ }
+
+ /**
+ * Tries to resolve type as function name.
+ *
+ * @param string $functionName Function name
+ * @param string $namespace Namespace name
+ * @return \ApiGen\ReflectionFunction
+ */
+ public function getFunction($functionName, $namespace = '')
+ {
+ if (isset($this->parsedFunctions[$namespace . '\\' . $functionName])) {
+ $function = $this->parsedFunctions[$namespace . '\\' . $functionName];
+ } elseif (isset($this->parsedFunctions[ltrim($functionName, '\\')])) {
+ $function = $this->parsedFunctions[ltrim($functionName, '\\')];
+ } else {
+ return null;
+ }
+
+ // Function is not "documented"
+ if (!$function->isDocumented()) {
+ return null;
+ }
+
+ return $function;
+ }
+
+ /**
+ * Tries to parse a definition of a class/method/property/constant/function and returns the appropriate instance if successful.
+ *
+ * @param string $definition Definition
+ * @param \ApiGen\ReflectionElement|\ApiGen\ReflectionParameter $context Link context
+ * @param string $expectedName Expected element name
+ * @return \ApiGen\ReflectionElement|null
+ */
+ public function resolveElement($definition, $context, &$expectedName = null)
+ {
+ // No simple type resolving
+ static $types = array(
+ 'boolean' => 1, 'integer' => 1, 'float' => 1, 'string' => 1,
+ 'array' => 1, 'object' => 1, 'resource' => 1, 'callback' => 1,
+ 'callable' => 1, 'null' => 1, 'false' => 1, 'true' => 1, 'mixed' => 1
+ );
+
+ if (empty($definition) || isset($types[$definition])) {
+ return null;
+ }
+
+ $originalContext = $context;
+
+ if ($context instanceof ReflectionParameter && null === $context->getDeclaringClassName()) {
+ // Parameter of function in namespace or global space
+ $context = $this->getFunction($context->getDeclaringFunctionName());
+ } elseif ($context instanceof ReflectionMethod || $context instanceof ReflectionParameter
+ || ($context instanceof ReflectionConstant && null !== $context->getDeclaringClassName())
+ || $context instanceof ReflectionProperty
+ ) {
+ // Member of a class
+ $context = $this->getClass($context->getDeclaringClassName());
+ }
+
+ if (null === $context) {
+ return null;
+ }
+
+ // self, $this references
+ if ('self' === $definition || '$this' === $definition) {
+ return $context instanceof ReflectionClass ? $context : null;
+ }
+
+ $definitionBase = substr($definition, 0, strcspn($definition, '\\:'));
+ $namespaceAliases = $context->getNamespaceAliases();
+ if (!empty($definitionBase) && isset($namespaceAliases[$definitionBase]) && $definition !== ($className = \TokenReflection\Resolver::resolveClassFQN($definition, $namespaceAliases, $context->getNamespaceName()))) {
+ // Aliased class
+ $expectedName = $className;
+
+ if (false === strpos($className, ':')) {
+ return $this->getClass($className, $context->getNamespaceName());
+ } else {
+ $definition = $className;
+ }
+ } elseif ($class = $this->getClass($definition, $context->getNamespaceName())) {
+ // Class
+ return $class;
+ } elseif ($constant = $this->getConstant($definition, $context->getNamespaceName())) {
+ // Constant
+ return $constant;
+ } elseif (($function = $this->getFunction($definition, $context->getNamespaceName()))
+ || ('()' === substr($definition, -2) && ($function = $this->getFunction(substr($definition, 0, -2), $context->getNamespaceName())))
+ ) {
+ // Function
+ return $function;
+ }
+
+ if (($pos = strpos($definition, '::')) || ($pos = strpos($definition, '->'))) {
+ // Class::something or Class->something
+ if (0 === strpos($definition, 'parent::') && ($parentClassName = $context->getParentClassName())) {
+ $context = $this->getClass($parentClassName);
+ } elseif (0 !== strpos($definition, 'self::')) {
+ $class = $this->getClass(substr($definition, 0, $pos), $context->getNamespaceName());
+
+ if (null === $class) {
+ $class = $this->getClass(\TokenReflection\Resolver::resolveClassFQN(substr($definition, 0, $pos), $context->getNamespaceAliases(), $context->getNamespaceName()));
+ }
+
+ $context = $class;
+ }
+
+ $definition = substr($definition, $pos + 2);
+ } elseif ($originalContext instanceof ReflectionParameter) {
+ return null;
+ }
+
+ // No usable context
+ if (null === $context || $context instanceof ReflectionConstant || $context instanceof ReflectionFunction) {
+ return null;
+ }
+
+ if ($context->hasProperty($definition)) {
+ // Class property
+ return $context->getProperty($definition);
+ } elseif ('$' === $definition{0} && $context->hasProperty(substr($definition, 1))) {
+ // Class $property
+ return $context->getProperty(substr($definition, 1));
+ } elseif ($context->hasMethod($definition)) {
+ // Class method
+ return $context->getMethod($definition);
+ } elseif ('()' === substr($definition, -2) && $context->hasMethod(substr($definition, 0, -2))) {
+ // Class method()
+ return $context->getMethod(substr($definition, 0, -2));
+ } elseif ($context->hasConstant($definition)) {
+ // Class constant
+ return $context->getConstant($definition);
+ }
+
+ return null;
+ }
+
+ /**
+ * Prints message if printing is enabled.
+ *
+ * @param string $message Output message
+ */
+ public function output($message)
+ {
+ if (!$this->config->quiet) {
+ echo $this->colorize($message);
+ }
+ }
+
+ /**
+ * Colorizes message or removes placeholders if OS doesn't support colors.
+ *
+ * @param string $message
+ * @return string
+ */
+ public function colorize($message)
+ {
+ static $placeholders = array(
+ '@header@' => "\x1b[1;34m",
+ '@count@' => "\x1b[1;34m",
+ '@option@' => "\x1b[0;36m",
+ '@value@' => "\x1b[0;32m",
+ '@error@' => "\x1b[0;31m",
+ '@c' => "\x1b[0m"
+ );
+
+ if (!$this->config->colors) {
+ $placeholders = array_fill_keys(array_keys($placeholders), '');
+ }
+
+ return strtr($message, $placeholders);
+ }
+
+ /**
+ * Returns header.
+ *
+ * @return string
+ */
+ public function getHeader()
+ {
+ $name = sprintf('%s %s', self::NAME, self::VERSION);
+ return sprintf("@header@%s@c\n%s\n", $name, str_repeat('-', strlen($name)));
+ }
+
+ /**
+ * Removes phar:// from the path.
+ *
+ * @param string $path Path
+ * @return string
+ */
+ public function unPharPath($path)
+ {
+ if (0 === strpos($path, 'phar://')) {
+ $path = substr($path, 7);
+ }
+ return $path;
+ }
+
+ /**
+ * Adds phar:// to the path.
+ *
+ * @param string $path Path
+ * @return string
+ */
+ private function pharPath($path)
+ {
+ return 'phar://' . $path;
+ }
+
+ /**
+ * Checks if given path is a phar.
+ *
+ * @param string $path
+ * @return boolean
+ */
+ private function isPhar($path)
+ {
+ return (bool) preg_match('~\\.phar(?:\\.zip|\\.tar|(?:(?:\\.tar)?(?:\\.gz|\\.bz2))|$)~i', $path);
+ }
+
+ /**
+ * Normalizes directory separators in given path.
+ *
+ * @param string $path Path
+ * @return string
+ */
+ private function normalizePath($path)
+ {
+ $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
+ $path = str_replace('phar:\\\\', 'phar://', $path);
+ return $path;
+ }
+
+ /**
+ * Prepares the progressbar.
+ *
+ * @param integer $maximum Maximum progressbar value
+ */
+ private function prepareProgressBar($maximum = 1)
+ {
+ if (!$this->config->progressbar) {
+ return;
+ }
+
+ $this->progressbar['current'] = 0;
+ $this->progressbar['maximum'] = $maximum;
+ }
+
+ /**
+ * Increments the progressbar by one.
+ *
+ * @param integer $increment Progressbar increment
+ */
+ private function incrementProgressBar($increment = 1)
+ {
+ if (!$this->config->progressbar) {
+ return;
+ }
+
+ echo str_repeat(chr(0x08), $this->progressbar['width']);
+
+ $this->progressbar['current'] += $increment;
+
+ $percent = $this->progressbar['current'] / $this->progressbar['maximum'];
+
+ $progress = str_pad(str_pad('>', round($percent * $this->progressbar['bar']), '=', STR_PAD_LEFT), $this->progressbar['bar'], ' ', STR_PAD_RIGHT);
+
+ echo sprintf($this->progressbar['skeleton'], $progress, $percent * 100, round(memory_get_usage(true) / 1024 / 1024));
+
+ if ($this->progressbar['current'] === $this->progressbar['maximum']) {
+ echo "\n";
+ }
+ }
+
+ /**
+ * Checks memory usage.
+ *
+ * @return \ApiGen\Generator
+ * @throws \RuntimeException If there is unsufficient reserve of memory.
+ */
+ public function checkMemory()
+ {
+ static $limit = null;
+ if (null === $limit) {
+ $value = ini_get('memory_limit');
+ $unit = substr($value, -1);
+ if ('-1' === $value) {
+ $limit = 0;
+ } elseif ('G' === $unit) {
+ $limit = (int) $value * 1024 * 1024 * 1024;
+ } elseif ('M' === $unit) {
+ $limit = (int) $value * 1024 * 1024;
+ } else {
+ $limit = (int) $value;
+ }
+ }
+
+ if ($limit && memory_get_usage(true) / $limit >= 0.9) {
+ throw new RuntimeException(sprintf('Used %d%% of the current memory limit, please increase the limit to generate the whole documentation.', round(memory_get_usage(true) / $limit * 100)));
+ }
+
+ return $this;
+ }
+
+ /**
+ * Detects character set for the given text.
+ *
+ * @param string $text Text
+ * @return string
+ */
+ private function detectCharset($text)
+ {
+ // One character set
+ if (1 === count($this->config->charset) && 'AUTO' !== $this->config->charset[0]) {
+ return $this->config->charset[0];
+ }
+
+ static $charsets = array();
+ if (empty($charsets)) {
+ if (1 === count($this->config->charset) && 'AUTO' === $this->config->charset[0]) {
+ // Autodetection
+ $charsets = array(
+ 'Windows-1251', 'Windows-1252', 'ISO-8859-2', 'ISO-8859-1', 'ISO-8859-3', 'ISO-8859-4', 'ISO-8859-5', 'ISO-8859-6',
+ 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9', 'ISO-8859-10', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15'
+ );
+ } else {
+ // More character sets
+ $charsets = $this->config->charset;
+ if (false !== ($key = array_search('WINDOWS-1250', $charsets))) {
+ // WINDOWS-1250 is not supported
+ $charsets[$key] = 'ISO-8859-2';
+ }
+ }
+ // Only supported character sets
+ $charsets = array_intersect($charsets, mb_list_encodings());
+
+ // UTF-8 have to be first
+ array_unshift($charsets, 'UTF-8');
+ }
+
+ $charset = mb_detect_encoding($text, $charsets);
+ // The previous function can not handle WINDOWS-1250 and returns ISO-8859-2 instead
+ if ('ISO-8859-2' === $charset && preg_match('~[\x7F-\x9F\xBC]~', $text)) {
+ $charset = 'WINDOWS-1250';
+ }
+
+ return $charset;
+ }
+
+ /**
+ * Converts text from given character set to UTF-8.
+ *
+ * @param string $text Text
+ * @param string $charset Character set
+ * @return string
+ */
+ private function toUtf($text, $charset)
+ {
+ if ('UTF-8' === $charset) {
+ return $text;
+ }
+
+ return @iconv($charset, 'UTF-8//TRANSLIT//IGNORE', $text);
+ }
+
+ /**
+ * Checks if sitemap.xml is enabled.
+ *
+ * @return boolean
+ */
+ private function isSitemapEnabled()
+ {
+ return !empty($this->config->baseUrl) && $this->templateExists('sitemap', 'optional');
+ }
+
+ /**
+ * Checks if opensearch.xml is enabled.
+ *
+ * @return boolean
+ */
+ private function isOpensearchEnabled()
+ {
+ return !empty($this->config->googleCseId) && !empty($this->config->baseUrl) && $this->templateExists('opensearch', 'optional');
+ }
+
+ /**
+ * Checks if robots.txt is enabled.
+ *
+ * @return boolean
+ */
+ private function isRobotsEnabled()
+ {
+ return !empty($this->config->baseUrl) && $this->templateExists('robots', 'optional');
+ }
+
+ /**
+ * Sorts methods by FQN.
+ *
+ * @param \ApiGen\ReflectionMethod $one
+ * @param \ApiGen\ReflectionMethod $two
+ * @return integer
+ */
+ private function sortMethods(ReflectionMethod $one, ReflectionMethod $two)
+ {
+ return strcasecmp($one->getDeclaringClassName() . '::' . $one->getName(), $two->getDeclaringClassName() . '::' . $two->getName());
+ }
+
+ /**
+ * Sorts constants by FQN.
+ *
+ * @param \ApiGen\ReflectionConstant $one
+ * @param \ApiGen\ReflectionConstant $two
+ * @return integer
+ */
+ private function sortConstants(ReflectionConstant $one, ReflectionConstant $two)
+ {
+ return strcasecmp(($one->getDeclaringClassName() ?: $one->getNamespaceName()) . '\\' . $one->getName(), ($two->getDeclaringClassName() ?: $two->getNamespaceName()) . '\\' . $two->getName());
+ }
+
+ /**
+ * Sorts functions by FQN.
+ *
+ * @param \ApiGen\ReflectionFunction $one
+ * @param \ApiGen\ReflectionFunction $two
+ * @return integer
+ */
+ private function sortFunctions(ReflectionFunction $one, ReflectionFunction $two)
+ {
+ return strcasecmp($one->getNamespaceName() . '\\' . $one->getName(), $two->getNamespaceName() . '\\' . $two->getName());
+ }
+
+ /**
+ * Sorts functions by FQN.
+ *
+ * @param \ApiGen\ReflectionProperty $one
+ * @param \ApiGen\ReflectionProperty $two
+ * @return integer
+ */
+ private function sortProperties(ReflectionProperty $one, ReflectionProperty $two)
+ {
+ return strcasecmp($one->getDeclaringClassName() . '::' . $one->getName(), $two->getDeclaringClassName() . '::' . $two->getName());
+ }
+
+ /**
+ * Returns list of element types.
+ *
+ * @return array
+ */
+ private function getElementTypes()
+ {
+ static $types = array('classes', 'interfaces', 'traits', 'exceptions', 'constants', 'functions');
+ return $types;
+ }
+
+ /**
+ * Returns main filter.
+ *
+ * @return \Closure
+ */
+ private function getMainFilter()
+ {
+ return function($element) {
+ return $element->isMain();
+ };
+ }
+
+ /**
+ * Returns ZIP archive path.
+ *
+ * @return string
+ */
+ private function getArchivePath()
+ {
+ $name = trim(sprintf('%s API documentation', $this->config->title));
+ return $this->config->destination . DIRECTORY_SEPARATOR . Nette\Utils\Strings::webalize($name) . '.zip';
+ }
+
+ /**
+ * Returns filename relative path to the source directory.
+ *
+ * @param string $fileName
+ * @return string
+ * @throws \InvalidArgumentException If relative path could not be determined.
+ */
+ public function getRelativePath($fileName)
+ {
+ if (isset($this->symlinks[$fileName])) {
+ $fileName = $this->symlinks[$fileName];
+ }
+ foreach ($this->config->source as $source) {
+ if ($this->isPhar($source)) {
+ $source = $this->pharPath($source);
+ }
+ if (0 === strpos($fileName, $source)) {
+ return is_dir($source) ? str_replace('\\', '/', substr($fileName, strlen($source) + 1)) : basename($fileName);
+ }
+ }
+
+ throw new InvalidArgumentException(sprintf('Could not determine "%s" relative path', $fileName));
+ }
+
+ /**
+ * Returns template directory.
+ *
+ * @return string
+ */
+ private function getTemplateDir()
+ {
+ return dirname($this->config->templateConfig);
+ }
+
+ /**
+ * Returns template path.
+ *
+ * @param string $name Template name
+ * @param string $type Template type
+ * @return string
+ */
+ private function getTemplatePath($name, $type = 'main')
+ {
+ return $this->getTemplateDir() . DIRECTORY_SEPARATOR . $this->config->template['templates'][$type][$name]['template'];
+ }
+
+ /**
+ * Returns template filename.
+ *
+ * @param string $name Template name
+ * @param string $type Template type
+ * @return string
+ */
+ private function getTemplateFileName($name, $type = 'main')
+ {
+ return $this->config->destination . DIRECTORY_SEPARATOR . $this->config->template['templates'][$type][$name]['filename'];
+ }
+
+ /**
+ * Checks if template exists.
+ *
+ * @param string $name Template name
+ * @param string $type Template type
+ * @return string
+ */
+ private function templateExists($name, $type = 'main')
+ {
+ return isset($this->config->template['templates'][$type][$name]);
+ }
+
+ /**
+ * Checks if template exists and creates dir.
+ *
+ * @param string $name
+ * @throws \RuntimeException If template is not set.
+ */
+ private function prepareTemplate($name)
+ {
+ if (!$this->templateExists($name)) {
+ throw new RuntimeException(sprintf('Template for "%s" is not set', $name));
+ }
+
+ $this->forceDir($this->getTemplateFileName($name));
+ return $this;
+ }
+
+ /**
+ * Returns list of all generated files.
+ *
+ * @return array
+ */
+ private function getGeneratedFiles()
+ {
+ $files = array();
+
+ // Resources
+ foreach ($this->config->template['resources'] as $item) {
+ $path = $this->getTemplateDir() . DIRECTORY_SEPARATOR . $item;
+ if (is_dir($path)) {
+ $iterator = Nette\Utils\Finder::findFiles('*')->from($path)->getIterator();
+ foreach ($iterator as $innerItem) {
+ $files[] = $this->config->destination . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . $iterator->getSubPathName();
+ }
+ } else {
+ $files[] = $this->config->destination . DIRECTORY_SEPARATOR . $item;
+ }
+ }
+
+ // Common files
+ foreach ($this->config->template['templates']['common'] as $item) {
+ $files[] = $this->config->destination . DIRECTORY_SEPARATOR . $item;
+ }
+
+ // Optional files
+ foreach ($this->config->template['templates']['optional'] as $optional) {
+ $files[] = $this->config->destination . DIRECTORY_SEPARATOR . $optional['filename'];
+ }
+
+ // Main files
+ $masks = array_map(function($config) {
+ return preg_replace('~%[^%]*?s~', '*', $config['filename']);
+ }, $this->config->template['templates']['main']);
+ $filter = function($item) use ($masks) {
+ foreach ($masks as $mask) {
+ if (fnmatch($mask, $item->getFilename())) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ foreach (Nette\Utils\Finder::findFiles('*')->filter($filter)->from($this->config->destination) as $item) {
+ $files[] = $item->getPathName();
+ }
+
+ return $files;
+ }
+
+ /**
+ * Ensures a directory is created.
+ *
+ * @param string $path Directory path
+ * @return string
+ */
+ private function forceDir($path)
+ {
+ @mkdir(dirname($path), 0755, true);
+ return $path;
+ }
+
+ /**
+ * Deletes a directory.
+ *
+ * @param string $path Directory path
+ * @return boolean
+ */
+ private function deleteDir($path)
+ {
+ if (!is_dir($path)) {
+ return true;
+ }
+
+ foreach (Nette\Utils\Finder::find('*')->from($path)->childFirst() as $item) {
+ if ($item->isDir()) {
+ if (!@rmdir($item)) {
+ return false;
+ }
+ } elseif ($item->isFile()) {
+ if (!@unlink($item)) {
+ return false;
+ }
+ }
+ }
+ if (!@rmdir($path)) {
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/IHelperSet.php b/vendor/apigen/apigen/ApiGen/IHelperSet.php
new file mode 100644
index 0000000..911c838
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/IHelperSet.php
@@ -0,0 +1,28 @@
+getConfig();
+ self::$parsedClasses = $generator->getParsedClasses();
+ self::$parsedConstants = $generator->getParsedConstants();
+ self::$parsedFunctions = $generator->getParsedFunctions();
+ }
+
+ $this->reflectionType = get_class($this);
+ if (!isset(self::$reflectionMethods[$this->reflectionType])) {
+ self::$reflectionMethods[$this->reflectionType] = array_flip(get_class_methods($this));
+ }
+
+ $this->reflection = $reflection;
+ }
+
+ /**
+ * Retrieves a property or method value.
+ *
+ * First tries the envelope object's property storage, then its methods
+ * and finally the inspected element reflection.
+ *
+ * @param string $name Property name
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ $key = ucfirst($name);
+ if (isset(self::$reflectionMethods[$this->reflectionType]['get' . $key])) {
+ return $this->{'get' . $key}();
+ }
+
+ if (isset(self::$reflectionMethods[$this->reflectionType]['is' . $key])) {
+ return $this->{'is' . $key}();
+ }
+
+ return $this->reflection->__get($name);
+ }
+
+ /**
+ * Checks if the given property exists.
+ *
+ * First tries the envelope object's property storage, then its methods
+ * and finally the inspected element reflection.
+ *
+ * @param mixed $name Property name
+ * @return boolean
+ */
+ public function __isset($name)
+ {
+ $key = ucfirst($name);
+ return isset(self::$reflectionMethods[$this->reflectionType]['get' . $key]) || isset(self::$reflectionMethods[$this->reflectionType]['is' . $key]) || $this->reflection->__isset($name);
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->reflection->getBroker();
+ }
+
+ /**
+ * Returns the name (FQN).
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->reflection->getName();
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return $this->reflection->getPrettyName();
+ }
+
+ /**
+ * Returns if the reflection object is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return $this->reflection->isInternal();
+ }
+
+ /**
+ * Returns if the reflection object is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return $this->reflection->isUserDefined();
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return $this->reflection->isTokenized();
+ }
+
+ /**
+ * Returns the file name the reflection object is defined in.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->reflection->getFileName();
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return integer
+ */
+ public function getStartLine()
+ {
+ $startLine = $this->reflection->getStartLine();
+
+ if ($doc = $this->getDocComment()) {
+ $startLine -= substr_count($doc, "\n") + 1;
+ }
+
+ return $startLine;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return integer
+ */
+ public function getEndLine()
+ {
+ return $this->reflection->getEndLine();
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionClass.php b/vendor/apigen/apigen/ApiGen/ReflectionClass.php
new file mode 100644
index 0000000..8053cd6
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionClass.php
@@ -0,0 +1,1421 @@
+accessLevels as $level) {
+ switch (strtolower($level)) {
+ case 'public':
+ self::$methodAccessLevels |= InternalReflectionMethod::IS_PUBLIC;
+ self::$propertyAccessLevels |= InternalReflectionProperty::IS_PUBLIC;
+ break;
+ case 'protected':
+ self::$methodAccessLevels |= InternalReflectionMethod::IS_PROTECTED;
+ self::$propertyAccessLevels |= InternalReflectionProperty::IS_PROTECTED;
+ break;
+ case 'private':
+ self::$methodAccessLevels |= InternalReflectionMethod::IS_PRIVATE;
+ self::$propertyAccessLevels |= InternalReflectionProperty::IS_PRIVATE;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the unqualified name (UQN).
+ *
+ * @return string
+ */
+ public function getShortName()
+ {
+ return $this->reflection->getShortName();
+ }
+
+ /**
+ * Returns modifiers.
+ *
+ * @return array
+ */
+ public function getModifiers()
+ {
+ return $this->reflection->getModifiers();
+ }
+
+ /**
+ * Returns if the class is abstract.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ return $this->reflection->isAbstract();
+ }
+
+ /**
+ * Returns if the class is final.
+ *
+ * @return boolean
+ */
+ public function isFinal()
+ {
+ return $this->reflection->isFinal();
+ }
+
+ /**
+ * Returns if the class is an interface.
+ *
+ * @return boolean
+ */
+ public function isInterface()
+ {
+ return $this->reflection->isInterface();
+ }
+
+ /**
+ * Returns if the class is an exception or its descendant.
+ *
+ * @return boolean
+ */
+ public function isException()
+ {
+ return $this->reflection->isException();
+ }
+
+ /**
+ * Returns if the current class is a subclass of the given class.
+ *
+ * @param string $class Class name
+ * @return boolean
+ */
+ public function isSubclassOf($class)
+ {
+ return $this->reflection->isSubclassOf($class);
+ }
+
+ /**
+ * Returns visible methods.
+ *
+ * @return array
+ */
+ public function getMethods()
+ {
+ if (null === $this->methods) {
+ $this->methods = $this->getOwnMethods();
+ foreach ($this->reflection->getMethods(self::$methodAccessLevels) as $method) {
+ if (isset($this->methods[$method->getName()])) {
+ continue;
+ }
+ $apiMethod = new ReflectionMethod($method, self::$generator);
+ if (!$this->isDocumented() || $apiMethod->isDocumented()) {
+ $this->methods[$method->getName()] = $apiMethod;
+ }
+ }
+ }
+ return $this->methods;
+ }
+
+ /**
+ * Returns visible methods declared by inspected class.
+ *
+ * @return array
+ */
+ public function getOwnMethods()
+ {
+ if (null === $this->ownMethods) {
+ $this->ownMethods = array();
+ foreach ($this->reflection->getOwnMethods(self::$methodAccessLevels) as $method) {
+ $apiMethod = new ReflectionMethod($method, self::$generator);
+ if (!$this->isDocumented() || $apiMethod->isDocumented()) {
+ $this->ownMethods[$method->getName()] = $apiMethod;
+ }
+ }
+ }
+ return $this->ownMethods;
+ }
+
+ /**
+ * Returns visible magic methods.
+ *
+ * @return array
+ */
+ public function getMagicMethods()
+ {
+ $methods = $this->getOwnMagicMethods();
+
+ $parent = $this->getParentClass();
+ while ($parent) {
+ foreach ($parent->getOwnMagicMethods() as $method) {
+ if (isset($methods[$method->getName()])) {
+ continue;
+ }
+
+ if (!$this->isDocumented() || $method->isDocumented()) {
+ $methods[$method->getName()] = $method;
+ }
+ }
+ $parent = $parent->getParentClass();
+ }
+
+ foreach ($this->getTraits() as $trait) {
+ foreach ($trait->getOwnMagicMethods() as $method) {
+ if (isset($methods[$method->getName()])) {
+ continue;
+ }
+
+ if (!$this->isDocumented() || $method->isDocumented()) {
+ $methods[$method->getName()] = $method;
+ }
+ }
+ }
+
+ return $methods;
+ }
+
+ /**
+ * Returns visible magic methods declared by inspected class.
+ *
+ * @return array
+ */
+ public function getOwnMagicMethods()
+ {
+ if (null === $this->ownMagicMethods) {
+ $this->ownMagicMethods = array();
+
+ if (!(self::$methodAccessLevels & InternalReflectionMethod::IS_PUBLIC) || false === $this->getDocComment()) {
+ return $this->ownMagicMethods;
+ }
+
+ $annotations = $this->getAnnotation('method');
+ if (null === $annotations) {
+ return $this->ownMagicMethods;
+ }
+
+ foreach ($annotations as $annotation) {
+ if (!preg_match('~^(?:([\\w\\\\]+(?:\\|[\\w\\\\]+)*)\\s+)?(&)?\\s*(\\w+)\\s*\\(\\s*(.*)\\s*\\)\\s*(.*|$)~s', $annotation, $matches)) {
+ // Wrong annotation format
+ continue;
+ }
+
+ list(, $returnTypeHint, $returnsReference, $name, $args, $shortDescription) = $matches;
+
+ $doc = $this->getDocComment();
+ $tmp = $annotation;
+ if ($delimiter = strpos($annotation, "\n")) {
+ $tmp = substr($annotation, 0, $delimiter);
+ }
+
+ $startLine = $this->getStartLine() + substr_count(substr($doc, 0, strpos($doc, $tmp)), "\n");
+ $endLine = $startLine + substr_count($annotation, "\n");
+
+ $method = new ReflectionMethodMagic(null, self::$generator);
+ $method
+ ->setName($name)
+ ->setShortDescription(str_replace("\n", ' ', $shortDescription))
+ ->setStartLine($startLine)
+ ->setEndLine($endLine)
+ ->setReturnsReference('&' === $returnsReference)
+ ->setDeclaringClass($this)
+ ->addAnnotation('return', $returnTypeHint);
+
+ $this->ownMagicMethods[$name] = $method;
+
+ $parameters = array();
+ foreach (array_filter(preg_split('~\\s*,\\s*~', $args)) as $position => $arg) {
+ if (!preg_match('~^(?:([\\w\\\\]+(?:\\|[\\w\\\\]+)*)\\s+)?(&)?\\s*\\$(\\w+)(?:\\s*=\\s*(.*))?($)~s', $arg, $matches)) {
+ // Wrong annotation format
+ continue;
+ }
+
+ list(, $typeHint, $passedByReference, $name, $defaultValueDefinition) = $matches;
+
+ if (empty($typeHint)) {
+ $typeHint = 'mixed';
+ }
+
+ $parameter = new ReflectionParameterMagic(null, self::$generator);
+ $parameter
+ ->setName($name)
+ ->setPosition($position)
+ ->setTypeHint($typeHint)
+ ->setDefaultValueDefinition($defaultValueDefinition)
+ ->setUnlimited(false)
+ ->setPassedByReference('&' === $passedByReference)
+ ->setDeclaringFunction($method);
+
+ $parameters[$name] = $parameter;
+
+ $method->addAnnotation('param', ltrim(sprintf('%s $%s', $typeHint, $name)));
+ }
+ $method->setParameters($parameters);
+ }
+ }
+ return $this->ownMagicMethods;
+ }
+
+ /**
+ * Returns visible methods declared by traits.
+ *
+ * @return array
+ */
+ public function getTraitMethods()
+ {
+ $methods = array();
+ foreach ($this->reflection->getTraitMethods(self::$methodAccessLevels) as $method) {
+ $apiMethod = new ReflectionMethod($method, self::$generator);
+ if (!$this->isDocumented() || $apiMethod->isDocumented()) {
+ $methods[$method->getName()] = $apiMethod;
+ }
+ }
+ return $methods;
+ }
+
+ /**
+ * Returns a method reflection.
+ *
+ * @param string $name Method name
+ * @return \ApiGen\ReflectionMethod
+ * @throws \InvalidArgumentException If required method does not exist.
+ */
+ public function getMethod($name)
+ {
+ if ($this->hasMethod($name)) {
+ return $this->methods[$name];
+ }
+
+ throw new InvalidArgumentException(sprintf('Method %s does not exist in class %s', $name, $this->reflection->getName()));
+ }
+
+ /**
+ * Returns visible properties.
+ *
+ * @return array
+ */
+ public function getProperties()
+ {
+ if (null === $this->properties) {
+ $this->properties = $this->getOwnProperties();
+ foreach ($this->reflection->getProperties(self::$propertyAccessLevels) as $property) {
+ if (isset($this->properties[$property->getName()])) {
+ continue;
+ }
+ $apiProperty = new ReflectionProperty($property, self::$generator);
+ if (!$this->isDocumented() || $apiProperty->isDocumented()) {
+ $this->properties[$property->getName()] = $apiProperty;
+ }
+ }
+ }
+ return $this->properties;
+ }
+
+ /**
+ * Returns visible magic properties.
+ *
+ * @return array
+ */
+ public function getMagicProperties()
+ {
+ $properties = $this->getOwnMagicProperties();
+
+ $parent = $this->getParentClass();
+ while ($parent) {
+ foreach ($parent->getOwnMagicProperties() as $property) {
+ if (isset($properties[$method->getName()])) {
+ continue;
+ }
+
+ if (!$this->isDocumented() || $property->isDocumented()) {
+ $properties[$property->getName()] = $property;
+ }
+ }
+ $parent = $parent->getParentClass();
+ }
+
+ foreach ($this->getTraits() as $trait) {
+ foreach ($trait->getOwnMagicProperties() as $property) {
+ if (isset($properties[$method->getName()])) {
+ continue;
+ }
+
+ if (!$this->isDocumented() || $property->isDocumented()) {
+ $properties[$property->getName()] = $property;
+ }
+ }
+ }
+
+ return $properties;
+ }
+
+ /**
+ * Returns visible properties declared by inspected class.
+ *
+ * @return array
+ */
+ public function getOwnProperties()
+ {
+ if (null === $this->ownProperties) {
+ $this->ownProperties = array();
+ foreach ($this->reflection->getOwnProperties(self::$propertyAccessLevels) as $property) {
+ $apiProperty = new ReflectionProperty($property, self::$generator);
+ if (!$this->isDocumented() || $apiProperty->isDocumented()) {
+ $this->ownProperties[$property->getName()] = $apiProperty;
+ }
+ }
+ }
+ return $this->ownProperties;
+ }
+
+ /**
+ * Returns visible properties magicly declared by inspected class.
+ *
+ * @return array
+ */
+ public function getOwnMagicProperties()
+ {
+ if (null === $this->ownMagicProperties) {
+ $this->ownMagicProperties = array();
+
+ if (!(self::$propertyAccessLevels & InternalReflectionProperty::IS_PUBLIC) || false === $this->getDocComment()) {
+ return $this->ownMagicProperties;
+ }
+
+ foreach (array('property', 'property-read', 'property-write') as $annotationName) {
+ $annotations = $this->getAnnotation($annotationName);
+ if (null === $annotations) {
+ continue;
+ }
+
+ foreach ($annotations as $annotation) {
+ if (!preg_match('~^(?:([\\w\\\\]+(?:\\|[\\w\\\\]+)*)\\s+)?\\$(\\w+)(?:\\s+(.*))?($)~s', $annotation, $matches)) {
+ // Wrong annotation format
+ continue;
+ }
+
+ list(, $typeHint, $name, $shortDescription) = $matches;
+
+ if (empty($typeHint)) {
+ $typeHint = 'mixed';
+ }
+
+ $doc = $this->getDocComment();
+ $tmp = $annotation;
+ if ($delimiter = strpos($annotation, "\n")) {
+ $tmp = substr($annotation, 0, $delimiter);
+ }
+
+ $startLine = $this->getStartLine() + substr_count(substr($doc, 0, strpos($doc, $tmp)), "\n");
+ $endLine = $startLine + substr_count($annotation, "\n");
+
+ $magicProperty = new ReflectionPropertyMagic(null, self::$generator);
+ $magicProperty
+ ->setName($name)
+ ->setTypeHint($typeHint)
+ ->setShortDescription(str_replace("\n", ' ', $shortDescription))
+ ->setStartLine($startLine)
+ ->setEndLine($endLine)
+ ->setReadOnly('property-read' === $annotationName)
+ ->setWriteOnly('property-write' === $annotationName)
+ ->setDeclaringClass($this)
+ ->addAnnotation('var', $typeHint);
+
+ $this->ownMagicProperties[$name] = $magicProperty;
+ }
+ }
+ }
+
+ return $this->ownMagicProperties;
+ }
+
+ /**
+ * Returns visible properties declared by traits.
+ *
+ * @return array
+ */
+ public function getTraitProperties()
+ {
+ $properties = array();
+ foreach ($this->reflection->getTraitProperties(self::$propertyAccessLevels) as $property) {
+ $apiProperty = new ReflectionProperty($property, self::$generator);
+ if (!$this->isDocumented() || $apiProperty->isDocumented()) {
+ $properties[$property->getName()] = $apiProperty;
+ }
+ }
+ return $properties;
+ }
+
+ /**
+ * Returns a method property.
+ *
+ * @param string $name Method name
+ * @return \ApiGen\ReflectionProperty
+ * @throws \InvalidArgumentException If required property does not exist.
+ */
+ public function getProperty($name)
+ {
+ if ($this->hasProperty($name)) {
+ return $this->properties[$name];
+ }
+
+ throw new InvalidArgumentException(sprintf('Property %s does not exist in class %s', $name, $this->reflection->getName()));
+ }
+
+ /**
+ * Returns visible properties.
+ *
+ * @return array
+ */
+ public function getConstants()
+ {
+ if (null === $this->constants) {
+ $this->constants = array();
+ foreach ($this->reflection->getConstantReflections() as $constant) {
+ $apiConstant = new ReflectionConstant($constant, self::$generator);
+ if (!$this->isDocumented() || $apiConstant->isDocumented()) {
+ $this->constants[$constant->getName()] = $apiConstant;
+ }
+ }
+ }
+
+ return $this->constants;
+ }
+
+ /**
+ * Returns constants declared by inspected class.
+ *
+ * @return array
+ */
+ public function getOwnConstants()
+ {
+ if (null === $this->ownConstants) {
+ $this->ownConstants = array();
+ $className = $this->reflection->getName();
+ foreach ($this->getConstants() as $constantName => $constant) {
+ if ($className === $constant->getDeclaringClassName()) {
+ $this->ownConstants[$constantName] = $constant;
+ }
+ }
+ }
+ return $this->ownConstants;
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @return \ApiGen\ReflectionConstant
+ * @throws \InvalidArgumentException If required constant does not exist.
+ */
+ public function getConstantReflection($name)
+ {
+ if (null === $this->constants) {
+ $this->getConstants();
+ }
+
+ if (isset($this->constants[$name])) {
+ return $this->constants[$name];
+ }
+
+ throw new InvalidArgumentException(sprintf('Constant %s does not exist in class %s', $name, $this->reflection->getName()));
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @return \ApiGen\ReflectionConstant
+ */
+ public function getConstant($name)
+ {
+ return $this->getConstantReflection($name);
+ }
+
+ /**
+ * Checks if there is a constant of the given name.
+ *
+ * @param string $constantName Constant name
+ * @return boolean
+ */
+ public function hasConstant($constantName)
+ {
+ if (null === $this->constants) {
+ $this->getConstants();
+ }
+
+ return isset($this->constants[$constantName]);
+ }
+
+ /**
+ * Checks if there is a constant of the given name.
+ *
+ * @param string $constantName Constant name
+ * @return boolean
+ */
+ public function hasOwnConstant($constantName)
+ {
+ if (null === $this->ownConstants) {
+ $this->getOwnConstants();
+ }
+
+ return isset($this->ownConstants[$constantName]);
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @return \ApiGen\ReflectionConstant
+ * @throws \InvalidArgumentException If required constant does not exist.
+ */
+ public function getOwnConstantReflection($name)
+ {
+ if (null === $this->ownConstants) {
+ $this->getOwnConstants();
+ }
+
+ if (isset($this->ownConstants[$name])) {
+ return $this->ownConstants[$name];
+ }
+
+ throw new InvalidArgumentException(sprintf('Constant %s does not exist in class %s', $name, $this->reflection->getName()));
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @return \ApiGen\ReflectionConstant
+ */
+ public function getOwnConstant($name)
+ {
+ return $this->getOwnConstantReflection($name);
+ }
+
+ /**
+ * Returns a parent class reflection encapsulated by this class.
+ *
+ * @return \ApiGen\ReflectionClass
+ */
+ public function getParentClass()
+ {
+ if ($className = $this->reflection->getParentClassName()) {
+ return self::$parsedClasses[$className];
+ }
+ return $className;
+ }
+
+ /**
+ * Returns the parent class name.
+ *
+ * @return string|null
+ */
+ public function getParentClassName()
+ {
+ return $this->reflection->getParentClassName();
+ }
+
+ /**
+ * Returns all parent classes reflections encapsulated by this class.
+ *
+ * @return array
+ */
+ public function getParentClasses()
+ {
+ if (null === $this->parentClasses) {
+ $classes = self::$parsedClasses;
+ $this->parentClasses = array_map(function(IReflectionClass $class) use ($classes) {
+ return $classes[$class->getName()];
+ }, $this->reflection->getParentClasses());
+ }
+ return $this->parentClasses;
+ }
+
+
+ /**
+ * Returns the parent classes names.
+ *
+ * @return array
+ */
+ public function getParentClassNameList()
+ {
+ return $this->reflection->getParentClassNameList();
+ }
+
+ /**
+ * Returns if the class implements the given interface.
+ *
+ * @param string|object $interface Interface name or reflection object
+ * @return boolean
+ */
+ public function implementsInterface($interface)
+ {
+ return $this->reflection->implementsInterface($interface);
+ }
+
+ /**
+ * Returns all interface reflections encapsulated by this class.
+ *
+ * @return array
+ */
+ public function getInterfaces()
+ {
+ $classes = self::$parsedClasses;
+ return array_map(function(IReflectionClass $class) use ($classes) {
+ return $classes[$class->getName()];
+ }, $this->reflection->getInterfaces());
+ }
+
+ /**
+ * Returns interface names.
+ *
+ * @return array
+ */
+ public function getInterfaceNames()
+ {
+ return $this->reflection->getInterfaceNames();
+ }
+
+ /**
+ * Returns all interfaces implemented by the inspected class and not its parents.
+ *
+ * @return array
+ */
+ public function getOwnInterfaces()
+ {
+ $classes = self::$parsedClasses;
+ return array_map(function(IReflectionClass $class) use ($classes) {
+ return $classes[$class->getName()];
+ }, $this->reflection->getOwnInterfaces());
+ }
+
+ /**
+ * Returns names of interfaces implemented by this class, not its parents.
+ *
+ * @return array
+ */
+ public function getOwnInterfaceNames()
+ {
+ return $this->reflection->getOwnInterfaceNames();
+ }
+
+ /**
+ * Returns all traits reflections encapsulated by this class.
+ *
+ * @return array
+ */
+ public function getTraits()
+ {
+ $classes = self::$parsedClasses;
+ return array_map(function(IReflectionClass $class) use ($classes) {
+ return $classes[$class->getName()];
+ }, $this->reflection->getTraits());
+ }
+
+ /**
+ * Returns names of used traits.
+ *
+ * @return array
+ */
+ public function getTraitNames()
+ {
+ return $this->reflection->getTraitNames();
+ }
+
+ /**
+ * Returns names of traits used by this class an not its parents.
+ *
+ * @return array
+ */
+ public function getOwnTraitNames()
+ {
+ return $this->reflection->getOwnTraitNames();
+ }
+
+ /**
+ * Returns method aliases from traits.
+ *
+ * @return array
+ */
+ public function getTraitAliases()
+ {
+ return $this->reflection->getTraitAliases();
+ }
+
+ /**
+ * Returns all traits used by the inspected class and not its parents.
+ *
+ * @return array
+ */
+ public function getOwnTraits()
+ {
+ $classes = self::$parsedClasses;
+ return array_map(function(IReflectionClass $class) use ($classes) {
+ if (!isset($classes[$class->getName()])) {
+ throw new InvalidArgumentException(sprintf('The class %s is in use but has not been found in the defined sources.', $class->getName()));
+ }
+ return $classes[$class->getName()];
+ }, $this->reflection->getOwnTraits());
+ }
+
+ /**
+ * Returns if the class is a trait.
+ *
+ * @return boolean
+ */
+ public function isTrait()
+ {
+ return $this->reflection->isTrait();
+ }
+
+ /**
+ * Returns if the class uses a particular trait.
+ *
+ * @param string $trait Trait name
+ * @return boolean
+ */
+ public function usesTrait($trait)
+ {
+ return $this->reflection->usesTrait($trait);
+ }
+
+ /**
+ * Returns reflections of direct subclasses.
+ *
+ * @return array
+ */
+ public function getDirectSubClasses()
+ {
+ $subClasses = array();
+ $name = $this->reflection->getName();
+ foreach (self::$parsedClasses as $class) {
+ if (!$class->isDocumented()) {
+ continue;
+ }
+ if ($name === $class->getParentClassName()) {
+ $subClasses[] = $class;
+ }
+ }
+ return $subClasses;
+ }
+
+ /**
+ * Returns reflections of indirect subclasses.
+ *
+ * @return array
+ */
+ public function getIndirectSubClasses()
+ {
+ $subClasses = array();
+ $name = $this->reflection->getName();
+ foreach (self::$parsedClasses as $class) {
+ if (!$class->isDocumented()) {
+ continue;
+ }
+ if ($name !== $class->getParentClassName() && $class->isSubclassOf($name)) {
+ $subClasses[] = $class;
+ }
+ }
+ return $subClasses;
+ }
+
+ /**
+ * Returns reflections of classes directly implementing this interface.
+ *
+ * @return array
+ */
+ public function getDirectImplementers()
+ {
+ if (!$this->isInterface()) {
+ return array();
+ }
+
+ $implementers = array();
+ $name = $this->reflection->getName();
+ foreach (self::$parsedClasses as $class) {
+ if (!$class->isDocumented()) {
+ continue;
+ }
+ if (in_array($name, $class->getOwnInterfaceNames())) {
+ $implementers[] = $class;
+ }
+ }
+ return $implementers;
+ }
+
+ /**
+ * Returns reflections of classes indirectly implementing this interface.
+ *
+ * @return array
+ */
+ public function getIndirectImplementers()
+ {
+ if (!$this->isInterface()) {
+ return array();
+ }
+
+ $implementers = array();
+ $name = $this->reflection->getName();
+ foreach (self::$parsedClasses as $class) {
+ if (!$class->isDocumented()) {
+ continue;
+ }
+ if ($class->implementsInterface($name) && !in_array($name, $class->getOwnInterfaceNames())) {
+ $implementers[] = $class;
+ }
+ }
+ return $implementers;
+ }
+
+ /**
+ * Returns reflections of classes directly using this trait.
+ *
+ * @return array
+ */
+ public function getDirectUsers()
+ {
+ if (!$this->isTrait()) {
+ return array();
+ }
+
+ $users = array();
+ $name = $this->reflection->getName();
+ foreach (self::$parsedClasses as $class) {
+ if (!$class->isDocumented()) {
+ continue;
+ }
+
+ if (in_array($name, $class->getOwnTraitNames())) {
+ $users[] = $class;
+ }
+ }
+ return $users;
+ }
+
+ /**
+ * Returns reflections of classes indirectly using this trait.
+ *
+ * @return array
+ */
+ public function getIndirectUsers()
+ {
+ if (!$this->isTrait()) {
+ return array();
+ }
+
+ $users = array();
+ $name = $this->reflection->getName();
+ foreach (self::$parsedClasses as $class) {
+ if (!$class->isDocumented()) {
+ continue;
+ }
+ if ($class->usesTrait($name) && !in_array($name, $class->getOwnTraitNames())) {
+ $users[] = $class;
+ }
+ }
+ return $users;
+ }
+
+ /**
+ * Returns an array of inherited methods from parent classes grouped by the declaring class name.
+ *
+ * @return array
+ */
+ public function getInheritedMethods()
+ {
+ $methods = array();
+ $allMethods = array_flip(array_map(function($method) {
+ return $method->getName();
+ }, $this->getOwnMethods()));
+
+ foreach (array_merge($this->getParentClasses(), $this->getInterfaces()) as $class) {
+ $inheritedMethods = array();
+ foreach ($class->getOwnMethods() as $method) {
+ if (!array_key_exists($method->getName(), $allMethods) && !$method->isPrivate()) {
+ $inheritedMethods[$method->getName()] = $method;
+ $allMethods[$method->getName()] = null;
+ }
+ }
+
+ if (!empty($inheritedMethods)) {
+ ksort($inheritedMethods);
+ $methods[$class->getName()] = array_values($inheritedMethods);
+ }
+ }
+
+ return $methods;
+ }
+
+ /**
+ * Returns an array of inherited magic methods from parent classes grouped by the declaring class name.
+ *
+ * @return array
+ */
+ public function getInheritedMagicMethods()
+ {
+ $methods = array();
+ $allMethods = array_flip(array_map(function($method) {
+ return $method->getName();
+ }, $this->getOwnMagicMethods()));
+
+ foreach (array_merge($this->getParentClasses(), $this->getInterfaces()) as $class) {
+ $inheritedMethods = array();
+ foreach ($class->getOwnMagicMethods() as $method) {
+ if (!array_key_exists($method->getName(), $allMethods)) {
+ $inheritedMethods[$method->getName()] = $method;
+ $allMethods[$method->getName()] = null;
+ }
+ }
+
+ if (!empty($inheritedMethods)) {
+ ksort($inheritedMethods);
+ $methods[$class->getName()] = array_values($inheritedMethods);
+ }
+ }
+
+ return $methods;
+ }
+
+ /**
+ * Returns an array of used methods from used traits grouped by the declaring trait name.
+ *
+ * @return array
+ */
+ public function getUsedMethods()
+ {
+ $usedMethods = array();
+ foreach ($this->getMethods() as $method) {
+ if (null === $method->getDeclaringTraitName() || $this->getName() === $method->getDeclaringTraitName()) {
+ continue;
+ }
+
+ $usedMethods[$method->getDeclaringTraitName()][$method->getName()]['method'] = $method;
+ if (null !== $method->getOriginalName() && $method->getName() !== $method->getOriginalName()) {
+ $usedMethods[$method->getDeclaringTraitName()][$method->getName()]['aliases'][$method->getName()] = $method;
+ }
+ }
+
+ // Sort
+ array_walk($usedMethods, function(&$methods) {
+ ksort($methods);
+ array_walk($methods, function(&$aliasedMethods) {
+ if (!isset($aliasedMethods['aliases'])) {
+ $aliasedMethods['aliases'] = array();
+ }
+ ksort($aliasedMethods['aliases']);
+ });
+ });
+
+ return $usedMethods;
+ }
+
+ /**
+ * Returns an array of used magic methods from used traits grouped by the declaring trait name.
+ *
+ * @return array
+ */
+ public function getUsedMagicMethods()
+ {
+ $usedMethods = array();
+
+ foreach ($this->getMagicMethods() as $method) {
+ if (null === $method->getDeclaringTraitName() || $this->getName() === $method->getDeclaringTraitName()) {
+ continue;
+ }
+
+ $usedMethods[$method->getDeclaringTraitName()][$method->getName()]['method'] = $method;
+ }
+
+ // Sort
+ array_walk($usedMethods, function(&$methods) {
+ ksort($methods);
+ array_walk($methods, function(&$aliasedMethods) {
+ if (!isset($aliasedMethods['aliases'])) {
+ $aliasedMethods['aliases'] = array();
+ }
+ ksort($aliasedMethods['aliases']);
+ });
+ });
+
+ return $usedMethods;
+ }
+
+ /**
+ * Returns an array of inherited constants from parent classes grouped by the declaring class name.
+ *
+ * @return array
+ */
+ public function getInheritedConstants()
+ {
+ return array_filter(
+ array_map(
+ function(ReflectionClass $class) {
+ $reflections = $class->getOwnConstants();
+ ksort($reflections);
+ return $reflections;
+ },
+ array_merge($this->getParentClasses(), $this->getInterfaces())
+ )
+ );
+ }
+
+ /**
+ * Returns an array of inherited properties from parent classes grouped by the declaring class name.
+ *
+ * @return array
+ */
+ public function getInheritedProperties()
+ {
+ $properties = array();
+ $allProperties = array_flip(array_map(function($property) {
+ return $property->getName();
+ }, $this->getOwnProperties()));
+
+ foreach ($this->getParentClasses() as $class) {
+ $inheritedProperties = array();
+ foreach ($class->getOwnProperties() as $property) {
+ if (!array_key_exists($property->getName(), $allProperties) && !$property->isPrivate()) {
+ $inheritedProperties[$property->getName()] = $property;
+ $allProperties[$property->getName()] = null;
+ }
+ }
+
+ if (!empty($inheritedProperties)) {
+ ksort($inheritedProperties);
+ $properties[$class->getName()] = array_values($inheritedProperties);
+ }
+ }
+
+ return $properties;
+ }
+
+ /**
+ * Returns an array of inherited magic properties from parent classes grouped by the declaring class name.
+ *
+ * @return array
+ */
+ public function getInheritedMagicProperties()
+ {
+ $properties = array();
+ $allProperties = array_flip(array_map(function($property) {
+ return $property->getName();
+ }, $this->getOwnMagicProperties()));
+
+ foreach ($this->getParentClasses() as $class) {
+ $inheritedProperties = array();
+ foreach ($class->getOwnMagicProperties() as $property) {
+ if (!array_key_exists($property->getName(), $allProperties)) {
+ $inheritedProperties[$property->getName()] = $property;
+ $allProperties[$property->getName()] = null;
+ }
+ }
+
+ if (!empty($inheritedProperties)) {
+ ksort($inheritedProperties);
+ $properties[$class->getName()] = array_values($inheritedProperties);
+ }
+ }
+
+ return $properties;
+ }
+
+ /**
+ * Returns an array of used properties from used traits grouped by the declaring trait name.
+ *
+ * @return array
+ */
+ public function getUsedProperties()
+ {
+ $properties = array();
+ $allProperties = array_flip(array_map(function($property) {
+ return $property->getName();
+ }, $this->getOwnProperties()));
+
+ foreach ($this->getTraits() as $trait) {
+ $usedProperties = array();
+ foreach ($trait->getOwnProperties() as $property) {
+ if (!array_key_exists($property->getName(), $allProperties)) {
+ $usedProperties[$property->getName()] = $property;
+ $allProperties[$property->getName()] = null;
+ }
+ }
+
+ if (!empty($usedProperties)) {
+ ksort($usedProperties);
+ $properties[$trait->getName()] = array_values($usedProperties);
+ }
+ }
+
+ return $properties;
+ }
+
+ /**
+ * Returns an array of used magic properties from used traits grouped by the declaring trait name.
+ *
+ * @return array
+ */
+ public function getUsedMagicProperties()
+ {
+ $properties = array();
+ $allProperties = array_flip(array_map(function($property) {
+ return $property->getName();
+ }, $this->getOwnMagicProperties()));
+
+ foreach ($this->getTraits() as $trait) {
+ $usedProperties = array();
+ foreach ($trait->getOwnMagicProperties() as $property) {
+ if (!array_key_exists($property->getName(), $allProperties)) {
+ $usedProperties[$property->getName()] = $property;
+ $allProperties[$property->getName()] = null;
+ }
+ }
+
+ if (!empty($usedProperties)) {
+ ksort($usedProperties);
+ $properties[$trait->getName()] = array_values($usedProperties);
+ }
+ }
+
+ return $properties;
+ }
+
+ /**
+ * Checks if there is a property of the given name.
+ *
+ * @param string $propertyName Property name
+ * @return boolean
+ */
+ public function hasProperty($propertyName)
+ {
+ if (null === $this->properties) {
+ $this->getProperties();
+ }
+
+ return isset($this->properties[$propertyName]);
+ }
+
+ /**
+ * Checks if there is a property of the given name.
+ *
+ * @param string $propertyName Property name
+ * @return boolean
+ */
+ public function hasOwnProperty($propertyName)
+ {
+ if (null === $this->ownProperties) {
+ $this->getOwnProperties();
+ }
+
+ return isset($this->ownProperties[$propertyName]);
+ }
+
+ /**
+ * Checks if there is a property of the given name.
+ *
+ * @param string $propertyName Property name
+ * @return boolean
+ */
+ public function hasTraitProperty($propertyName)
+ {
+ $properties = $this->getTraitProperties();
+ return isset($properties[$propertyName]);
+ }
+
+ /**
+ * Checks if there is a method of the given name.
+ *
+ * @param string $methodName Method name
+ * @return boolean
+ */
+ public function hasMethod($methodName)
+ {
+ if (null === $this->methods) {
+ $this->getMethods();
+ }
+
+ return isset($this->methods[$methodName]);
+ }
+
+ /**
+ * Checks if there is a method of the given name.
+ *
+ * @param string $methodName Method name
+ * @return boolean
+ */
+ public function hasOwnMethod($methodName)
+ {
+ if (null === $this->ownMethods) {
+ $this->getOwnMethods();
+ }
+
+ return isset($this->ownMethods[$methodName]);
+ }
+
+ /**
+ * Checks if there is a method of the given name.
+ *
+ * @param string $methodName Method name
+ * @return boolean
+ */
+ public function hasTraitMethod($methodName)
+ {
+ $methods = $this->getTraitMethods();
+ return isset($methods[$methodName]);
+ }
+
+ /**
+ * Returns if the class is valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ if ($this->reflection instanceof TokenReflection\Invalid\ReflectionClass) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns if the class should be documented.
+ *
+ * @return boolean
+ */
+ public function isDocumented()
+ {
+ if (null === $this->isDocumented && parent::isDocumented()) {
+ $fileName = self::$generator->unPharPath($this->reflection->getFilename());
+ foreach (self::$config->skipDocPath as $mask) {
+ if (fnmatch($mask, $fileName, FNM_NOESCAPE)) {
+ $this->isDocumented = false;
+ break;
+ }
+ }
+ if (true === $this->isDocumented) {
+ foreach (self::$config->skipDocPrefix as $prefix) {
+ if (0 === strpos($this->reflection->getName(), $prefix)) {
+ $this->isDocumented = false;
+ break;
+ }
+ }
+ }
+ }
+
+ return $this->isDocumented;
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionConstant.php b/vendor/apigen/apigen/ApiGen/ReflectionConstant.php
new file mode 100644
index 0000000..c7993aa
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionConstant.php
@@ -0,0 +1,145 @@
+reflection->getShortName();
+ }
+
+ /**
+ * Returns constant type hint.
+ *
+ * @return string
+ */
+ public function getTypeHint()
+ {
+ if ($annotations = $this->getAnnotation('var')) {
+ list($types) = preg_split('~\s+|$~', $annotations[0], 2);
+ if (!empty($types)) {
+ return $types;
+ }
+ }
+
+ try {
+ $type = gettype($this->getValue());
+ if ('null' !== strtolower($type)) {
+ return $type;
+ }
+ } catch (\Exception $e) {
+ // Nothing
+ }
+
+ return 'mixed';
+ }
+
+ /**
+ * Returns the constant declaring class.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getDeclaringClass()
+ {
+ $className = $this->reflection->getDeclaringClassName();
+ return null === $className ? null : self::$parsedClasses[$className];
+ }
+
+ /**
+ * Returns the name of the declaring class.
+ *
+ * @return string|null
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->reflection->getDeclaringClassName();
+ }
+
+ /**
+ * Returns the constant value.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->reflection->getValue();
+ }
+
+ /**
+ * Returns the constant value definition.
+ *
+ * @return string
+ */
+ public function getValueDefinition()
+ {
+ return $this->reflection->getValueDefinition();
+ }
+
+ /**
+ * Returns if the constant is valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ if ($this->reflection instanceof \TokenReflection\Invalid\ReflectionConstant) {
+ return false;
+ }
+
+ if ($class = $this->getDeclaringClass()) {
+ return $class->isValid();
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns if the constant should be documented.
+ *
+ * @return boolean
+ */
+ public function isDocumented()
+ {
+ if (null === $this->isDocumented && parent::isDocumented() && null === $this->reflection->getDeclaringClassName()) {
+ $fileName = self::$generator->unPharPath($this->reflection->getFilename());
+ foreach (self::$config->skipDocPath as $mask) {
+ if (fnmatch($mask, $fileName, FNM_NOESCAPE)) {
+ $this->isDocumented = false;
+ break;
+ }
+ }
+ if (true === $this->isDocumented) {
+ foreach (self::$config->skipDocPrefix as $prefix) {
+ if (0 === strpos($this->reflection->getName(), $prefix)) {
+ $this->isDocumented = false;
+ break;
+ }
+ }
+ }
+ }
+
+ return $this->isDocumented;
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionElement.php b/vendor/apigen/apigen/ApiGen/ReflectionElement.php
new file mode 100644
index 0000000..8f12485
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionElement.php
@@ -0,0 +1,373 @@
+reflection->getExtension();
+ return null === $extension ? null : new ReflectionExtension($extension, self::$generator);
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * @return boolean
+ */
+ public function getExtensionName()
+ {
+ return $this->reflection->getExtensionName();
+ }
+
+ /**
+ * Returns the start position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getStartPosition()
+ {
+ return $this->reflection->getStartPosition();
+ }
+
+ /**
+ * Returns the end position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getEndPosition()
+ {
+ return $this->reflection->getEndPosition();
+ }
+
+ /**
+ * Returns if the element belongs to main project.
+ *
+ * @return boolean
+ */
+ public function isMain()
+ {
+ return empty(self::$config->main) || 0 === strpos($this->getName(), self::$config->main);
+ }
+
+ /**
+ * Returns if the element should be documented.
+ *
+ * @return boolean
+ */
+ public function isDocumented()
+ {
+ if (null === $this->isDocumented) {
+ $this->isDocumented = $this->reflection->isTokenized() || $this->reflection->isInternal();
+
+ if ($this->isDocumented) {
+ if (!self::$config->php && $this->reflection->isInternal()) {
+ $this->isDocumented = false;
+ } elseif (!self::$config->deprecated && $this->reflection->isDeprecated()) {
+ $this->isDocumented = false;
+ } elseif (!self::$config->internal && ($internal = $this->reflection->getAnnotation('internal')) && empty($internal[0])) {
+ $this->isDocumented = false;
+ } elseif (count($this->reflection->getAnnotation('ignore')) > 0) {
+ $this->isDocumented = false;
+ }
+ }
+ }
+
+ return $this->isDocumented;
+ }
+
+ /**
+ * Returns if the element is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ if ($this->reflection->isDeprecated()) {
+ return true;
+ }
+
+ if (($this instanceof ReflectionMethod || $this instanceof ReflectionProperty || $this instanceof ReflectionConstant)
+ && $class = $this->getDeclaringClass()
+ ) {
+ return $class->isDeprecated();
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns if the element is in package.
+ *
+ * @return boolean
+ */
+ public function inPackage()
+ {
+ return '' !== $this->getPackageName();
+ }
+
+ /**
+ * Returns element package name (including subpackage name).
+ *
+ * @return string
+ */
+ public function getPackageName()
+ {
+ static $packages = array();
+
+ if ($package = $this->getAnnotation('package')) {
+ $packageName = preg_replace('~\s+.*~s', '', $package[0]);
+ if (empty($packageName)) {
+ return '';
+ }
+
+ if ($subpackage = $this->getAnnotation('subpackage')) {
+ $subpackageName = preg_replace('~\s+.*~s', '', $subpackage[0]);
+ if (empty($subpackageName)) {
+ // Do nothing
+ } elseif (0 === strpos($subpackageName, $packageName)) {
+ $packageName = $subpackageName;
+ } else {
+ $packageName .= '\\' . $subpackageName;
+ }
+ }
+ $packageName = strtr($packageName, '._/', '\\\\\\');
+
+ $lowerPackageName = strtolower($packageName);
+ if (!isset($packages[$lowerPackageName])) {
+ $packages[$lowerPackageName] = $packageName;
+ }
+
+ return $packages[$lowerPackageName];
+ }
+
+ return '';
+ }
+
+ /**
+ * Returns element package name (including subpackage name).
+ *
+ * For internal elements returns "PHP", for elements in global space returns "None".
+ *
+ * @return string
+ */
+ public function getPseudoPackageName()
+ {
+ if ($this->isInternal()) {
+ return 'PHP';
+ }
+
+ return $this->getPackageName() ?: 'None';
+ }
+
+ /**
+ * Returns if the element is defined within a namespace.
+ *
+ * @return boolean
+ */
+ public function inNamespace()
+ {
+ return '' !== $this->getNamespaceName();
+ }
+
+ /**
+ * Returns element namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ static $namespaces = array();
+
+ $namespaceName = $this->reflection->getNamespaceName();
+
+ if (!$namespaceName) {
+ return $namespaceName;
+ }
+
+ $lowerNamespaceName = strtolower($namespaceName);
+ if (!isset($namespaces[$lowerNamespaceName])) {
+ $namespaces[$lowerNamespaceName] = $namespaceName;
+ }
+
+ return $namespaces[$lowerNamespaceName];
+ }
+
+ /**
+ * Returns element namespace name.
+ *
+ * For internal elements returns "PHP", for elements in global space returns "None".
+ *
+ * @return string
+ */
+ public function getPseudoNamespaceName()
+ {
+ return $this->isInternal() ? 'PHP' : $this->getNamespaceName() ?: 'None';
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->reflection->getNamespaceAliases();
+ }
+
+ /**
+ * Returns the short description.
+ *
+ * @return string
+ */
+ public function getShortDescription()
+ {
+ $short = $this->reflection->getAnnotation(\TokenReflection\ReflectionAnnotation::SHORT_DESCRIPTION);
+ if (!empty($short)) {
+ return $short;
+ }
+
+ if ($this instanceof ReflectionProperty || $this instanceof ReflectionConstant) {
+ $var = $this->getAnnotation('var');
+ list(, $short) = preg_split('~\s+|$~', $var[0], 2);
+ }
+
+ return $short;
+ }
+
+ /**
+ * Returns the long description.
+ *
+ * @return string
+ */
+ public function getLongDescription()
+ {
+ $short = $this->getShortDescription();
+ $long = $this->reflection->getAnnotation(\TokenReflection\ReflectionAnnotation::LONG_DESCRIPTION);
+
+ if (!empty($long)) {
+ $short .= "\n\n" . $long;
+ }
+
+ return $short;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return string|boolean
+ */
+ public function getDocComment()
+ {
+ return $this->reflection->getDocComment();
+ }
+
+ /**
+ * Returns reflection element annotations.
+ *
+ * Removes the short and long description.
+ *
+ * In case of classes, functions and constants, @package, @subpackage, @author and @license annotations
+ * are added from declaring files if not already present.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ if (null === $this->annotations) {
+ static $fileLevel = array('package' => true, 'subpackage' => true, 'author' => true, 'license' => true, 'copyright' => true);
+
+ $annotations = $this->reflection->getAnnotations();
+ unset($annotations[\TokenReflection\ReflectionAnnotation::SHORT_DESCRIPTION]);
+ unset($annotations[\TokenReflection\ReflectionAnnotation::LONG_DESCRIPTION]);
+
+ if ($this->reflection instanceof \TokenReflection\ReflectionClass || $this->reflection instanceof \TokenReflection\ReflectionFunction || ($this->reflection instanceof \TokenReflection\ReflectionConstant && null === $this->reflection->getDeclaringClassName())) {
+ foreach ($this->reflection->getFileReflection()->getAnnotations() as $name => $value) {
+ if (isset($fileLevel[$name]) && empty($annotations[$name])) {
+ $annotations[$name] = $value;
+ }
+ }
+ }
+
+ $this->annotations = $annotations;
+ }
+
+ return $this->annotations;
+ }
+
+ /**
+ * Returns reflection element annotation.
+ *
+ * @param string $annotation Annotation name
+ * @return array
+ */
+ public function getAnnotation($annotation)
+ {
+ $annotations = $this->getAnnotations();
+ return isset($annotations[$annotation]) ? $annotations[$annotation] : null;
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $annotation Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($annotation)
+ {
+ $annotations = $this->getAnnotations();
+ return isset($annotations[$annotation]);
+ }
+
+ /**
+ * Adds element annotation.
+ *
+ * @param string $annotation Annotation name
+ * @param string $value Annotation value
+ * @return \ApiGen\ReflectionElement
+ */
+ public function addAnnotation($annotation, $value)
+ {
+ if (null === $this->annotations) {
+ $this->getAnnotations();
+ }
+ $this->annotations[$annotation][] = $value;
+
+ return $this;
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionExtension.php b/vendor/apigen/apigen/ApiGen/ReflectionExtension.php
new file mode 100644
index 0000000..1d636bc
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionExtension.php
@@ -0,0 +1,135 @@
+reflection->getClass($name);
+ if (null === $class) {
+ return null;
+ }
+ if (isset(self::$parsedClasses[$name])) {
+ return self::$parsedClasses[$name];
+ }
+ return new ReflectionClass($class, self::$generator);
+ }
+
+ /**
+ * Returns classes defined by this extension.
+ *
+ * @return array
+ */
+ public function getClasses()
+ {
+ $generator = self::$generator;
+ $classes = self::$parsedClasses;
+ return array_map(function(TokenReflection\IReflectionClass $class) use ($generator, $classes) {
+ return isset($classes[$class->getName()]) ? $classes[$class->getName()] : new ReflectionClass($class, $generator);
+ }, $this->reflection->getClasses());
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @return \ApiGen\ReflectionConstant|null
+ */
+ public function getConstant($name)
+ {
+ return $this->getConstantReflection($name);
+ }
+
+ /**
+ * Returns a constant reflection.
+ *
+ * @param string $name Constant name
+ * @return \ApiGen\ReflectionConstant|null
+ */
+ public function getConstantReflection($name)
+ {
+ $constant = $this->reflection->getConstantReflection($name);
+ return null === $constant ? null : new ReflectionConstant($constant, self::$generator);
+ }
+
+ /**
+ * Returns reflections of defined constants.
+ *
+ * @return array
+ */
+ public function getConstants()
+ {
+ return $this->getConstantReflections();
+ }
+
+ /**
+ * Returns reflections of defined constants.
+ *
+ * @return array
+ */
+ public function getConstantReflections()
+ {
+ $generator = self::$generator;
+ return array_map(function(TokenReflection\IReflectionConstant $constant) use ($generator) {
+ return new ReflectionConstant($constant, $generator);
+ }, $this->reflection->getConstantReflections());
+ }
+
+ /**
+ * Returns a function reflection.
+ *
+ * @param string $name Function name
+ * @return \ApiGen\ReflectionFunction
+ */
+ public function getFunction($name)
+ {
+ $function = $this->reflection->getFunction($name);
+ return null === $function ? null : new ReflectionFunction($function, self::$generator);
+ }
+
+ /**
+ * Returns functions defined by this extension.
+ *
+ * @return array
+ */
+ public function getFunctions()
+ {
+ $generator = self::$generator;
+ return array_map(function(TokenReflection\IReflectionFunction $function) use ($generator) {
+ return new ReflectionFunction($function, $generator);
+ }, $this->reflection->getFunctions());
+ }
+
+ /**
+ * Returns names of functions defined by this extension.
+ *
+ * @return array
+ */
+ public function getFunctionNames()
+ {
+ return $this->reflection->getFunctionNames();
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionFunction.php b/vendor/apigen/apigen/ApiGen/ReflectionFunction.php
new file mode 100644
index 0000000..75f2e40
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionFunction.php
@@ -0,0 +1,64 @@
+reflection instanceof \TokenReflection\Invalid\ReflectionFunction) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns if the function should be documented.
+ *
+ * @return boolean
+ */
+ public function isDocumented()
+ {
+ if (null === $this->isDocumented && parent::isDocumented()) {
+ $fileName = self::$generator->unPharPath($this->reflection->getFilename());
+ foreach (self::$config->skipDocPath as $mask) {
+ if (fnmatch($mask, $fileName, FNM_NOESCAPE)) {
+ $this->isDocumented = false;
+ break;
+ }
+ }
+ if (true === $this->isDocumented) {
+ foreach (self::$config->skipDocPrefix as $prefix) {
+ if (0 === strpos($this->reflection->getName(), $prefix)) {
+ $this->isDocumented = false;
+ break;
+ }
+ }
+ }
+ }
+
+ return $this->isDocumented;
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionFunctionBase.php b/vendor/apigen/apigen/ApiGen/ReflectionFunctionBase.php
new file mode 100644
index 0000000..a86326f
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionFunctionBase.php
@@ -0,0 +1,151 @@
+reflection->getShortName();
+ }
+
+ /**
+ * Returns if the function/method returns its value as reference.
+ *
+ * @return boolean
+ */
+ public function returnsReference()
+ {
+ return $this->reflection->returnsReference();
+ }
+
+ /**
+ * Returns a list of function/method parameters.
+ *
+ * @return array
+ */
+ public function getParameters()
+ {
+ if (null === $this->parameters) {
+ $generator = self::$generator;
+ $this->parameters = array_map(function(TokenReflection\IReflectionParameter $parameter) use ($generator) {
+ return new ReflectionParameter($parameter, $generator);
+ }, $this->reflection->getParameters());
+
+ $annotations = $this->getAnnotation('param');
+ if (null !== $annotations) {
+ foreach ($annotations as $position => $annotation) {
+ if (isset($parameters[$position])) {
+ // Standard parameter
+ continue;
+ }
+
+ if (!preg_match('~^(?:([\\w\\\\]+(?:\\|[\\w\\\\]+)*)\\s+)?\\$(\\w+),\\.{3}(?:\\s+(.*))?($)~s', $annotation, $matches)) {
+ // Wrong annotation format
+ continue;
+ }
+
+ list(, $typeHint, $name) = $matches;
+
+ if (empty($typeHint)) {
+ $typeHint = 'mixed';
+ }
+
+ $parameter = new ReflectionParameterMagic(null, self::$generator);
+ $parameter
+ ->setName($name)
+ ->setPosition($position)
+ ->setTypeHint($typeHint)
+ ->setDefaultValueDefinition(null)
+ ->setUnlimited(true)
+ ->setPassedByReference(false)
+ ->setDeclaringFunction($this);
+
+ $this->parameters[$position] = $parameter;
+ }
+ }
+ }
+
+ return $this->parameters;
+ }
+
+ /**
+ * Returns a particular function/method parameter.
+ *
+ * @param integer|string $parameterName Parameter name or position
+ * @return \ApiGen\ReflectionParameter
+ * @throws \InvalidArgumentException If there is no parameter of the given name.
+ * @throws \InvalidArgumentException If there is no parameter at the given position.
+ */
+ public function getParameter($parameterName)
+ {
+ $parameters = $this->getParameters();
+
+ if (is_numeric($parameterName)) {
+ if (isset($parameters[$parameterName])) {
+ return $parameters[$parameterName];
+ }
+
+ throw new InvalidArgumentException(sprintf('There is no parameter at position "%d" in function/method "%s"', $parameterName, $this->getName()), Exception\Runtime::DOES_NOT_EXIST);
+ } else {
+ foreach ($parameters as $parameter) {
+ if ($parameter->getName() === $parameterName) {
+ return $parameter;
+ }
+ }
+
+ throw new InvalidArgumentException(sprintf('There is no parameter "%s" in function/method "%s"', $parameterName, $this->getName()), Exception\Runtime::DOES_NOT_EXIST);
+ }
+ }
+
+ /**
+ * Returns the number of parameters.
+ *
+ * @return integer
+ */
+ public function getNumberOfParameters()
+ {
+ return $this->reflection->getNumberOfParameters();
+ }
+
+ /**
+ * Returns the number of required parameters.
+ *
+ * @return integer
+ */
+ public function getNumberOfRequiredParameters()
+ {
+ return $this->reflection->getNumberOfRequiredParameters();
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionMethod.php b/vendor/apigen/apigen/ApiGen/ReflectionMethod.php
new file mode 100644
index 0000000..007935c
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionMethod.php
@@ -0,0 +1,250 @@
+reflection->getDeclaringClassName();
+ return null === $className ? null : self::$parsedClasses[$className];
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->reflection->getDeclaringClassName();
+ }
+
+ /**
+ * Returns method modifiers.
+ *
+ * @return integer
+ */
+ public function getModifiers()
+ {
+ return $this->reflection->getModifiers();
+ }
+
+ /**
+ * Returns if the method is abstract.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ return $this->reflection->isAbstract();
+ }
+
+ /**
+ * Returns if the method is final.
+ *
+ * @return boolean
+ */
+ public function isFinal()
+ {
+ return $this->reflection->isFinal();
+ }
+
+ /**
+ * Returns if the method is private.
+ *
+ * @return boolean
+ */
+ public function isPrivate()
+ {
+ return $this->reflection->isPrivate();
+ }
+
+ /**
+ * Returns if the method is protected.
+ *
+ * @return boolean
+ */
+ public function isProtected()
+ {
+ return $this->reflection->isProtected();
+ }
+
+ /**
+ * Returns if the method is public.
+ *
+ * @return boolean
+ */
+ public function isPublic()
+ {
+ return $this->reflection->isPublic();
+ }
+
+ /**
+ * Returns if the method is static.
+ *
+ * @return boolean
+ */
+ public function isStatic()
+ {
+ return $this->reflection->isStatic();
+ }
+
+ /**
+ * Returns if the method is a constructor.
+ *
+ * @return boolean
+ */
+ public function isConstructor()
+ {
+ return $this->reflection->isConstructor();
+ }
+
+ /**
+ * Returns if the method is a destructor.
+ *
+ * @return boolean
+ */
+ public function isDestructor()
+ {
+ return $this->reflection->isDestructor();
+ }
+
+ /**
+ * Returns the method declaring trait.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getDeclaringTrait()
+ {
+ $traitName = $this->reflection->getDeclaringTraitName();
+ return null === $traitName ? null : self::$parsedClasses[$traitName];
+ }
+
+ /**
+ * Returns the declaring trait name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringTraitName()
+ {
+ return $this->reflection->getDeclaringTraitName();
+ }
+
+ /**
+ * Returns the overridden method.
+ *
+ * @return \ApiGen\ReflectionMethod|null
+ */
+ public function getImplementedMethod()
+ {
+ foreach ($this->getDeclaringClass()->getOwnInterfaces() as $interface) {
+ if ($interface->hasMethod($this->getName())) {
+ return $interface->getMethod($this->getName());
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the overridden method.
+ *
+ * @return \ApiGen\ReflectionMethod|null
+ */
+ public function getOverriddenMethod()
+ {
+ $parent = $this->getDeclaringClass()->getParentClass();
+ if (null === $parent) {
+ return null;
+ }
+
+ foreach ($parent->getMethods() as $method) {
+ if ($this->getName() === $method->getName()) {
+ if (!$method->isPrivate() && !$method->isAbstract()) {
+ return $method;
+ } else {
+ return null;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the original name when importing from a trait.
+ *
+ * @return string|null
+ */
+ public function getOriginalName()
+ {
+ return $this->reflection->getOriginalName();
+ }
+
+ /**
+ * Returns the original modifiers value when importing from a trait.
+ *
+ * @return integer|null
+ */
+ public function getOriginalModifiers()
+ {
+ return $this->reflection->getOriginalModifiers();
+ }
+
+ /**
+ * Returns the original method when importing from a trait.
+ *
+ * @return \ApiGen\ReflectionMethod|null
+ */
+ public function getOriginal()
+ {
+ $originalName = $this->reflection->getOriginalName();
+ return null === $originalName ? null : self::$parsedClasses[$this->reflection->getOriginal()->getDeclaringClassName()]->getMethod($originalName);
+ }
+
+ /**
+ * Returns if the method is valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ if ($class = $this->getDeclaringClass()) {
+ return $class->isValid();
+ }
+
+ return true;
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionMethodMagic.php b/vendor/apigen/apigen/ApiGen/ReflectionMethodMagic.php
new file mode 100644
index 0000000..05b4514
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionMethodMagic.php
@@ -0,0 +1,729 @@
+reflectionType = get_class($this);
+ if (!isset(self::$reflectionMethods[$this->reflectionType])) {
+ self::$reflectionMethods[$this->reflectionType] = array_flip(get_class_methods($this));
+ }
+ }
+
+ /**
+ * Sets method name.
+ *
+ * @param string $name
+ * @return \Apigen\ReflectionMethodMagic
+ */
+ public function setName($name)
+ {
+ $this->name = (string) $name;
+ return $this;
+
+ }
+
+ /**
+ * Sets short description.
+ *
+ * @param string $shortDescription
+ * @return \Apigen\ReflectionMethodMagic
+ */
+ public function setShortDescription($shortDescription)
+ {
+ $this->shortDescription = (string) $shortDescription;
+ return $this;
+ }
+
+ /**
+ * Sets start line.
+ *
+ * @param integer $startLine
+ * @return \Apigen\ReflectionMethodMagic
+ */
+ public function setStartLine($startLine)
+ {
+ $this->startLine = (int) $startLine;
+ return $this;
+ }
+
+ /**
+ * Sets end line.
+ *
+ * @param integer $endLine
+ * @return \Apigen\ReflectionMethodMagic
+ */
+ public function setEndLine($endLine)
+ {
+ $this->endLine = (int) $endLine;
+ return $this;
+ }
+
+ /**
+ * Sets if the method returns reference.
+ *
+ * @param boolean $returnsReference
+ * @return \Apigen\ReflectionMethodMagic
+ */
+ public function setReturnsReference($returnsReference)
+ {
+ $this->returnsReference = (bool) $returnsReference;
+ return $this;
+ }
+
+ /**
+ * Sets parameters.
+ *
+ * @param array $parameters
+ * @return \Apigen\ReflectionMethodMagic
+ */
+ public function setParameters(array $parameters)
+ {
+ $this->parameters = $parameters;
+ return $this;
+ }
+
+ /**
+ * Sets declaring class.
+ *
+ * @param \ApiGen\ReflectionClass $declaringClass
+ * @return \ApiGen\ReflectionMethodMagic
+ */
+ public function setDeclaringClass(ReflectionClass $declaringClass)
+ {
+ $this->declaringClass = $declaringClass;
+ return $this;
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->declaringClass->getBroker();
+ }
+
+ /**
+ * Returns the start position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getStartPosition()
+ {
+ return $this->declaringClass->getStartPosition();
+ }
+
+ /**
+ * Returns the end position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getEndPosition()
+ {
+ return $this->declaringClass->getEndPosition();
+ }
+
+ /**
+ * Returns the name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the short description.
+ *
+ * @return string
+ */
+ public function getShortDescription()
+ {
+ return $this->shortDescription;
+ }
+
+ /**
+ * Returns the long description.
+ *
+ * @return string
+ */
+ public function getLongDescription()
+ {
+ return $this->shortDescription;
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return integer
+ */
+ public function getStartLine()
+ {
+ return $this->startLine;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return integer
+ */
+ public function getEndLine()
+ {
+ return $this->endLine;
+ }
+
+ /**
+ * Returns if the function/method returns its value as reference.
+ *
+ * @return boolean
+ */
+ public function returnsReference()
+ {
+ return $this->returnsReference;
+ }
+
+ /**
+ * Returns if the property is magic.
+ *
+ * @return boolean
+ */
+ public function isMagic()
+ {
+ return true;
+ }
+
+ /**
+ * Returns the unqualified name (UQN).
+ *
+ * @return string
+ */
+ public function getShortName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return \ApiGen\ReflectionExtension|null
+ */
+ public function getExtension()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * @return boolean
+ */
+ public function getExtensionName()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the method should be documented.
+ *
+ * @return boolean
+ */
+ public function isDocumented()
+ {
+ if (null === $this->isDocumented) {
+ $this->isDocumented = self::$config->deprecated || !$this->isDeprecated();
+ }
+
+ return $this->isDocumented;
+ }
+
+ /**
+ * Returns if the property is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return $this->declaringClass->isDeprecated();
+ }
+
+ /**
+ * Returns property package name (including subpackage name).
+ *
+ * @return string
+ */
+ public function getPackageName()
+ {
+ return $this->declaringClass->getPackageName();
+ }
+
+ /**
+ * Returns property namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return $this->declaringClass->getNamespaceName();
+ }
+
+ /**
+ * Returns property annotations.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ if (null === $this->annotations) {
+ $this->annotations = array();
+ }
+ return $this->annotations;
+ }
+
+ /**
+ * Returns the method declaring class.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getDeclaringClass()
+ {
+ return $this->declaringClass;
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->declaringClass->getName();
+ }
+
+ /**
+ * Returns method modifiers.
+ *
+ * @return integer
+ */
+ public function getModifiers()
+ {
+ return InternalReflectionMethod::IS_PUBLIC;
+ }
+
+ /**
+ * Returns if the method is abstract.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the method is final.
+ *
+ * @return boolean
+ */
+ public function isFinal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the method is private.
+ *
+ * @return boolean
+ */
+ public function isPrivate()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the method is protected.
+ *
+ * @return boolean
+ */
+ public function isProtected()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the method is public.
+ *
+ * @return boolean
+ */
+ public function isPublic()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the method is static.
+ *
+ * @return boolean
+ */
+ public function isStatic()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the property is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the method is a constructor.
+ *
+ * @return boolean
+ */
+ public function isConstructor()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the method is a destructor.
+ *
+ * @return boolean
+ */
+ public function isDestructor()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the method declaring trait.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getDeclaringTrait()
+ {
+ return $this->declaringClass->isTrait() ? $this->declaringClass : null;
+ }
+
+ /**
+ * Returns the declaring trait name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringTraitName()
+ {
+ if ($declaringTrait = $this->getDeclaringTrait()) {
+ return $declaringTrait->getName();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the overridden method.
+ *
+ * @return \ApiGen\ReflectionMethod|null
+ */
+ public function getImplementedMethod()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the overridden method.
+ *
+ * @return \ApiGen\ReflectionMethod|null
+ */
+ public function getOverriddenMethod()
+ {
+ $parent = $this->declaringClass->getParentClass();
+ if (null === $parent) {
+ return null;
+ }
+
+ foreach ($parent->getMagicMethods() as $method) {
+ if ($this->name === $method->getName()) {
+ return $method;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the original name when importing from a trait.
+ *
+ * @return string|null
+ */
+ public function getOriginalName()
+ {
+ return $this->getName();
+ }
+
+ /**
+ * Returns the original modifiers value when importing from a trait.
+ *
+ * @return integer|null
+ */
+ public function getOriginalModifiers()
+ {
+ return $this->getModifiers();
+ }
+
+ /**
+ * Returns the original method when importing from a trait.
+ *
+ * @return \ApiGen\ReflectionMethod|null
+ */
+ public function getOriginal()
+ {
+ return null;
+ }
+
+ /**
+ * Returns a list of method parameters.
+ *
+ * @return array
+ */
+ public function getParameters()
+ {
+ return $this->parameters;
+ }
+
+ /**
+ * Returns the number of parameters.
+ *
+ * @return integer
+ */
+ public function getNumberOfParameters()
+ {
+ return count($this->parameters);
+ }
+
+ /**
+ * Returns the number of required parameters.
+ *
+ * @return integer
+ */
+ public function getNumberOfRequiredParameters()
+ {
+ $count = 0;
+ array_walk($this->parameters, function(ReflectionParameter $parameter) use (&$count) {
+ if (!$parameter->isOptional()) {
+ $count++;
+ }
+ });
+ return $count;
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->declaringClass->getNamespaceAliases();
+ }
+
+ /**
+ * Returns an property pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return sprintf('%s::%s()', $this->declaringClass->getName(), $this->name);
+ }
+
+ /**
+ * Returns the file name the method is defined in.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->declaringClass->getFileName();
+ }
+
+ /**
+ * Returns if the method is user defined.
+
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the method comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return true;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return string|boolean
+ */
+ public function getDocComment()
+ {
+ $docComment = "/**\n";
+
+ if (!empty($this->shortDescription)) {
+ $docComment .= $this->shortDescription . "\n\n";
+ }
+
+ if ($annotations = $this->getAnnotation('param')) {
+ foreach ($annotations as $annotation) {
+ $docComment .= sprintf("@param %s\n", $annotation);
+ }
+ }
+
+ if ($annotations = $this->getAnnotation('return')) {
+ foreach ($annotations as $annotation) {
+ $docComment .= sprintf("@return %s\n", $annotation);
+ }
+ }
+
+ $docComment .= "*/\n";
+
+ return $docComment;
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ $annotations = $this->getAnnotations();
+ return array_key_exists($name, $annotations);
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return string|array|null
+ */
+ public function getAnnotation($name)
+ {
+ $annotations = $this->getAnnotations();
+ if (array_key_exists($name, $annotations)) {
+ return $annotations[$name];
+ }
+ return null;
+ }
+
+ /**
+ * Retrieves a property or method value.
+ *
+ * @param string $name Property name
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ $key = ucfirst($name);
+ if (isset(self::$reflectionMethods[$this->reflectionType]['get' . $key])) {
+ return $this->{'get' . $key}();
+ }
+
+ if (isset(self::$reflectionMethods[$this->reflectionType]['is' . $key])) {
+ return $this->{'is' . $key}();
+ }
+
+ return null;
+ }
+
+ /**
+ * Checks if the given property exists.
+ *
+ * @param mixed $name Property name
+ * @return boolean
+ */
+ public function __isset($name)
+ {
+ $key = ucfirst($name);
+ return isset(self::$reflectionMethods[$this->reflectionType]['get' . $key]) || isset(self::$reflectionMethods[$this->reflectionType]['is' . $key]);
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionParameter.php b/vendor/apigen/apigen/ApiGen/ReflectionParameter.php
new file mode 100644
index 0000000..92fefbd
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionParameter.php
@@ -0,0 +1,231 @@
+isArray()) {
+ return 'array';
+ } elseif ($this->isCallable()) {
+ return 'callable';
+ } elseif ($className = $this->getClassName()) {
+ return $className;
+ } elseif ($annotations = $this->getDeclaringFunction()->getAnnotation('param')) {
+ if (!empty($annotations[$this->getPosition()])) {
+ list($types) = preg_split('~\s+|$~', $annotations[$this->getPosition()], 2);
+ if (!empty($types) && '$' !== $types[0]) {
+ return $types;
+ }
+ }
+ }
+
+ return 'mixed';
+ }
+
+ /**
+ * Returns parameter description.
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ $annotations = $this->getDeclaringFunction()->getAnnotation('param');
+ if (empty($annotations[$this->getPosition()])) {
+ return '';
+ }
+
+ $description = trim(strpbrk($annotations[$this->getPosition()], "\n\r\t "));
+ return preg_replace('~^(\\$' . $this->getName() . '(?:,\\.{3})?)(\\s+|$)~i', '\\2', $description, 1);
+ }
+
+ /**
+ * Returns the part of the source code defining the parameter default value.
+ *
+ * @return string
+ */
+ public function getDefaultValueDefinition()
+ {
+ return $this->reflection->getDefaultValueDefinition();
+ }
+
+ /**
+ * Retutns if a default value for the parameter is available.
+ *
+ * @return boolean
+ */
+ public function isDefaultValueAvailable()
+ {
+ return $this->reflection->isDefaultValueAvailable();
+ }
+
+ /**
+ * Returns the position within all parameters.
+ *
+ * @return integer
+ */
+ public function getPosition()
+ {
+ return $this->reflection->position;
+ }
+
+ /**
+ * Returns if the parameter expects an array.
+ *
+ * @return boolean
+ */
+ public function isArray()
+ {
+ return $this->reflection->isArray();
+ }
+
+ /**
+ * Returns if the parameter expects a callback.
+ *
+ * @return boolean
+ */
+ public function isCallable()
+ {
+ return $this->reflection->isCallable();
+ }
+
+ /**
+ * Returns reflection of the required class of the parameter.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getClass()
+ {
+ $className = $this->reflection->getClassName();
+ return null === $className ? null : self::$parsedClasses[$className];
+ }
+
+ /**
+ * Returns the required class name of the value.
+ *
+ * @return string|null
+ */
+ public function getClassName()
+ {
+ return $this->reflection->getClassName();
+ }
+
+ /**
+ * Returns if the the parameter allows NULL.
+ *
+ * @return boolean
+ */
+ public function allowsNull()
+ {
+ return $this->reflection->allowsNull();
+ }
+
+ /**
+ * Returns if the parameter is optional.
+ *
+ * @return boolean
+ */
+ public function isOptional()
+ {
+ return $this->reflection->isOptional();
+ }
+
+ /**
+ * Returns if the parameter value is passed by reference.
+ *
+ * @return boolean
+ */
+ public function isPassedByReference()
+ {
+ return $this->reflection->isPassedByReference();
+ }
+
+ /**
+ * Returns if the paramter value can be passed by value.
+ *
+ * @return boolean
+ */
+ public function canBePassedByValue()
+ {
+ return $this->reflection->canBePassedByValue();
+ }
+
+ /**
+ * Returns the declaring function.
+ *
+ * @return \ApiGen\ReflectionFunctionBase
+ */
+ public function getDeclaringFunction()
+ {
+ $functionName = $this->reflection->getDeclaringFunctionName();
+
+ if ($className = $this->reflection->getDeclaringClassName()) {
+ return self::$parsedClasses[$className]->getMethod($functionName);
+ } else {
+ return self::$parsedFunctions[$functionName];
+ }
+ }
+
+ /**
+ * Returns the declaring function name.
+ *
+ * @return string
+ */
+ public function getDeclaringFunctionName()
+ {
+ return $this->reflection->getDeclaringFunctionName();
+ }
+
+ /**
+ * Returns the function/method declaring class.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getDeclaringClass()
+ {
+ $className = $this->reflection->getDeclaringClassName();
+ return null === $className ? null : self::$parsedClasses[$className];
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->reflection->getDeclaringClassName();
+ }
+
+ /**
+ * If the parameter can be used unlimited.
+ *
+ * @return boolean
+ */
+ public function isUnlimited()
+ {
+ return false;
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionParameterMagic.php b/vendor/apigen/apigen/ApiGen/ReflectionParameterMagic.php
new file mode 100644
index 0000000..1482928
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionParameterMagic.php
@@ -0,0 +1,479 @@
+reflectionType = get_class($this);
+ if (!isset(self::$reflectionMethods[$this->reflectionType])) {
+ self::$reflectionMethods[$this->reflectionType] = array_flip(get_class_methods($this));
+ }
+ }
+
+ /**
+ * Sets parameter name.
+ *
+ * @param string $name
+ * @return \ApiGen\ReflectionParameterMagic
+ */
+ public function setName($name)
+ {
+ $this->name = (string) $name;
+ return $this;
+ }
+
+ /**
+ * Sets type hint.
+ *
+ * @param string $typeHint
+ * @return \ApiGen\ReflectionParameterMagic
+ */
+ public function setTypeHint($typeHint)
+ {
+ $this->typeHint = (string) $typeHint;
+ return $this;
+ }
+
+ /**
+ * Sets position of the parameter in the function/method.
+ *
+ * @param integer $position
+ * @return \ApiGen\ReflectionParameterMagic
+ */
+ public function setPosition($position)
+ {
+ $this->position = (int) $position;
+ return $this;
+ }
+
+ /**
+ * Sets the part of the source code defining the parameter default value.
+ *
+ * @param string|null $defaultValueDefinition
+ * @return \ApiGen\ReflectionParameterMagic
+ */
+ public function setDefaultValueDefinition($defaultValueDefinition)
+ {
+ $this->defaultValueDefinition = $defaultValueDefinition;
+ return $this;
+ }
+
+ /**
+ * Sets if the parameter can be used unlimited times.
+ *
+ * @param boolean $unlimited
+ * @return \ApiGen\ReflectionParameterMagic
+ */
+ public function setUnlimited($unlimited)
+ {
+ $this->unlimited = (bool) $unlimited;
+ return $this;
+ }
+
+ /**
+ * Sets if the parameter value is passed by reference.
+ *
+ * @param boolean $passedByReference
+ * @return \ApiGen\ReflectionParameterMagic
+ */
+ public function setPassedByReference($passedByReference)
+ {
+ $this->passedByReference = (bool) $passedByReference;
+ return $this;
+ }
+
+ /**
+ * Sets declaring function.
+ *
+ * @param \ApiGen\ReflectionFunctionBase $declaringFunction
+ * @return \ApiGen\ReflectionParameterMagic
+ */
+ public function setDeclaringFunction(ReflectionFunctionBase $declaringFunction)
+ {
+ $this->declaringFunction = $declaringFunction;
+ return $this;
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->declaringFunction->getBroker();
+ }
+
+ /**
+ * Returns the name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the type hint.
+ *
+ * @return string
+ */
+ public function getTypeHint()
+ {
+ return $this->typeHint;
+ }
+
+ /**
+ * Returns the file name the parameter is defined in.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->declaringFunction->getFileName();
+ }
+
+ /**
+ * Returns if the reflection object is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the reflection object is user defined.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the current reflection comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return true;
+ }
+
+ /**
+ * Returns an element pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return str_replace('()', '($' . $this->name . ')', $this->declaringFunction->getPrettyName());
+ }
+
+ /**
+ * Returns the declaring class.
+ *
+ * @return \Apigen\ReflectionClass|null
+ */
+ public function getDeclaringClass()
+ {
+ return $this->declaringFunction->getDeclaringClass();
+ }
+
+ /**
+ * Returns the declaring class name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->declaringFunction->getDeclaringClassName();
+ }
+
+ /**
+ * Returns the declaring function.
+ *
+ * @return \ApiGen\ReflectionFunctionBase
+ */
+ public function getDeclaringFunction()
+ {
+ return $this->declaringFunction;
+ }
+
+ /**
+ * Returns the declaring function name.
+ *
+ * @return string
+ */
+ public function getDeclaringFunctionName()
+ {
+ return $this->declaringFunction->getName();
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return integer
+ */
+ public function getStartLine()
+ {
+ return $this->declaringFunction->getStartLine();
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return integer
+ */
+ public function getEndLine()
+ {
+ return $this->declaringFunction->getEndLine();
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return string|boolean
+ */
+ public function getDocComment()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the part of the source code defining the parameter default value.
+ *
+ * @return string
+ */
+ public function getDefaultValueDefinition()
+ {
+ return $this->defaultValueDefinition;
+ }
+
+ /**
+ * Returns if a default value for the parameter is available.
+ *
+ * @return boolean
+ */
+ public function isDefaultValueAvailable()
+ {
+ return (bool) $this->defaultValueDefinition;
+ }
+
+ /**
+ * Returns the position within all parameters.
+ *
+ * @return integer
+ */
+ public function getPosition()
+ {
+ return $this->position;
+ }
+
+ /**
+ * Returns if the parameter expects an array.
+ *
+ * @return boolean
+ */
+ public function isArray()
+ {
+ return TokenReflection\ReflectionParameter::ARRAY_TYPE_HINT === $this->typeHint;
+ }
+
+ public function isCallable()
+ {
+ return TokenReflection\ReflectionParameter::CALLABLE_TYPE_HINT === $this->typeHint;
+ }
+
+ /**
+ * Returns reflection of the required class of the value.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getClass()
+ {
+ $className = $this->getClassName();
+ return null === $className ? null : self::$parsedClasses[$className];
+ }
+
+ /**
+ * Returns the required class name of the value.
+ *
+ * @return string|null
+ */
+ public function getClassName()
+ {
+ if ($this->isArray() || $this->isCallable()) {
+ return null;
+ }
+
+ if (isset(self::$parsedClasses[$this->typeHint])) {
+ return $typeHint;
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns if the the parameter allows NULL.
+ *
+ * @return boolean
+ */
+ public function allowsNull()
+ {
+ if ($this->isArray() || $this->isCallable()) {
+ return 'null' === strtolower($this->defaultValueDefinition);
+ }
+
+ return !empty($this->defaultValueDefinition);
+ }
+
+ /**
+ * Returns if the parameter is optional.
+ *
+ * @return boolean
+ */
+ public function isOptional()
+ {
+ return $this->isDefaultValueAvailable();
+ }
+
+ /**
+ * Returns if the parameter value is passed by reference.
+ *
+ * @return boolean
+ */
+ public function isPassedByReference()
+ {
+ return $this->passedByReference;
+ }
+
+ /**
+ * Returns if the parameter value can be passed by value.
+ *
+ * @return boolean
+ */
+ public function canBePassedByValue()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the parameter can be used unlimited times.
+ *
+ * @return boolean
+ */
+ public function isUnlimited()
+ {
+ return $this->unlimited;
+ }
+
+ /**
+ * Retrieves a property or method value.
+ *
+ * @param string $name Property name
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ $key = ucfirst($name);
+ if (isset(self::$reflectionMethods[$this->reflectionType]['get' . $key])) {
+ return $this->{'get' . $key}();
+ }
+
+ if (isset(self::$reflectionMethods[$this->reflectionType]['is' . $key])) {
+ return $this->{'is' . $key}();
+ }
+
+ return null;
+ }
+
+ /**
+ * Checks if the given property exists.
+ *
+ * @param mixed $name Property name
+ * @return boolean
+ */
+ public function __isset($name)
+ {
+ $key = ucfirst($name);
+ return isset(self::$reflectionMethods[$this->reflectionType]['get' . $key]) || isset(self::$reflectionMethods[$this->reflectionType]['is' . $key]);
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionProperty.php b/vendor/apigen/apigen/ApiGen/ReflectionProperty.php
new file mode 100644
index 0000000..414cb1c
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionProperty.php
@@ -0,0 +1,214 @@
+getAnnotation('var')) {
+ list($types) = preg_split('~\s+|$~', $annotations[0], 2);
+ if (!empty($types) && '$' !== $types[0]) {
+ return $types;
+ }
+ }
+
+ try {
+ $type = gettype($this->getDefaultValue());
+ if ('null' !== strtolower($type)) {
+ return $type;
+ }
+ } catch (\Exception $e) {
+ // Nothing
+ }
+
+ return 'mixed';
+ }
+
+ /**
+ * Returns the property declaring class.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getDeclaringClass()
+ {
+ $className = $this->reflection->getDeclaringClassName();
+ return null === $className ? null : self::$parsedClasses[$className];
+ }
+
+ /**
+ * Returns the name of the declaring class.
+ *
+ * @return string
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->reflection->getDeclaringClassName();
+ }
+
+ /**
+ * Returns the property default value.
+ *
+ * @return mixed
+ */
+ public function getDefaultValue()
+ {
+ return $this->reflection->getDefaultValue();
+ }
+
+ /**
+ * Returns the part of the source code defining the property default value.
+ *
+ * @return string
+ */
+ public function getDefaultValueDefinition()
+ {
+ return $this->reflection->getDefaultValueDefinition();
+ }
+
+ /**
+ * Returns if the property was created at compile time.
+ *
+ * @return boolean
+ */
+ public function isDefault()
+ {
+ return $this->reflection->isDefault();
+ }
+
+ /**
+ * Returns property modifiers.
+ *
+ * @return integer
+ */
+ public function getModifiers()
+ {
+ return $this->reflection->getModifiers();
+ }
+
+ /**
+ * Returns if the property is private.
+ *
+ * @return boolean
+ */
+ public function isPrivate()
+ {
+ return $this->reflection->isPrivate();
+ }
+
+ /**
+ * Returns if the property is protected.
+ *
+ * @return boolean
+ */
+ public function isProtected()
+ {
+ return $this->reflection->isProtected();
+ }
+
+ /**
+ * Returns if the property is public.
+ *
+ * @return boolean
+ */
+ public function isPublic()
+ {
+ return $this->reflection->isPublic();
+ }
+
+ /**
+ * Returns if the poperty is static.
+ *
+ * @return boolean
+ */
+ public function isStatic()
+ {
+ return $this->reflection->isStatic();
+ }
+
+ /**
+ * Returns the property declaring trait.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getDeclaringTrait()
+ {
+ $traitName = $this->reflection->getDeclaringTraitName();
+ return null === $traitName ? null : self::$parsedClasses[$traitName];
+ }
+
+ /**
+ * Returns the declaring trait name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringTraitName()
+ {
+ return $this->reflection->getDeclaringTraitName();
+ }
+
+ /**
+ * Returns if the property is valid.
+ *
+ * @return boolean
+ */
+ public function isValid()
+ {
+ if ($class = $this->getDeclaringClass()) {
+ return $class->isValid();
+ }
+
+ return true;
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/ReflectionPropertyMagic.php b/vendor/apigen/apigen/ApiGen/ReflectionPropertyMagic.php
new file mode 100644
index 0000000..98e7e24
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/ReflectionPropertyMagic.php
@@ -0,0 +1,651 @@
+reflectionType = get_class($this);
+ if (!isset(self::$reflectionMethods[$this->reflectionType])) {
+ self::$reflectionMethods[$this->reflectionType] = array_flip(get_class_methods($this));
+ }
+ }
+
+ /**
+ * Sets property name.
+ *
+ * @param string $name
+ * @return \Apigen\ReflectionPropertyMagic
+ */
+ public function setName($name)
+ {
+ $this->name = (string) $name;
+ return $this;
+
+ }
+
+ /**
+ * Sets type hint.
+ *
+ * @param string $typeHint
+ * @return \ApiGen\ReflectionParameterUnlimited
+ */
+ public function setTypeHint($typeHint)
+ {
+ $this->typeHint = (string) $typeHint;
+ return $this;
+ }
+
+ /**
+ * Sets short description.
+ *
+ * @param string $shortDescription
+ * @return \Apigen\ReflectionPropertyMagic
+ */
+ public function setShortDescription($shortDescription)
+ {
+ $this->shortDescription = (string) $shortDescription;
+ return $this;
+ }
+
+ /**
+ * Sets start line.
+ *
+ * @param integer $startLine
+ * @return \Apigen\ReflectionPropertyMagic
+ */
+ public function setStartLine($startLine)
+ {
+ $this->startLine = (int) $startLine;
+ return $this;
+ }
+
+ /**
+ * Sets end line.
+ *
+ * @param integer $endLine
+ * @return \Apigen\ReflectionPropertyMagic
+ */
+ public function setEndLine($endLine)
+ {
+ $this->endLine = (int) $endLine;
+ return $this;
+ }
+
+ /**
+ * Sets if the property is read-only.
+ *
+ * @param boolean $readOnly
+ * @return \Apigen\ReflectionPropertyMagic
+ */
+ public function setReadOnly($readOnly)
+ {
+ $this->readOnly = (bool) $readOnly;
+ return $this;
+ }
+
+ /**
+ * Sets if the property is write only.
+ *
+ * @param boolean $writeOnly
+ * @return \Apigen\ReflectionPropertyMagic
+ */
+ public function setWriteOnly($writeOnly)
+ {
+ $this->writeOnly = (bool) $writeOnly;
+ return $this;
+ }
+
+ /**
+ * Sets declaring class.
+ *
+ * @param \ApiGen\ReflectionClass $declaringClass
+ * @return \ApiGen\ReflectionPropertyMagic
+ */
+ public function setDeclaringClass(ReflectionClass $declaringClass)
+ {
+ $this->declaringClass = $declaringClass;
+ return $this;
+ }
+
+ /**
+ * Returns the reflection broker used by this reflection object.
+ *
+ * @return \TokenReflection\Broker
+ */
+ public function getBroker()
+ {
+ return $this->declaringClass->getBroker();
+ }
+
+ /**
+ * Returns the start position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getStartPosition()
+ {
+ return $this->declaringClass->getStartPosition();
+ }
+
+ /**
+ * Returns the end position in the file token stream.
+ *
+ * @return integer
+ */
+ public function getEndPosition()
+ {
+ return $this->declaringClass->getEndPosition();
+ }
+
+ /**
+ * Returns the name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the type hint.
+ *
+ * @return string
+ */
+ public function getTypeHint()
+ {
+ return $this->typeHint;
+ }
+
+ /**
+ * Returns the short description.
+ *
+ * @return string
+ */
+ public function getShortDescription()
+ {
+ return $this->shortDescription;
+ }
+
+ /**
+ * Returns the long description.
+ *
+ * @return string
+ */
+ public function getLongDescription()
+ {
+ return $this->shortDescription;
+ }
+
+ /**
+ * Returns the definition start line number in the file.
+ *
+ * @return integer
+ */
+ public function getStartLine()
+ {
+ return $this->startLine;
+ }
+
+ /**
+ * Returns the definition end line number in the file.
+ *
+ * @return integer
+ */
+ public function getEndLine()
+ {
+ return $this->endLine;
+ }
+
+ /**
+ * Returns if the property is read-only.
+ *
+ * @return boolean
+ */
+ public function isReadOnly()
+ {
+ return $this->readOnly;
+ }
+
+ /**
+ * Returns if the property is write-only.
+ *
+ * @return boolean
+ */
+ public function isWriteOnly()
+ {
+ return $this->writeOnly;
+ }
+
+ /**
+ * Returns if the property is magic.
+ *
+ * @return boolean
+ */
+ public function isMagic()
+ {
+ return true;
+ }
+
+ /**
+ * Returns the PHP extension reflection.
+ *
+ * @return \ApiGen\ReflectionExtension|null
+ */
+ public function getExtension()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the PHP extension name.
+ *
+ * @return boolean
+ */
+ public function getExtensionName()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the property should be documented.
+ *
+ * @return boolean
+ */
+ public function isDocumented()
+ {
+ if (null === $this->isDocumented) {
+ $this->isDocumented = self::$config->deprecated || !$this->isDeprecated();
+ }
+
+ return $this->isDocumented;
+ }
+
+ /**
+ * Returns if the property is deprecated.
+ *
+ * @return boolean
+ */
+ public function isDeprecated()
+ {
+ return $this->declaringClass->isDeprecated();
+ }
+
+ /**
+ * Returns property package name (including subpackage name).
+ *
+ * @return string
+ */
+ public function getPackageName()
+ {
+ return $this->declaringClass->getPackageName();
+ }
+
+ /**
+ * Returns property namespace name.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return $this->declaringClass->getNamespaceName();
+ }
+
+ /**
+ * Returns property annotations.
+ *
+ * @return array
+ */
+ public function getAnnotations()
+ {
+ if (null === $this->annotations) {
+ $this->annotations = array();
+ }
+ return $this->annotations;
+ }
+
+ /**
+ * Returns the property declaring class.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getDeclaringClass()
+ {
+ return $this->declaringClass;
+ }
+
+ /**
+ * Returns the name of the declaring class.
+ *
+ * @return string
+ */
+ public function getDeclaringClassName()
+ {
+ return $this->declaringClass->getName();
+ }
+
+ /**
+ * Returns the property default value.
+ *
+ * @return mixed
+ */
+ public function getDefaultValue()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the part of the source code defining the property default value.
+ *
+ * @return string
+ */
+ public function getDefaultValueDefinition()
+ {
+ return '';
+ }
+
+ /**
+ * Returns if the property was created at compile time.
+ *
+ * @return boolean
+ */
+ public function isDefault()
+ {
+ return false;
+ }
+
+ /**
+ * Returns property modifiers.
+ *
+ * @return integer
+ */
+ public function getModifiers()
+ {
+ return InternalReflectionProperty::IS_PUBLIC;
+ }
+
+ /**
+ * Returns if the property is private.
+ *
+ * @return boolean
+ */
+ public function isPrivate()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the property is protected.
+ *
+ * @return boolean
+ */
+ public function isProtected()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the property is public.
+ *
+ * @return boolean
+ */
+ public function isPublic()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the poperty is static.
+ *
+ * @return boolean
+ */
+ public function isStatic()
+ {
+ return false;
+ }
+
+ /**
+ * Returns if the property is internal.
+ *
+ * @return boolean
+ */
+ public function isInternal()
+ {
+ return false;
+ }
+
+ /**
+ * Returns the property declaring trait.
+ *
+ * @return \ApiGen\ReflectionClass|null
+ */
+ public function getDeclaringTrait()
+ {
+ return $this->declaringClass->isTrait() ? $this->declaringClass : null;
+ }
+
+ /**
+ * Returns the declaring trait name.
+ *
+ * @return string|null
+ */
+ public function getDeclaringTraitName()
+ {
+ if ($declaringTrait = $this->getDeclaringTrait()) {
+ return $declaringTrait->getName();
+ }
+ return null;
+ }
+
+ /**
+ * Returns imported namespaces and aliases from the declaring namespace.
+ *
+ * @return array
+ */
+ public function getNamespaceAliases()
+ {
+ return $this->declaringClass->getNamespaceAliases();
+ }
+
+ /**
+ * Returns an property pretty (docblock compatible) name.
+ *
+ * @return string
+ */
+ public function getPrettyName()
+ {
+ return sprintf('%s::$%s', $this->declaringClass->getName(), $this->name);
+ }
+
+ /**
+ * Returns the file name the property is defined in.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->declaringClass->getFileName();
+ }
+
+ /**
+ * Returns if the property is user defined.
+
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return true;
+ }
+
+ /**
+ * Returns if the property comes from a tokenized source.
+ *
+ * @return boolean
+ */
+ public function isTokenized()
+ {
+ return true;
+ }
+
+ /**
+ * Returns the appropriate docblock definition.
+ *
+ * @return string|boolean
+ */
+ public function getDocComment()
+ {
+ $docComment = "/**\n";
+
+ if (!empty($this->shortDescription)) {
+ $docComment .= $this->shortDescription . "\n\n";
+ }
+
+ if ($annotations = $this->getAnnotation('var')) {
+ $docComment .= sprintf("@var %s\n", $annotations[0]);
+ }
+
+ $docComment .= "*/\n";
+
+ return $docComment;
+ }
+
+ /**
+ * Checks if there is a particular annotation.
+ *
+ * @param string $name Annotation name
+ * @return boolean
+ */
+ public function hasAnnotation($name)
+ {
+ $annotations = $this->getAnnotations();
+ return array_key_exists($name, $annotations);
+ }
+
+ /**
+ * Returns a particular annotation value.
+ *
+ * @param string $name Annotation name
+ * @return string|array|null
+ */
+ public function getAnnotation($name)
+ {
+ $annotations = $this->getAnnotations();
+ if (array_key_exists($name, $annotations)) {
+ return $annotations[$name];
+ }
+ return null;
+ }
+
+ /**
+ * Retrieves a property or method value.
+ *
+ * @param string $name Property name
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ $key = ucfirst($name);
+ if (isset(self::$reflectionMethods[$this->reflectionType]['get' . $key])) {
+ return $this->{'get' . $key}();
+ }
+
+ if (isset(self::$reflectionMethods[$this->reflectionType]['is' . $key])) {
+ return $this->{'is' . $key}();
+ }
+
+ return null;
+ }
+
+ /**
+ * Checks if the given property exists.
+ *
+ * @param mixed $name Property name
+ * @return boolean
+ */
+ public function __isset($name)
+ {
+ $key = ucfirst($name);
+ return isset(self::$reflectionMethods[$this->reflectionType]['get' . $key]) || isset(self::$reflectionMethods[$this->reflectionType]['is' . $key]);
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/SourceFilesFilterIterator.php b/vendor/apigen/apigen/ApiGen/SourceFilesFilterIterator.php
new file mode 100644
index 0000000..dc84108
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/SourceFilesFilterIterator.php
@@ -0,0 +1,75 @@
+excludeMasks = $excludeMasks;
+ }
+
+ /**
+ * Returns if the current file/directory should be processed.
+ *
+ * @return boolean
+ */
+ public function accept() {
+ /** @var \SplFileInfo */
+ $current = $this->current();
+
+ foreach ($this->excludeMasks as $mask) {
+ if (fnmatch($mask, $current->getPathName(), FNM_NOESCAPE)) {
+ return false;
+ }
+ }
+
+ if (!is_readable($current->getPathname())) {
+ throw new \InvalidArgumentException(sprintf('File/directory "%s" is not readable.', $current->getPathname()));
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns the iterator of the current element's children.
+ *
+ * @return \ApiGen\SourceFilesFilterIterator
+ */
+ public function getChildren()
+ {
+ return new static($this->getInnerIterator()->getChildren(), $this->excludeMasks);
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/Template.php b/vendor/apigen/apigen/ApiGen/Template.php
new file mode 100644
index 0000000..8bf4172
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/Template.php
@@ -0,0 +1,804 @@
+generator = $generator;
+ $this->config = $generator->getConfig();
+
+ $that = $this;
+
+ // Output in HTML5
+ Nette\Utils\Html::$xhtml = false;
+
+ // FSHL
+ $fshl = new FSHL\Highlighter(new FSHL\Output\Html());
+ $fshl->setLexer(new FSHL\Lexer\Php());
+
+ // Texy
+ $this->texy = new \Texy();
+ $this->texy->allowedTags = array_flip($this->config->allowedHtml);
+ $this->texy->allowed['list/definition'] = false;
+ $this->texy->allowed['phrase/em-alt'] = false;
+ $this->texy->allowed['longwords'] = false;
+ $this->texy->allowed['typography'] = false;
+ $this->texy->linkModule->shorten = false;
+ // Highlighting ,
+ $this->texy->addHandler('beforeParse', function($texy, &$text, $singleLine) {
+ $text = preg_replace('~(.+?)~', '#code#\\1#/code#', $text);
+ });
+ $this->texy->registerLinePattern(
+ function($parser, $matches, $name) use ($fshl) {
+ $content = $parser->getTexy()->protect($fshl->highlight($matches[1]), \Texy::CONTENT_MARKUP);
+ return \TexyHtml::el('code', $content);
+ },
+ '~#code#(.+?)#/code#~',
+ 'codeInlineSyntax'
+ );
+ $this->texy->registerBlockPattern(
+ function($parser, $matches, $name) use ($fshl) {
+ if ('code' === $matches[1]) {
+ $lines = array_filter(explode("\n", $matches[2]));
+ if (!empty($lines)) {
+ $firstLine = array_shift($lines);
+
+ $indent = '';
+ $li = 0;
+
+ while (isset($firstLine[$li]) && preg_match('~\s~', $firstLine[$li])) {
+ foreach ($lines as $line) {
+ if (!isset($line[$li]) || $firstLine[$li] !== $line[$li]) {
+ break 2;
+ }
+ }
+
+ $indent .= $firstLine[$li++];
+ }
+
+ if (!empty($indent)) {
+ $matches[2] = str_replace(
+ "\n" . $indent,
+ "\n",
+ 0 === strpos($matches[2], $indent) ? substr($matches[2], $li) : $matches[2]
+ );
+ }
+ }
+
+ $content = $fshl->highlight($matches[2]);
+ } else {
+ $content = htmlspecialchars($matches[2]);
+ }
+
+ $content = $parser->getTexy()->protect($content, \Texy::CONTENT_BLOCK);
+ return \TexyHtml::el('pre', $content);
+ },
+ '~<(code|pre)>(.+?)\1>~s',
+ 'codeBlockSyntax'
+ );
+
+ // Common operations
+ $this->registerHelperLoader('Nette\Templating\Helpers::loader');
+
+ // PHP source highlight
+ $this->registerHelper('highlightPHP', function($source, $context) use ($that, $fshl) {
+ return $that->resolveLink($that->getTypeName($source), $context) ?: $fshl->highlight((string) $source);
+ });
+ $this->registerHelper('highlightValue', function($definition, $context) use ($that) {
+ return $that->highlightPHP(preg_replace('~^(?:[ ]{4}|\t)~m', '', $definition), $context);
+ });
+
+ // Urls
+ $this->registerHelper('packageUrl', new Nette\Callback($this, 'getPackageUrl'));
+ $this->registerHelper('namespaceUrl', new Nette\Callback($this, 'getNamespaceUrl'));
+ $this->registerHelper('groupUrl', new Nette\Callback($this, 'getGroupUrl'));
+ $this->registerHelper('classUrl', new Nette\Callback($this, 'getClassUrl'));
+ $this->registerHelper('methodUrl', new Nette\Callback($this, 'getMethodUrl'));
+ $this->registerHelper('propertyUrl', new Nette\Callback($this, 'getPropertyUrl'));
+ $this->registerHelper('constantUrl', new Nette\Callback($this, 'getConstantUrl'));
+ $this->registerHelper('functionUrl', new Nette\Callback($this, 'getFunctionUrl'));
+ $this->registerHelper('elementUrl', new Nette\Callback($this, 'getElementUrl'));
+ $this->registerHelper('sourceUrl', new Nette\Callback($this, 'getSourceUrl'));
+ $this->registerHelper('manualUrl', new Nette\Callback($this, 'getManualUrl'));
+
+ // Packages & namespaces
+ $this->registerHelper('packageLinks', new Nette\Callback($this, 'getPackageLinks'));
+ $this->registerHelper('namespaceLinks', new Nette\Callback($this, 'getNamespaceLinks'));
+ $this->registerHelper('subgroupName', function($groupName) {
+ if ($pos = strrpos($groupName, '\\')) {
+ return substr($groupName, $pos + 1);
+ }
+ return $groupName;
+ });
+
+ // Types
+ $this->registerHelper('typeLinks', new Nette\Callback($this, 'getTypeLinks'));
+
+ // Docblock descriptions
+ $this->registerHelper('description', function($annotation, $context) use ($that) {
+ $description = trim(strpbrk($annotation, "\n\r\t $")) ?: $annotation;
+ return $that->doc($description, $context);
+ });
+ $this->registerHelper('shortDescription', function($element, $block = false) use ($that) {
+ return $that->doc($element->getShortDescription(), $element, $block);
+ });
+ $this->registerHelper('longDescription', function($element) use ($that) {
+ $long = $element->getLongDescription();
+
+ // Merge lines
+ $long = preg_replace_callback('~(?:<(code|pre)>.+?\1>)|([^<]*)~s', function($matches) {
+ return !empty($matches[2])
+ ? preg_replace('~\n(?:\t|[ ])+~', ' ', $matches[2])
+ : $matches[0];
+ }, $long);
+
+ return $that->doc($long, $element, true);
+ });
+
+ // Individual annotations processing
+ $this->registerHelper('annotation', function($value, $name, ReflectionElement $context) use ($that, $generator) {
+ switch ($name) {
+ case 'return':
+ case 'throws':
+ $description = $that->description($value, $context);
+ return sprintf('%s%s', $that->getTypeLinks($value, $context), $description ? ' ' . $description : '');
+ case 'license':
+ list($url, $description) = $that->split($value);
+ return $that->link($url, $description ?: $url);
+ case 'link':
+ list($url, $description) = $that->split($value);
+ if (Nette\Utils\Validators::isUrl($url)) {
+ return $that->link($url, $description ?: $url);
+ }
+ break;
+ case 'see':
+ $doc = array();
+ foreach (preg_split('~\\s*,\\s*~', $value) as $link) {
+ if (null !== $generator->resolveElement($link, $context)) {
+ $doc[] = sprintf('%s', $that->getTypeLinks($link, $context));
+ } else {
+ $doc[] = $that->doc($link, $context);
+ }
+ }
+ return implode(', ', $doc);
+ case 'uses':
+ case 'usedby':
+ list($link, $description) = $that->split($value);
+ $separator = $context instanceof ReflectionClass || !$description ? ' ' : ' ';
+ if (null !== $generator->resolveElement($link, $context)) {
+ return sprintf('%s%s%s', $that->getTypeLinks($link, $context), $separator, $description);
+ }
+ break;
+ default:
+ break;
+ }
+
+ // Default
+ return $that->doc($value, $context);
+ });
+
+ $todo = $this->config->todo;
+ $internal = $this->config->internal;
+ $this->registerHelper('annotationFilter', function(array $annotations, array $filter = array()) use ($todo, $internal) {
+ // Filtered, unsupported or deprecated annotations
+ static $filtered = array(
+ 'package', 'subpackage', 'property', 'property-read', 'property-write', 'method', 'abstract',
+ 'access', 'final', 'filesource', 'global', 'name', 'static', 'staticvar'
+ );
+ foreach ($filtered as $annotation) {
+ unset($annotations[$annotation]);
+ }
+
+ // Custom filter
+ foreach ($filter as $annotation) {
+ unset($annotations[$annotation]);
+ }
+
+ // Show/hide internal
+ if (!$internal) {
+ unset($annotations['internal']);
+ }
+
+ // Show/hide tasks
+ if (!$todo) {
+ unset($annotations['todo']);
+ }
+
+ return $annotations;
+ });
+
+ $this->registerHelper('annotationSort', function(array $annotations) {
+ uksort($annotations, function($one, $two) {
+ static $order = array(
+ 'deprecated' => 0, 'category' => 1, 'copyright' => 2, 'license' => 3, 'author' => 4, 'version' => 5,
+ 'since' => 6, 'see' => 7, 'uses' => 8, 'usedby' => 9, 'link' => 10, 'internal' => 11,
+ 'example' => 12, 'tutorial' => 13, 'todo' => 14
+ );
+
+ if (isset($order[$one], $order[$two])) {
+ return $order[$one] - $order[$two];
+ } elseif (isset($order[$one])) {
+ return -1;
+ } elseif (isset($order[$two])) {
+ return 1;
+ } else {
+ return strcasecmp($one, $two);
+ }
+ });
+ return $annotations;
+ });
+
+ $this->registerHelper('annotationBeautify', function($annotation) {
+ static $names = array(
+ 'usedby' => 'Used by'
+ );
+
+ if (isset($names[$annotation])) {
+ return $names[$annotation];
+ }
+
+ return Nette\Utils\Strings::firstUpper($annotation);
+ });
+
+ // Static files versioning
+ $destination = $this->config->destination;
+ $this->registerHelper('staticFile', function($name) use ($destination) {
+ static $versions = array();
+
+ $filename = $destination . DIRECTORY_SEPARATOR . $name;
+ if (!isset($versions[$filename]) && is_file($filename)) {
+ $versions[$filename] = sprintf('%u', crc32(file_get_contents($filename)));
+ }
+ if (isset($versions[$filename])) {
+ $name .= '?' . $versions[$filename];
+ }
+ return $name;
+ });
+
+ // Source anchors
+ $this->registerHelper('sourceAnchors', function($source) {
+ // Classes, interfaces, traits and exceptions
+ $source = preg_replace_callback('~((?:class|interface|trait)\\s+)(\\w+)~i', function($matches) {
+ $link = sprintf('%1$s', $matches[2]);
+ return $matches[1] . $link;
+ }, $source);
+
+ // Methods and functions
+ $source = preg_replace_callback('~(function\\s+)(\\w+)~i', function($matches) {
+ $link = sprintf('%1$s', $matches[2]);
+ return $matches[1] . $link;
+ }, $source);
+
+ // Constants
+ $source = preg_replace_callback('~(const)(.*?)(;)~is', function($matches) {
+ $links = preg_replace_callback('~(\\s|,)([A-Z_]+)(\\s+=)~', function($matches) {
+ return $matches[1] . sprintf('%1$s', $matches[2]) . $matches[3];
+ }, $matches[2]);
+ return $matches[1] . $links . $matches[3];
+ }, $source);
+
+ // Properties
+ $source = preg_replace_callback('~((?:private|protected|public|var|static)\\s+)(.*?)(;)~is', function($matches) {
+ $links = preg_replace_callback('~()(\\$\\w+)~i', function($matches) {
+ return $matches[1] . sprintf('%1$s', $matches[2]);
+ }, $matches[2]);
+ return $matches[1] . $links . $matches[3];
+ }, $source);
+
+ return $source;
+ });
+
+ $this->registerHelper('urlize', array($this, 'urlize'));
+
+ $this->registerHelper('relativePath', array($generator, 'getRelativePath'));
+ $this->registerHelper('resolveElement', array($generator, 'resolveElement'));
+ $this->registerHelper('getClass', array($generator, 'getClass'));
+ }
+
+ /**
+ * Returns unified type value definition (class name or member data type).
+ *
+ * @param string $name
+ * @param boolean $trimNamespaceSeparator
+ * @return string
+ */
+ public function getTypeName($name, $trimNamespaceSeparator = true)
+ {
+ static $names = array(
+ 'int' => 'integer',
+ 'bool' => 'boolean',
+ 'double' => 'float',
+ 'void' => '',
+ 'FALSE' => 'false',
+ 'TRUE' => 'true',
+ 'NULL' => 'null',
+ 'callback' => 'callable'
+ );
+
+ // Simple type
+ if (isset($names[$name])) {
+ return $names[$name];
+ }
+
+ // Class, constant or function
+ return $trimNamespaceSeparator ? ltrim($name, '\\') : $name;
+ }
+
+ /**
+ * Returns links for types.
+ *
+ * @param string $annotation
+ * @param \ApiGen\ReflectionElement $context
+ * @return string
+ */
+ public function getTypeLinks($annotation, ReflectionElement $context)
+ {
+ $links = array();
+
+ list($types) = $this->split($annotation);
+ if (!empty($types) && '$' === $types{0}) {
+ $types = null;
+ }
+
+ if (empty($types)) {
+ $types = 'mixed';
+ }
+
+ foreach (explode('|', $types) as $type) {
+ $type = $this->getTypeName($type, false);
+ $links[] = $this->resolveLink($type, $context) ?: $this->escapeHtml(ltrim($type, '\\'));
+ }
+
+ return implode('|', $links);
+ }
+
+ /**
+ * Returns links for package/namespace and its parent packages.
+ *
+ * @param string $package
+ * @param boolean $last
+ * @return string
+ */
+ public function getPackageLinks($package, $last = true)
+ {
+ if (empty($this->packages)) {
+ return $package;
+ }
+
+ $links = array();
+
+ $parent = '';
+ foreach (explode('\\', $package) as $part) {
+ $parent = ltrim($parent . '\\' . $part, '\\');
+ $links[] = $last || $parent !== $package
+ ? $this->link($this->getPackageUrl($parent), $part)
+ : $this->escapeHtml($part);
+ }
+
+ return implode('\\', $links);
+ }
+
+ /**
+ * Returns links for namespace and its parent namespaces.
+ *
+ * @param string $namespace
+ * @param boolean $last
+ * @return string
+ */
+ public function getNamespaceLinks($namespace, $last = true)
+ {
+ if (empty($this->namespaces)) {
+ return $namespace;
+ }
+
+ $links = array();
+
+ $parent = '';
+ foreach (explode('\\', $namespace) as $part) {
+ $parent = ltrim($parent . '\\' . $part, '\\');
+ $links[] = $last || $parent !== $namespace
+ ? $this->link($this->getNamespaceUrl($parent), $part)
+ : $this->escapeHtml($part);
+ }
+
+ return implode('\\', $links);
+ }
+
+ /**
+ * Returns a link to a namespace summary file.
+ *
+ * @param string $namespaceName Namespace name
+ * @return string
+ */
+ public function getNamespaceUrl($namespaceName)
+ {
+ return sprintf($this->config->template['templates']['main']['namespace']['filename'], $this->urlize($namespaceName));
+ }
+
+ /**
+ * Returns a link to a package summary file.
+ *
+ * @param string $packageName Package name
+ * @return string
+ */
+ public function getPackageUrl($packageName)
+ {
+ return sprintf($this->config->template['templates']['main']['package']['filename'], $this->urlize($packageName));
+ }
+
+ /**
+ * Returns a link to a group summary file.
+ *
+ * @param string $groupName Group name
+ * @return string
+ */
+ public function getGroupUrl($groupName)
+ {
+ if (!empty($this->packages)) {
+ return $this->getPackageUrl($groupName);
+ }
+
+ return $this->getNamespaceUrl($groupName);
+ }
+
+ /**
+ * Returns a link to class summary file.
+ *
+ * @param string|\ApiGen\ReflectionClass $class Class reflection or name
+ * @return string
+ */
+ public function getClassUrl($class)
+ {
+ $className = $class instanceof ReflectionClass ? $class->getName() : $class;
+ return sprintf($this->config->template['templates']['main']['class']['filename'], $this->urlize($className));
+ }
+
+ /**
+ * Returns a link to method in class summary file.
+ *
+ * @param \ApiGen\ReflectionMethod $method Method reflection
+ * @param \ApiGen\ReflectionClass $class Method declaring class
+ * @return string
+ */
+ public function getMethodUrl(ReflectionMethod $method, ReflectionClass $class = null)
+ {
+ $className = null !== $class ? $class->getName() : $method->getDeclaringClassName();
+ return $this->getClassUrl($className) . '#' . ($method->isMagic() ? 'm' : '') . '_' . ($method->getOriginalName() ?: $method->getName());
+ }
+
+ /**
+ * Returns a link to property in class summary file.
+ *
+ * @param \ApiGen\ReflectionProperty $property Property reflection
+ * @param \ApiGen\ReflectionClass $class Property declaring class
+ * @return string
+ */
+ public function getPropertyUrl(ReflectionProperty $property, ReflectionClass $class = null)
+ {
+ $className = null !== $class ? $class->getName() : $property->getDeclaringClassName();
+ return $this->getClassUrl($className) . '#' . ($property->isMagic() ? 'm' : '') . '$' . $property->getName();
+ }
+
+ /**
+ * Returns a link to constant in class summary file or to constant summary file.
+ *
+ * @param \ApiGen\ReflectionConstant $constant Constant reflection
+ * @return string
+ */
+ public function getConstantUrl(ReflectionConstant $constant)
+ {
+ // Class constant
+ if ($className = $constant->getDeclaringClassName()) {
+ return $this->getClassUrl($className) . '#' . $constant->getName();
+ }
+ // Constant in namespace or global space
+ return sprintf($this->config->template['templates']['main']['constant']['filename'], $this->urlize($constant->getName()));
+ }
+
+ /**
+ * Returns a link to function summary file.
+ *
+ * @param \ApiGen\ReflectionFunction $function Function reflection
+ * @return string
+ */
+ public function getFunctionUrl(ReflectionFunction $function)
+ {
+ return sprintf($this->config->template['templates']['main']['function']['filename'], $this->urlize($function->getName()));
+ }
+
+ /**
+ * Returns a link to element summary file.
+ *
+ * @param \ApiGen\ReflectionElement $element Element reflection
+ * @return string
+ */
+ public function getElementUrl(ReflectionElement $element)
+ {
+ if ($element instanceof ReflectionClass) {
+ return $this->getClassUrl($element);
+ } elseif ($element instanceof ReflectionMethod) {
+ return $this->getMethodUrl($element);
+ } elseif ($element instanceof ReflectionProperty) {
+ return $this->getPropertyUrl($element);
+ } elseif ($element instanceof ReflectionConstant) {
+ return $this->getConstantUrl($element);
+ } elseif ($element instanceof ReflectionFunction) {
+ return $this->getFunctionUrl($element);
+ }
+ }
+
+ /**
+ * Returns a link to a element source code.
+ *
+ * @param \ApiGen\ReflectionElement $element Element reflection
+ * @param boolean $withLine Include file line number into the link
+ * @return string
+ */
+ public function getSourceUrl(ReflectionElement $element, $withLine = true)
+ {
+ if ($element instanceof ReflectionClass || $element instanceof ReflectionFunction || ($element instanceof ReflectionConstant && null === $element->getDeclaringClassName())) {
+ $elementName = $element->getName();
+
+ if ($element instanceof ReflectionClass) {
+ $file = 'class-';
+ } elseif ($element instanceof ReflectionConstant) {
+ $file = 'constant-';
+ } elseif ($element instanceof ReflectionFunction) {
+ $file = 'function-';
+ }
+ } else {
+ $elementName = $element->getDeclaringClassName();
+ $file = 'class-';
+ }
+
+ $file .= $this->urlize($elementName);
+
+ $lines = null;
+ if ($withLine) {
+ $lines = $element->getStartLine() !== $element->getEndLine() ? sprintf('%s-%s', $element->getStartLine(), $element->getEndLine()) : $element->getStartLine();
+ }
+
+ return sprintf($this->config->template['templates']['main']['source']['filename'], $file) . (null !== $lines ? '#' . $lines : '');
+ }
+
+ /**
+ * Returns a link to a element documentation at php.net.
+ *
+ * @param \ApiGen\ReflectionBase $element Element reflection
+ * @return string
+ */
+ public function getManualUrl(ReflectionBase $element)
+ {
+ static $manual = 'http://php.net/manual';
+ static $reservedClasses = array('stdClass', 'Closure', 'Directory');
+
+ // Extension
+ if ($element instanceof ReflectionExtension) {
+ $extensionName = strtolower($element->getName());
+ if ('core' === $extensionName) {
+ return $manual;
+ }
+
+ if ('date' === $extensionName) {
+ $extensionName = 'datetime';
+ }
+
+ return sprintf('%s/book.%s.php', $manual, $extensionName);
+ }
+
+ // Class and its members
+ $class = $element instanceof ReflectionClass ? $element : $element->getDeclaringClass();
+
+ if (in_array($class->getName(), $reservedClasses)) {
+ return $manual . '/reserved.classes.php';
+ }
+
+ $className = strtolower($class->getName());
+ $classUrl = sprintf('%s/class.%s.php', $manual, $className);
+ $elementName = strtolower(strtr(ltrim($element->getName(), '_'), '_', '-'));
+
+ if ($element instanceof ReflectionClass) {
+ return $classUrl;
+ } elseif ($element instanceof ReflectionMethod) {
+ return sprintf('%s/%s.%s.php', $manual, $className, $elementName);
+ } elseif ($element instanceof ReflectionProperty) {
+ return sprintf('%s#%s.props.%s', $classUrl, $className, $elementName);
+ } elseif ($element instanceof ReflectionConstant) {
+ return sprintf('%s#%s.constants.%s', $classUrl, $className, $elementName);
+ }
+ }
+
+ /**
+ * Tries to parse a definition of a class/method/property/constant/function and returns the appropriate link if successful.
+ *
+ * @param string $definition Definition
+ * @param \ApiGen\ReflectionElement $context Link context
+ * @return string|null
+ */
+ public function resolveLink($definition, ReflectionElement $context)
+ {
+ if (empty($definition)) {
+ return null;
+ }
+
+ $suffix = '';
+ if ('[]' === substr($definition, -2)) {
+ $definition = substr($definition, 0, -2);
+ $suffix = '[]';
+ }
+
+ $element = $this->generator->resolveElement($definition, $context, $expectedName);
+ if (null === $element) {
+ return $expectedName;
+ }
+
+ $classes = array();
+ if ($element->isDeprecated()) {
+ $classes[] = 'deprecated';
+ }
+ if (!$element->isValid()) {
+ $classes[] = 'invalid';
+ }
+
+ if ($element instanceof ReflectionClass) {
+ $link = $this->link($this->getClassUrl($element), $element->getName(), true, $classes);
+ } elseif ($element instanceof ReflectionConstant && null === $element->getDeclaringClassName()) {
+ $text = $element->inNamespace()
+ ? $this->escapeHtml($element->getNamespaceName()) . '\\' . $this->escapeHtml($element->getShortName()) . ''
+ : '' . $this->escapeHtml($element->getName()) . '';
+ $link = $this->link($this->getConstantUrl($element), $text, false, $classes);
+ } elseif ($element instanceof ReflectionFunction) {
+ $link = $this->link($this->getFunctionUrl($element), $element->getName() . '()', true, $classes);
+ } else {
+ $text = $this->escapeHtml($element->getDeclaringClassName());
+ if ($element instanceof ReflectionProperty) {
+ $url = $this->propertyUrl($element);
+ $text .= '::$' . $this->escapeHtml($element->getName()) . '';
+ } elseif ($element instanceof ReflectionMethod) {
+ $url = $this->methodUrl($element);
+ $text .= '::' . $this->escapeHtml($element->getName()) . '()';
+ } elseif ($element instanceof ReflectionConstant) {
+ $url = $this->constantUrl($element);
+ $text .= '::' . $this->escapeHtml($element->getName()) . '';
+ }
+
+ $link = $this->link($url, $text, false, $classes);
+ }
+
+ return sprintf('%s', $link . $suffix);
+ }
+
+ /**
+ * Resolves links in documentation.
+ *
+ * @param string $text Processed documentation text
+ * @param \ApiGen\ReflectionElement $context Reflection object
+ * @return string
+ */
+ private function resolveLinks($text, ReflectionElement $context)
+ {
+ $that = $this;
+ return preg_replace_callback('~{@(?:link|see)\\s+([^}]+)}~', function ($matches) use ($context, $that) {
+ // Texy already added so it has to be stripped
+ list($url, $description) = $that->split(strip_tags($matches[1]));
+ if (Nette\Utils\Validators::isUrl($url)) {
+ return $that->link($url, $description ?: $url);
+ }
+ return $that->resolveLink($matches[1], $context) ?: $matches[1];
+ }, $text);
+ }
+
+ /**
+ * Resolves internal annotation.
+ *
+ * @param string $text
+ * @return string
+ */
+ private function resolveInternal($text)
+ {
+ $internal = $this->config->internal;
+ return preg_replace_callback('~\\{@(\\w+)(?:(?:\\s+((?>(?R)|[^{}]+)*)\\})|\\})~', function($matches) use ($internal) {
+ // Replace only internal
+ if ('internal' !== $matches[1]) {
+ return $matches[0];
+ }
+ return $internal && isset($matches[2]) ? $matches[2] : '';
+ }, $text);
+ }
+
+ /**
+ * Formats text as documentation block or line.
+ *
+ * @param string $text Text
+ * @param \ApiGen\ReflectionElement $context Reflection object
+ * @param boolean $block Parse text as block
+ * @return string
+ */
+ public function doc($text, ReflectionElement $context, $block = false)
+ {
+ return $this->resolveLinks($this->texy->process($this->resolveInternal($text), !$block), $context);
+ }
+
+ /**
+ * Parses annotation value.
+ *
+ * @param string $value
+ * @return array
+ */
+ public function split($value)
+ {
+ return preg_split('~\s+|$~', $value, 2);
+ }
+
+ /**
+ * Returns link.
+ *
+ * @param string $url
+ * @param string $text
+ * @param boolean $escape If the text should be escaped
+ * @param array $classes List of classes
+ * @return string
+ */
+ public function link($url, $text, $escape = true, array $classes = array())
+ {
+ $class = !empty($classes) ? sprintf(' class="%s"', implode(' ', $classes)) : '';
+ return sprintf('%s', $url, $class, $escape ? $this->escapeHtml($text) : $text);
+ }
+
+ /**
+ * Converts string to url safe characters.
+ *
+ * @param string $string
+ * @return string
+ */
+ public function urlize($string)
+ {
+ return preg_replace('~[^\w]~', '.', $string);
+ }
+}
diff --git a/vendor/apigen/apigen/ApiGen/Tree.php b/vendor/apigen/apigen/ApiGen/Tree.php
new file mode 100644
index 0000000..01f47b6
--- /dev/null
+++ b/vendor/apigen/apigen/ApiGen/Tree.php
@@ -0,0 +1,90 @@
+setPrefixPart(RecursiveTreeIterator::PREFIX_END_HAS_NEXT, self::HAS_NEXT);
+ $this->setPrefixPart(RecursiveTreeIterator::PREFIX_END_LAST, self::LAST);
+ $this->rewind();
+
+ $this->reflections = $reflections;
+ }
+
+ /**
+ * Returns if the current item has a sibling on the same level.
+ *
+ * @return boolean
+ */
+ public function hasSibling()
+ {
+ $prefix = $this->getPrefix();
+ return !empty($prefix) && self::HAS_NEXT === substr($prefix, -1);
+ }
+
+ /**
+ * Returns the current reflection.
+ *
+ * @return \ApiGen\Reflection
+ * @throws \UnexpectedValueException If current is not reflection array.
+ */
+ public function current()
+ {
+ $className = $this->key();
+ if (!isset($this->reflections[$className])) {
+ throw new RuntimeException(sprintf('Class "%s" is not in the reflection array', $className));
+ }
+
+ return $this->reflections[$className];
+ }
+}
diff --git a/vendor/apigen/apigen/CHANGELOG.md b/vendor/apigen/apigen/CHANGELOG.md
new file mode 100644
index 0000000..a836e55
--- /dev/null
+++ b/vendor/apigen/apigen/CHANGELOG.md
@@ -0,0 +1,128 @@
+## ApiGen 2.8.0 (2012-09-08) ##
+
+* Added support for @property and @method annotations
+* Added support for variable length parameters
+* Enabled selection of more rows in source code
+* Templates can specify minimum and maximum required ApiGen version
+* Added template for 404 page
+* Improved support for malformed @param annotations
+* Fixed excluding files and directories and detecting non accessible files and directories
+* Fixed internal error when no timezone is specified in php.ini
+* Fixed autocomplate in Opera browser
+* Nette framework updated to version 2.0.5
+* TokenReflection library updated to version 1.3.1
+* FSHL library updated to version 2.1.0
+
+## ApiGen 2.7.0 (2012-07-15) ##
+
+* Support of custom template macros and helpers
+* Information about overridden methods in class method list
+* Template UX fixes
+* Fixed bugs causing ApiGen to crash
+* TokenReflection library updated to version 1.3.0
+* Bootstrap2 based template
+* Removed template with frames
+
+## ApiGen 2.6.1 (2012-03-27) ##
+
+* Fixed resolving element names in annotations
+* Nette framework updated to version 2.0.1
+* TokenReflection library updated to version 1.2.2
+
+## ApiGen 2.6.0 (2012-03-11) ##
+
+* Better error reporting, especially about duplicate classes, functions and constants
+* Character set autodetection is on by default
+* Changed visualization of deprecated elements
+* Improved packages parsing and visualization
+* Improved @license and @link visualization
+* Improved `````` parsing
+* Added option ```--extensions``` to specify file extensions of parsed files
+* Minor visualization improvements
+* Fixed autocomplete for classes in namespaces
+* TokenReflection library updated to version 1.2.0
+
+## ApiGen 2.5.0 (2012-02-12) ##
+
+* Added option ```--groups``` for grouping classes, interfaces, traits and exceptions in the menu
+* Added option ```--autocomplete``` for choosing elements in the search autocomplete
+* Inheriting some annotations from the file-level docblock
+* @uses annotations create a @usedby annotation in the target documentation
+* Added warning for unknown options
+* Added support of comma-separated values for @see
+* Changed all path options to be relative to the configuration file
+* Fixed dependencies check
+* Nette framework updated to 2.0.0 stable version
+* TokenReflection library updated to version 1.1.0
+
+## ApiGen 2.4.1 (2012-01-25) ##
+
+* TokenReflection library updated to version 1.0.2
+* Nette framework updated to version 2.0.0RC1
+
+## ApiGen 2.4.0 (2011-12-24) ##
+
+* TokenReflection library updated to version 1.0.0
+* Fixed support for older PHP versions of the 5.3 branch
+* Option ```templateConfig``` is relative to the config file (was relative to cwd)
+
+## ApiGen 2.3.0 (2011-11-13) ##
+
+* Added support for default configuration file
+* Added link to download documentation as ZIP archive
+* Added option ```--charset``` and autodetection of charsets
+* Added support for @ignore annotation
+* Added PHAR support
+* Added support for ClassName[]
+* Added memory usage reporting in progressbar
+* Improved templates for small screens
+* Changed option name ```--undocumented``` to ```--report```
+* FSHL library updated to version 2.0.1
+
+## ApiGen 2.2.1 (2011-10-26) ##
+
+* Fixed processing of magic constants
+* Fixed resize.png
+* TokenReflection library updated to version 1.0.0RC2
+
+## ApiGen 2.2.0 (2011-10-16) ##
+
+* Added an option to check for updates
+* Added an option to initially display elements in alphabetical order
+* Added an option to generate the robots.txt file
+* Added required extensions check
+* Changed reporting of undocumented elements to the checkstyle format
+* Improved deprecated elements highlighting
+* Highlighting the linked source code line
+* Unknown annotations are sorted alphabetically
+* Fixed class parameter description parsing
+* Fixed command line options parsing
+* Fixed include path setting of the GitHub version
+* Fixed frames template
+
+## ApiGen 2.1.0 (2011-09-04) ##
+
+* Experimental support of PHP 5.4 traits
+* Added option ```--colors```
+* Added template with frames
+* Added templates option to make element details expanded by default
+
+## ApiGen 2.0.3 (2011-08-22) ##
+
+* @param, @return and @throw annotations are inherited
+
+## ApiGen 2.0.2 (2011-07-21) ##
+
+* Fixed inherited methods listing
+* Interfaces are not labeled "Abstract interface"
+* Fixed Google CSE ID validation
+* Fixed filtering by ```--exclude``` and ```--skip-doc-path```
+* Fixed exception output when using ```--debug```
+
+## ApiGen 2.0.1 (2011-07-17) ##
+
+* Updated TokenReflection library to 1.0.0beta5
+* Requires FSHL 2.0.0RC
+* Fixed url in footer
+
+## ApiGen 2.0.0 (2011-06-28) ##
diff --git a/vendor/apigen/apigen/LICENSE.md b/vendor/apigen/apigen/LICENSE.md
new file mode 100644
index 0000000..afe8631
--- /dev/null
+++ b/vendor/apigen/apigen/LICENSE.md
@@ -0,0 +1,32 @@
+# Licenses #
+
+You may use ApiGen under the terms of either the New BSD License or the GNU General Public License (GPL) version 2 or 3.
+
+The BSD License is recommended for most projects. It is easy to understand and it places almost no restrictions on what you can do with the framework. If the GPL fits better to your project, you can use the framework under this license.
+
+You don't have to notify anyone which license you are using. You can freely use ApiGen in commercial projects as long as the copyright header remains intact.
+
+## New BSD License ##
+
+Copyright (c) 2010 [David Grudl](http://davidgrudl.com)
+Copyright (c) 2011-2012 [Jaroslav Hanslík](https://github.com/kukulich)
+Copyright (c) 2011-2012 [Ondřej Nešpor](https://github.com/Andrewsville)
+
+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 "ApiGen" 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.
+
+## GNU General Public License ##
+
+GPL licenses are very very long, so instead of including them here we offer you URLs with full text:
+
+* [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html)
+* [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/vendor/apigen/apigen/README.md b/vendor/apigen/apigen/README.md
new file mode 100644
index 0000000..71a56b0
--- /dev/null
+++ b/vendor/apigen/apigen/README.md
@@ -0,0 +1,259 @@
+# Welcome to ApiGen #
+
+ApiGen is the tool for creating professional API documentation from PHP source code, similar to discontinued phpDocumentor/phpDoc.
+
+ApiGen has support for PHP 5.3 namespaces, packages, linking between documentation, cross referencing to PHP standard classes and general documentation, creation of highlighted source code and experimental support for PHP 5.4 **traits**.
+
+## Support & Bug Reports ##
+
+For all support questions please use our [mailing list](https://groups.google.com/group/apigen). For bug reports and issues the [issue tracker](https://github.com/apigen/apigen/issues) is available. Changes between versions are described in the [change log](https://github.com/apigen/apigen/blob/master/CHANGELOG.md).
+
+## Features ##
+
+* Our own [TokenReflection library](https://github.com/Andrewsville/PHP-Token-Reflection) is used to describe the source code. It is **safe** (documented source code does not get included and thus parsed) and **simple** (you do not need to include or autoload all libraries you use in your source code).
+* Detailed documentation of classes, functions and constants.
+* Highlighted source code.
+* Support of namespaces and packages with subpackages.
+* Experimental support of traits.
+* A page with trees of classes, interfaces, traits and exceptions.
+* A page with a list of deprecated elements.
+* A page with Todo tasks.
+* Link to download documentation as ZIP archive.
+* Checkstyle report of poorly documented elements.
+* Support for docblock templates.
+* Support for @inheritdoc.
+* Support for {@link}.
+* Active links in @see and @uses tags.
+* Documentation of used internal PHP classes.
+* Links to the start line in the highlighted source code for every described element.
+* List of direct and indirect known subclasses, implementers and users for every class/interface/trait/exception.
+* Check for a new version.
+* Google CSE support with suggest.
+* Google Analytics support.
+* Support for multiple/custom templates.
+* Sitemap and opensearch support.
+* Support for different charsets and line endings.
+* Lots of configuration options (see below).
+
+## Installation ##
+
+The preferred installation way is using the standalone package but there are three more ways how to install ApiGen.
+
+### Standalone package ###
+
+To download the actual release visit the [Downloads section](https://github.com/apigen/apigen/downloads). There you find separate packages for each release in two formats - zip and tar.gz. These packages are prepared by the ApiGen team and are truly standalone; they contain all required libraries in appropriate versions. You just need to extract the contents of an archive and you can start using ApiGen.
+
+### Composer ###
+
+Just create a `composer.json` file and run the `php composer.phar install` command to install it:
+
+```
+{
+ "require-dev": {
+ "apigen/apigen": "~2.8.0"
+ }
+}
+```
+
+### GitHub built archive ###
+
+GitHub allows you to download any repository as a zip or tar.gz archive. You can use this feature to download an archive with the current version of ApiGen. However this approach has one disadvantage. Such archive (in contrast to the standalone packages) does not contain required libraries. They are included as git submodules in the repository and GitHub simply ignores them when generating the archive. It means that you will have to obtain required libraries manually.
+
+### Cloning the repository ###
+
+The last way how to install ApiGen is simply to clone our repository. If you do so, remember to fetch and rebase to get new versions and do not forget to update submodules in the libs directory.
+
+## Usage ##
+
+```
+ apigen --config [options]
+ apigen --source --destination [options]
+```
+
+As you can see, you can use ApiGen either by providing individual parameters via the command line or using a config file. Moreover you can combine the two methods and the command line parameters will have precedence over those in the config file.
+
+Every configuration option has to be followed by its value. And it is exactly the same to write ```--config=file.conf``` and ```--config file.conf```. The only exceptions are boolean options (those with yes|no values). When using these options on the command line you do not have to provide the "yes" value explicitly. If ommited, it is assumed that you wanted to turn the option on. So using ```--debug=yes``` and ```--debug``` does exactly the same (and the opposite is ```--debug=no```).
+
+Some options can have multiple values. To do so, you can either use them multiple times or separate their values by a comma. It means that ```--source=file1.php --source=file2.php``` and ```--source=file1.php,file2.php``` is exactly the same.
+
+### Options ###
+
+```--config|-c ```
+
+Path to the config file.
+
+```--source|-s ``` **required**
+
+Path to the directory or file to be processed. You can use the parameter multiple times to provide a list of directories or files. All types of PHAR archives are supported (requires the PHAR extension). To process gz/bz2 compressed archives you need the appropriate extension (see requirements).
+
+```--destination|-d ``` **required**
+
+Documentation will be generated into this directory.
+
+```--extensions ```
+
+List of allowed file extensions, default is "php".
+
+```--exclude ```
+
+Directories and files matching this file mask will not be parsed. You can exclude for example tests from processing this way. This parameter is case sensitive and can be used multiple times.
+
+```--skip-doc-path ```
+```--skip-doc-prefix ```
+
+Using this parameters you can tell ApiGen not to generate documentation for elements from certain files or with certain name prefix. Such classes will appear in class trees, but will not create a link to their documentation. These parameters are case sensitive and can be used multiple times.
+
+```--charset ```
+
+Character set of source files, default is "auto" that lets ApiGen choose from all supported character sets. However if you use only one characters set across your source files you should set it explicitly to avoid autodetection because it can be tricky (and is not completely realiable). Moreover autodetection slows down the process of generating documentation. You can also use the parameter multiple times to provide a list of all used character sets in your documentation. In that case ApiGen will choose one of provided character sets for each file.
+
+```--main ```
+
+Elements with this name prefix will be considered as the "main project" (the rest will be considered as libraries).
+
+```--title ```
+
+Title of the generated documentation.
+
+```--base-url ```
+
+Documentation base URL used in the sitemap. Only needed if you plan to make your documentation public.
+
+```--google-cse-id ```
+
+If you have a Google CSE ID, the search box will use it when you do not enter an exact class, constant or function name.
+
+```--google-analytics ```
+
+A Google Analytics tracking code. If provided, an ansynchronous tracking code will be placed into every generated page.
+
+```--template-config ```
+
+Template config file, default is the config file of ApiGen default template.
+
+```--allowed-html ```
+
+List of allowed HTML tags in documentation separated by comma. Default value is "b,i,a,ul,ol,li,p,br,var,samp,kbd,tt".
+
+```--groups ```
+
+How should elements be grouped in the menu. Possible options are "auto", "namespaces", "packages" and "none". Default value is "auto" (namespaces are used if the source code uses them, packages otherwise).
+
+```--autocomplete ```
+
+List of element types that will appear in the search input autocomplete. Possible values are "classes", "constants", "functions", "methods", "properties" and "classconstants". Default value is "classes,constants,functions".
+
+```--access-levels ```
+
+Access levels of methods and properties that should get their documentation parsed. Default value is "public,protected" (don't generate private class members).
+
+```--internal ```
+
+Generate documentation for elements marked as internal (```@internal``` without description) and display parts of the documentation that are marked as internal (```@internal with description ...``` or inline ```{@internal ...}```), default is "No".
+
+```--php ```
+
+Generate documentation for PHP internal classes, default is "Yes".
+
+```--tree ```
+
+Generate tree view of classes, interfaces, traits and exceptions, default is "Yes".
+
+```--deprecated ```
+
+Generate documentation for deprecated elements, default is "No".
+
+```--todo ```
+
+Generate a list of tasks, default is "No".
+
+```--source-code ```
+
+Generate highlighted source code for user defined elements, default is "Yes".
+
+```--download ```
+
+Add a link to download documentation as a ZIP archive, default is "No".
+
+```--report ```
+
+Save a checkstyle report of poorly documented elements into a file.
+
+```--wipeout ```
+
+Delete files generated in the previous run, default is "Yes".
+
+```--quiet ```
+
+Do not print any messages to the console, default is "No".
+
+```--progressbar ```
+
+Display progressbars, default is "Yes".
+
+```--colors ```
+
+Use colors, default "No" on Windows, "Yes" on other systems. Windows doesn't support colors in console however you can enable it with [Ansicon](http://adoxa.110mb.com/ansicon/).
+
+```--update-check ```
+
+Check for a new version of ApiGen, default is "Yes".
+
+```--debug ```
+
+Display additional information (exception trace) in case of an error, default is "No".
+
+```--help|-h ```
+
+Display the list of possible options.
+
+Only ```--source``` and ```--destination``` parameters are required. You can provide them via command line or a configuration file.
+
+### Config files ###
+
+Instead of providing individual parameters via the command line, you can prepare a config file for later use. You can use all the above listed parameters (with one exception: the ```--config``` option) only without dashes and with an uppercase letter after each dash (so ```--access-level``` becomes ```accessLevel```).
+
+ApiGen uses the [NEON file format](http://ne-on.org) for all its config files. You can try the [online parser](http://ne-on.org) to debug your config files and see how they get parsed.
+
+Then you can call ApiGen with a single parameter ```--config``` specifying the config file to load.
+
+```
+ apigen --config [options]
+```
+
+Even when using a config file, you can still provide additional parameters via the command line. Such parameters will have precedence over parameters from the config file.
+
+Keep in mind, that any values in the config file will be **overwritten** by values from the command line. That means that providing the ```--source``` parameter values both in the config file and via the command line will not result in using all the provided values but only those from the command line.
+
+If you provide no command line parameters at all, ApiGen will try to load a default config file called ```apigen.neon``` in the current working directory. If found it will work as if you used the ```--config``` option. Note that when using any command line option, you have to specify the config file if you have one. ApiGen will try to load one automatically only when no command line parameters are used. Option names have to be in camelCase in config files (```--template-config``` on the command line becomes ```templateConfig``` in a config file). You can see a full list of configuration options with short descriptions in the example config file [apigen.neon.example](https://github.com/apigen/apigen/blob/master/apigen.neon.example).
+
+### Example ###
+
+We are generating documentation for the Nella Framework. We want Nette and Doctrine to be parsed as well because we want their classes to appear in class trees, lists of parent classes and their members in lists of inherited properties, methods and constants. However we do not want to generate their full documentation along with highlighted source codes. And we do not want to process any "test" directories, because there might be classes that do not belong to the project actually.
+
+```
+ apigen --source ~/nella/Nella --source ~/doctrine2/lib/Doctrine --source ~/doctrine2/lib/vendor --source ~/nette/Nette --skip-doc-path "~/doctrine2/*" --skip-doc-prefix Nette --exclude "*/tests/*" --destination ~/docs/ --title "Nella Framework"
+```
+
+## Requirements ##
+
+ApiGen requires PHP 5.3 or later. Four libraries it uses ([Nette](https://github.com/nette/nette), [Texy](https://github.com/dg/texy), [TokenReflection](https://github.com/Andrewsville/PHP-Token-Reflection) and [FSHL](https://github.com/kukulich/fshl)) require four additional PHP extensions: [tokenizer](http://php.net/manual/book.tokenizer.php), [mbstring](http://php.net/manual/book.mbstring.php), [iconv](http://php.net/manual/book.iconv.php) and [json](http://php.net/manual/book.json.php). For documenting PHAR archives you need the [phar extension](http://php.net/manual/book.phar.php) and for documenting gz or bz2 compressed PHARs, you need the [zlib](http://php.net/manual/book.zlib.php) or [bz2](http://php.net/manual/book.bzip2.php) extension respectively. To generate the ZIP file with documentation you need the [zip extension](http://php.net/manual/book.zip.php).
+
+When generating documentation of large libraries (Zend Framework for example) we recommend not to have the Xdebug PHP extension loaded (it does not need to be used, it significantly slows down the generating process even when only loaded).
+
+## Authors ##
+
+* [Jaroslav Hanslík](https://github.com/kukulich)
+* [Ondřej Nešpor](https://github.com/Andrewsville)
+* [David Grudl](https://github.com/dg)
+
+## Usage examples ##
+
+* [Doctrine](http://www.doctrine-project.org/api/orm/2.2/index.html)
+* [Nette Framework](http://api.nette.org/2.0/)
+* [TokenReflection library](http://andrewsville.github.com/PHP-Token-Reflection/)
+* [FSHL library](http://fshl.kukulich.cz/api/)
+* [Nella Framework](http://api.nellafw.org/)
+* Jyxo PHP Libraries, both [namespaced](http://jyxo.github.com/php/) and [non-namespaced](http://jyxo.github.com/php-no-namespace/)
+
+Besides from these publicly visible examples there are companies that use ApiGen to generate their inhouse documentation: [Medio Interactive](http://www.medio.cz/), [Wikidi](http://wikidi.com/).
\ No newline at end of file
diff --git a/vendor/apigen/apigen/apigen b/vendor/apigen/apigen/apigen
new file mode 100755
index 0000000..0e52ab5
--- /dev/null
+++ b/vendor/apigen/apigen/apigen
@@ -0,0 +1,262 @@
+#!/usr/bin/env php
+processCliOptions($options);
+ $generator = new Generator($config);
+
+ // Help
+ if ($config->isHelpRequested()) {
+ echo $generator->colorize($generator->getHeader());
+ echo $generator->colorize($config->getHelp());
+ die();
+ }
+
+ // Prepare configuration
+ $config->prepare();
+
+ if ($config->debug) {
+ Debugger::$onFatalError = array();
+ Debugger::enable(Debugger::DEVELOPMENT, false);
+ }
+
+ $generator->output($generator->getHeader());
+
+ // Check for update (only in production mode)
+ if ($config->updateCheck && !$config->debug) {
+ ini_set('default_socket_timeout', 5);
+ $latestVersion = @file_get_contents('http://pear.apigen.org/rest/r/apigen/latest.txt');
+ if (false !== $latestVersion && version_compare(trim($latestVersion), Generator::VERSION, '>')) {
+ $generator->output(sprintf("New version @header@%s@c available\n\n", $latestVersion));
+ }
+ }
+
+ // Scan
+ if (count($config->source) > 1) {
+ $generator->output(sprintf("Scanning\n @value@%s@c\n", implode("\n ", $config->source)));
+ } else {
+ $generator->output(sprintf("Scanning @value@%s@c\n", $config->source[0]));
+ }
+ if (count($config->exclude) > 1) {
+ $generator->output(sprintf("Excluding\n @value@%s@c\n", implode("\n ", $config->exclude)));
+ } elseif (!empty($config->exclude)) {
+ $generator->output(sprintf("Excluding @value@%s@c\n", $config->exclude[0]));
+ }
+
+ $parsed = $generator->parse();
+
+ if (count($parsed->errors) > 1) {
+ $generator->output(sprintf("@error@Found %d errors@c\n\n", count($parsed->errors)));
+
+ $no = 1;
+ foreach ($parsed->errors as $e) {
+
+ if ($e instanceof TokenReflection\Exception\ParseException) {
+ $generator->output(sprintf("@error@%d.@c The TokenReflection library threw an exception while parsing the file @value@%s@c.\n", $no, $e->getFileName()));
+ if ($config->debug) {
+ $generator->output("\nThis can have two reasons: a) the source code in the file is not valid or b) you have just found a bug in the TokenReflection library.\n\n");
+ $generator->output("If the license allows it please send the whole file or at least the following fragment describing where exacly is the problem along with the backtrace to apigen@apigen.org. Thank you!\n\n");
+
+ $token = $e->getToken();
+ $sender = $e->getSender();
+ if (!empty($token)) {
+ $generator->output(
+ sprintf(
+ "The cause of the exception \"%s\" was the @value@%s@c token (line @count@%d@c) in following part of %s source code:\n\n",
+ $e->getMessage(),
+ $e->getTokenName(),
+ $e->getExceptionLine(),
+ $sender && $sender->getName() ? '@value@' . $sender->getPrettyName() . '@c' : 'the'
+ )
+ );
+ } else {
+ $generator->output(
+ sprintf(
+ "The exception \"%s\" was thrown when processing %s source code:\n\n",
+ $e->getMessage(),
+ $sender && $sender->getName() ? '@value@' . $sender->getPrettyName() . '@c' : 'the'
+ )
+ );
+ }
+
+ $generator->output($e->getSourcePart(true) . "\n\nThe exception backtrace is following:\n\n" . $e->getTraceAsString() . "\n\n");
+ }
+ } elseif ($e instanceof TokenReflection\Exception\FileProcessingException) {
+ $generator->output(sprintf("@error@%d.@c %s\n", $no, $e->getMessage()));
+ if ($config->debug) {
+ $generator->output("\n" . $e->getDetail() . "\n\n");
+ }
+ } else {
+ $generator->output(sprintf("@error@%d.@c %s\n", $no, $e->getMessage()));
+ if ($config->debug) {
+ $trace = $e->getTraceAsString();
+ while ($e = $e->getPrevious()) {
+ $generator->output(sprintf("\n%s", $e->getMessage()));
+ $trace = $e->getTraceAsString();
+ }
+ $generator->output(sprintf("\n%s\n\n", $trace));
+ }
+ }
+
+ $no++;
+ }
+
+ if (!$config->debug) {
+ $generator->output("\nEnable the debug mode (@option@--debug@c) to see more details.\n\n");
+ }
+ }
+
+ $generator->output(sprintf("Found @count@%d@c classes, @count@%d@c constants, @count@%d@c functions and other @count@%d@c used PHP internal classes\n", $parsed->classes, $parsed->constants, $parsed->functions, $parsed->internalClasses));
+ $generator->output(sprintf("Documentation for @count@%d@c classes, @count@%d@c constants, @count@%d@c functions and other @count@%d@c used PHP internal classes will be generated\n", $parsed->documentedClasses, $parsed->documentedConstants, $parsed->documentedFunctions, $parsed->documentedInternalClasses));
+
+ // Generating
+ $generator->output(sprintf("Using template config file @value@%s@c\n", $config->templateConfig));
+
+ if ($config->wipeout && is_dir($config->destination)) {
+ $generator->output("Wiping out destination directory\n");
+ if (!$generator->wipeOutDestination()) {
+ throw new \RuntimeException('Cannot wipe out destination directory');
+ }
+ }
+
+ $generator->output(sprintf("Generating to directory @value@%s@c\n", $config->destination));
+ $skipping = array_merge($config->skipDocPath, $config->skipDocPrefix);
+ if (count($skipping) > 1) {
+ $generator->output(sprintf("Will not generate documentation for\n @value@%s@c\n", implode("\n ", $skipping)));
+ } elseif (!empty($skipping)) {
+ $generator->output(sprintf("Will not generate documentation for @value@%s@c\n", $skipping[0]));
+ }
+ $generator->generate();
+
+ // End
+ $end = new \DateTime();
+ $interval = $end->diff($start);
+ $parts = array();
+ if ($interval->h > 0) {
+ $parts[] = sprintf('@count@%d@c hours', $interval->h);
+ }
+ if ($interval->i > 0) {
+ $parts[] = sprintf('@count@%d@c min', $interval->i);
+ }
+ if ($interval->s > 0) {
+ $parts[] = sprintf('@count@%d@c sec', $interval->s);
+ }
+ if (empty($parts)) {
+ $parts[] = sprintf('@count@%d@c sec', 1);
+ }
+
+ $duration = implode(' ', $parts);
+ $generator->output(sprintf("Done. Total time: %s, used: @count@%d@c MB RAM\n", $duration, round(memory_get_peak_usage(true) / 1024 / 1024)));
+
+} catch (ConfigException $e) {
+ // Configuration error
+ echo $generator->colorize($generator->getHeader() . sprintf("\n@error@%s@c\n\n", $e->getMessage()) . $config->getHelp());
+
+ die(2);
+} catch (\Exception $e) {
+ // Everything else
+ if ($config->debug) {
+ do {
+ echo $generator->colorize(sprintf("\n%s(%d): @error@%s@c", $e->getFile(), $e->getLine(), $e->getMessage()));
+ $trace = $e->getTraceAsString();
+ } while ($e = $e->getPrevious());
+
+ printf("\n\n%s\n", $trace);
+ } else {
+ echo $generator->colorize(sprintf("\n@error@%s@c\n", $e->getMessage()));
+ }
+
+ die(1);
+}
\ No newline at end of file
diff --git a/vendor/apigen/apigen/apigen.bat b/vendor/apigen/apigen/apigen.bat
new file mode 100644
index 0000000..9be5228
--- /dev/null
+++ b/vendor/apigen/apigen/apigen.bat
@@ -0,0 +1,16 @@
+@echo off
+REM ApiGen 2.8.0 - API documentation generator for PHP 5.3+
+REM
+REM Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
+REM Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
+REM Copyright (c) 2011-2012 Ondřej Nešpor (https://github.com/Andrewsville)
+REM
+REM For the full copyright and license information, please view
+REM the file LICENCE.md that was distributed with this source code.
+REM
+
+IF EXIST "@php_bin@" (
+ "@php_bin@" "@bin_dir@\apigen" %*
+) ELSE (
+ "php.exe" "%~dp0apigen.php" %*
+)
diff --git a/vendor/apigen/apigen/apigen.neon.example b/vendor/apigen/apigen/apigen.neon.example
new file mode 100644
index 0000000..e6ad37b
--- /dev/null
+++ b/vendor/apigen/apigen/apigen.neon.example
@@ -0,0 +1,65 @@
+# Source file or directory to parse
+source:
+# Directory where to save the generated documentation
+destination:
+# List of allowed file extensions
+extensions: [php]
+# Mask to exclude file or directory from processing
+exclude:
+# Don't generate documentation for classes from file or directory with this mask
+skipDocPath:
+# Don't generate documentation for classes with this name prefix
+skipDocPrefix:
+# Character set of source files
+charset: auto
+# Main project name prefix
+main:
+
+# Title of generated documentation
+title:
+# Documentation base URL
+baseUrl:
+# Google Custom Search ID
+googleCseId:
+# Google Analytics tracking code
+googleAnalytics:
+# Template config file
+templateConfig: './templates/default/config.neon'
+# Grouping of classes
+groups: auto
+# List of allowed HTML tags in documentation
+allowedHtml: [b, i, a, ul, ol, li, p, br, var, samp, kbd, tt]
+# Element types for search input autocomplete
+autocomplete: [classes, constants, functions]
+
+# Generate documentation for methods and properties with given access level
+accessLevels: [public, protected]
+# Generate documentation for elements marked as internal and display internal documentation parts
+internal: No
+# Generate documentation for PHP internal classes
+php: Yes
+# Generate tree view of classes, interfaces and exceptions
+tree: Yes
+# Generate documentation for deprecated classes, methods, properties and constants
+deprecated: No
+# Generate documentation of tasks
+todo: No
+# Generate highlighted source code files
+sourceCode: Yes
+# Add a link to download documentation as a ZIP archive
+download: No
+# Save a checkstyle report of poorly documented elements into a file
+report:
+
+# Wipe out the destination directory first
+wipeout: Yes
+# Don't display scanning and generating messages
+quiet: No
+# Display progressbars
+progressbar: Yes
+# Use colors
+colors: No
+# Check for update
+updateCheck: Yes
+# Display additional information in case of an error
+debug: No
diff --git a/vendor/apigen/apigen/composer.json b/vendor/apigen/apigen/composer.json
new file mode 100644
index 0000000..0c6cf0f
--- /dev/null
+++ b/vendor/apigen/apigen/composer.json
@@ -0,0 +1,56 @@
+{
+ "name": "apigen/apigen",
+ "description": "API documentation generator for PHP 5.3+",
+ "type": "project",
+ "keywords": ["documentation", "docblock", "phpdoc", "phpdocumentor", "generator", "api"],
+ "homepage": "http://apigen.org/",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Jaroslav Hanslík",
+ "homepage": "https://github.com/kukulich"
+ },
+ {
+ "name": "Ondřej Nešpor",
+ "homepage": "https://github.com/andrewsville"
+ },
+ {
+ "name": "David Grudl",
+ "homepage": "http://davidgrudl.com"
+ }
+ ],
+ "support": {
+ "issues": "https://github.com/apigen/apigen/issues",
+ "forum": "https://groups.google.com/group/apigen",
+ "source": "https://github.com/apigen/apigen"
+ },
+ "require": {
+ "php": ">=5.3.0",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "nette/nette": "~2.1.1",
+ "texy/texy": "~2.4.0",
+ "kukulich/fshl": "~2.1.0",
+ "andrewsville/php-token-reflection": "~1.3.1"
+ },
+ "suggest": {
+ "ext-bz2": "*",
+ "ext-phar": "*",
+ "ext-zip": "*",
+ "ext-zlib": "*"
+ },
+ "autoload": {
+ "psr-0": {
+ "ApiGen": "./"
+ }
+ },
+ "bin": [
+ "apigen"
+ ],
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8.0",
+ "dev-develop": "3.0.0-dev"
+ }
+ }
+}
diff --git a/vendor/apigen/apigen/templates/bootstrap/404.latte b/vendor/apigen/apigen/templates/bootstrap/404.latte
new file mode 100644
index 0000000..3b0d1f8
--- /dev/null
+++ b/vendor/apigen/apigen/templates/bootstrap/404.latte
@@ -0,0 +1,23 @@
+{*
+ApiGen 2.8.0 - API documentation generator for PHP 5.3+
+
+Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
+Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
+Copyright (c) 2011-2012 Ondřej Nešpor (https://github.com/Andrewsville)
+
+For the full copyright and license information, please view
+the file LICENSE.md that was distributed with this source code.
+*}
+{layout '@layout.latte'}
+{var $robots = false}
+
+{block title}Page not found{/block}
+
+{block content}
+
+
{include title}
+
The requested page could not be found.
+
You have probably clicked on a link that is outdated and points to a page that does not exist any more or you have made an typing error in the address.
+
To continue please try to find requested page in the menu,{if $config->tree} take a look at the tree view of the whole project{/if} or use search field on the top.
+
+{/block}
diff --git a/vendor/apigen/apigen/templates/bootstrap/@elementlist.latte b/vendor/apigen/apigen/templates/bootstrap/@elementlist.latte
new file mode 100644
index 0000000..06a5754
--- /dev/null
+++ b/vendor/apigen/apigen/templates/bootstrap/@elementlist.latte
@@ -0,0 +1,59 @@
+{*
+ApiGen 2.8.0 - API documentation generator for PHP 5.3+
+
+Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
+Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
+Copyright (c) 2011-2012 Ondřej Nešpor (https://github.com/Andrewsville)
+Copyright (c) 2012 Olivier Laviale (https://github.com/olvlvl)
+
+For the full copyright and license information, please view
+the file LICENSE.md that was distributed with this source code.
+*}
+{define elements}
+
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
+ {include tree, tree => $exceptionTree}
+ {/if}
+
+{/block}
diff --git a/vendor/apigen/apigen/templates/default/404.latte b/vendor/apigen/apigen/templates/default/404.latte
new file mode 100644
index 0000000..3b0d1f8
--- /dev/null
+++ b/vendor/apigen/apigen/templates/default/404.latte
@@ -0,0 +1,23 @@
+{*
+ApiGen 2.8.0 - API documentation generator for PHP 5.3+
+
+Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
+Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
+Copyright (c) 2011-2012 Ondřej Nešpor (https://github.com/Andrewsville)
+
+For the full copyright and license information, please view
+the file LICENSE.md that was distributed with this source code.
+*}
+{layout '@layout.latte'}
+{var $robots = false}
+
+{block title}Page not found{/block}
+
+{block content}
+
+
{include title}
+
The requested page could not be found.
+
You have probably clicked on a link that is outdated and points to a page that does not exist any more or you have made an typing error in the address.
+
To continue please try to find requested page in the menu,{if $config->tree} take a look at the tree view of the whole project{/if} or use search field on the top.
+
+{/block}
diff --git a/vendor/apigen/apigen/templates/default/@elementlist.latte b/vendor/apigen/apigen/templates/default/@elementlist.latte
new file mode 100644
index 0000000..0770770
--- /dev/null
+++ b/vendor/apigen/apigen/templates/default/@elementlist.latte
@@ -0,0 +1,46 @@
+{*
+ApiGen 2.8.0 - API documentation generator for PHP 5.3+
+
+Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
+Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
+Copyright (c) 2011-2012 Ondřej Nešpor (https://github.com/Andrewsville)
+
+For the full copyright and license information, please view
+the file LICENSE.md that was distributed with this source code.
+*}
+{define elements}
+
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
';
+ ?>
+```
+
+Or
+
+```php
+ ';
+ echo $highlighter->highlight('', new \FSHL\Lexer\Php());
+ echo '';
+ ?>
+```
+
+### Stylesheet ###
+
+A nice default stylesheet is located in the `style.css` file.
+
+
+## Requirements ##
+
+FSHL requires PHP 5.3 or later.
+
+
+## Authors ##
+
+* [Jaroslav Hanslík](https://github.com/kukulich)
+* Juraj 'hvge' Durech
diff --git a/vendor/kukulich/fshl/composer.json b/vendor/kukulich/fshl/composer.json
new file mode 100644
index 0000000..99b56bc
--- /dev/null
+++ b/vendor/kukulich/fshl/composer.json
@@ -0,0 +1,25 @@
+{
+ "name": "kukulich/fshl",
+ "type": "library",
+ "description": "FSHL is a free, open source, universal, fast syntax highlighter written in PHP.",
+ "keywords": ["library", "highlight", "syntax"],
+ "homepage": "http://fshl.kukulich.cz/",
+ "license": "GPL-2.0+",
+
+ "authors": [
+ {
+ "name": "Jaroslav Hanslík",
+ "homepage": "https://github.com/kukulich"
+ }
+ ],
+
+ "require": {
+ "php": ">=5.3"
+ },
+
+ "autoload": {
+ "psr-0": {
+ "FSHL": "./"
+ }
+ }
+}
diff --git a/vendor/kukulich/fshl/style.css b/vendor/kukulich/fshl/style.css
new file mode 100644
index 0000000..427ce31
--- /dev/null
+++ b/vendor/kukulich/fshl/style.css
@@ -0,0 +1,109 @@
+/**
+ * FSHL 2.1.0 | Fast Syntax HighLighter |
+ * -----------------------------------------------------------------------
+ *
+ * LICENSE
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/* Copyright (c) 2002 Martin Cohen */
+/* Copyright (c) 2011-2012 Jaroslav Hanslík */
+
+/* Common */
+.xlang {color: #ff0000; font-weight: bold;}
+.line {color: #000000; background-color: #ffffff;}
+
+/* CSS */
+.css-at-rule {color: #004a80; font-weight: bold;}
+.css-tag {color: #004a80;}
+.css-id {color: #7da7d9; font-weight: bold;}
+.css-class {color: #004a80;}
+.css-pseudo {color: #004a80;}
+.css-property {color: #003663; font-weight: bold;}
+.css-value {color: #448ccb;}
+.css-func {color: #448ccb; font-weight: bold;}
+.css-color {color: #0076a3;}
+.css-comment {background-color: #e5f8ff; color: #999999;}
+
+/* CPP */
+.cpp-keywords1 {color: #0000ff; font-weight: bold;}
+.cpp-num {color: #ff0000;}
+.cpp-quote {color: #a52a2a; font-weight: bold;}
+.cpp-comment {color: #00ff00;}
+.cpp-preproc {color: #c0c0c0;}
+
+/* HTML */
+.html-tag {color: #598527; font-weight: bold;}
+.html-tagin {color: #89a315}
+.html-quote {color: #598527; font-weight: bold;}
+.html-comment {color: #999999; background-color: #f1fae4;}
+.html-entity {color: #89a315;}
+
+/* Java */
+.java-keywords1 {color: #0000ff; font-weight: bold;}
+.java-num {color: #ff0000;}
+.java-quote {color: #a52a2a; font-weight: bold;}
+.java-comment {color: #009900;}
+.java-preproc {color: #c0c0c0;}
+
+/* Javascript */
+.js-out {color: #898993;}
+.js-keywords1 {color: #575757; font-weight: bold;}
+.js-num {color: #575757;}
+.js-quote {color: #575757; font-weight: bold;}
+.js-comment {color: #898993; background-color: #f4f4f4;}
+
+/* Neon */
+.neon-section {color: #598527;}
+.neon-sep {color: #ff0000;}
+.neon-key {color: #0000ff;}
+.neon-comment {color: #999999;}
+.neon-value {color: #000000;}
+.neon-quote {color: #884433;}
+.neon-num {color: #448ccb;}
+.neon-var {color: #ffaa00;}
+.neon-ref {color: #884433;}
+
+/* PHP */
+.php-keyword1 {color: #dd2244; font-weight: bold;}
+.php-keyword2 {color: #dd2244;}
+.php-var {color: #ffaa00; font-weight: bold;}
+.php-num {color: #ff0000;}
+.php-quote {color: #884433; font-weight: bold;}
+.php-comment {color: #999999; background-color: #ffffee;}
+
+/* Python */
+.py-keyword1 {color: #0033cc; font-weight: bold;}
+.py-keyword2 {color: #ce3333; font-weight: bold;}
+.py-keyword3 {color: #660066; font-weight: bold;}
+.py-num {color: #993300;}
+.py-docstring {color: #e86a18;}
+.py-quote {color: #878787; font-weight: bold;}
+.py-comment {color: #009900; font-style: italic;}
+
+/* SQL */
+.sql-keyword1 {color: #dd0000; font-weight: bold;}
+.sql-keyword2 {color: #dd2222;}
+.sql-keyword3 {color: #0000ff; font-weight: bold;}
+.sql-value {color: #5674b9;}
+.sql-comment {color: #ffaa00;}
+.sql-num {color: #ff0000;}
+.sql-option {color: #004a80; font-weight: bold;}
+
+/* Texy */
+.texy-hlead {color: #4444bb; font-weight: bold;}
+.texy-hbody {background-color: #eeeeff; color: #4444bb;}
+.texy-hr {color: #bb4444;}
+.texy-code {color: #666666;}
+.texy-html {color: #66aa66;}
+.texy-text {color: #6666aa;}
+.texy-err {background-color: #ff0000; color: #ffffff;}
diff --git a/vendor/mockery/mockery/.coveralls.yml b/vendor/mockery/mockery/.coveralls.yml
new file mode 100644
index 0000000..eb8e63b
--- /dev/null
+++ b/vendor/mockery/mockery/.coveralls.yml
@@ -0,0 +1 @@
+src_dir: .
diff --git a/vendor/mockery/mockery/.gitignore b/vendor/mockery/mockery/.gitignore
new file mode 100644
index 0000000..e9aa577
--- /dev/null
+++ b/vendor/mockery/mockery/.gitignore
@@ -0,0 +1,10 @@
+*~
+pearfarm.spec
+*.sublime-project
+library/Hamcrest/*
+composer.lock
+vendor/
+composer.phar
+test.php
+build/
+phpunit.xml
diff --git a/vendor/mockery/mockery/.scrutinizer.yml b/vendor/mockery/mockery/.scrutinizer.yml
new file mode 100644
index 0000000..3b633cc
--- /dev/null
+++ b/vendor/mockery/mockery/.scrutinizer.yml
@@ -0,0 +1,24 @@
+filter:
+ paths: [library/*]
+ excluded_paths: [vendor/*, tests/*, examples/*]
+before_commands:
+ - 'composer install --dev --prefer-source'
+tools:
+ external_code_coverage:
+ timeout: 300
+ php_code_sniffer: true
+ php_cpd:
+ enabled: true
+ excluded_dirs: [vendor, tests, examples]
+ php_pdepend:
+ enabled: true
+ excluded_dirs: [vendor, tests, examples]
+ php_loc:
+ enabled: true
+ excluded_dirs: [vendor, tests, examples]
+ php_hhvm: false
+ php_mess_detector: true
+ php_analyzer: true
+changetracking:
+ bug_patterns: ["\bfix(?:es|ed)?\b"]
+ feature_patterns: ["\badd(?:s|ed)?\b", "\bimplement(?:s|ed)?\b"]
diff --git a/vendor/mockery/mockery/.travis.yml b/vendor/mockery/mockery/.travis.yml
new file mode 100644
index 0000000..e622427
--- /dev/null
+++ b/vendor/mockery/mockery/.travis.yml
@@ -0,0 +1,28 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+ - 5.5
+ - 5.6
+ - hhvm
+
+before_script:
+ - travis_retry composer self-update
+ - travis_retry composer install --no-interaction --prefer-source
+ - sh -c "if [ \"$TRAVIS_PHP_VERSION\" != \"hhvm\" ]; then echo \"extension = mongo.so\nextension = redis.so\" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
+ - phpenv rehash
+
+script:
+ - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml; fi
+ - if [[ "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then vendor/bin/phpunit; fi
+
+after_script:
+ - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then vendor/bin/coveralls -v; fi
+ - if [[ "$TRAVIS_PHP_VERSION" == "5.5" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
+ - if [[ "$TRAVIS_PHP_VERSION" == "5.5" ]]; then php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi
+
+notifications:
+ email:
+ - padraic.brady@gmail.com
+ - dave@atstsolutions.co.uk
diff --git a/vendor/mockery/mockery/CHANGELOG.md b/vendor/mockery/mockery/CHANGELOG.md
new file mode 100644
index 0000000..1f9ba81
--- /dev/null
+++ b/vendor/mockery/mockery/CHANGELOG.md
@@ -0,0 +1,27 @@
+# Change Log
+
+## 0.9.2 (2014-09-03)
+
+* Some workarounds for the serilisation problems created by changes to PHP in 5.5.13, 5.4.29,
+ 5.6.
+* Demeter chains attempt to reuse doubles as they see fit, so for foo->bar and
+ foo->baz, we'll attempt to use the same foo
+
+## 0.9.1 (2014-05-02)
+
+* Allow specifying consecutive exceptions to be thrown with `andThrowExceptions`
+* Allow specifying methods which can be mocked when using
+ `Mockery\Configuration::allowMockingNonExistentMethods(false)` with
+ `Mockery\MockInterface::shouldAllowMockingMethod($methodName)`
+* Added andReturnSelf method: `$mock->shouldReceive("foo")->andReturnSelf()`
+* `shouldIgnoreMissing` now takes an optional value that will be return instead
+ of null, e.g. `$mock->shouldIgnoreMissing($mock)`
+
+## 0.9.0 (2014-02-05)
+
+* Allow mocking classes with final __wakeup() method
+* Quick definitions are now always `byDefault`
+* Allow mocking of protected methods with `shouldAllowMockingProtectedMethods`
+* Support official Hamcrest package
+* Generator completely rewritten
+* Easily create named mocks with namedMock
diff --git a/vendor/mockery/mockery/CONTRIBUTING.md b/vendor/mockery/mockery/CONTRIBUTING.md
new file mode 100644
index 0000000..2fe862d
--- /dev/null
+++ b/vendor/mockery/mockery/CONTRIBUTING.md
@@ -0,0 +1,89 @@
+# Contributing
+
+
+We'd love you to help out with mockery and no contribution is too small.
+
+
+## Reporting Bugs
+
+Issues can be reported on the [issue
+tracker](https://github.com/padraic/mockery/issues). Please try and report any
+bugs with a minimal reproducible example, it will make things easier for other
+contributors and your problems will hopefully be resolved quickly.
+
+
+## Requesting Features
+
+We're always interested to hear about your ideas and you can request features by
+creating a ticket in the [issue
+tracker](https://github.com/padraic/mockery/issues). We can't always guarantee
+someone will jump on it straight away, but putting it out there to see if anyone
+else is interested is a good idea.
+
+Likewise, if a feature you would like is already listed in
+the issue tracker, add a :+1: so that other contributors know it's a feature
+that would help others.
+
+
+## Contributing code and documentation
+
+We loosely follow the
+[PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)
+and
+[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standards,
+but we'll probably merge any code that looks close enough.
+
+* Fork the [repository](https://github.com/padraic/mockery) on GitHub
+* Add the code for your feature or bug
+* Add some tests for your feature or bug
+* Optionally, but preferably, write some documentation (currently in README.md)
+* Optionally, update the CHANGELOG.md file with your feature or
+ [BC](http://en.wikipedia.org/wiki/Backward_compatibility) break
+* If you have created new library files, add them to the root package.xml file for PEAR install support.
+* Send a [Pull
+ Request](https://help.github.com/articles/creating-a-pull-request) to the
+ correct target branch (see below)
+
+If you have a big change or would like to discuss something, create an issue in
+the [issue tracker](https://github.com/padraic/mockery/issues) or jump in to
+\#mockery on freenode
+
+
+Any code you contribute must be licensed under the [BSD 3-Clause
+License](http://opensource.org/licenses/BSD-3-Clause).
+
+
+## Target Branch
+
+Mockery may have several active branches at any one time and roughly follows a
+[Git Branching Model](https://igor.io/2013/10/21/git-branching-model.html).
+Generally, if you're developing a new feature, you want to be targeting the
+master branch, if it's a bug fix, you want to be targeting a release branch,
+e.g. 0.8.
+
+
+## Testing Mockery
+
+To run the unit tests for Mockery, clone the git repository, download Composer using
+the instructions at [http://getcomposer.org/download/](http://getcomposer.org/download/),
+then install the dependencies with `php /path/to/composer.phar install --dev`.
+
+This will install the required PHPUnit and Hamcrest dev dependencies and create the
+autoload files required by the unit tests. You may run the `vendor/bin/phpunit` command
+to run the unit tests. If everything goes to plan, there will be no failed tests!
+
+
+## Debugging Mockery
+
+Mockery and it's code generation can be difficult to debug. A good start is to
+use the `RequireLoader`, which will dump the code generated by mockery to a file
+before requiring it, rather than using eval. This will help with stack traces,
+and you will be able to open the mock class in your editor.
+
+``` php
+
+// tests/bootstrap.php
+
+Mockery::setLoader(new Mockery\Loader\RequireLoader(sys_get_temp_dir()));
+
+```
diff --git a/vendor/mockery/mockery/LICENSE b/vendor/mockery/mockery/LICENSE
new file mode 100644
index 0000000..2ca3b06
--- /dev/null
+++ b/vendor/mockery/mockery/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2010-2014, Pádraic Brady
+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.
+
+ * The name of Pádraic Brady may not 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.
diff --git a/vendor/mockery/mockery/README.md b/vendor/mockery/mockery/README.md
new file mode 100644
index 0000000..ebcb8d1
--- /dev/null
+++ b/vendor/mockery/mockery/README.md
@@ -0,0 +1,82 @@
+Mockery
+=======
+
+[](http://travis-ci.org/padraic/mockery)
+[](https://packagist.org/packages/mockery/mockery)
+[](https://packagist.org/packages/mockery/mockery)
+
+
+Mockery is a simple yet flexible PHP mock object framework for use in unit testing
+with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a
+test double framework with a succinct API capable of clearly defining all possible
+object operations and interactions using a human readable Domain Specific Language
+(DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library,
+Mockery is easy to integrate with PHPUnit and can operate alongside
+phpunit-mock-objects without the World ending.
+
+Mockery is released under a New BSD License.
+
+The current released version for PEAR is 0.9.0. Composer users may instead opt to use
+the current master branch in lieu of using the more static 0.9.0 git tag.
+
+
+## Mock Objects
+
+In unit tests, mock objects simulate the behaviour of real objects. They are
+commonly utilised to offer test isolation, to stand in for objects which do not
+yet exist, or to allow for the exploratory design of class APIs without
+requiring actual implementation up front.
+
+The benefits of a mock object framework are to allow for the flexible generation
+of such mock objects (and stubs). They allow the setting of expected method calls
+and return values using a flexible API which is capable of capturing every
+possible real object behaviour in way that is stated as close as possible to a
+natural language description.
+
+
+## Prerequisites
+
+Mockery requires PHP 5.3.2 or greater. In addition, it is recommended to install
+the Hamcrest library (see below for instructions) which contains additional
+matchers used when defining expected method arguments.
+
+
+## Documentation
+
+**Note:** We're transitioning the documentation to readthedocs.org, current
+version can be seen at [docs.mockery.io](http://docs.mockery.io), feedback
+welcome. The old docs will also remain here for the time being.
+
+- [Installation](docs/01-INSTALLATION.md)
+- [Upgrading](docs/02-UPGRADING.md)
+- [Simple Example](docs/03-SIMPLE-EXAMPLE.md)
+- [PHPUnit Integration](docs/04-PHPUNIT-INTEGRATION.md)
+ - [Warning: PHPUnit running tests in separate processes](docs/04-PHPUNIT-INTEGRATION.md#warning-phpunit-running-tests-in-separate-processes)
+- [Quick Reference](docs/05-QUICK-REFERENCE.md)
+ - [Behaviour Modifiers](docs/05-QUICK-REFERENCE.md#behaviour-modifiers)
+- [Expectation Declarations](docs/06-EXPECTATION DECLARATIONS.md)
+- [Argument Validation](docs/07-ARGUMENT-VALIDATION.md)
+- [Creating Partial Mocks](docs/08-CREATING-PARTIAL-MOCKS.md)
+ - [Traditional Partial Mock](docs/08-CREATING-PARTIAL-MOCKS.md#traditional-partial-mock)
+ - [Passive Partial Mock](docs/08-CREATING-PARTIAL-MOCKS.md#passive-partial-mock)
+ - [Proxied Partial Mock](docs/08-CREATING-PARTIAL-MOCKS.md#proxied-partial-mock)
+ - [Special Internal Cases](docs/08-CREATING-PARTIAL-MOCKS.md#special-internal-cases)
+- [Detecting Mock Objects](docs/09-DETECTING-MOCK-OBJECTS.md)
+- [Default Mock Expectations](docs/10-DEFAULT-MOCK-EXPECTATIONS.md)
+- [Mocking Public Properties](docs/11-MOCKING-PUBLIC-PROPERTIES.md)
+- [Mocking Public Static Methods](docs/12-MOCKING-PUBLIC-STATIC-METHODS.md)
+- [Instance Mocking](docs/13-INSTANCE-MOCKING.md)
+- [Preserving Pass-By-Reference Method Parameter Behaviour](docs/14-PRESERVING-PASS-BY-REFERENCE-PARAMETER-BEHAVIOUR.md)
+- [Mocking Demeter Chains And Fluent Interfaces](docs/15-MOCKING-DEMETER-CHAINS-AND-FLUENT-INTERFACES.md)
+- [Mockery Exceptions](docs/16-MOCKERY-EXCEPTIONS.md)
+ - [\Mockery\Exception\InvalidCountException](docs/16-MOCKERY-EXCEPTIONS.md#mockeryexceptioninvalidcountexception)
+ - [\Mockery\Exception\InvalidOrderException](docs/16-MOCKERY-EXCEPTIONS.md#mockeryexceptioninvalidorderexception)
+ - [\Mockery\Exception\NoMatchingExpectationException](docs/16-MOCKERY-EXCEPTIONS.md#mockeryexceptionnomatchingexpectationexception)
+- [Mock Object Recording](docs/17-MOCK-OBJECT-RECORDING.md)
+- [Dealing with Final Classes/Methods](docs/18-DEALING-WITH-FINAL-CLASSES-OR-METHODS.md)
+- [Mockery Global Configuration](docs/19-MOCKERY-GLOBAL-CONFIGURATION.md)
+- [Reserved Method Names](docs/20-RESERVED-METHOD-NAMES.md)
+- [PHP Magic Methods](docs/21-PHP-MAGIC-METHODS.md)
+- [Gotchas!](docs/22-GOTCHAS.md)
+- [Quick Examples](docs/23-QUICK-EXAMPLES.md)
+- [Contributing](CONTRIBUTING.md)
diff --git a/vendor/mockery/mockery/composer.json b/vendor/mockery/mockery/composer.json
new file mode 100644
index 0000000..964453c
--- /dev/null
+++ b/vendor/mockery/mockery/composer.json
@@ -0,0 +1,36 @@
+{
+ "name": "mockery/mockery",
+ "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.",
+ "keywords": ["library", "testing", "test", "stub", "mock", "mockery", "test double", "tdd", "bdd", "mock objects"],
+ "homepage": "http://github.com/padraic/mockery",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Pádraic Brady",
+ "email": "padraic.brady@gmail.com",
+ "homepage": "http://blog.astrumfutura.com"
+ },
+ {
+ "name": "Dave Marshall",
+ "email": "dave.marshall@atstsolutions.co.uk",
+ "homepage": "http://davedevelopment.co.uk"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.2",
+ "lib-pcre": ">=7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0",
+ "hamcrest/hamcrest-php": "~1.1",
+ "satooshi/php-coveralls": "~0.7@dev"
+ },
+ "autoload": {
+ "psr-0": { "Mockery": "library/" }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.9.x-dev"
+ }
+ }
+}
diff --git a/vendor/mockery/mockery/docs/01-INSTALLATION.md b/vendor/mockery/mockery/docs/01-INSTALLATION.md
new file mode 100644
index 0000000..b000b84
--- /dev/null
+++ b/vendor/mockery/mockery/docs/01-INSTALLATION.md
@@ -0,0 +1,60 @@
+# Installation
+
+
+Mockery can be installed using Composer, PEAR or by cloning it from its GitHub repository.
+These three options are outlined below.
+
+
+## Composer
+
+You can read more about Composer on [getcomposer.org](https://getcomposer.org). To install Mockery
+using Composer, first install Composer for your project using the instructions on the
+[Composer download page](https://getcomposer.org/download/). You can then define your development
+dependency on Mockery using the suggested parameters below. While every effort is made to keep the
+master branch stable, you may prefer to use the current stable version tag instead (use the
+`@stable` tag).
+
+ {
+ "require-dev": {
+ "mockery/mockery": "dev-master"
+ }
+ }
+
+To install, you then may call:
+
+ php /path/to/composer.phar install --dev
+
+This will install Mockery as a development dependency, meaning it won't be installed when using
+`php composer.phar update --no-dev` in production.
+
+
+## PEAR
+
+Mockery is hosted on the [survivethedeepend.com](http://pear.survivethedeepend.com) PEAR channel
+and can be installed using the following commands:
+
+ sudo pear channel-discover pear.survivethedeepend.com
+ sudo pear channel-discover hamcrest.googlecode.com/svn/pear
+ sudo pear install --alldeps deepend/Mockery
+
+
+## Git
+
+The Git repository hosts the development version in its master branch. You can
+install this using Composer by referencing `dev-master` as your preferred version
+in your project's `composer.json` file as the earlier example shows.
+
+You may also install this development version using PEAR:
+
+ git clone git://github.com/padraic/mockery.git
+ cd mockery
+ sudo pear channel-discover hamcrest.googlecode.com/svn/pear
+ sudo pear install --alldeps package.xml
+
+The above processes will install both Mockery and Hamcrest.
+While omitting Hamcrest will not break Mockery, Hamcrest is recommended
+as it adds a wider variety of functionality for argument matching.
+
+
+
+**[Contents](../README.md#documentation) | [Next →](02-UPGRADING.md)**
diff --git a/vendor/mockery/mockery/docs/02-UPGRADING.md b/vendor/mockery/mockery/docs/02-UPGRADING.md
new file mode 100644
index 0000000..7aedb25
--- /dev/null
+++ b/vendor/mockery/mockery/docs/02-UPGRADING.md
@@ -0,0 +1,25 @@
+# Upgrading
+
+
+## Upgrading to 0.9
+
+The generator was completely rewritten, so any code with a deep integration to
+mockery will need evaluating
+
+
+## Upgrading to 0.8
+
+Since the release of 0.8.0 the following behaviours were altered:
+
+1. The shouldIgnoreMissing() behaviour optionally applied to mock objects returned an instance of
+ \Mockery\Undefined when methods called did not match a known expectation. Since 0.8.0, this
+ behaviour was switched to returning null instead. You can restore the 0.7.2 behavour by using the
+ following:
+
+ ```PHP
+ $mock = \Mockery::mock('stdClass')->shouldIgnoreMissing()->asUndefined();
+ ```
+
+
+
+**[← Previous](01-INSTALLATION.md) | [Contents](../README.md#documentation) | [Next →](03-SIMPLE-EXAMPLE.md)**
diff --git a/vendor/mockery/mockery/docs/03-SIMPLE-EXAMPLE.md b/vendor/mockery/mockery/docs/03-SIMPLE-EXAMPLE.md
new file mode 100644
index 0000000..b9b5aae
--- /dev/null
+++ b/vendor/mockery/mockery/docs/03-SIMPLE-EXAMPLE.md
@@ -0,0 +1,64 @@
+# Simple Example
+
+
+Imagine we have a `Temperature` class which samples the temperature of a locale
+before reporting an average temperature. The data could come from a web service
+or any other data source, but we do not have such a class at present. We can,
+however, assume some basic interactions with such a class based on its interaction
+with the `Temperature` class.
+
+```PHP
+class Temperature
+{
+
+ public function __construct($service)
+ {
+ $this->_service = $service;
+ }
+
+ public function average()
+ {
+ $total = 0;
+ for ($i=0;$i<3;$i++) {
+ $total += $this->_service->readTemp();
+ }
+ return $total/3;
+ }
+
+}
+```
+
+Even without an actual service class, we can see how we expect it to operate.
+When writing a test for the `Temperature` class, we can now substitute a mock
+object for the real service which allows us to test the behaviour of the
+`Temperature` class without actually needing a concrete service instance.
+
+Note: PHPUnit integration can remove the need for a `tearDown()` method.
+
+```PHP
+use \Mockery as m;
+
+class TemperatureTest extends PHPUnit_Framework_TestCase
+{
+
+ protected function tearDown()
+ {
+ m::close();
+ }
+
+ public function testGetsAverageTemperatureFromThreeServiceReadings()
+ {
+ $service = m::mock('service');
+ $service->shouldReceive('readTemp')->times(3)->andReturn(10, 12, 14);
+
+ $temperature = new Temperature($service);
+
+ $this->assertEquals(12, $temperature->average());
+ }
+
+}
+```
+
+
+
+**[← Previous](02-UPGRADING.md) | [Contents](../README.md#documentation) | [Next →](04-PHPUNIT-INTEGRATION.md)**
diff --git a/vendor/mockery/mockery/docs/04-PHPUNIT-INTEGRATION.md b/vendor/mockery/mockery/docs/04-PHPUNIT-INTEGRATION.md
new file mode 100644
index 0000000..4bedc77
--- /dev/null
+++ b/vendor/mockery/mockery/docs/04-PHPUNIT-INTEGRATION.md
@@ -0,0 +1,102 @@
+# PHPUnit Integration
+
+
+Mockery was designed as a simple-to-use *standalone* mock object framework, so
+its need for integration with any testing framework is entirely optional.
+To integrate Mockery, you just need to define a `tearDown()` method for your
+tests containing the following (you may use a shorter `\Mockery` namespace alias):
+
+```PHP
+protected function tearDown() {
+ \Mockery::close();
+}
+```
+
+This static call cleans up the Mockery container used by the current test, and
+run any verification tasks needed for your expectations.
+
+For some added brevity when it comes to using Mockery, you can also explicitly
+use the Mockery namespace with a shorter alias. For example:
+
+```PHP
+use \Mockery as m;
+
+class SimpleTest extends PHPUnit_Framework_TestCase
+{
+ public function testSimpleMock() {
+ $mock = m::mock('simplemock');
+ $mock->shouldReceive('foo')->with(5, m::any())->once()->andReturn(10);
+
+ $this->assertEquals(10, $mock->foo(5));
+ }
+
+ protected function tearDown() {
+ m::close();
+ }
+}
+```
+
+Mockery ships with an autoloader so you don't need to litter your tests with
+`require_once()` calls. To use it, ensure Mockery is on your `include_path` and add
+the following to your test suite's `Bootstrap.php` or `TestHelper.php` file:
+
+```PHP
+require_once 'Mockery/Loader.php';
+require_once 'Hamcrest/Hamcrest.php';
+
+$loader = new \Mockery\Loader;
+$loader->register();
+```
+
+If you are using Composer, you can simplify this to just including the Composer generated autoloader
+file:
+
+```PHP
+require __DIR__ . '/../vendor/autoload.php'; // assuming vendor is one directory up
+```
+
+To integrate Mockery into PHPUnit and avoid having to call the close method and
+have Mockery remove itself from code coverage reports, use this in your suite:
+
+```PHP
+// Create Suite
+$suite = new PHPUnit_Framework_TestSuite();
+
+// Create a result listener or add it
+$result = new PHPUnit_Framework_TestResult();
+$result->addListener(new \Mockery\Adapter\Phpunit\TestListener());
+
+// Run the tests.
+$suite->run($result);
+```
+
+If you are using PHPUnit's XML configuration approach, you can include the following to load the
+`TestListener`:
+
+``` XML
+
+
+
+```
+
+Make sure Composer's or Mockery's autoloader is present in the bootstrap file or you will need to
+also define a "file" attribute pointing to the file of the above `TestListener` class.
+
+
+## Warning: PHPUnit running tests in separate processes
+
+PHPUnit provides a functionality that allows [tests to run in a separated process]
+(http://phpunit.de/manual/4.0/en/appendixes.annotations.html#appendixes.annotations.runTestsInSeparateProcesses),
+to ensure better isolation. Mockery verifies the mocks expectations using the
+`Mockery::close` method, and provides a PHPUnit listener, that automatically
+calls this method for you after every test.
+
+However, this listener is not called in the right process when using PHPUnit's process
+isolation, resulting in expectations that might not be respected, but without raising
+any `Mockery\Exception`. To avoid this, you cannot rely on the supplied Mockery PHPUnit
+`TestListener`, and you need to explicitly calls `Mockery::close`. The easiest solution
+to include this call in the `tearDown()` method, as explained previously.
+
+
+
+**[← Previous](03-SIMPLE-EXAMPLE.md) | [Contents](../README.md#documentation) | [Next →](05-QUICK-REFERENCE.md)**
diff --git a/vendor/mockery/mockery/docs/05-QUICK-REFERENCE.md b/vendor/mockery/mockery/docs/05-QUICK-REFERENCE.md
new file mode 100644
index 0000000..26daaba
--- /dev/null
+++ b/vendor/mockery/mockery/docs/05-QUICK-REFERENCE.md
@@ -0,0 +1,220 @@
+# Quick Reference
+
+
+Mockery implements a shorthand API when creating a mock. Here's a sampling
+of the possible startup methods.
+
+```PHP
+$mock = \Mockery::mock('foo');
+```
+
+Creates a mock object named "foo". In this case, "foo" is a name (not necessarily
+a class name) used as a simple identifier when raising exceptions. This creates
+a mock object of type `\Mockery\Mock` and is the loosest form of mock possible.
+
+```PHP
+$mock = \Mockery::mock(array('foo'=>1,'bar'=>2));
+```
+
+Creates an mock object named unknown since we passed no name. However we did
+pass an expectation array, a quick method of setting up methods to expect with
+their return values.
+
+```PHP
+$mock = \Mockery::mock('foo', array('foo'=>1,'bar'=>2));
+```
+
+Similar to the previous examples and all examples going forward, expectation arrays
+can be passed for all mock objects as the second parameter to `mock()`.
+
+```PHP
+$mock = \Mockery::mock('foo', function($mock) {
+ $mock->shouldReceive(method_name);
+});
+```
+
+In addition to expectation arrays, you can also pass in a closure which contains
+reusable expectations. This can be passed as the second parameter, or as the third
+parameter if partnered with an expectation array. This is one method for creating
+reusable mock expectations.
+
+```PHP
+$mock = \Mockery::mock('stdClass');
+```
+
+Creates a mock identical to a named mock, except the name is an actual class
+name. Creates a simple mock as previous examples show, except the mock
+object will inherit the class type (via inheritance), i.e. it will pass type hints
+or instanceof evaluations for stdClass. Useful where a mock object must be of a specific
+type.
+
+```PHP
+$mock = \Mockery::mock('FooInterface');
+```
+
+You can create mock objects based on any concrete class, abstract class or
+even an interface. Again, the primary purpose is to ensure the mock object
+inherits a specific type for type hinting. There is an exception in that classes
+marked final, or with methods marked final, cannot be mocked fully. In these cases
+a partial mock (explained later) must be utilised.
+
+```PHP
+$mock = \Mockery::mock('alias:MyNamespace\MyClass');
+```
+
+Prefixing the valid name of a class (which is NOT currently loaded) with "alias:"
+will generate an "alias mock". Alias mocks create a class alias with the given
+classname to stdClass and are generally used to enable the mocking of public
+static methods. Expectations set on the new mock object which refer to static
+methods will be used by all static calls to this class.
+
+```PHP
+$mock = \Mockery::mock('overload:MyNamespace\MyClass');
+```
+
+Prefixing the valid name of a class (which is NOT currently loaded) with "overload:" will
+generate an alias mock (as with "alias:") except that created new instances of that
+class will import any expectations set on the origin mock (`$mock`). The origin
+mock is never verified since it's used an expectation store for new instances. For this
+purpose we use the term "instance mock" to differentiate it from the simpler "alias mock".
+
+Note: Using alias/instance mocks across more than one test will generate a fatal error since
+you can't have two classes of the same name. To avoid this, run each test of this
+kind in a separate PHP process (which is supported out of the box by both
+PHPUnit and PHPT).
+
+```PHP
+$mock = \Mockery::mock('stdClass, MyInterface1, MyInterface2');
+```
+
+The first argument can also accept a list of interfaces that the mock object must
+implement, optionally including no more than one existing class to be based on. The
+class name doesn't need to be the first member of the list but it's a friendly
+convention to use for readability. All subsequent arguments remain unchanged from
+previous examples.
+
+If the given class does not exist, you must define and include it beforehand or a
+`\Mockery\Exception` will be thrown.
+
+```PHP
+$mock = \Mockery::mock('MyNamespace\MyClass[foo,bar]');
+```
+
+The syntax above tells Mockery to partially mock the `MyNamespace\MyClass` class,
+by mocking the `foo()` and `bar()` methods only. Any other method will be not be
+overridden by Mockery. This traditional form of "partial mock" can be applied to any class
+or abstract class (e.g. mocking abstract methods where a concrete implementation
+does not exist yet). If you attempt to partial mock a method marked final, it will
+actually be ignored in that instance leaving the final method untouched. This is
+necessary since mocking of final methods is, by definition in PHP, impossible.
+
+Please refer to [Creating Partial Mocks](#creating-partial-mocks) for a detailed
+explanation on how to create Partial Mocks in Mockery.
+
+```PHP
+$mock = \Mockery::mock("MyNamespace\MyClass[foo]", array($arg1, $arg2));
+```
+
+If Mockery encounters an indexed array as the second or third argument, it will
+assume they are constructor parameters and pass them when constructing the mock
+object. The syntax above will create a new partial mock, particularly useful if
+method `bar` calls method `foo` internally with `$this->foo()`.
+
+```PHP
+$mock = \Mockery::mock(new Foo);
+```
+
+Passing any real object into Mockery will create a Proxied Partial Mock. This
+can be useful if real partials are impossible, e.g. a final class or class where
+you absolutely must override a method marked final. Since you can already create
+a concrete object, so all we need to do is selectively
+override a subset of existing methods (or add non-existing methods!) for
+our expectations.
+
+A little revision: All mock methods accept the class, object or alias name to be
+mocked as the first parameter. The second parameter can be an expectation array
+of methods and their return values, or an expectation closure (which can be the
+third param if used in conjunction with an expectation array).
+
+```PHP
+\Mockery::self()
+```
+
+At times, you will discover that expectations on a mock include methods which need
+to return the same mock object (e.g. a common case when designing a Domain Specific
+Language (DSL) such as the one Mockery itself uses!). To facilitate this, calling
+`\Mockery::self()` will always return the last Mock Object created by calling
+`\Mockery::mock()`. For example:
+
+```PHP
+$mock = \Mockery::mock('BazIterator')
+ ->shouldReceive('next')
+ ->andReturn(\Mockery::self())
+ ->mock();
+```
+
+The above class being mocked, as the `next()` method suggests, is an iterator. In
+many cases, you can replace all the iterated elements (since they are the same type
+many times) with just the one mock object which is programmed to act as discrete
+iterated elements.
+
+```PHP
+$mock = \Mockery::namedMock('MyClassName', 'DateTime');
+```
+
+The `namedMock` method will generate a class called by the first argument, so in
+this example `MyClassName`. The rest of the arguments are treat in the same way
+as the `mock` method, so again, this example would create a class called
+`MyClassName` that extends `DateTime`.
+
+Named mocks are quite an edge case, but they can be useful when code depends on
+the `__CLASS__` magic constant, or when you need two derivatives of an abstract
+type, that are actually different classes.
+
+*Warning*: You can only create a named mock once, any subsequent calls to
+`namedMock`, with different arguments are likely to cause exceptions.
+
+
+## Behaviour Modifiers
+
+When creating a mock object, you may wish to use some commonly preferred behaviours
+that are not the default in Mockery.
+
+```PHP
+\Mockery::mock('MyClass')->shouldIgnoreMissing()
+```
+
+The use of the `shouldIgnoreMissing()` behaviour modifier will label this mock object
+as a Passive Mock. In such a mock object, calls to methods which are not covered by
+expectations will return `null` instead of the usual complaining about there
+being no expectation matching the call.
+
+You can optionally prefer to return an object of type `\Mockery\Undefined` (i.e.
+a `null` object) (which was the 0.7.2 behaviour) by using an additional modifier:
+
+```PHP
+\Mockery::mock('MyClass')->shouldIgnoreMissing()->asUndefined()
+```
+
+The returned object is nothing more than a placeholder so if, by some act of fate,
+it's erroneously used somewhere it shouldn't it will likely not pass a logic check.
+
+```PHP
+\Mockery::mock('MyClass')->makePartial()
+```
+
+also
+
+```PHP
+\Mockery::mock('MyClass')->shouldDeferMissing()
+```
+
+Known as a Passive Partial Mock (not to be confused with real partial mock objects
+discussed later), this form of mock object will defer all methods not subject to
+an expectation to the parent class of the mock, i.e. `MyClass`. Whereas the previous
+`shouldIgnoreMissing()` returned `null`, this behaviour simply calls the parent's
+matching method.
+
+
+
+**[← Previous](04-PHPUNIT-INTEGRATION.md) | [Contents](../README.md#documentation) | [Next →](06-EXPECTATION DECLARATIONS.md)**
diff --git a/vendor/mockery/mockery/docs/06-EXPECTATION DECLARATIONS.md b/vendor/mockery/mockery/docs/06-EXPECTATION DECLARATIONS.md
new file mode 100644
index 0000000..bfac481
--- /dev/null
+++ b/vendor/mockery/mockery/docs/06-EXPECTATION DECLARATIONS.md
@@ -0,0 +1,243 @@
+# Expectation Declarations
+
+
+Once you have created a mock object, you'll often want to start defining how
+exactly it should behave (and how it should be called). This is where the
+Mockery expectation declarations take over.
+
+```PHP
+shouldReceive(method_name)
+```
+
+Declares that the mock expects a call to the given method name. This is the
+starting expectation upon which all other expectations and constraints are
+appended.
+
+```PHP
+shouldReceive(method1, method2, ...)
+```
+
+Declares a number of expected method calls, all of which will adopt any chained
+expectations or constraints.
+
+```PHP
+shouldReceive(array('method1'=>1, 'method2'=>2, ...))
+```
+
+Declares a number of expected calls but also their return values. All will
+adopt any additional chained expectations or constraints.
+
+```PHP
+shouldReceive(closure)
+```
+
+Creates a mock object (only from a partial mock) which is used to create a mock
+object recorder. The recorder is a simple proxy to the original object passed
+in for mocking. This is passed to the closure, which may run it through a set of
+operations which are recorded as expectations on the partial mock. A simple
+use case is automatically recording expectations based on an existing usage
+(e.g. during refactoring). See examples in a later section.
+
+```PHP
+with(arg1, arg2, ...) / withArgs(array(arg1, arg2, ...))
+```
+
+Adds a constraint that this expectation only applies to method calls which
+match the expected argument list. You can add a lot more flexibility to argument
+matching using the built in matcher classes (see later). For example,
+`\Mockery::any()` matches any argument passed to that position in the `with()`
+parameter list. Mockery also allows Hamcrest library matchers - for example, the
+Hamcrest function `anything()` is equivalent to `\Mockery::any()`.
+
+It's important to note that this means all expectations attached only apply
+to the given method when it is called with these exact arguments. This allows for
+setting up differing expectations based on the arguments provided to expected calls.
+
+```PHP
+withAnyArgs()
+```
+
+Declares that this expectation matches a method call regardless of what arguments
+are passed. This is set by default unless otherwise specified.
+
+```PHP
+withNoArgs()
+```
+
+Declares this expectation matches method calls with zero arguments.
+
+```PHP
+andReturn(value)
+```
+
+Sets a value to be returned from the expected method call.
+
+```PHP
+andReturn(value1, value2, ...)
+```
+
+Sets up a sequence of return values or closures. For example, the first call will return
+value1 and the second value2. Note that all subsequent calls to a mocked method
+will always return the final value (or the only value) given to this declaration.
+
+```PHP
+andReturnNull() / andReturn([null])
+```
+
+Both of the above options are primarily for communication to test readers. They mark the
+mock object method call as returning null or nothing.
+
+```PHP
+andReturnValues(array)
+```
+
+Alternative syntax for `andReturn()` that accepts a simple array instead of a list of parameters.
+The order of return is determined by the numerical index of the given array with the last array
+member being return on all calls once previous return values are exhausted.
+
+```PHP
+andReturnUsing(closure, ...)
+```
+
+Sets a closure (anonymous function) to be called with the arguments passed to
+the method. The return value from the closure is then returned. Useful for some
+dynamic processing of arguments into related concrete results. Closures can
+queued by passing them as extra parameters as for `andReturn()`. Note that you
+cannot currently mix `andReturnUsing()` with `andReturn()`.
+
+```PHP
+andThrow(Exception)
+```
+
+Declares that this method will throw the given `Exception` object when called.
+
+```PHP
+andThrow(exception_name, message)
+```
+
+Rather than an object, you can pass in the `Exception` class and message to
+use when throwing an `Exception` from the mocked method.
+
+```PHP
+andSet(name, value1) / set(name, value1)
+```
+
+Used with an expectation so that when a matching method is called, one
+can also cause a mock object's public property to be set to a specified value.
+
+```PHP
+passthru()
+```
+
+Tells the expectation to bypass a return queue and instead call the real method
+of the class that was mocked and return the result. Basically, it allows
+expectation matching and call count validation to be applied against real methods
+while still calling the real class method with the expected arguments.
+
+```PHP
+zeroOrMoreTimes()
+```
+
+Declares that the expected method may be called zero or more times. This is
+the default for all methods unless otherwise set.
+
+```PHP
+once()
+```
+
+Declares that the expected method may only be called once. Like all other
+call count constraints, it will throw a `\Mockery\CountValidator\Exception`
+if breached and can be modified by the `atLeast()` and `atMost()` constraints.
+
+```PHP
+twice()
+```
+
+Declares that the expected method may only be called twice.
+
+```PHP
+times(n)
+```
+
+Declares that the expected method may only be called n times.
+
+```PHP
+never()
+```
+
+Declares that the expected method may never be called. Ever!
+
+```PHP
+atLeast()
+```
+
+Adds a minimum modifier to the next call count expectation. Thus
+`atLeast()->times(3)` means the call must be called at least three times (given
+matching method args) but never less than three times.
+
+```PHP
+atMost()
+```
+Adds a maximum modifier to the next call count expectation. Thus
+`atMost()->times(3)` means the call must be called no more than three times. This
+also means no calls are acceptable.
+
+```PHP
+between(min, max)
+```
+
+Sets an expected range of call counts. This is actually identical to using
+`atLeast()->times(min)->atMost()->times(max)` but is provided as a shorthand.
+It may be followed by a `times()` call with no parameter to preserve the
+APIs natural language readability.
+
+```PHP
+ordered()
+```
+
+Declares that this method is expected to be called in a specific order in
+relation to similarly marked methods. The order is dictated by the order in
+which this modifier is actually used when setting up mocks.
+
+```PHP
+ordered(group)
+```
+
+Declares the method as belonging to an order group (which can be named or
+numbered). Methods within a group can be called in any order, but the ordered
+calls from outside the group are ordered in relation to the group, i.e. you can
+set up so that method1 is called before group1 which is in turn called before
+method 2.
+
+```PHP
+globally()
+```
+
+When called prior to `ordered()` or `ordered(group)`, it declares this ordering to
+apply across all mock objects (not just the current mock). This allows for dictating
+order expectations across multiple mocks.
+
+```PHP
+byDefault()
+```
+
+Marks an expectation as a default. Default expectations are applied unless
+a non-default expectation is created. These later expectations immediately
+replace the previously defined default. This is useful so you can setup default
+mocks in your unit test `setUp()` and later tweak them in specific tests as
+needed.
+
+```PHP
+getMock()
+```
+
+Returns the current mock object from an expectation chain. Useful where
+you prefer to keep mock setups as a single statement, e.g.
+
+```PHP
+$mock = \Mockery::mock('foo')->shouldReceive('foo')->andReturn(1)->getMock();
+```
+
+
+
+**[← Previous](05-QUICK-REFERENCE.md) | [Contents](../README.md#documentation) | [Next →](07-ARGUMENT-VALIDATION.md)**
diff --git a/vendor/mockery/mockery/docs/07-ARGUMENT-VALIDATION.md b/vendor/mockery/mockery/docs/07-ARGUMENT-VALIDATION.md
new file mode 100644
index 0000000..bea366f
--- /dev/null
+++ b/vendor/mockery/mockery/docs/07-ARGUMENT-VALIDATION.md
@@ -0,0 +1,163 @@
+# Argument Validation
+
+
+The arguments passed to the `with()` declaration when setting up an expectation
+determine the criteria for matching method calls to expectations. Thus, you
+can setup up many expectations for a single method, each differentiated by
+the expected arguments. Such argument matching is done on a "best fit" basis.
+This ensures explicit matches take precedence over generalised matches.
+
+An explicit match is merely where the expected argument and the actual argument
+are easily equated (i.e. using `===` or `==`). More generalised matches are possible
+using regular expressions, class hinting and the available generic matchers. The
+purpose of generalised matchers is to allow arguments be defined in non-explicit
+terms, e.g. `Mockery::any()` passed to `with()` will match **any** argument in that
+position.
+
+Mockery's generic matchers do not cover all possibilities but offers optional
+support for the Hamcrest library of matchers. Hamcrest is a PHP port of the
+similarly named Java library (which has been ported also to Python, Erlang, etc).
+I strongly recommend using Hamcrest since Mockery simply does not need to duplicate
+Hamcrest's already impressive utility which itself promotes a natural English DSL.
+
+The example below show Mockery matchers and their Hamcrest equivalent. Hamcrest uses
+functions (no namespacing).
+
+Here's a sample of the possibilities.
+
+```PHP
+with(1)
+```
+
+Matches the integer 1. This passes the `===` test (identical). It does facilitate
+a less strict `==` check (equals) where the string `'1'` would also match the
+argument.
+
+```PHP
+with(\Mockery::any()) OR with(anything())
+```
+
+Matches any argument. Basically, anything and everything passed in this argument
+slot is passed unconstrained.
+
+```PHP
+with(\Mockery::type('resource')) OR with(resourceValue()) OR with(typeOf('resource'))
+```
+
+Matches any resource, i.e. returns true from an `is_resource()` call. The Type
+matcher accepts any string which can be attached to `is_` to form a valid
+type check. For example, `\Mockery::type('float')` or Hamcrest's `floatValue()` and
+`typeOf('float')` checks using `is_float()`, and `\Mockery::type('callable')` or Hamcrest's
+`callable()` uses `is_callable()`.
+
+The Type matcher also accepts a class or interface name to be used in an `instanceof`
+evaluation of the actual argument (similarly Hamcrest uses `anInstanceOf()`).
+
+You may find a full list of the available type checkers at
+http://www.php.net/manual/en/ref.var.php or browse Hamcrest's function list at
+http://code.google.com/p/hamcrest/source/browse/trunk/hamcrest-php/hamcrest/Hamcrest.php.
+
+```PHP
+with(\Mockery::on(closure))
+```
+
+The On matcher accepts a closure (anonymous function) to which the actual argument
+will be passed. If the closure evaluates to (i.e. returns) boolean `true` then
+the argument is assumed to have matched the expectation. This is invaluable
+where your argument expectation is a bit too complex for or simply not
+implemented in the current default matchers.
+
+There is no Hamcrest version of this functionality.
+
+```PHP
+with('/^foo/') OR with(matchesPattern('/^foo/'))
+```
+
+The argument declarator also assumes any given string may be a regular
+expression to be used against actual arguments when matching. The regex option
+is only used when a) there is no `===` or `==` match and b) when the regex
+is verified to be a valid regex (i.e. does not return false from `preg_match()`).
+If the regex detection doesn't suit your tastes, Hamcrest offers the more
+explicit `matchesPattern()` function.
+
+```PHP
+with(\Mockery::ducktype('foo', 'bar'))
+```
+
+The Ducktype matcher is an alternative to matching by class type. It simply
+matches any argument which is an object containing the provided list
+of methods to call.
+
+There is no Hamcrest version of this functionality.
+
+```PHP
+with(\Mockery::mustBe(2)) OR with(identicalTo(2))
+```
+
+The MustBe matcher is more strict than the default argument matcher. The default
+matcher allows for PHP type casting, but the MustBe matcher also verifies that
+the argument must be of the same type as the expected value. Thus by default,
+the argument `'2'` matches the actual argument 2 (integer) but the MustBe matcher
+would fail in the same situation since the expected argument was a string and
+instead we got an integer.
+
+Note: Objects are not subject to an identical comparison using this matcher
+since PHP would fail the comparison if both objects were not the exact same
+instance. This is a hindrance when objects are generated prior to being
+returned, since an identical match just would never be possible.
+
+```PHP
+with(\Mockery::not(2)) OR with(not(2))
+```
+
+The Not matcher matches any argument which is not equal or identical to the
+matcher's parameter.
+
+```PHP
+with(\Mockery::anyOf(1, 2)) OR with(anyOf(1,2))
+```
+
+Matches any argument which equals any one of the given parameters.
+
+```PHP
+with(\Mockery::notAnyOf(1, 2))
+```
+
+Matches any argument which is not equal or identical to any of the given
+parameters.
+
+There is no Hamcrest version of this functionality.
+
+```PHP
+with(\Mockery::subset(array(0=>'foo')))
+```
+
+Matches any argument which is any array containing the given array subset. This
+enforces both key naming and values, i.e. both the key and value of each
+actual element is compared.
+
+There is no Hamcrest version of this functionality, though Hamcrest can check a
+single entry using `hasEntry()` or `hasKeyValuePair()`.
+
+```PHP
+with(\Mockery::contains(value1, value2))
+```
+
+Matches any argument which is an array containing the listed values. The naming
+of keys is ignored.
+
+```PHP
+with(\Mockery::hasKey(key));
+```
+
+Matches any argument which is an array containing the given key name.
+
+```PHP
+with(\Mockery::hasValue(value));
+```
+
+Matches any argument which is an array containing the given value.
+
+
+
+**[← Previous](06-EXPECTATION DECLARATIONS.md) | [Contents](../README.md#documentation) | [Next →](08-CREATING-PARTIAL-MOCKS.md)**
diff --git a/vendor/mockery/mockery/docs/08-CREATING-PARTIAL-MOCKS.md b/vendor/mockery/mockery/docs/08-CREATING-PARTIAL-MOCKS.md
new file mode 100644
index 0000000..00fe297
--- /dev/null
+++ b/vendor/mockery/mockery/docs/08-CREATING-PARTIAL-MOCKS.md
@@ -0,0 +1,95 @@
+# Creating Partial Mocks
+
+
+Partial mocks are useful when you only need to mock several methods of
+an object leaving the remainder free to respond to calls normally (i.e.
+as implemented). Mockery implements three distinct strategies for creating
+partials. Each has specific advantages and disadvantages so which strategy
+you use will depend on your own preferences and the source code in need
+of mocking.
+
+1. Traditional Partial Mock
+2. Passive Partial Mock
+3. Proxied Partial Mock
+
+
+## Traditional Partial Mock
+
+A traditional partial mock defined ahead of time which methods of a class
+are to be mocked and which are to left unmocked (i.e. callable as normal).
+The syntax for creating traditional mocks is:
+
+```PHP
+$mock = \Mockery::mock('MyClass[foo,bar]');
+```
+
+In the above example, the `foo()` and `bar()` methods of MyClass will be
+mocked but no other MyClass methods are touched. You will need to define
+expectations for the `foo()` and `bar()` methods to dictate their mocked behaviour.
+
+Don't forget that you can pass in constructor arguments since unmocked
+methods may rely on those!
+
+```PHP
+$mock = \Mockery::mock("MyNamespace\MyClass[foo]", array($arg1, $arg2));
+```
+
+
+## Passive Partial Mock
+
+A passive partial mock is more of a default state of being.
+
+```PHP
+$mock = \Mockery::mock('MyClass')->makePartial();
+```
+
+In a passive partial, we assume that all methods will simply defer to
+the parent class (`MyClass`) original methods unless a method call
+matches a known expectation. If you have no matching expectation for
+a specific method call, that call is deferred to the class being
+mocked. Since the division between mocked and unmocked calls depends
+entirely on the expectations you define, there is no need to define
+which methods to mock in advance. The `makePartial()` method is identical to the
+original `shouldDeferMissing()` method which first introduced this Partial Mock
+type.
+
+
+## Proxied Partial Mock
+
+A proxied partial mock is a partial of last resort. You may encounter
+a class which is simply not capable of being mocked because it has
+been marked as final. Similarly, you may find a class with methods
+marked as final. In such a scenario, we cannot simply extend the
+class and override methods to mock - we need to get creative.
+
+```PHP
+$mock = \Mockery::mock(new MyClass);
+```
+
+Yes, the new mock is a Proxy. It intercepts calls and reroutes them to
+the proxied object (which you construct and pass in) for methods which
+are not subject to any expectations. Indirectly, this allows you to
+mock methods marked final since the Proxy is not subject to those
+limitations. The tradeoff should be obvious - a proxied partial will
+fail any typehint checks for the class being mocked since it cannot
+extend that class.
+
+
+## Special Internal Cases
+
+All mock objects, with the exception of Proxied Partials, allow you to make any
+expectation call the underlying real class method using the passthru() expectation
+call. This will return values from the real call and bypass any mocked return queue
+(which can simply be omitted obviously).
+
+There is a fourth kind of partial mock reserved for internal use. This is automatically
+generated when you attempt to mock a class containing methods marked final. Since we
+cannot override such methods, they are simply left unmocked. Typically, you don't need
+to worry about this but if you really really must mock a final method, the only possible
+means is through a Proxied Partial Mock. SplFileInfo, for example, is a common class subject
+to this form of automatic internal partial since it contains public final methods used
+internally.
+
+
+
+**[← Previous](07-ARGUMENT-VALIDATION.md) | [Contents](../README.md#documentation) | [Next →](09-DETECTING-MOCK-OBJECTS.md)**
diff --git a/vendor/mockery/mockery/docs/09-DETECTING-MOCK-OBJECTS.md b/vendor/mockery/mockery/docs/09-DETECTING-MOCK-OBJECTS.md
new file mode 100644
index 0000000..9d611ee
--- /dev/null
+++ b/vendor/mockery/mockery/docs/09-DETECTING-MOCK-OBJECTS.md
@@ -0,0 +1,14 @@
+# Detecting Mock Objects
+
+
+Users may find it useful to check whether a given object is a real object or a simulated
+Mock Object. All Mockery mocks implement the `\Mockery\MockInterface` interface which can
+be used in a type check.
+
+```PHP
+assert($mightBeMocked instanceof \Mockery\MockInterface);
+```
+
+
+
+**[← Previous](08-CREATING-PARTIAL-MOCKS.md) | [Contents](../README.md#documentation) | [Next →](10-DEFAULT-MOCK-EXPECTATIONS.md)**
diff --git a/vendor/mockery/mockery/docs/10-DEFAULT-MOCK-EXPECTATIONS.md b/vendor/mockery/mockery/docs/10-DEFAULT-MOCK-EXPECTATIONS.md
new file mode 100644
index 0000000..c550d8a
--- /dev/null
+++ b/vendor/mockery/mockery/docs/10-DEFAULT-MOCK-EXPECTATIONS.md
@@ -0,0 +1,18 @@
+# Default Mock Expectations
+
+
+Often in unit testing, we end up with sets of tests which use the same object
+dependency over and over again. Rather than mocking this class/object within
+every single unit test (requiring a mountain of duplicate code), we can instead
+define reusable default mocks within the test case's `setUp()` method. This even
+works where unit tests use varying expectations on the same or similar mock
+object.
+
+How this works, is that you can define mocks with default expectations. Then,
+in a later unit test, you can add or fine-tune expectations for that
+specific test. Any expectation can be set as a default using the `byDefault()`
+declaration.
+
+
+
+**[← Previous](09-DETECTING-MOCK-OBJECTS.md) | [Contents](../README.md#documentation) | [Next →](11-MOCKING-PUBLIC-PROPERTIES.md)**
diff --git a/vendor/mockery/mockery/docs/11-MOCKING-PUBLIC-PROPERTIES.md b/vendor/mockery/mockery/docs/11-MOCKING-PUBLIC-PROPERTIES.md
new file mode 100644
index 0000000..c045997
--- /dev/null
+++ b/vendor/mockery/mockery/docs/11-MOCKING-PUBLIC-PROPERTIES.md
@@ -0,0 +1,17 @@
+# Mocking Public Properties
+
+
+Mockery allows you to mock properties in several ways. The simplest is that
+you can simply set a public property and value on any mock object. The second
+is that you can use the expectation methods `set()` and `andSet()` to set property
+values if that expectation is ever met.
+
+You should note that, in general, Mockery does not support mocking any magic
+methods since these are generally not considered a public API (and besides they
+are a PITA to differentiate when you badly need them for mocking!). So please
+mock virtual properties (those relying on `__get()` and `__set()`) as if they were
+actually declared on the class.
+
+
+
+**[← Previous](10-DEFAULT-MOCK-EXPECTATIONS.md) | [Contents](../README.md#documentation) | [Next →](12-MOCKING-PUBLIC-STATIC-METHODS.md)**
diff --git a/vendor/mockery/mockery/docs/12-MOCKING-PUBLIC-STATIC-METHODS.md b/vendor/mockery/mockery/docs/12-MOCKING-PUBLIC-STATIC-METHODS.md
new file mode 100644
index 0000000..32d9ff4
--- /dev/null
+++ b/vendor/mockery/mockery/docs/12-MOCKING-PUBLIC-STATIC-METHODS.md
@@ -0,0 +1,13 @@
+# Mocking Public Static Methods
+
+
+Static methods are not called on real objects, so normal mock objects can't mock
+them. Mockery supports class aliased mocks, mocks representing a class name which
+would normally be loaded (via autoloading or a require statement) in the system
+under test. These aliases block that loading (unless via a require statement - so please
+use autoloading!) and allow Mockery to intercept static method calls and add
+expectations for them.
+
+
+
+**[← Previous](11-MOCKING-PUBLIC-PROPERTIES.md) | [Contents](../README.md#documentation) | [Next →](13-INSTANCE-MOCKING.md)**
diff --git a/vendor/mockery/mockery/docs/13-INSTANCE-MOCKING.md b/vendor/mockery/mockery/docs/13-INSTANCE-MOCKING.md
new file mode 100644
index 0000000..115f124
--- /dev/null
+++ b/vendor/mockery/mockery/docs/13-INSTANCE-MOCKING.md
@@ -0,0 +1,23 @@
+# Instance Mocking
+
+
+Instance mocking means that a statement like:
+
+```PHP
+$obj = new \MyNamespace\Foo;
+```
+
+...will actually generate a mock object. This is done by replacing the real class
+with an instance mock (similar to an alias mock), as with mocking public methods.
+The alias will import its
+expectations from the original mock of that type (note that the original is never
+verified and should be ignored after its expectations are setup). This lets you
+intercept instantiation where you can't simply inject a replacement object.
+
+As before, this does not prevent a require statement from including the real
+class and triggering a fatal PHP error. It's intended for use where autoloading
+is the primary class loading mechanism.
+
+
+
+**[← Previous](12-MOCKING-PUBLIC-STATIC-METHODS.md) | [Contents](../README.md#documentation) | [Next →](14-PRESERVING-PASS-BY-REFERENCE-PARAMETER-BEHAVIOUR.md)**
diff --git a/vendor/mockery/mockery/docs/14-PRESERVING-PASS-BY-REFERENCE-PARAMETER-BEHAVIOUR.md b/vendor/mockery/mockery/docs/14-PRESERVING-PASS-BY-REFERENCE-PARAMETER-BEHAVIOUR.md
new file mode 100644
index 0000000..f44e900
--- /dev/null
+++ b/vendor/mockery/mockery/docs/14-PRESERVING-PASS-BY-REFERENCE-PARAMETER-BEHAVIOUR.md
@@ -0,0 +1,78 @@
+# Preserving Pass-By-Reference Method Parameter Behaviour
+
+
+PHP Class method may accept parameters by reference. In this case, changes made
+to the parameter (a reference to the original variable passed to the method) are
+reflected in the original variable. A simple example:
+
+```PHP
+class Foo {
+ public function bar(&$a) {
+ $a++;
+ }
+}
+
+$baz = 1;
+$foo = new Foo;
+$foo->bar($baz);
+
+echo $baz; // will echo the integer 2
+```
+
+In the example above, the variable $baz is passed by reference to `Foo::bar()`
+(notice the `&` symbol in front of the parameter?).
+Any change `bar()` makes to the parameter reference is reflected in the original
+variable, `$baz`.
+
+Mockery 0.7+ handles references correctly for all methods where it can analyse the
+parameter (using `Reflection`) to see if it is passed by reference. To mock how a
+reference is manipulated by the class method, you can use a closure argument
+matcher to manipulate it, i.e. `\Mockery::on()` - see the [Argument
+Validation](07-ARGUMENT-VALIDATION.md) chapter.
+
+There is an exception for internal PHP classes where Mockery cannot analyse
+method parameters using `Reflection` (a limitation in PHP). To work around this,
+you can explicitly declare method parameters for an internal class using
+`/Mockery/Configuration::setInternalClassMethodParamMap()`.
+
+Here's an example using `MongoCollection::insert()`. `MongoCollection` is an internal
+class offered by the mongo extension from PECL. Its `insert()` method accepts an array
+of data as the first parameter, and an optional options array as the second
+parameter. The original data array is updated (i.e. when a `insert()` pass-by-reference
+parameter) to include a new `_id` field. We can mock this behaviour using
+a configured parameter map (to tell Mockery to expect a pass by reference parameter)
+and a Closure attached to the expected method parameter to be updated.
+
+Here's a PHPUnit unit test verifying that this pass-by-reference behaviour is preserved:
+
+```PHP
+public function testCanOverrideExpectedParametersOfInternalPHPClassesToPreserveRefs()
+{
+ \Mockery::getConfiguration()->setInternalClassMethodParamMap(
+ 'MongoCollection',
+ 'insert',
+ array('&$data', '$options = array()')
+ );
+ $m = \Mockery::mock('MongoCollection');
+ $m->shouldReceive('insert')->with(
+ \Mockery::on(function(&$data) {
+ if (!is_array($data)) return false;
+ $data['_id'] = 123;
+ return true;
+ }),
+ \Mockery::any()
+ );
+
+ $data = array('a'=>1,'b'=>2);
+ $m->insert($data);
+
+ $this->assertTrue(isset($data['_id']));
+ $this->assertEquals(123, $data['_id']);
+
+ \Mockery::resetContainer();
+}
+```
+
+
+
+**[← Previous](13-INSTANCE-MOCKING.md) | [Contents](../README.md#documentation) | [Next →](15-MOCKING-DEMETER-CHAINS-AND-FLUENT-INTERFACES.md)**
diff --git a/vendor/mockery/mockery/docs/15-MOCKING-DEMETER-CHAINS-AND-FLUENT-INTERFACES.md b/vendor/mockery/mockery/docs/15-MOCKING-DEMETER-CHAINS-AND-FLUENT-INTERFACES.md
new file mode 100644
index 0000000..1afacff
--- /dev/null
+++ b/vendor/mockery/mockery/docs/15-MOCKING-DEMETER-CHAINS-AND-FLUENT-INTERFACES.md
@@ -0,0 +1,39 @@
+# Mocking Demeter Chains And Fluent Interfaces
+
+
+Both of these terms refer to the growing practice of invoking statements
+similar to:
+
+```PHP
+$object->foo()->bar()->zebra()->alpha()->selfDestruct();
+```
+
+The long chain of method calls isn't necessarily a bad thing, assuming they
+each link back to a local object the calling class knows. Just as a fun example,
+Mockery's long chains (after the first `shouldReceive()` method) all call to the
+same instance of `\Mockery\Expectation`. However, sometimes this is not the case
+and the chain is constantly crossing object boundaries.
+
+In either case, mocking such a chain can be a horrible task. To make it easier
+Mockery support demeter chain mocking. Essentially, we shortcut through the
+chain and return a defined value from the final call. For example, let's
+assume `selfDestruct()` returns the string "Ten!" to $object (an instance of
+`CaptainsConsole`). Here's how we could mock it.
+
+```PHP
+$mock = \Mockery::mock('CaptainsConsole');
+$mock->shouldReceive('foo->bar->zebra->alpha->selfDestruct')->andReturn('Ten!');
+```
+
+The above expectation can follow any previously seen format or expectation, except
+that the method name is simply the string of all expected chain calls separated
+by `->`. Mockery will automatically setup the chain of expected calls with
+its final return values, regardless of whatever intermediary object might be
+used in the real implementation.
+
+Arguments to all members of the chain (except the final call) are ignored in
+this process.
+
+
+
+**[← Previous](14-PRESERVING-PASS-BY-REFERENCE-PARAMETER-BEHAVIOUR.md) | [Contents](../README.md#documentation) | [Next →](16-MOCKERY-EXCEPTIONS.md)**
diff --git a/vendor/mockery/mockery/docs/16-MOCKERY-EXCEPTIONS.md b/vendor/mockery/mockery/docs/16-MOCKERY-EXCEPTIONS.md
new file mode 100644
index 0000000..51642de
--- /dev/null
+++ b/vendor/mockery/mockery/docs/16-MOCKERY-EXCEPTIONS.md
@@ -0,0 +1,57 @@
+# Mockery Exceptions
+
+
+Mockery throws three types of exceptions when it cannot verify a mock object.
+
+1. `\Mockery\Exception\InvalidCountException`
+2. `\Mockery\Exception\InvalidOrderException`
+3. `\Mockery\Exception\NoMatchingExpectationException`
+
+You can capture any of these exceptions in a try...catch block to query them for
+specific information which is also passed along in the exception message but is provided
+separately from getters should they
+be useful when logging or reformatting output.
+
+
+## \Mockery\Exception\InvalidCountException
+
+The exception class is used when a method is called too many (or too few) times
+and offers the following methods:
+
++ `getMock()` - return actual mock object
++ `getMockName()` - return the name of the mock object
++ `getMethodName()` - return the name of the method the failing expectation is attached to
++ `getExpectedCount()` - return expected calls
++ `getExpectedCountComparative()` - returns a string, e.g. `<=` used to compare to actual count
++ `getActualCount()` - return actual calls made with given argument constraints
+
+
+## \Mockery\Exception\InvalidOrderException
+
+The exception class is used when a method is called outside the expected order set using the
+`ordered()` and `globally()` expectation modifiers. It offers the following methods:
+
++ `getMock()` - return actual mock object
++ `getMockName()` - return the name of the mock object
++ `getMethodName()` - return the name of the method the failing expectation is attached to
++ `getExpectedOrder()` - returns an integer represented the expected index for which this call was expected
++ `getActualOrder()` - return the actual index at which this method call occurred.
+
+
+## \Mockery\Exception\NoMatchingExpectationException
+
+The exception class is used when a method call does not match any known expectation.
+All expectations are uniquely identified in a mock object by the method name and the list
+of expected arguments. You can disable this exception and opt for returning null from all
+unexpected method calls by using the earlier mentioned shouldIgnoreMissing() behaviour
+modifier.
+This exception class offers the following methods:
+
++ `getMock()` - return actual mock object
++ `getMockName()` - return the name of the mock object
++ `getMethodName()` - return the name of the method the failing expectation is attached to
++ `getActualArguments()` - return actual arguments used to search for a matching expectation
+
+
+
+**[← Previous](15-MOCKING-DEMETER-CHAINS-AND-FLUENT-INTERFACES.md) | [Contents](../README.md#documentation) | [Next →](17-MOCK-OBJECT-RECORDING.md)**
diff --git a/vendor/mockery/mockery/docs/17-MOCK-OBJECT-RECORDING.md b/vendor/mockery/mockery/docs/17-MOCK-OBJECT-RECORDING.md
new file mode 100644
index 0000000..a9591c9
--- /dev/null
+++ b/vendor/mockery/mockery/docs/17-MOCK-OBJECT-RECORDING.md
@@ -0,0 +1,92 @@
+# Mock Object Recording
+
+
+In certain cases, you may find that you are testing against an already
+established pattern of behaviour, perhaps during refactoring. Rather then hand
+crafting mock object expectations for this behaviour, you could instead use
+the existing source code to record the interactions a real object undergoes
+onto a mock object as expectations - expectations you can then verify against
+an alternative or refactored version of the source code.
+
+To record expectations, you need a concrete instance of the class to be mocked.
+This can then be used to create a partial mock to which is given the necessary
+code to execute the object interactions to be recorded. A simple example is
+outline below (we use a closure for passing instructions to the mock).
+
+Here we have a very simple setup, a class (SubjectUser) which uses another class
+(Subject) to retrieve some value. We want to record as expectations on our
+mock (which will replace Subject later) all the calls and return values of
+a Subject instance when interacting with SubjectUser.
+
+```PHP
+class Subject
+{
+
+ public function execute() {
+ return 'executed!';
+ }
+
+}
+
+class SubjectUser
+{
+
+ public function use(Subject $subject) {
+ return $subject->execute();
+ }
+
+}
+```
+
+Here's the test case showing the recording:
+
+```PHP
+class SubjectUserTest extends PHPUnit_Framework_TestCase
+{
+
+ protected function tearDown()
+ {
+ \Mockery::close();
+ }
+
+ public function testSomething()
+ {
+ $mock = \Mockery::mock(new Subject);
+ $mock->shouldExpect(function ($subject) {
+ $user = new SubjectUser;
+ $user->use($subject);
+ });
+
+ /**
+ * Assume we have a replacement SubjectUser called NewSubjectUser.
+ * We want to verify it behaves identically to SubjectUser, i.e.
+ * it uses Subject in the exact same way
+ */
+ $newSubject = new NewSubjectUser;
+ $newSubject->use($mock);
+ }
+
+}
+```
+
+After the `\Mockery::close()` call in `tearDown()` validates the mock object, we
+should have zero exceptions if `NewSubjectUser` acted on `Subject` in a similar way
+to `SubjectUser`. By default the order of calls are not enforced, and loose argument
+matching is enabled, i.e. arguments may be equal (`==`) but not necessarily identical
+(`===`).
+
+If you wished to be more strict, for example ensuring the order of calls
+and the final call counts were identical, or ensuring arguments are completely
+identical, you can invoke the recorder's strict mode from the closure block, e.g.
+
+```PHP
+$mock->shouldExpect(function ($subject) {
+ $subject->shouldBeStrict();
+ $user = new SubjectUser;
+ $user->use($subject);
+});
+```
+
+
+
+**[← Previous](16-MOCKERY-EXCEPTIONS.md) | [Contents](../README.md#documentation) | [Next →](18-DEALING-WITH-FINAL-CLASSES-OR-METHODS.md)**
diff --git a/vendor/mockery/mockery/docs/18-DEALING-WITH-FINAL-CLASSES-OR-METHODS.md b/vendor/mockery/mockery/docs/18-DEALING-WITH-FINAL-CLASSES-OR-METHODS.md
new file mode 100644
index 0000000..3418c7f
--- /dev/null
+++ b/vendor/mockery/mockery/docs/18-DEALING-WITH-FINAL-CLASSES-OR-METHODS.md
@@ -0,0 +1,24 @@
+# Dealing with Final Classes/Methods
+
+
+One of the primary restrictions of mock objects in PHP, is that mocking classes
+or methods marked final is hard. The final keyword prevents methods so marked
+from being replaced in subclasses (subclassing is how mock objects can inherit
+the type of the class or object being mocked.
+
+The simplest solution is not to mark classes or methods as final!
+
+However, in a compromise between mocking functionality and type safety, Mockery
+does allow creating "proxy mocks" from classes marked final, or from classes with
+methods marked final. This offers all the usual mock object goodness but the
+resulting mock will not inherit the class type of the object being mocked, i.e.
+it will not pass any instanceof comparison.
+
+You can create a proxy mock by passing the instantiated object you wish to mock
+into `\Mockery::mock()`, i.e. Mockery will then generate a Proxy to the real object
+and selectively intercept method calls for the purposes of setting and
+meeting expectations.
+
+
+
+**[← Previous](17-MOCK-OBJECT-RECORDING.md) | [Contents](../README.md#documentation) | [Next →](19-MOCKERY-GLOBAL-CONFIGURATION.md)**
diff --git a/vendor/mockery/mockery/docs/19-MOCKERY-GLOBAL-CONFIGURATION.md b/vendor/mockery/mockery/docs/19-MOCKERY-GLOBAL-CONFIGURATION.md
new file mode 100644
index 0000000..5f2223f
--- /dev/null
+++ b/vendor/mockery/mockery/docs/19-MOCKERY-GLOBAL-CONFIGURATION.md
@@ -0,0 +1,65 @@
+# Mockery Global Configuration
+
+
+To allow for a degree of fine-tuning, Mockery utilises a singleton configuration
+object to store a small subset of core behaviours. The three currently present
+include:
+
+* Option to allow/disallow the mocking of methods which do not actually exist
+* Option to allow/disallow the existence of expectations which are never fulfilled (i.e. unused)
+* Setter/Getter for added a parameter map for internal PHP class methods (Reflection
+ cannot detect these automatically)
+
+By default, the first two behaviours are enabled. Of course, there are situations where
+this can lead to unintended consequences. The mocking of non-existent methods
+may allow mocks based on real classes/objects to fall out of sync with the
+actual implementations, especially when some degree of integration testing (testing
+of object wiring) is not being performed. Allowing unfulfilled expectations means
+unnecessary mock expectations go unnoticed, cluttering up test code, and
+potentially confusing test readers.
+
+You may allow or disallow these behaviours (whether for whole test suites or just
+select tests) by using one or both of the following two calls:
+
+```PHP
+\Mockery::getConfiguration()->allowMockingNonExistentMethods(bool);
+\Mockery::getConfiguration()->allowMockingMethodsUnnecessarily(bool);
+```
+
+Passing a true allows the behaviour, false disallows it. Both take effect
+immediately until switched back. In both cases, if either
+behaviour is detected when not allowed, it will result in an Exception being
+thrown at that point. Note that disallowing these behaviours should be carefully
+considered since they necessarily remove at least some of Mockery's flexibility.
+
+Note that when allowMockingNonExistentMethods is set to false it is still possible
+to allow non-existent methods to be mocked by calling shouldAllowMockingMethod
+on the mocked object:
+
+```PHP
+$mock->shouldAllowMockingMethod('someMagicMethodCall');
+```
+
+This is often preferable to using the global setting since it lets us select which
+non-existent methods we want to whitelist whilst still protecting us from mock
+objects and their classes going out-of-sync.
+
+
+The other two methods are:
+
+```PHP
+\Mockery::getConfiguration()->setInternalClassMethodParamMap($class, $method, array $paramMap)
+\Mockery::getConfiguration()->getInternalClassMethodParamMap($class, $method)
+```
+
+These are used to define parameters (i.e. the signature string of each) for the
+methods of internal PHP classes (e.g. SPL, or PECL extension classes like
+ext/mongo's MongoCollection. Reflection cannot analyse the parameters of internal
+classes. Most of the time, you never need to do this. It's mainly needed where an
+internal class method uses pass-by-reference for a parameter - you MUST in such
+cases ensure the parameter signature includes the "&" symbol correctly as Mockery
+won't correctly add it automatically for internal classes.
+
+
+
+**[← Previous](18-DEALING-WITH-FINAL-CLASSES-OR-METHODS.md) | [Contents](../README.md#documentation) | [Next →](20-RESERVED-METHOD-NAMES.md)**
diff --git a/vendor/mockery/mockery/docs/20-RESERVED-METHOD-NAMES.md b/vendor/mockery/mockery/docs/20-RESERVED-METHOD-NAMES.md
new file mode 100644
index 0000000..3e6d114
--- /dev/null
+++ b/vendor/mockery/mockery/docs/20-RESERVED-METHOD-NAMES.md
@@ -0,0 +1,20 @@
+# Reserved Method Names
+
+
+As you may have noticed, Mockery uses a number of methods called directly on
+all mock objects, for example `shouldReceive()`. Such methods are necessary
+in order to setup expectations on the given mock, and so they cannot be
+implemented on the classes or objects being mocked without creating a method
+name collision (reported as a PHP fatal error). The methods reserved by Mockery are:
+
+* `shouldReceive()`
+* `shouldBeStrict()`
+
+In addition, all mocks utilise a set of added methods and protected properties
+which cannot exist on the class or object being mocked. These are far less likely
+to cause collisions. All properties are prefixed with "_mockery" and all method
+names with "mockery_".
+
+
+
+**[← Previous](19-MOCKERY-GLOBAL-CONFIGURATION.md) | [Contents](../README.md#documentation) | [Next →](21-PHP-MAGIC-METHODS.md)**
diff --git a/vendor/mockery/mockery/docs/21-PHP-MAGIC-METHODS.md b/vendor/mockery/mockery/docs/21-PHP-MAGIC-METHODS.md
new file mode 100644
index 0000000..39f90e6
--- /dev/null
+++ b/vendor/mockery/mockery/docs/21-PHP-MAGIC-METHODS.md
@@ -0,0 +1,17 @@
+# PHP Magic Methods
+
+
+PHP magic methods which are prefixed with a double underscore, e.g. `__set()`, pose
+a particular problem in mocking and unit testing in general. It is strongly
+recommended that unit tests and mock objects do not directly refer to magic
+methods. Instead, refer only to the virtual methods and properties these magic
+methods simulate.
+
+Following this piece of advice will ensure you are testing the real API of classes
+and also ensures there is no conflict should Mockery override these magic methods,
+which it will inevitably do in order to support its role in intercepting method
+calls and properties.
+
+
+
+**[← Previous](20-RESERVED-METHOD-NAMES.md) | [Contents](../README.md#documentation) | [Next →](22-GOTCHAS.md)**
diff --git a/vendor/mockery/mockery/docs/22-GOTCHAS.md b/vendor/mockery/mockery/docs/22-GOTCHAS.md
new file mode 100644
index 0000000..42c57ee
--- /dev/null
+++ b/vendor/mockery/mockery/docs/22-GOTCHAS.md
@@ -0,0 +1,42 @@
+# Gotchas!
+
+
+Mocking objects in PHP has its limitations and gotchas. Some functionality can't
+be mocked or can't be mocked YET! If you locate such a circumstance, please please
+(pretty please with sugar on top) create a new issue on GitHub so it can be
+documented and resolved where possible. Here is a list to note:
+
+1. Classes containing public `__wakeup()` methods can be mocked but the mocked
+ `__wakeup()` method will perform no actions and cannot have expectations
+ set for it. This is necessary since Mockery must serialize and unserialize
+ objects to avoid some `__construct()` insanity and attempting to mock a
+ `__wakeup()` method as normal leads to a BadMethodCallException been thrown.
+
+2. Classes using non-real methods, i.e. where a method call triggers a `__call()`
+ method, will throw an exception that the non-real method does not exist
+ unless you first define at least one expectation (a simple `shouldReceive()`
+ call would suffice). This is necessary since there is no other way for
+ Mockery to be aware of the method name.
+
+3. Mockery has two scenarios where real classes are replaced: Instance mocks
+ and alias mocks. Both will generate PHP fatal errors if the real class is
+ loaded, usually via a require or include statement. Only use these two mock
+ types where autoloading is in place and where classes are not explicitly
+ loaded on a per-file basis using `require()`, `require_once()`, etc.
+
+4. Internal PHP classes are not entirely capable of being fully analysed using
+ `Reflection`. For example, `Reflection` cannot reveal details of expected
+ parameters to the methods of such internal classes. As a result, there will
+ be problems where a method parameter is defined to accept a value by
+ reference (Mockery cannot detect this condition and will assume a pass by
+ value on scalars and arrays). If references as internal class method
+ parameters are needed, you should use the
+ `\Mockery\Configuration::setInternalClassMethodParamMap()` method.
+
+The gotchas noted above are largely down to PHP's architecture and are assumed
+to be unavoidable. But - if you figure out a solution (or a better one than what
+may exist), let us know!
+
+
+
+**[← Previous](21-PHP-MAGIC-METHODS.md) | [Contents](../README.md#documentation) | [Next →](23-QUICK-EXAMPLES.md)**
diff --git a/vendor/mockery/mockery/docs/23-QUICK-EXAMPLES.md b/vendor/mockery/mockery/docs/23-QUICK-EXAMPLES.md
new file mode 100644
index 0000000..4a2876e
--- /dev/null
+++ b/vendor/mockery/mockery/docs/23-QUICK-EXAMPLES.md
@@ -0,0 +1,130 @@
+# Quick Examples
+
+
+Create a mock object to return a sequence of values from a set of method calls.
+
+```PHP
+class SimpleTest extends PHPUnit_Framework_TestCase
+{
+
+ protected function tearDown()
+ {
+ \Mockery::close();
+ }
+
+ public function testSimpleMock()
+ {
+ $mock = \Mockery::mock(array('pi' => 3.1416, 'e' => 2.71));
+ $this->assertEquals(3.1416, $mock->pi());
+ $this->assertEquals(2.71, $mock->e());
+ }
+
+}
+```
+
+Create a mock object which returns a self-chaining Undefined object for a method
+call.
+
+```PHP
+use \Mockery as m;
+
+class UndefinedTest extends PHPUnit_Framework_TestCase
+{
+
+ protected function tearDown()
+ {
+ m::close();
+ }
+
+ public function testUndefinedValues()
+ {
+ $mock = m::mock('mymock');
+ $mock->shouldReceive('divideBy')->with(0)->andReturnUndefined();
+ $this->assertTrue($mock->divideBy(0) instanceof \Mockery\Undefined);
+ }
+
+}
+```
+
+Creates a mock object which multiple query calls and a single update call
+
+```PHP
+use \Mockery as m;
+
+class DbTest extends PHPUnit_Framework_TestCase
+{
+
+ protected function tearDown()
+ {
+ m::close();
+ }
+
+ public function testDbAdapter()
+ {
+ $mock = m::mock('db');
+ $mock->shouldReceive('query')->andReturn(1, 2, 3);
+ $mock->shouldReceive('update')->with(5)->andReturn(null)->once();
+
+ // test code here using the mock
+ }
+
+}
+```
+
+Expect all queries to be executed before any updates.
+
+```PHP
+use \Mockery as m;
+
+class DbTest extends PHPUnit_Framework_TestCase
+{
+
+ protected function tearDown()
+ {
+ m::close();
+ }
+
+ public function testQueryAndUpdateOrder()
+ {
+ $mock = m::mock('db');
+ $mock->shouldReceive('query')->andReturn(1, 2, 3)->ordered();
+ $mock->shouldReceive('update')->andReturn(null)->once()->ordered();
+
+ // test code here using the mock
+ }
+
+}
+```
+
+Create a mock object where all queries occur after startup, but before finish, and
+where queries are expected with several different params.
+
+```PHP
+use \Mockery as m;
+
+class DbTest extends PHPUnit_Framework_TestCase
+{
+
+ protected function tearDown()
+ {
+ m::close();
+ }
+
+ public function testOrderedQueries()
+ {
+ $db = m::mock('db');
+ $db->shouldReceive('startup')->once()->ordered();
+ $db->shouldReceive('query')->with('CPWR')->andReturn(12.3)->once()->ordered('queries');
+ $db->shouldReceive('query')->with('MSFT')->andReturn(10.0)->once()->ordered('queries');
+ $db->shouldReceive('query')->with("/^....$/")->andReturn(3.3)->atLeast()->once()->ordered('queries');
+ $db->shouldReceive('finish')->once()->ordered();
+
+ // test code here using the mock
+ }
+
+}
+```
+
+
+
+**[← Previous](22-GOTCHAS.md) | [Contents](../README.md#documentation)**
diff --git a/vendor/mockery/mockery/examples/starship/Bootstrap.php b/vendor/mockery/mockery/examples/starship/Bootstrap.php
new file mode 100644
index 0000000..93b0af9
--- /dev/null
+++ b/vendor/mockery/mockery/examples/starship/Bootstrap.php
@@ -0,0 +1,11 @@
+register();
diff --git a/vendor/mockery/mockery/examples/starship/Starship.php b/vendor/mockery/mockery/examples/starship/Starship.php
new file mode 100644
index 0000000..135fa10
--- /dev/null
+++ b/vendor/mockery/mockery/examples/starship/Starship.php
@@ -0,0 +1,25 @@
+_engineering = $engineering;
+ }
+
+ public function enterOrbit()
+ {
+ $this->_engineering->disengageWarp();
+ $this->_engineering->runDiagnosticLevel(5);
+ $this->_engineering->divertPower(0.40, 'sensors');
+ $this->_engineering->divertPower(0.30, 'auxengines');
+ $this->_engineering->runDiagnosticLevel(1);
+
+ // We can add more runDiagnosticLevel() calls without failing the test
+ // anywhere above since they are unordered.
+ }
+
+}
diff --git a/vendor/mockery/mockery/examples/starship/StarshipTest.php b/vendor/mockery/mockery/examples/starship/StarshipTest.php
new file mode 100644
index 0000000..cfe4601
--- /dev/null
+++ b/vendor/mockery/mockery/examples/starship/StarshipTest.php
@@ -0,0 +1,22 @@
+shouldReceive('disengageWarp')->once()->ordered();
+ $mock->shouldReceive('divertPower')->with(0.40, 'sensors')->once()->ordered();
+ $mock->shouldReceive('divertPower')->with(0.30, 'auxengines')->once()->ordered();
+ $mock->shouldReceive('runDiagnosticLevel')->with(1)->once()->ordered();
+ $mock->shouldReceive('runDiagnosticLevel')->with(M::type('int'))->zeroOrMoreTimes();
+
+ $starship = new Starship($mock);
+ $starship->enterOrbit();
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery.php b/vendor/mockery/mockery/library/Mockery.php
new file mode 100644
index 0000000..b16d9ec
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery.php
@@ -0,0 +1,722 @@
+setName($name);
+
+ array_unshift($args, $builder);
+
+ return call_user_func_array(array(self::getContainer(), 'mock'), $args);
+ }
+
+ /**
+ * Static shortcut to \Mockery\Container::self().
+ *
+ * @throws LogicException
+ *
+ * @return \Mockery\MockInterface
+ */
+ public static function self()
+ {
+ if (is_null(self::$_container)) {
+ throw new \LogicException('You have not declared any mocks yet');
+ }
+
+ return self::$_container->self();
+ }
+
+ /**
+ * Static shortcut to closing up and verifying all mocks in the global
+ * container, and resetting the container static variable to null.
+ *
+ * @return void
+ */
+ public static function close()
+ {
+ if (is_null(self::$_container)) return;
+
+ self::$_container->mockery_teardown();
+ self::$_container->mockery_close();
+ self::$_container = null;
+ }
+
+ /**
+ * Static fetching of a mock associated with a name or explicit class poser.
+ *
+ * @param $name
+ *
+ * @return \Mockery\Mock
+ */
+ public static function fetchMock($name)
+ {
+ return self::$_container->fetchMock($name);
+ }
+
+ /**
+ * Get the container.
+ */
+ public static function getContainer()
+ {
+ if (is_null(self::$_container)) {
+ self::$_container = new Mockery\Container(self::getGenerator(), self::getLoader());
+ }
+
+ return self::$_container;
+ }
+
+ /**
+ * @param \Mockery\Generator\Generator $generator
+ */
+ public static function setGenerator(Generator $generator)
+ {
+ self::$_generator = $generator;
+ }
+
+ public static function getGenerator()
+ {
+ if (is_null(self::$_generator)) {
+ self::$_generator = self::getDefaultGenerator();
+ }
+
+ return self::$_generator;
+ }
+
+ public static function getDefaultGenerator()
+ {
+ $generator = new StringManipulationGenerator(array(
+ new CallTypeHintPass(),
+ new ClassPass(),
+ new ClassNamePass(),
+ new InstanceMockPass(),
+ new InterfacePass(),
+ new MethodDefinitionPass(),
+ new RemoveUnserializeForInternalSerializableClassesPass(),
+ new RemoveBuiltinMethodsThatAreFinalPass(),
+ ));
+
+ return new CachingGenerator($generator);
+ }
+
+ /**
+ * @param Loader $loader
+ */
+ public static function setLoader(Loader $loader)
+ {
+ self::$_loader = $loader;
+ }
+
+ /**
+ * @return Loader
+ */
+ public static function getLoader()
+ {
+ if (is_null(self::$_loader)) {
+ self::$_loader = self::getDefaultLoader();
+ }
+
+ return self::$_loader;
+ }
+
+ /**
+ * @return EvalLoader
+ */
+ public static function getDefaultLoader()
+ {
+ return new EvalLoader();
+ }
+
+ /**
+ * Set the container.
+ *
+ * @param \Mockery\Container $container
+ *
+ * @return \Mockery\Container
+ */
+ public static function setContainer(Mockery\Container $container)
+ {
+ return self::$_container = $container;
+ }
+
+ /**
+ * Reset the container to null.
+ */
+ public static function resetContainer()
+ {
+ self::$_container = null;
+ }
+
+ /**
+ * Return instance of ANY matcher.
+ *
+ * @return \Mockery\Matcher\Any
+ */
+ public static function any()
+ {
+ return new \Mockery\Matcher\Any();
+ }
+
+ /**
+ * Return instance of TYPE matcher.
+ *
+ * @param $expected
+ *
+ * @return \Mockery\Matcher\Type
+ */
+ public static function type($expected)
+ {
+ return new \Mockery\Matcher\Type($expected);
+ }
+
+ /**
+ * Return instance of DUCKTYPE matcher.
+ *
+ * @return \Mockery\Matcher\Ducktype
+ */
+ public static function ducktype()
+ {
+ return new \Mockery\Matcher\Ducktype(func_get_args());
+ }
+
+ /**
+ * Return instance of SUBSET matcher.
+ *
+ * @param array $part
+ *
+ * @return \Mockery\Matcher\Subset
+ */
+ public static function subset(array $part)
+ {
+ return new \Mockery\Matcher\Subset($part);
+ }
+
+ /**
+ * Return instance of CONTAINS matcher.
+ *
+ * @return \Mockery\Matcher\Contains
+ */
+ public static function contains()
+ {
+ return new \Mockery\Matcher\Contains(func_get_args());
+ }
+
+ /**
+ * Return instance of HASKEY matcher.
+ *
+ * @param $key
+ *
+ * @return \Mockery\Matcher\HasKey
+ */
+ public static function hasKey($key)
+ {
+ return new \Mockery\Matcher\HasKey($key);
+ }
+
+ /**
+ * Return instance of HASVALUE matcher.
+ *
+ * @param $val
+ *
+ * @return \Mockery\Matcher\HasValue
+ */
+ public static function hasValue($val)
+ {
+ return new \Mockery\Matcher\HasValue($val);
+ }
+
+ /**
+ * Return instance of CLOSURE matcher.
+ *
+ * @param $closure
+ *
+ * @return \Mockery\Matcher\Closure
+ */
+ public static function on($closure)
+ {
+ return new \Mockery\Matcher\Closure($closure);
+ }
+
+ /**
+ * Return instance of MUSTBE matcher.
+ *
+ * @param $expected
+ *
+ * @return \Mockery\Matcher\MustBe
+ */
+ public static function mustBe($expected)
+ {
+ return new \Mockery\Matcher\MustBe($expected);
+ }
+
+ /**
+ * Return instance of NOT matcher.
+ *
+ * @param $expected
+ *
+ * @return \Mockery\Matcher\Not
+ */
+ public static function not($expected)
+ {
+ return new \Mockery\Matcher\Not($expected);
+ }
+
+ /**
+ * Return instance of ANYOF matcher.
+ *
+ * @return \Mockery\Matcher\AnyOf
+ */
+ public static function anyOf()
+ {
+ return new \Mockery\Matcher\AnyOf(func_get_args());
+ }
+
+ /**
+ * Return instance of NOTANYOF matcher.
+ *
+ * @return \Mockery\Matcher\NotAnyOf
+ */
+ public static function notAnyOf()
+ {
+ return new \Mockery\Matcher\NotAnyOf(func_get_args());
+ }
+
+ /**
+ * Get the global configuration container.
+ */
+ public static function getConfiguration()
+ {
+ if (is_null(self::$_config)) {
+ self::$_config = new \Mockery\Configuration();
+ }
+
+ return self::$_config;
+ }
+
+ /**
+ * Utility method to format method name and arguments into a string.
+ *
+ * @param string $method
+ * @param array $arguments
+ *
+ * @return string
+ */
+ public static function formatArgs($method, array $arguments = null)
+ {
+ if (is_null($arguments)) {
+ return $method . '()';
+ }
+
+ $formattedArguments = array();
+ foreach ($arguments as $argument) {
+ $formattedArguments[] = self::formatArgument($argument);
+ }
+
+ return $method . '(' . implode(', ', $formattedArguments) . ')';
+ }
+
+ private static function formatArgument($argument, $depth = 0)
+ {
+ if (is_object($argument)) {
+ return 'object(' . get_class($argument) . ')';
+ }
+
+ if (is_int($argument) || is_float($argument)) {
+ return $argument;
+ }
+
+ if (is_array($argument)) {
+ if ($depth === 1) {
+ $argument = 'array(...)';
+ } else {
+ $sample = array();
+ foreach ($argument as $key => $value) {
+ $sample[$key] = self::formatArgument($value, $depth + 1);
+ }
+ $argument = preg_replace("{\s}", '', var_export($sample, true));
+ }
+
+ return ((strlen($argument) > 1000) ? substr($argument, 0, 1000).'...)' : $argument);
+ }
+
+ if (is_bool($argument)) {
+ return $argument ? 'true' : 'false';
+ }
+
+ if (is_resource($argument)) {
+ return 'resource(...)';
+ }
+
+ $argument = (string) $argument;
+
+ return $depth === 0 ? '"' . $argument . '"' : $argument;
+ }
+
+ /**
+ * Utility function to format objects to printable arrays.
+ *
+ * @param array $objects
+ *
+ * @return string
+ */
+ public static function formatObjects(array $objects = null)
+ {
+ static $formatting;
+
+ if ($formatting) {
+ return '[Recursion]';
+ }
+
+ if (is_null($objects)) {
+ return '';
+ }
+
+ $objects = array_filter($objects, 'is_object');
+ if (empty($objects)) {
+ return '';
+ }
+
+ $formatting = true;
+ $parts = array();
+
+ foreach($objects as $object) {
+ $parts[get_class($object)] = self::objectToArray($object);
+ }
+
+ $formatting = false;
+
+ return 'Objects: ( ' . var_export($parts, true) . ')';
+ }
+
+ /**
+ * Utility function to turn public properties and public get* and is* method values into an array.
+ *
+ * @param $object
+ * @param int $nesting
+ *
+ * @return array
+ */
+ private static function objectToArray($object, $nesting = 3)
+ {
+ if ($nesting == 0) {
+ return array('...');
+ }
+
+ return array(
+ 'class' => get_class($object),
+ 'properties' => self::extractInstancePublicProperties($object, $nesting),
+ 'getters' => self::extractGetters($object, $nesting)
+ );
+ }
+
+ /**
+ * Returns all public instance properties.
+ *
+ * @param $object
+ * @param $nesting
+ *
+ * @return array
+ */
+ private static function extractInstancePublicProperties($object, $nesting)
+ {
+ $reflection = new \ReflectionClass(get_class($object));
+ $properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC & ~ \ReflectionProperty::IS_STATIC);
+ $cleanedProperties = array();
+
+ foreach ($properties as $publicProperty) {
+ $name = $publicProperty->getName();
+ $cleanedProperties[$name] = self::cleanupNesting($object->$name, $nesting);
+ }
+
+ return $cleanedProperties;
+ }
+
+ /**
+ * Returns all object getters.
+ *
+ * @param $object
+ * @param $nesting
+ *
+ * @return array
+ */
+ private static function extractGetters($object, $nesting)
+ {
+ $reflection = new \ReflectionClass(get_class($object));
+ $publicMethods = $reflection->getMethods(\ReflectionProperty::IS_PUBLIC & ~ \ReflectionProperty::IS_STATIC);
+ $getters = array();
+
+ foreach ($publicMethods as $publicMethod) {
+ $name = $publicMethod->getName();
+ $numberOfParameters = $publicMethod->getNumberOfParameters();
+
+ if ((substr($name, 0, 3) !== 'get' && substr($name, 0, 2) !== 'is') || $numberOfParameters != 0) {
+ continue;
+ }
+
+ try {
+ $getters[$name] = self::cleanupNesting($object->$name(), $nesting);
+ } catch(\Exception $e) {
+ $getters[$name] = '!! ' . get_class($e) . ': ' . $e->getMessage() . ' !!';
+ }
+ }
+
+ return $getters;
+ }
+
+ private static function cleanupNesting($argument, $nesting)
+ {
+ if (is_object($argument)) {
+ $object = self::objectToArray($argument, $nesting - 1);
+ $object['class'] = get_class($argument);
+
+ return $object;
+ }
+
+ if (is_array($argument)) {
+ return self::cleanupArray($argument, $nesting - 1);
+ }
+
+ return $argument;
+ }
+
+ private static function cleanupArray($argument, $nesting = 3)
+ {
+ if ($nesting == 0) {
+ return '...';
+ }
+
+ foreach ($argument as $key => $value) {
+ if (is_array($value)) {
+ $argument[$key] = self::cleanupArray($value, $nesting - 1);
+ } elseif (is_object($value)) {
+ $argument[$key] = self::objectToArray($value, $nesting - 1);
+ }
+ }
+
+ return $argument;
+ }
+
+ /**
+ * Utility function to parse shouldReceive() arguments and generate
+ * expectations from such as needed.
+ *
+ * @param Mockery\MockInterface $mock
+ * @param array $args
+ * @param callable $add
+ * @return \Mockery\CompositeExpectation
+ */
+ public static function parseShouldReturnArgs(\Mockery\MockInterface $mock, $args, $add)
+ {
+ $composite = new \Mockery\CompositeExpectation();
+
+ foreach ($args as $arg) {
+ if (is_array($arg)) {
+ foreach($arg as $k => $v) {
+ $expectation = self::buildDemeterChain($mock, $k, $add)->andReturn($v);
+ $composite->add($expectation);
+ }
+ } elseif (is_string($arg)) {
+ $expectation = self::buildDemeterChain($mock, $arg, $add);
+ $composite->add($expectation);
+ }
+ }
+
+ return $composite;
+ }
+
+ /**
+ * Sets up expectations on the members of the CompositeExpectation and
+ * builds up any demeter chain that was passed to shouldReceive.
+ *
+ * @param \Mockery\MockInterface $mock
+ * @param string $arg
+ * @param callable $add
+ * @throws Mockery\Exception
+ * @return \Mockery\ExpectationDirector
+ */
+ protected static function buildDemeterChain(\Mockery\MockInterface $mock, $arg, $add)
+ {
+ /** @var Mockery\Container $container */
+ $container = $mock->mockery_getContainer();
+ $methodNames = explode('->', $arg);
+ reset($methodNames);
+
+ if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed()
+ && !$mock->mockery_isAnonymous()
+ && !in_array(current($methodNames), $mock->mockery_getMockableMethods())
+ ) {
+ throw new \Mockery\Exception(
+ 'Mockery\'s configuration currently forbids mocking the method '
+ . current($methodNames) . ' as it does not exist on the class or object '
+ . 'being mocked'
+ );
+ }
+
+ /** @var ExpectationInterface|null $expectations */
+ $expectations = null;
+
+ /** @var Callable $nextExp */
+ $nextExp = function ($method) use ($add) {
+ return $add($method);
+ };
+
+ while (true) {
+ $method = array_shift($methodNames);
+ $expectations = $mock->mockery_getExpectationsFor($method);
+
+ if (is_null($expectations) || self::noMoreElementsInChain($methodNames)) {
+ $expectations = $nextExp($method);
+ if (self::noMoreElementsInChain($methodNames)) {
+ break;
+ }
+
+ $mock = self::getNewDemeterMock($container, $method, $expectations);
+ } else {
+ $demeterMockKey = $container->getKeyOfDemeterMockFor($method);
+ if ($demeterMockKey) {
+ $mock = self::getExistingDemeterMock($container, $demeterMockKey);
+ }
+ }
+
+ $nextExp = function ($n) use ($mock) {
+ return $mock->shouldReceive($n);
+ };
+ }
+
+ return $expectations;
+ }
+
+ /**
+ * @param \Mockery\Container $container
+ * @param string $method
+ * @param Mockery\ExpectationInterface $exp
+ *
+ * @return \Mockery\Mock
+ */
+ private static function getNewDemeterMock(Mockery\Container $container,
+ $method,
+ Mockery\ExpectationInterface $exp
+ ) {
+ $mock = $container->mock('demeter_' . $method);
+ $exp->andReturn($mock);
+
+ return $mock;
+ }
+
+ /**
+ * @param \Mockery\Container $container
+ * @param string $demeterMockKey
+ *
+ * @return mixed
+ */
+ private static function getExistingDemeterMock(Mockery\Container $container, $demeterMockKey)
+ {
+ $mocks = $container->getMocks();
+ $mock = $mocks[$demeterMockKey];
+
+ return $mock;
+ }
+
+ /**
+ * @param array $methodNames
+ *
+ * @return bool
+ */
+ private static function noMoreElementsInChain(array $methodNames)
+ {
+ return empty($methodNames);
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php
new file mode 100644
index 0000000..50fac3d
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php
@@ -0,0 +1,80 @@
+mockery_getExpectationCount();
+ $test->addToAssertionCount($expectation_count);
+ }
+ \Mockery::close();
+ } catch (\Exception $e) {
+ $result = $test->getTestResultObject();
+ $result->addError($test, $e, $time);
+ }
+ }
+
+ /**
+ * Add Mockery files to PHPUnit's blacklist so they don't showup on coverage reports
+ */
+ public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
+ {
+ if (class_exists('\\PHP_CodeCoverage_Filter')
+ && method_exists('\\PHP_CodeCoverage_Filter', 'getInstance')) {
+ \PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(
+ __DIR__.'/../../../Mockery/', '.php', '', 'PHPUNIT'
+ );
+
+ \PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__DIR__.'/../../../Mockery.php', 'PHPUNIT');
+ }
+ }
+ /**
+ * The Listening methods below are not required for Mockery
+ */
+ public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) {}
+
+ public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) {}
+
+ public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) {}
+
+ public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) {}
+
+ public function addRiskyTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) {}
+
+
+ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) {}
+
+ public function startTest(\PHPUnit_Framework_Test $test) {}
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php b/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php
new file mode 100644
index 0000000..bfac688
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php
@@ -0,0 +1,128 @@
+_expectations[] = $expectation;
+ }
+
+ public function andReturn()
+ {
+ return $this->__call(__FUNCTION__, func_get_args());
+ }
+
+ /**
+ * Intercept any expectation calls and direct against all expectations
+ *
+ * @param string $method
+ * @param array $args
+ * @return self
+ */
+ public function __call($method, array $args)
+ {
+ foreach ($this->_expectations as $expectation) {
+ call_user_func_array(array($expectation, $method), $args);
+ }
+ return $this;
+ }
+
+ /**
+ * Return order number of the first expectation
+ *
+ * @return int
+ */
+ public function getOrderNumber()
+ {
+ reset($this->_expectations);
+ $first = current($this->_expectations);
+ return $first->getOrderNumber();
+ }
+
+ /**
+ * Return the parent mock of the first expectation
+ *
+ * @return \Mockery\MockInterface
+ */
+ public function getMock()
+ {
+ reset($this->_expectations);
+ $first = current($this->_expectations);
+ return $first->getMock();
+ }
+
+ /**
+ * Mockery API alias to getMock
+ *
+ * @return \Mockery\MockInterface
+ */
+ public function mock()
+ {
+ return $this->getMock();
+ }
+
+ /**
+ * Starts a new expectation addition on the first mock which is the primary
+ * target outside of a demeter chain
+ *
+ * @return \Mockery\Expectation
+ */
+ public function shouldReceive()
+ {
+ $args = func_get_args();
+ reset($this->_expectations);
+ $first = current($this->_expectations);
+ return call_user_func_array(array($first->getMock(), 'shouldReceive'), $args);
+ }
+
+ /**
+ * Return the string summary of this composite expectation
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $return = '[';
+ $parts = array();
+ foreach ($this->_expectations as $exp) {
+ $parts[] = (string) $exp;
+ }
+ $return .= implode(', ', $parts) . ']';
+ return $return;
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Configuration.php b/vendor/mockery/mockery/library/Mockery/Configuration.php
new file mode 100644
index 0000000..4423c9e
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Configuration.php
@@ -0,0 +1,132 @@
+_allowMockingNonExistentMethod = (bool) $flag;
+ }
+
+ /**
+ * Return flag indicating whether mocking non-existent methods allowed
+ *
+ * @return bool
+ */
+ public function mockingNonExistentMethodsAllowed()
+ {
+ return $this->_allowMockingNonExistentMethod;
+ }
+
+ /**
+ * Set boolean to allow/prevent unnecessary mocking of methods
+ *
+ * @param bool
+ */
+ public function allowMockingMethodsUnnecessarily($flag = true)
+ {
+ $this->_allowMockingMethodsUnnecessarily = (bool) $flag;
+ }
+
+ /**
+ * Return flag indicating whether mocking non-existent methods allowed
+ *
+ * @return bool
+ */
+ public function mockingMethodsUnnecessarilyAllowed()
+ {
+ return $this->_allowMockingMethodsUnnecessarily;
+ }
+
+ /**
+ * Set a parameter map (array of param signature strings) for the method
+ * of an internal PHP class.
+ *
+ * @param string $class
+ * @param string $method
+ * @param array $map
+ */
+ public function setInternalClassMethodParamMap($class, $method, array $map)
+ {
+ if (!isset($this->_internalClassParamMap[strtolower($class)])) {
+ $this->_internalClassParamMap[strtolower($class)] = array();
+ }
+ $this->_internalClassParamMap[strtolower($class)][strtolower($method)] = $map;
+ }
+
+ /**
+ * Remove all overriden parameter maps from internal PHP classes.
+ */
+ public function resetInternalClassMethodParamMaps()
+ {
+ $this->_internalClassParamMap = array();
+ }
+
+ /**
+ * Get the parameter map of an internal PHP class method
+ *
+ * @return array
+ */
+ public function getInternalClassMethodParamMap($class, $method)
+ {
+ if (isset($this->_internalClassParamMap[strtolower($class)][strtolower($method)])) {
+ return $this->_internalClassParamMap[strtolower($class)][strtolower($method)];
+ }
+ }
+
+ public function getInternalClassMethodParamMaps()
+ {
+ return $this->_internalClassParamMap;
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Container.php b/vendor/mockery/mockery/library/Mockery/Container.php
new file mode 100644
index 0000000..7fdac3d
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Container.php
@@ -0,0 +1,543 @@
+_generator = $generator ?: \Mockery::getDefaultGenerator();
+ $this->_loader = $loader ?: \Mockery::getDefaultLoader();
+ }
+
+ /**
+ * Generates a new mock object for this container
+ *
+ * I apologies in advance for this. A God Method just fits the API which
+ * doesn't require differentiating between classes, interfaces, abstracts,
+ * names or partials - just so long as it's something that can be mocked.
+ * I'll refactor it one day so it's easier to follow.
+ *
+ * @throws Exception\RuntimeException
+ * @throws Exception
+ * @return \Mockery\Mock
+ */
+ public function mock()
+ {
+ $expectationClosure = null;
+ $quickdefs = array();
+ $constructorArgs = null;
+ $blocks = array();
+ $args = func_get_args();
+
+ if (count($args) > 1) {
+ $finalArg = end($args);
+ reset($args);
+ if (is_callable($finalArg) && is_object($finalArg)) {
+ $expectationClosure = array_pop($args);
+ }
+ }
+
+ $builder = new MockConfigurationBuilder();
+
+ foreach ($args as $k => $arg) {
+ if ($arg instanceof MockConfigurationBuilder) {
+ $builder = $arg;
+ unset($args[$k]);
+ }
+ }
+ reset($args);
+
+ $builder->setParameterOverrides(\Mockery::getConfiguration()->getInternalClassMethodParamMaps());
+
+ while (count($args) > 0) {
+ $arg = current($args);
+ // check for multiple interfaces
+ if (is_string($arg) && strpos($arg, ',') && !strpos($arg, ']')) {
+ $interfaces = explode(',', str_replace(' ', '', $arg));
+ foreach ($interfaces as $i) {
+ if (!interface_exists($i, true) && !class_exists($i, true)) {
+ throw new \Mockery\Exception(
+ 'Class name follows the format for defining multiple'
+ . ' interfaces, however one or more of the interfaces'
+ . ' do not exist or are not included, or the base class'
+ . ' (which you may omit from the mock definition) does not exist'
+ );
+ }
+ }
+ $builder->addTargets($interfaces);
+ array_shift($args);
+
+ continue;
+ } elseif (is_string($arg) && substr($arg, 0, 6) == 'alias:') {
+ $name = array_shift($args);
+ $name = str_replace('alias:', '', $name);
+ $builder->addTarget('stdClass');
+ $builder->setName($name);
+ continue;
+ } elseif (is_string($arg) && substr($arg, 0, 9) == 'overload:') {
+ $name = array_shift($args);
+ $name = str_replace('overload:', '', $name);
+ $builder->setInstanceMock(true);
+ $builder->addTarget('stdClass');
+ $builder->setName($name);
+ continue;
+ } elseif (is_string($arg) && substr($arg, strlen($arg)-1, 1) == ']') {
+ $parts = explode('[', $arg);
+ if (!class_exists($parts[0], true) && !interface_exists($parts[0], true)) {
+ throw new \Mockery\Exception('Can only create a partial mock from'
+ . ' an existing class or interface');
+ }
+ $class = $parts[0];
+ $parts[1] = str_replace(' ','', $parts[1]);
+ $partialMethods = explode(',', strtolower(rtrim($parts[1], ']')));
+ $builder->addTarget($class);
+ $builder->setWhiteListedMethods($partialMethods);
+ array_shift($args);
+ continue;
+ } elseif (is_string($arg) && (class_exists($arg, true) || interface_exists($arg, true))) {
+ $class = array_shift($args);
+ $builder->addTarget($class);
+ continue;
+ } elseif (is_string($arg)) {
+ $class = array_shift($args);
+ $builder->addTarget($class);
+ continue;
+ } elseif (is_object($arg)) {
+ $partial = array_shift($args);
+ $builder->addTarget($partial);
+ continue;
+ } elseif (is_array($arg) && !empty($arg) && array_keys($arg) !== range(0, count($arg) - 1)) {
+ // if associative array
+ if(array_key_exists(self::BLOCKS, $arg)) $blocks = $arg[self::BLOCKS]; unset($arg[self::BLOCKS]);
+ $quickdefs = array_shift($args);
+ continue;
+ } elseif (is_array($arg)) {
+ $constructorArgs = array_shift($args);
+ continue;
+ }
+
+ throw new \Mockery\Exception(
+ 'Unable to parse arguments sent to '
+ . get_class($this) . '::mock()'
+ );
+ }
+
+ $builder->addBlackListedMethods($blocks);
+
+ if (!is_null($constructorArgs)) {
+ $builder->addBlackListedMethod("__construct"); // we need to pass through
+ }
+
+ if (!empty($partialMethods) && $constructorArgs === null) {
+ $constructorArgs = array();
+ }
+
+ $config = $builder->getMockConfiguration();
+
+ $this->checkForNamedMockClashes($config);
+
+ $def = $this->getGenerator()->generate($config);
+
+ if (class_exists($def->getClassName(), $attemptAutoload = false)) {
+ $rfc = new \ReflectionClass($def->getClassName());
+ if (!$rfc->implementsInterface("Mockery\MockInterface")) {
+ throw new \Mockery\Exception\RuntimeException("Could not load mock {$def->getClassName()}, class already exists");
+ }
+ }
+
+ $this->getLoader()->load($def);
+
+ $mock = $this->_getInstance($def->getClassName(), $constructorArgs);
+ $mock->mockery_init($this, $config->getTargetObject());
+
+ if (!empty($quickdefs)) {
+ $mock->shouldReceive($quickdefs)->byDefault();
+ }
+ if (!empty($expectationClosure)) {
+ $expectationClosure($mock);
+ }
+ $this->rememberMock($mock);
+ return $mock;
+ }
+
+ public function instanceMock()
+ {
+
+ }
+
+ public function getLoader()
+ {
+ return $this->_loader;
+ }
+
+ public function getGenerator()
+ {
+ return $this->_generator;
+ }
+
+ /**
+ * @param string $method
+ * @return string|null
+ */
+ public function getKeyOfDemeterMockFor($method)
+ {
+
+ $keys = array_keys($this->_mocks);
+ $match = preg_grep("/__demeter_{$method}$/", $keys);
+ if (count($match) == 1) {
+ $res = array_values($match);
+ if (count($res) > 0) {
+ return $res[0];
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return array
+ */
+ public function getMocks()
+ {
+ return $this->_mocks;
+ }
+
+ /**
+ * Tear down tasks for this container
+ *
+ * @throws \Exception
+ * @return void
+ */
+ public function mockery_teardown()
+ {
+ try {
+ $this->mockery_verify();
+ } catch (\Exception $e) {
+ $this->mockery_close();
+ throw $e;
+ }
+ }
+
+ /**
+ * Verify the container mocks
+ *
+ * @return void
+ */
+ public function mockery_verify()
+ {
+ foreach($this->_mocks as $mock) {
+ $mock->mockery_verify();
+ }
+ }
+
+ /**
+ * Reset the container to its original state
+ *
+ * @return void
+ */
+ public function mockery_close()
+ {
+ foreach($this->_mocks as $mock) {
+ $mock->mockery_teardown();
+ }
+ $this->_mocks = array();
+ }
+
+ /**
+ * Fetch the next available allocation order number
+ *
+ * @return int
+ */
+ public function mockery_allocateOrder()
+ {
+ $this->_allocatedOrder += 1;
+ return $this->_allocatedOrder;
+ }
+
+ /**
+ * Set ordering for a group
+ *
+ * @param mixed $group
+ * @param int $order
+ */
+ public function mockery_setGroup($group, $order)
+ {
+ $this->_groups[$group] = $order;
+ }
+
+ /**
+ * Fetch array of ordered groups
+ *
+ * @return array
+ */
+ public function mockery_getGroups()
+ {
+ return $this->_groups;
+ }
+
+ /**
+ * Set current ordered number
+ *
+ * @param int $order
+ * @return int The current order number that was set
+ */
+ public function mockery_setCurrentOrder($order)
+ {
+ $this->_currentOrder = $order;
+ return $this->_currentOrder;
+ }
+
+ /**
+ * Get current ordered number
+ *
+ * @return int
+ */
+ public function mockery_getCurrentOrder()
+ {
+ return $this->_currentOrder;
+ }
+
+ /**
+ * Validate the current mock's ordering
+ *
+ * @param string $method
+ * @param int $order
+ * @throws \Mockery\Exception
+ * @return void
+ */
+ public function mockery_validateOrder($method, $order, \Mockery\MockInterface $mock)
+ {
+ if ($order < $this->_currentOrder) {
+ $exception = new \Mockery\Exception\InvalidOrderException(
+ 'Method ' . $method . ' called out of order: expected order '
+ . $order . ', was ' . $this->_currentOrder
+ );
+ $exception->setMock($mock)
+ ->setMethodName($method)
+ ->setExpectedOrder($order)
+ ->setActualOrder($this->_currentOrder);
+ throw $exception;
+ }
+ $this->mockery_setCurrentOrder($order);
+ }
+
+ /**
+ * Gets the count of expectations on the mocks
+ *
+ * @return int
+ */
+ public function mockery_getExpectationCount()
+ {
+ $count = 0;
+ foreach($this->_mocks as $mock) {
+ $count += $mock->mockery_getExpectationCount();
+ }
+ return $count;
+ }
+
+ /**
+ * Store a mock and set its container reference
+ *
+ * @param \Mockery\Mock
+ * @return \Mockery\Mock
+ */
+ public function rememberMock(\Mockery\MockInterface $mock)
+ {
+ if (!isset($this->_mocks[get_class($mock)])) {
+ $this->_mocks[get_class($mock)] = $mock;
+ } else {
+ /**
+ * This condition triggers for an instance mock where origin mock
+ * is already remembered
+ */
+ $this->_mocks[] = $mock;
+ }
+ return $mock;
+ }
+
+ /**
+ * Retrieve the last remembered mock object, which is the same as saying
+ * retrieve the current mock being programmed where you have yet to call
+ * mock() to change it - thus why the method name is "self" since it will be
+ * be used during the programming of the same mock.
+ *
+ * @return \Mockery\Mock
+ */
+ public function self()
+ {
+ $mocks = array_values($this->_mocks);
+ $index = count($mocks) - 1;
+ return $mocks[$index];
+ }
+
+ /**
+ * Return a specific remembered mock according to the array index it
+ * was stored to in this container instance
+ *
+ * @return \Mockery\Mock
+ */
+ public function fetchMock($reference)
+ {
+ if (isset($this->_mocks[$reference])) return $this->_mocks[$reference];
+ }
+
+ protected function _getInstance($mockName, $constructorArgs = null)
+ {
+ $r = new \ReflectionClass($mockName);
+
+ if (null === $r->getConstructor()) {
+ $return = new $mockName;
+ return $return;
+ }
+
+ if ($constructorArgs !== null) {
+ return $r->newInstanceArgs($constructorArgs);
+ }
+
+ $isInternal = $r->isInternal();
+ $child = $r;
+ while (!$isInternal && $parent = $child->getParentClass()) {
+ $isInternal = $parent->isInternal();
+ $child = $parent;
+ }
+
+ try {
+ if (version_compare(PHP_VERSION, '5.4') < 0 || $isInternal) {
+ $return = unserialize(sprintf(
+ '%s:%d:"%s":0:{}',
+ // see https://github.com/sebastianbergmann/phpunit-mock-objects/pull/176/files
+ (version_compare(PHP_VERSION, '5.4', '>') && $r->implementsInterface('Serializable') ? 'C' : 'O'),
+ strlen($mockName),
+ $mockName)
+ );
+ } else {
+ $return = $r->newInstanceWithoutConstructor();
+ }
+ } catch (\Exception $ex) {
+ $internalMockName = $mockName . '_Internal';
+
+ if (!class_exists($internalMockName)) {
+ eval("class $internalMockName extends $mockName {" .
+ 'public function __construct() {}' .
+ '}');
+ }
+
+ $return = new $internalMockName();
+ }
+
+ return $return;
+ }
+
+ /**
+ * Takes a class name and declares it
+ *
+ * @param string $fqcn
+ */
+ public function declareClass($fqcn)
+ {
+ if (false !== strpos($fqcn, '/')) {
+ throw new \Mockery\Exception(
+ 'Class name contains a forward slash instead of backslash needed '
+ . 'when employing namespaces'
+ );
+ }
+ if (false !== strpos($fqcn, "\\")) {
+ $parts = array_filter(explode("\\", $fqcn), function ($part) {
+ return $part !== "";
+ });
+ $cl = array_pop($parts);
+ $ns = implode("\\", $parts);
+ eval(" namespace $ns { class $cl {} }");
+ } else {
+ eval(" class $fqcn {} ");
+ }
+ }
+
+ protected function checkForNamedMockClashes($config)
+ {
+ $name = $config->getName();
+
+ if (!$name) {
+ return;
+ }
+
+ $hash = $config->getHash();
+
+ if (isset($this->_namedMocks[$name])) {
+ if ($hash !== $this->_namedMocks[$name]) {
+ throw new \Mockery\Exception(
+ "The mock named '$name' has been already defined with a different mock configuration"
+ );
+ }
+ }
+
+ $this->_namedMocks[$name] = $hash;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php b/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php
new file mode 100644
index 0000000..94d9dd2
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php
@@ -0,0 +1,63 @@
+_limit > $n) {
+ $exception = new Mockery\Exception\InvalidCountException(
+ 'Method ' . (string) $this->_expectation
+ . ' from ' . $this->_expectation->getMock()->mockery_getName()
+ . ' should be called' . PHP_EOL
+ . ' at least ' . $this->_limit . ' times but called ' . $n
+ . ' times.'
+ );
+ $exception->setMock($this->_expectation->getMock())
+ ->setMethodName((string) $this->_expectation)
+ ->setExpectedCountComparative('>=')
+ ->setExpectedCount($this->_limit)
+ ->setActualCount($n);
+ throw $exception;
+ }
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php b/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php
new file mode 100644
index 0000000..5a34e46
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php
@@ -0,0 +1,52 @@
+_limit < $n) {
+ $exception = new Mockery\Exception\InvalidCountException(
+ 'Method ' . (string) $this->_expectation
+ . ' from ' . $this->_expectation->getMock()->mockery_getName()
+ . ' should be called' . PHP_EOL
+ . ' at most ' . $this->_limit . ' times but called ' . $n
+ . ' times.'
+ );
+ $exception->setMock($this->_expectation->getMock())
+ ->setMethodName((string) $this->_expectation)
+ ->setExpectedCountComparative('<=')
+ ->setExpectedCount($this->_limit)
+ ->setActualCount($n);
+ throw $exception;
+ }
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php b/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php
new file mode 100644
index 0000000..dc643b7
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php
@@ -0,0 +1,71 @@
+_expectation = $expectation;
+ $this->_limit = $limit;
+ }
+
+ /**
+ * Checks if the validator can accept an additional nth call
+ *
+ * @param int $n
+ * @return bool
+ */
+ public function isEligible($n)
+ {
+ return ($n < $this->_limit);
+ }
+
+ /**
+ * Validate the call count against this validator
+ *
+ * @param int $n
+ * @return bool
+ */
+ abstract public function validate($n);
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php b/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php
new file mode 100644
index 0000000..7e42824
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php
@@ -0,0 +1,53 @@
+_limit !== $n) {
+ $exception = new Mockery\Exception\InvalidCountException(
+ 'Method ' . (string) $this->_expectation
+ . ' from ' . $this->_expectation->getMock()->mockery_getName()
+ . ' should be called' . PHP_EOL
+ . ' exactly ' . $this->_limit . ' times but called ' . $n
+ . ' times.'
+ );
+ $exception->setMock($this->_expectation->getMock())
+ ->setMethodName((string) $this->_expectation)
+ ->setExpectedCountComparative('=')
+ ->setExpectedCount($this->_limit)
+ ->setActualCount($n);
+ throw $exception;
+
+ }
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php b/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php
new file mode 100644
index 0000000..b44159b
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php
@@ -0,0 +1,26 @@
+mockObject = $mock;
+ return $this;
+ }
+
+ public function setMethodName($name)
+ {
+ $this->method = $name;
+ return $this;
+ }
+
+ public function setActualCount($count)
+ {
+ $this->actual = $count;
+ return $this;
+ }
+
+ public function setExpectedCount($count)
+ {
+ $this->expected = $count;
+ return $this;
+ }
+
+ public function setExpectedCountComparative($comp)
+ {
+ if (!in_array($comp, array('=', '>', '<', '>=', '<='))) {
+ throw new RuntimeException(
+ 'Illegal comparative for expected call counts set: ' . $comp
+ );
+ }
+ $this->expectedComparative = $comp;
+ return $this;
+ }
+
+ public function getMock()
+ {
+ return $this->mockObject;
+ }
+
+ public function getMethodName()
+ {
+ return $this->method;
+ }
+
+ public function getActualCount()
+ {
+ return $this->actual;
+ }
+
+ public function getExpectedCount()
+ {
+ return $this->expected;
+ }
+
+ public function getMockName()
+ {
+ return $this->getMock()->mockery_getName();
+ }
+
+ public function getExpectedCountComparative()
+ {
+ return $this->expectedComparative;
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php b/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php
new file mode 100644
index 0000000..6e14461
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php
@@ -0,0 +1,84 @@
+mockObject = $mock;
+ return $this;
+ }
+
+ public function setMethodName($name)
+ {
+ $this->method = $name;
+ return $this;
+ }
+
+ public function setActualOrder($count)
+ {
+ $this->actual = $count;
+ return $this;
+ }
+
+ public function setExpectedOrder($count)
+ {
+ $this->expected = $count;
+ return $this;
+ }
+
+ public function getMock()
+ {
+ return $this->mockObject;
+ }
+
+ public function getMethodName()
+ {
+ return $this->method;
+ }
+
+ public function getActualOrder()
+ {
+ return $this->actual;
+ }
+
+ public function getExpectedOrder()
+ {
+ return $this->expected;
+ }
+
+ public function getMockName()
+ {
+ return $this->getMock()->mockery_getName();
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php b/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php
new file mode 100644
index 0000000..654cfd2
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php
@@ -0,0 +1,71 @@
+mockObject = $mock;
+ return $this;
+ }
+
+ public function setMethodName($name)
+ {
+ $this->method = $name;
+ return $this;
+ }
+
+ public function setActualArguments($count)
+ {
+ $this->actual = $count;
+ return $this;
+ }
+
+ public function getMock()
+ {
+ return $this->mockObject;
+ }
+
+ public function getMethodName()
+ {
+ return $this->method;
+ }
+
+ public function getActualArguments()
+ {
+ return $this->actual;
+ }
+
+ public function getMockName()
+ {
+ return $this->getMock()->mockery_getName();
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php b/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php
new file mode 100644
index 0000000..e703aeb
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php
@@ -0,0 +1,26 @@
+_mock = $mock;
+ $this->_name = $name;
+ }
+
+ /**
+ * Return a string with the method name and arguments formatted
+ *
+ * @param string $name Name of the expected method
+ * @param array $args List of arguments to the method
+ * @return string
+ */
+ public function __toString()
+ {
+ return \Mockery::formatArgs($this->_name, $this->_expectedArgs);
+ }
+
+ /**
+ * Verify the current call, i.e. that the given arguments match those
+ * of this expectation
+ *
+ * @param array $args
+ * @return mixed
+ */
+ public function verifyCall(array $args)
+ {
+ $this->validateOrder();
+ $this->_actualCount++;
+ if (true === $this->_passthru) {
+ return $this->_mock->mockery_callSubjectMethod($this->_name, $args);
+ }
+ $return = $this->_getReturnValue($args);
+ if ($return instanceof \Exception && $this->_throw === true) {
+ throw $return;
+ }
+ return $return;
+ }
+
+ /**
+ * Fetch the return value for the matching args
+ *
+ * @param array $args
+ * @return mixed
+ */
+ protected function _getReturnValue(array $args)
+ {
+ if (count($this->_closureQueue) > 1) {
+ return call_user_func_array(array_shift($this->_closureQueue), $args);
+ } elseif (count($this->_closureQueue) > 0) {
+ return call_user_func_array(current($this->_closureQueue), $args);
+ } elseif (count($this->_returnQueue) > 1) {
+ return array_shift($this->_returnQueue);
+ } elseif (count($this->_returnQueue) > 0) {
+ return current($this->_returnQueue);
+ }
+ }
+
+ /**
+ * Checks if this expectation is eligible for additional calls
+ *
+ * @return bool
+ */
+ public function isEligible()
+ {
+ foreach ($this->_countValidators as $validator) {
+ if (!$validator->isEligible($this->_actualCount)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Check if there is a constraint on call count
+ *
+ * @return bool
+ */
+ public function isCallCountConstrained()
+ {
+ return (count($this->_countValidators) > 0);
+ }
+
+ /**
+ * Verify call order
+ *
+ * @return void
+ */
+ public function validateOrder()
+ {
+ if ($this->_orderNumber) {
+ $this->_mock->mockery_validateOrder((string) $this, $this->_orderNumber, $this->_mock);
+ }
+ if ($this->_globalOrderNumber) {
+ $this->_mock->mockery_getContainer()
+ ->mockery_validateOrder((string) $this, $this->_globalOrderNumber, $this->_mock);
+ }
+ }
+
+ /**
+ * Verify this expectation
+ *
+ * @return bool
+ */
+ public function verify()
+ {
+ foreach ($this->_countValidators as $validator) {
+ $validator->validate($this->_actualCount);
+ }
+ }
+
+ /**
+ * Check if passed arguments match an argument expectation
+ *
+ * @param array $args
+ * @return bool
+ */
+ public function matchArgs(array $args)
+ {
+ if(empty($this->_expectedArgs) && !$this->_noArgsExpectation) {
+ return true;
+ }
+ if(count($args) !== count($this->_expectedArgs)) {
+ return false;
+ }
+ $argCount = count($args);
+ for ($i=0; $i<$argCount; $i++) {
+ $param =& $args[$i];
+ if (!$this->_matchArg($this->_expectedArgs[$i], $param)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Check if passed argument matches an argument expectation
+ *
+ * @param array $args
+ * @return bool
+ */
+ protected function _matchArg($expected, &$actual)
+ {
+ if ($expected === $actual) {
+ return true;
+ }
+ if (!is_object($expected) && !is_object($actual) && $expected == $actual) {
+ return true;
+ }
+ if (is_string($expected) && !is_array($actual) && !is_object($actual)) {
+ # push/pop an error handler here to to make sure no error/exception thrown if $expected is not a regex
+ set_error_handler(function () {});
+ $result = preg_match($expected, (string) $actual);
+ restore_error_handler();
+
+ if($result) {
+ return true;
+ }
+ }
+ if (is_string($expected) && is_object($actual)) {
+ $result = $actual instanceof $expected;
+ if($result) {
+ return true;
+ }
+ }
+ if ($expected instanceof \Mockery\Matcher\MatcherAbstract) {
+ return $expected->match($actual);
+ }
+ if (is_a($expected, '\Hamcrest\Matcher') || is_a($expected, '\Hamcrest_Matcher')) {
+ return $expected->matches($actual);
+ }
+ return false;
+ }
+
+ /**
+ * Expected argument setter for the expectation
+ *
+ * @param mixed
+ * @return self
+ */
+ public function with()
+ {
+ return $this->withArgs(func_get_args());
+ }
+
+ /**
+ * Expected arguments for the expectation passed as an array
+ *
+ * @param array $args
+ * @return self
+ */
+ public function withArgs(array $args)
+ {
+ if (empty($args)) {
+ return $this->withNoArgs();
+ }
+ $this->_expectedArgs = $args;
+ $this->_noArgsExpectation = false;
+ return $this;
+ }
+
+ /**
+ * Set with() as no arguments expected
+ *
+ * @return self
+ */
+ public function withNoArgs()
+ {
+ $this->_noArgsExpectation = true;
+ $this->_expectedArgs = null;
+ return $this;
+ }
+
+ /**
+ * Set expectation that any arguments are acceptable
+ *
+ * @return self
+ */
+ public function withAnyArgs()
+ {
+ $this->_expectedArgs = array();
+ return $this;
+ }
+
+ /**
+ * Set a return value, or sequential queue of return values
+ *
+ * @return self
+ */
+ public function andReturn()
+ {
+ $this->_returnQueue = func_get_args();
+ return $this;
+ }
+
+ /**
+ * Return this mock, like a fluent interface
+ *
+ * @return self
+ */
+ public function andReturnSelf()
+ {
+ return $this->andReturn($this->_mock);
+ }
+
+ /**
+ * Set a sequential queue of return values with an array
+ *
+ * @param array $values
+ * @return self
+ */
+ public function andReturnValues(array $values)
+ {
+ call_user_func_array(array($this, 'andReturn'), $values);
+ return $this;
+ }
+
+ /**
+ * Set a closure or sequence of closures with which to generate return
+ * values. The arguments passed to the expected method are passed to the
+ * closures as parameters.
+ *
+ * @return self
+ */
+ public function andReturnUsing()
+ {
+ $this->_closureQueue = func_get_args();
+ return $this;
+ }
+
+ /**
+ * Return a self-returning black hole object.
+ *
+ * @return self
+ */
+ public function andReturnUndefined()
+ {
+ $this->andReturn(new \Mockery\Undefined);
+ return $this;
+ }
+
+ /**
+ * Return null. This is merely a language construct for Mock describing.
+ *
+ * @return self
+ */
+ public function andReturnNull()
+ {
+ return $this;
+ }
+
+ /**
+ * Set Exception class and arguments to that class to be thrown
+ *
+ * @param string $exception
+ * @param string $message
+ * @param int $code
+ * @param Exception $previous
+ * @return self
+ */
+ public function andThrow($exception, $message = '', $code = 0, \Exception $previous = null)
+ {
+ $this->_throw = true;
+ if (is_object($exception)) {
+ $this->andReturn($exception);
+ } else {
+ $this->andReturn(new $exception($message, $code, $previous));
+ }
+ return $this;
+ }
+
+ /**
+ * Set Exception classes to be thrown
+ *
+ * @param array $exceptions
+ * @return self
+ */
+ public function andThrowExceptions(array $exceptions)
+ {
+ $this->_throw = true;
+ foreach ($exceptions as $exception) {
+ if (!is_object($exception)) {
+ throw new Exception('You must pass an array of exception objects to andThrowExceptions');
+ }
+ }
+ return $this->andReturnValues($exceptions);
+ }
+
+ /**
+ * Set a public property on the mock
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return self
+ */
+ public function andSet($name, $value)
+ {
+ $this->_mock->{$name} = $value;
+ return $this;
+ }
+
+ /**
+ * Set a public property on the mock (alias to andSet()). Allows the natural
+ * English construct - set('foo', 'bar')->andReturn('bar')
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return self
+ */
+ public function set($name, $value)
+ {
+ return $this->andSet($name, $value);
+ }
+
+ /**
+ * Indicates this expectation should occur zero or more times
+ *
+ * @return self
+ */
+ public function zeroOrMoreTimes()
+ {
+ $this->atLeast()->never();
+ }
+
+ /**
+ * Indicates the number of times this expectation should occur
+ *
+ * @param int $limit
+ */
+ public function times($limit = null)
+ {
+ if (is_null($limit)) return $this;
+ $this->_countValidators[] = new $this->_countValidatorClass($this, $limit);
+ $this->_countValidatorClass = 'Mockery\CountValidator\Exact';
+ return $this;
+ }
+
+ /**
+ * Indicates that this expectation is never expected to be called
+ *
+ * @return self
+ */
+ public function never()
+ {
+ return $this->times(0);
+ }
+
+ /**
+ * Indicates that this expectation is expected exactly once
+ *
+ * @return self
+ */
+ public function once()
+ {
+ return $this->times(1);
+ }
+
+ /**
+ * Indicates that this expectation is expected exactly twice
+ *
+ * @return self
+ */
+ public function twice()
+ {
+ return $this->times(2);
+ }
+
+ /**
+ * Sets next count validator to the AtLeast instance
+ *
+ * @return self
+ */
+ public function atLeast()
+ {
+ $this->_countValidatorClass = 'Mockery\CountValidator\AtLeast';
+ return $this;
+ }
+
+ /**
+ * Sets next count validator to the AtMost instance
+ *
+ * @return self
+ */
+ public function atMost()
+ {
+ $this->_countValidatorClass = 'Mockery\CountValidator\AtMost';
+ return $this;
+ }
+
+ /**
+ * Shorthand for setting minimum and maximum constraints on call counts
+ *
+ * @param int $minimum
+ * @param int $maximum
+ */
+ public function between($minimum, $maximum)
+ {
+ return $this->atLeast()->times($minimum)->atMost()->times($maximum);
+ }
+
+ /**
+ * Indicates that this expectation must be called in a specific given order
+ *
+ * @param string $group Name of the ordered group
+ * @return self
+ */
+ public function ordered($group = null)
+ {
+ if ($this->_globally) {
+ $this->_globalOrderNumber = $this->_defineOrdered($group, $this->_mock->mockery_getContainer());
+ } else {
+ $this->_orderNumber = $this->_defineOrdered($group, $this->_mock);
+ }
+ $this->_globally = false;
+ return $this;
+ }
+
+ /**
+ * Indicates call order should apply globally
+ *
+ * @return self
+ */
+ public function globally()
+ {
+ $this->_globally = true;
+ return $this;
+ }
+
+ /**
+ * Setup the ordering tracking on the mock or mock container
+ *
+ * @param string $group
+ * @param object $ordering
+ * @return int
+ */
+ protected function _defineOrdered($group, $ordering)
+ {
+ $groups = $ordering->mockery_getGroups();
+ if (is_null($group)) {
+ $result = $ordering->mockery_allocateOrder();
+ } elseif (isset($groups[$group])) {
+ $result = $groups[$group];
+ } else {
+ $result = $ordering->mockery_allocateOrder();
+ $ordering->mockery_setGroup($group, $result);
+ }
+ return $result;
+ }
+
+ /**
+ * Return order number
+ *
+ * @return int
+ */
+ public function getOrderNumber()
+ {
+ return $this->_orderNumber;
+ }
+
+ /**
+ * Mark this expectation as being a default
+ *
+ * @return self
+ */
+ public function byDefault()
+ {
+ $director = $this->_mock->mockery_getExpectationsFor($this->_name);
+ if(!empty($director)) {
+ $director->makeExpectationDefault($this);
+ }
+ return $this;
+ }
+
+ /**
+ * Return the parent mock of the expectation
+ *
+ * @return \Mockery\MockInterface
+ */
+ public function getMock()
+ {
+ return $this->_mock;
+ }
+
+ /**
+ * Flag this expectation as calling the original class method with the
+ * any provided arguments instead of using a return value queue.
+ *
+ * @return self
+ */
+ public function passthru()
+ {
+ if ($this->_mock instanceof Mock) {
+ throw new Exception(
+ 'Mock Objects not created from a loaded/existing class are '
+ . 'incapable of passing method calls through to a parent class'
+ );
+ }
+ $this->_passthru = true;
+ return $this;
+ }
+
+ /**
+ * Cloning logic
+ *
+ */
+ public function __clone()
+ {
+ $newValidators = array();
+ $countValidators = $this->_countValidators;
+ foreach ($countValidators as $validator) {
+ $newValidators[] = clone $validator;
+ }
+ $this->_countValidators = $newValidators;
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php b/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php
new file mode 100644
index 0000000..0285f45
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php
@@ -0,0 +1,204 @@
+_name = $name;
+ $this->_mock = $mock;
+ }
+
+ /**
+ * Add a new expectation to the director
+ *
+ * @param Mutateme\Expectation $expectation
+ */
+ public function addExpectation(\Mockery\Expectation $expectation)
+ {
+ $this->_expectations[] = $expectation;
+ }
+
+ /**
+ * Handle a method call being directed by this instance
+ *
+ * @param array $args
+ * @return mixed
+ */
+ public function call(array $args)
+ {
+ $expectation = $this->findExpectation($args);
+ if (is_null($expectation)) {
+ $exception = new \Mockery\Exception\NoMatchingExpectationException(
+ 'No matching handler found for '
+ . $this->_mock->mockery_getName() . '::'
+ . \Mockery::formatArgs($this->_name, $args)
+ . '. Either the method was unexpected or its arguments matched'
+ . ' no expected argument list for this method'
+ . PHP_EOL . PHP_EOL
+ . \Mockery::formatObjects($args)
+ );
+ $exception->setMock($this->_mock)
+ ->setMethodName($this->_name)
+ ->setActualArguments($args);
+ throw $exception;
+ }
+ return $expectation->verifyCall($args);
+ }
+
+ /**
+ * Verify all expectations of the director
+ *
+ * @throws \Mockery\CountValidator\Exception
+ * @return void
+ */
+ public function verify()
+ {
+ if (!empty($this->_expectations)) {
+ foreach ($this->_expectations as $exp) {
+ $exp->verify();
+ }
+ } else {
+ foreach ($this->_defaults as $exp) {
+ $exp->verify();
+ }
+ }
+ }
+
+ /**
+ * Attempt to locate an expectation matching the provided args
+ *
+ * @param array $args
+ * @return mixed
+ */
+ public function findExpectation(array $args)
+ {
+ if (!empty($this->_expectations)) {
+ return $this->_findExpectationIn($this->_expectations, $args);
+ } else {
+ return $this->_findExpectationIn($this->_defaults, $args);
+ }
+ }
+
+ /**
+ * Make the given expectation a default for all others assuming it was
+ * correctly created last
+ *
+ * @param \Mockery\Expectation
+ */
+ public function makeExpectationDefault(\Mockery\Expectation $expectation)
+ {
+ $last = end($this->_expectations);
+ if ($last === $expectation) {
+ array_pop($this->_expectations);
+ array_unshift($this->_defaults, $expectation);
+ } else {
+ throw new \Mockery\Exception(
+ 'Cannot turn a previously defined expectation into a default'
+ );
+ }
+ }
+
+ /**
+ * Search current array of expectations for a match
+ *
+ * @param array $expectations
+ * @param array $args
+ * @return mixed
+ */
+ protected function _findExpectationIn(array $expectations, array $args)
+ {
+ foreach ($expectations as $exp) {
+ if ($exp->matchArgs($args) && $exp->isEligible()) {
+ return $exp;
+ }
+ }
+ foreach ($expectations as $exp) {
+ if ($exp->matchArgs($args)) {
+ return $exp;
+ }
+ }
+ }
+
+ /**
+ * Return all expectations assigned to this director
+ *
+ * @return array
+ */
+ public function getExpectations()
+ {
+ return $this->_expectations;
+ }
+
+ /**
+ * Return the number of expectations assigned to this director.
+ *
+ * @return int
+ */
+ public function getExpectationCount()
+ {
+ return count($this->getExpectations());
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php b/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php
new file mode 100644
index 0000000..b35fd37
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php
@@ -0,0 +1,40 @@
+generator = $generator;
+ }
+
+ public function generate(MockConfiguration $config)
+ {
+ $hash = $config->getHash();
+ if (isset($this->cache[$hash])) {
+ return $this->cache[$hash];
+ }
+
+ $definition = $this->generator->generate($config);
+ $this->cache[$hash] = $definition;
+
+ return $definition;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php b/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php
new file mode 100644
index 0000000..2c0ab96
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php
@@ -0,0 +1,90 @@
+rfc = $rfc;
+ }
+
+ public static function factory($name)
+ {
+ return new self(new \ReflectionClass($name));
+ }
+
+ public function getName()
+ {
+ return $this->rfc->getName();
+ }
+
+ public function isAbstract()
+ {
+ return $this->rfc->isAbstract();
+ }
+
+ public function isFinal()
+ {
+ return $this->rfc->isFinal();
+ }
+
+ public function getMethods()
+ {
+ return array_map(function ($method) {
+ return new Method($method);
+ }, $this->rfc->getMethods());
+ }
+
+ public function getInterfaces()
+ {
+ $class = __CLASS__;
+ return array_map(function ($interface) use ($class) {
+ return new $class($interface);
+ }, $this->rfc->getInterfaces());
+ }
+
+ public function __toString()
+ {
+ return $this->getName();
+ }
+
+ public function getNamespaceName()
+ {
+ return $this->rfc->getNamespaceName();
+ }
+
+ public function inNamespace()
+ {
+ return $this->rfc->inNamespace();
+ }
+
+ public function getShortName()
+ {
+ return $this->rfc->getShortName();
+ }
+
+ public function implementsInterface($interface)
+ {
+ return $this->rfc->implementsInterface($interface);
+ }
+
+ public function hasInternalAncestor()
+ {
+ if ($this->rfc->isInternal()) {
+ return true;
+ }
+
+ $child = $this->rfc;
+ while ($parent = $child->getParentClass()) {
+ if ($parent->isInternal()) {
+ return true;
+ }
+ $child = $parent;
+ }
+
+ return false;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/Generator.php b/vendor/mockery/mockery/library/Mockery/Generator/Generator.php
new file mode 100644
index 0000000..5c5d0d3
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/Generator.php
@@ -0,0 +1,9 @@
+method = $method;
+ }
+
+ public function __call($method, $args)
+ {
+ return call_user_func_array(array($this->method, $method), $args);
+ }
+
+ public function getParameters()
+ {
+ return array_map(function ($parameter) {
+ return new Parameter($parameter);
+ }, $this->method->getParameters());
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php b/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php
new file mode 100644
index 0000000..1bfad24
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php
@@ -0,0 +1,465 @@
+addTargets($targets);
+ $this->blackListedMethods = $blackListedMethods;
+ $this->whiteListedMethods = $whiteListedMethods;
+ $this->name = $name;
+ $this->instanceMock = $instanceMock;
+ $this->parameterOverrides = $parameterOverrides;
+ }
+
+ /**
+ * Attempt to create a hash of the configuration, in order to allow caching
+ *
+ * @TODO workout if this will work
+ *
+ * @return string
+ */
+ public function getHash()
+ {
+ $vars = array(
+ 'targetClassName' => $this->targetClassName,
+ 'targetInterfaceNames' => $this->targetInterfaceNames,
+ 'name' => $this->name,
+ 'blackListedMethods' => $this->blackListedMethods,
+ 'whiteListedMethod' => $this->whiteListedMethods,
+ 'instanceMock' => $this->instanceMock,
+ 'parameterOverrides' => $this->parameterOverrides,
+ );
+
+ return md5(serialize($vars));
+ }
+
+ /**
+ * Gets a list of methods from the classes, interfaces and objects and
+ * filters them appropriately. Lot's of filtering going on, perhaps we could
+ * have filter classes to iterate through
+ */
+ public function getMethodsToMock()
+ {
+ $methods = $this->getAllMethods();
+
+ foreach ($methods as $key => $method) {
+ if ($method->isFinal()) {
+ unset($methods[$key]);
+ }
+ }
+
+ /**
+ * Whitelist trumps everything else
+ */
+ if (count($this->getWhiteListedMethods())) {
+ $whitelist = array_map('strtolower', $this->getWhiteListedMethods());
+ $methods = array_filter($methods, function ($method) use ($whitelist) {
+ return $method->isAbstract() || in_array(strtolower($method->getName()), $whitelist);
+ });
+
+ return $methods;
+ }
+
+ /**
+ * Remove blacklisted methods
+ */
+ if (count($this->getBlackListedMethods())) {
+ $blacklist = array_map('strtolower', $this->getBlackListedMethods());
+ $methods = array_filter($methods, function ($method) use ($blacklist) {
+ return !in_array(strtolower($method->getName()), $blacklist);
+ });
+ }
+
+ /**
+ * Internal objects can not be instantiated with newInstanceArgs and if
+ * they implement Serializable, unserialize will have to be called. As
+ * such, we can't mock it and will need a pass to add a dummy
+ * implementation
+ */
+ if ($this->getTargetClass()
+ && $this->getTargetClass()->implementsInterface("Serializable")
+ && $this->getTargetClass()->hasInternalAncestor()) {
+
+ $methods = array_filter($methods, function ($method) {
+ return $method->getName() !== "unserialize";
+ });
+ }
+
+ return array_values($methods);
+ }
+
+ /**
+ * We declare the __call method to handle undefined stuff, if the class
+ * we're mocking has also defined it, we need to comply with their interface
+ */
+ public function requiresCallTypeHintRemoval()
+ {
+ foreach ($this->getAllMethods() as $method) {
+ if ("__call" === $method->getName()) {
+ $params = $method->getParameters();
+ return !$params[1]->isArray();
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * We declare the __callStatic method to handle undefined stuff, if the class
+ * we're mocking has also defined it, we need to comply with their interface
+ */
+ public function requiresCallStaticTypeHintRemoval()
+ {
+ foreach ($this->getAllMethods() as $method) {
+ if ("__callStatic" === $method->getName()) {
+ $params = $method->getParameters();
+ return !$params[1]->isArray();
+ }
+ }
+
+ return false;
+ }
+
+ public function rename($className)
+ {
+ $targets = array();
+
+ if ($this->targetClassName) {
+ $targets[] = $this->targetClassName;
+ }
+
+ if ($this->targetInterfaceNames) {
+ $targets = array_merge($targets, $this->targetInterfaceNames);
+ }
+
+ if ($this->targetObject) {
+ $targets[] = $this->targetObject;
+ }
+
+ return new self(
+ $targets,
+ $this->blackListedMethods,
+ $this->whiteListedMethods,
+ $className,
+ $this->instanceMock,
+ $this->parameterOverrides
+ );
+ }
+
+ protected function addTarget($target)
+ {
+ if (is_object($target)) {
+ $this->setTargetObject($target);
+ $this->setTargetClassName(get_class($target));
+ return $this;
+ }
+
+ if ($target[0] !== "\\") {
+ $target = "\\" . $target;
+ }
+
+ if (class_exists($target)) {
+ $this->setTargetClassName($target);
+ return $this;
+ }
+
+ if (interface_exists($target)) {
+ $this->addTargetInterfaceName($target);
+ return $this;
+ }
+
+ /**
+ * Default is to set as class, or interface if class already set
+ *
+ * Don't like this condition, can't remember what the default
+ * targetClass is for
+ */
+ if ($this->getTargetClassName()) {
+ $this->addTargetInterfaceName($target);
+ return $this;
+ }
+
+ $this->setTargetClassName($target);
+ }
+
+ protected function addTargets($interfaces)
+ {
+ foreach ($interfaces as $interface) {
+ $this->addTarget($interface);
+ }
+ }
+
+ public function getTargetClassName()
+ {
+ return $this->targetClassName;
+ }
+
+ public function getTargetClass()
+ {
+ if ($this->targetClass) {
+ return $this->targetClass;
+ }
+
+ if (!$this->targetClassName) {
+ return null;
+ }
+
+ if (class_exists($this->targetClassName)) {
+ $dtc = DefinedTargetClass::factory($this->targetClassName);
+
+ if (!$this->getTargetObject() && $dtc->isFinal()) {
+ throw new \Mockery\Exception(
+ 'The class ' . $this->targetClassName . ' is marked final and its methods'
+ . ' cannot be replaced. Classes marked final can be passed in'
+ . ' to \Mockery::mock() as instantiated objects to create a'
+ . ' partial mock, but only if the mock is not subject to type'
+ . ' hinting checks.'
+ );
+ }
+
+ $this->targetClass = $dtc;
+
+ } else {
+ $this->targetClass = new UndefinedTargetClass($this->targetClassName);
+ }
+
+ return $this->targetClass;
+ }
+
+ public function getTargetInterfaces()
+ {
+ if (!empty($this->targetInterfaces)) {
+ return $this->targetInterfaces;
+ }
+
+ foreach ($this->targetInterfaceNames as $targetInterface) {
+ if (!interface_exists($targetInterface)) {
+ $this->targetInterfaces[] = new UndefinedTargetClass($targetInterface);
+ return;
+ }
+
+ $dtc = DefinedTargetClass::factory($targetInterface);
+ $extendedInterfaces = array_keys($dtc->getInterfaces());
+ $extendedInterfaces[] = $targetInterface;
+
+ $traversableFound = false;
+ $iteratorShiftedToFront = false;
+ foreach ($extendedInterfaces as $interface) {
+
+ if (!$traversableFound && preg_match("/^\\?Iterator(|Aggregate)$/i", $interface)) {
+ break;
+ }
+
+ if (preg_match("/^\\\\?IteratorAggregate$/i", $interface)) {
+ $this->targetInterfaces[] = DefinedTargetClass::factory("\\IteratorAggregate");
+ $iteratorShiftedToFront = true;
+ } elseif (preg_match("/^\\\\?Iterator$/i", $interface)) {
+ $this->targetInterfaces[] = DefinedTargetClass::factory("\\Iterator");
+ $iteratorShiftedToFront = true;
+ } elseif (preg_match("/^\\\\?Traversable$/i", $interface)) {
+ $traversableFound = true;
+ }
+ }
+
+ if ($traversableFound && !$iteratorShiftedToFront) {
+ $this->targetInterfaces[] = DefinedTargetClass::factory("\\IteratorAggregate");
+ }
+
+ /**
+ * We never straight up implement Traversable
+ */
+ if (!preg_match("/^\\\\?Traversable$/i", $targetInterface)) {
+ $this->targetInterfaces[] = $dtc;
+ }
+
+ }
+ $this->targetInterfaces = array_unique($this->targetInterfaces); // just in case
+ return $this->targetInterfaces;
+ }
+
+ public function getTargetObject()
+ {
+ return $this->targetObject;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Generate a suitable name based on the config
+ */
+ public function generateName()
+ {
+ $name = 'Mockery_' . static::$mockCounter++;
+
+ if ($this->getTargetObject()) {
+ $name .= "_" . str_replace("\\", "_", get_class($this->getTargetObject()));
+ }
+
+ if ($this->getTargetClass()) {
+ $name .= "_" . str_replace("\\", "_", $this->getTargetClass()->getName());
+ }
+
+ if ($this->getTargetInterfaces()) {
+ $name .= array_reduce($this->getTargetInterfaces(), function ($tmpname, $i) {
+ $tmpname .= '_' . str_replace("\\", "_", $i->getName());
+ return $tmpname;
+ }, '');
+ }
+
+ return $name;
+ }
+
+ public function getShortName()
+ {
+ $parts = explode("\\", $this->getName());
+ return array_pop($parts);
+ }
+
+ public function getNamespaceName()
+ {
+ $parts = explode("\\", $this->getName());
+ array_pop($parts);
+
+ if (count($parts)) {
+ return implode("\\", $parts);
+ }
+
+ return "";
+ }
+
+ public function getBlackListedMethods()
+ {
+ return $this->blackListedMethods;
+ }
+
+ public function getWhiteListedMethods()
+ {
+ return $this->whiteListedMethods;
+ }
+
+ public function isInstanceMock()
+ {
+ return $this->instanceMock;
+ }
+
+ public function getParameterOverrides()
+ {
+ return $this->parameterOverrides;
+ }
+
+ protected function setTargetClassName($targetClassName)
+ {
+ $this->targetClassName = $targetClassName;
+ }
+
+ protected function getAllMethods()
+ {
+ if ($this->allMethods) {
+ return $this->allMethods;
+ }
+
+ $classes = $this->getTargetInterfaces();
+
+ if ($this->getTargetClass()) {
+ $classes[] = $this->getTargetClass();
+ }
+
+ $methods = array();
+ foreach ($classes as $class) {
+ $methods = array_merge($methods, $class->getMethods());
+ }
+
+ $names = array();
+ $methods = array_filter($methods, function ($method) use (&$names) {
+ if (in_array($method->getName(), $names)) {
+ return false;
+ }
+
+ $names[] = $method->getName();
+ return true;
+ });
+
+ return $this->allMethods = $methods;
+ }
+
+ /**
+ * If we attempt to implement Traversable, we must ensure we are also
+ * implementing either Iterator or IteratorAggregate, and that whichever one
+ * it is comes before Traversable in the list of implements.
+ */
+ protected function addTargetInterfaceName($targetInterface)
+ {
+ $this->targetInterfaceNames[] = $targetInterface;
+ }
+
+
+ protected function setTargetObject($object)
+ {
+ $this->targetObject = $object;
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php b/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php
new file mode 100644
index 0000000..6e5f683
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php
@@ -0,0 +1,124 @@
+targets[] = $target;
+
+ return $this;
+ }
+
+ public function addTargets($targets)
+ {
+ foreach ($targets as $target) {
+ $this->addTarget($target);
+ }
+
+ return $this;
+ }
+
+ public function setName($name)
+ {
+ $this->name = $name;
+ return $this;
+ }
+
+ public function addBlackListedMethod($blackListedMethod)
+ {
+ $this->blackListedMethods[] = $blackListedMethod;
+ return $this;
+ }
+
+ public function addBlackListedMethods(array $blackListedMethods)
+ {
+ foreach ($blackListedMethods as $method) {
+ $this->addBlackListedMethod($method);
+ }
+ return $this;
+ }
+
+ public function setBlackListedMethods(array $blackListedMethods)
+ {
+ $this->blackListedMethods = $blackListedMethods;
+ return $this;
+ }
+
+ public function addWhiteListedMethod($whiteListedMethod)
+ {
+ $this->whiteListedMethods[] = $whiteListedMethod;
+ return $this;
+ }
+
+ public function addWhiteListedMethods(array $whiteListedMethods)
+ {
+ foreach ($whiteListedMethods as $method) {
+ $this->addWhiteListedMethod($method);
+ }
+ return $this;
+ }
+
+ public function setWhiteListedMethods(array $whiteListedMethods)
+ {
+ $this->whiteListedMethods = $whiteListedMethods;
+ return $this;
+ }
+
+ public function setInstanceMock($instanceMock)
+ {
+ $this->instanceMock = (bool) $instanceMock;
+ }
+
+ public function setParameterOverrides(array $overrides)
+ {
+ $this->parameterOverrides = $overrides;
+ }
+
+ public function getMockConfiguration()
+ {
+ return new MockConfiguration(
+ $this->targets,
+ $this->blackListedMethods,
+ $this->whiteListedMethods,
+ $this->name,
+ $this->instanceMock,
+ $this->parameterOverrides
+ );
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php b/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php
new file mode 100644
index 0000000..29c8e20
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php
@@ -0,0 +1,33 @@
+getName()) {
+ throw new \InvalidArgumentException("MockConfiguration must contain a name");
+ }
+ $this->config = $config;
+ $this->code = $code;
+ }
+
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ public function getClassName()
+ {
+ return $this->config->getName();
+ }
+
+ public function getCode()
+ {
+ return $this->code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php b/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php
new file mode 100644
index 0000000..d6df61b
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php
@@ -0,0 +1,79 @@
+rfp = $rfp;
+ }
+
+ public function __call($method, array $args)
+ {
+ return call_user_func_array(array($this->rfp, $method), $args);
+ }
+
+ public function getClass()
+ {
+ return new DefinedTargetClass($this->rfp->getClass());
+ }
+
+ public function getTypeHintAsString()
+ {
+ if (method_exists($this->rfp, 'getTypehintText')) {
+ // Available in HHVM
+ $typehint = $this->rfp->getTypehintText();
+
+ // not exhaustive, but will do for now
+ if (in_array($typehint, array('int', 'integer', 'float', 'string', 'bool', 'boolean'))) {
+ return '';
+ }
+
+ return $typehint;
+ }
+
+ if ($this->rfp->isArray()) {
+ return 'array';
+ }
+
+ /*
+ * PHP < 5.4.1 has some strange behaviour with a typehint of self and
+ * subclass signatures, so we risk the regexp instead
+ */
+ if ((version_compare(PHP_VERSION, '5.4.1') >= 0)) {
+ try {
+ if ($this->rfp->getClass()) {
+ return $this->rfp->getClass()->getName();
+ }
+ } catch (\ReflectionException $re) {
+ // noop
+ }
+ }
+
+ if (preg_match('/^Parameter #[0-9]+ \[ \<(required|optional)\> (?\S+ )?.*\$' . $this->rfp->getName() . ' .*\]$/', $this->rfp->__toString(), $typehintMatch)) {
+ if (!empty($typehintMatch['typehint'])) {
+ return $typehintMatch['typehint'];
+ }
+ }
+
+ return '';
+ }
+
+ /**
+ * Some internal classes have funny looking definitions...
+ */
+ public function getName()
+ {
+ $name = $this->rfp->getName();
+ if (!$name || $name == '...') {
+ $name = 'arg' . static::$parameterCounter++;
+ }
+
+ return $name;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php
new file mode 100644
index 0000000..4341486
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php
@@ -0,0 +1,29 @@
+requiresCallTypeHintRemoval()) {
+ $code = str_replace(
+ 'public function __call($method, array $args)',
+ 'public function __call($method, $args)',
+ $code
+ );
+ }
+
+ if ($config->requiresCallStaticTypeHintRemoval()) {
+ $code = str_replace(
+ 'public static function __callStatic($method, array $args)',
+ 'public static function __callStatic($method, $args)',
+ $code
+ );
+ }
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php
new file mode 100644
index 0000000..cd8c828
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php
@@ -0,0 +1,28 @@
+getNamespaceName();
+ $className = $config->getShortName();
+
+ $code = str_replace(
+ 'namespace Mockery;',
+ $namespace ? 'namespace ' . $namespace . ';' : '',
+ $code
+ );
+
+ $code = str_replace(
+ 'class Mock',
+ 'class ' . $className,
+ $code
+ );
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php
new file mode 100644
index 0000000..db0ba20
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php
@@ -0,0 +1,50 @@
+getTargetClass();
+
+ if (!$target) {
+ return $code;
+ }
+
+ if ($target->isFinal()) {
+ return $code;
+ }
+
+ $className = ltrim($target->getName(), "\\");
+ if (!class_exists($className)) {
+
+ $targetCode = 'inNamespace()) {
+ $targetCode.= 'namespace ' . $target->getNamespaceName(). '; ';
+ }
+
+ $targetCode.= 'class ' . $target->getShortName() . ' {} ';
+
+ /*
+ * We could eval here, but it doesn't play well with the way
+ * PHPUnit tries to backup global state and the require definition
+ * loader
+ */
+ $tmpfname = tempnam(sys_get_temp_dir(), "Mockery");
+ file_put_contents($tmpfname, $targetCode);
+ require $tmpfname;
+ }
+
+ $code = str_replace(
+ "implements MockInterface",
+ "extends \\" . $className . " implements MockInterface",
+ $code
+ );
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php
new file mode 100644
index 0000000..ec370f3
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php
@@ -0,0 +1,50 @@
+_mockery_ignoreVerification = false;
+ \$associatedRealObject = \Mockery::fetchMock(__CLASS__);
+ \$directors = \$associatedRealObject->mockery_getExpectations();
+ foreach (\$directors as \$method=>\$director) {
+ \$expectations = \$director->getExpectations();
+ // get the director method needed
+ \$existingDirector = \$this->mockery_getExpectationsFor(\$method);
+ if (!\$existingDirector) {
+ \$existingDirector = new \Mockery\ExpectationDirector(\$method, \$this);
+ \$this->mockery_setExpectationsFor(\$method, \$existingDirector);
+ }
+ foreach (\$expectations as \$expectation) {
+ \$clonedExpectation = clone \$expectation;
+ \$existingDirector->addExpectation(\$clonedExpectation);
+ }
+ }
+ \Mockery::getContainer()->rememberMock(\$this);
+ }
+MOCK;
+
+ public function apply($code, MockConfiguration $config)
+ {
+ if ($config->isInstanceMock()) {
+ $code = $this->appendToClass($code, static::INSTANCE_MOCK_CODE);
+ }
+
+ return $code;
+ }
+
+ protected function appendToClass($class, $code)
+ {
+ $lastBrace = strrpos($class, "}");
+ $class = substr($class, 0, $lastBrace) . $code . "\n }\n";
+ return $class;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php
new file mode 100644
index 0000000..152c736
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php
@@ -0,0 +1,23 @@
+getTargetInterfaces(), function ($code, $i) {
+ return $code . ", \\" . $i->getName();
+ }, "");
+
+ $code = str_replace(
+ "implements MockInterface",
+ "implements MockInterface" . $interfaces,
+ $code
+ );
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php
new file mode 100644
index 0000000..6a71499
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php
@@ -0,0 +1,127 @@
+getMethodsToMock() as $method) {
+
+ if ($method->isPublic()) {
+ $methodDef = 'public';
+ } elseif($method->isProtected()) {
+ $methodDef = 'protected';
+ } else {
+ $methodDef = 'private';
+ }
+
+ if ($method->isStatic()) {
+ $methodDef .= ' static';
+ }
+
+ $methodDef .= ' function ';
+ $methodDef .= $method->returnsReference() ? ' & ' : '';
+ $methodDef .= $method->getName();
+ $methodDef .= $this->renderParams($method, $config);
+ $methodDef .= $this->renderMethodBody($method, $config);
+
+ $code = $this->appendToClass($code, $methodDef);
+ }
+
+ return $code;
+ }
+
+ protected function renderParams(Method $method, $config)
+ {
+ $class = $method->getDeclaringClass();
+ if ($class->isInternal()) {
+ $overrides = $config->getParameterOverrides();
+
+ if (isset($overrides[strtolower($class->getName())][$method->getName()])) {
+ return '(' . implode(',', $overrides[strtolower($class->getName())][$method->getName()]) . ')';
+ }
+ }
+
+ $methodParams = array();
+ $params = $method->getParameters();
+ foreach ($params as $param) {
+ $paramDef = $param->getTypeHintAsString();
+ $paramDef .= $param->isPassedByReference() ? '&' : '';
+ $paramDef .= '$' . $param->getName();
+
+ if (false !== $param->isDefaultValueAvailable()) {
+ $paramDef .= ' = ' . var_export($param->getDefaultValue(), true);
+ } elseif ($param->isOptional()) {
+ $paramDef .= ' = null';
+ }
+
+ $methodParams[] = $paramDef;
+ }
+ return '(' . implode(', ', $methodParams) . ')';
+ }
+
+ protected function appendToClass($class, $code)
+ {
+ $lastBrace = strrpos($class, "}");
+ $class = substr($class, 0, $lastBrace) . $code . "\n }\n";
+ return $class;
+ }
+
+ private function renderMethodBody($method, $config)
+ {
+ $invoke = $method->isStatic() ? 'static::__callStatic' : '$this->__call';
+ $body = <<getDeclaringClass();
+ $class_name = strtolower($class->getName());
+ $overrides = $config->getParameterOverrides();
+ if (isset($overrides[$class_name][$method->getName()])) {
+ $params = array_values($overrides[$class_name][$method->getName()]);
+ $paramCount = count($params);
+ for ($i = 0; $i < $paramCount; ++$i) {
+ $param = $params[$i];
+ if (strpos($param, '&') !== false) {
+ $body .= << $i) {
+ \$argv[$i] = {$param};
+}
+
+BODY;
+ }
+ }
+ } else {
+ $params = array_values($method->getParameters());
+ $paramCount = count($params);
+ for ($i = 0; $i < $paramCount; ++$i) {
+ $param = $params[$i];
+ if (!$param->isPassedByReference()) {
+ continue;
+ }
+ $body .= << $i) {
+ \$argv[$i] =& \${$param->getName()};
+}
+
+BODY;
+ }
+ }
+ $body .= << '/public function __wakeup\(\)\s+\{.*?\}/sm',
+ );
+
+ public function apply($code, MockConfiguration $config)
+ {
+ $target = $config->getTargetClass();
+
+ if (!$target) {
+ return $code;
+ }
+
+ foreach ($target->getMethods() as $method) {
+ if ($method->isFinal() && isset($this->methods[$method->getName()])) {
+ $code = preg_replace($this->methods[$method->getName()], '', $code);
+ }
+ }
+
+ return $code;
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php
new file mode 100644
index 0000000..cd640a1
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php
@@ -0,0 +1,40 @@
+getTargetClass();
+
+ if (!$target) {
+ return $code;
+ }
+
+ if (!$target->hasInternalAncestor() || !$target->implementsInterface("Serializable")) {
+ return $code;
+ }
+
+ $code = $this->appendToClass($code, self::DUMMY_METHOD_DEFINITION);
+
+ return $code;
+ }
+
+ protected function appendToClass($class, $code)
+ {
+ $lastBrace = strrpos($class, "}");
+ $class = substr($class, 0, $lastBrace) . $code . "\n }\n";
+ return $class;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php
new file mode 100644
index 0000000..f8f8bdb
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php
@@ -0,0 +1,34 @@
+passes = $passes;
+ }
+
+ public function generate(MockConfiguration $config)
+ {
+ $code = file_get_contents(__DIR__ . '/../Mock.php');
+ $className = $config->getName() ?: $config->generateName();
+
+ $namedConfig = $config->rename($className);
+
+ foreach ($this->passes as $pass) {
+ $code = $pass->apply($code, $namedConfig);
+ }
+
+ return new MockDefinition($namedConfig, $code);
+ }
+
+ public function addPass(Pass $pass)
+ {
+ $this->passes[] = $pass;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/TargetClass.php b/vendor/mockery/mockery/library/Mockery/Generator/TargetClass.php
new file mode 100644
index 0000000..f6fff1d
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/TargetClass.php
@@ -0,0 +1,34 @@
+name = $name;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ public function isAbstract()
+ {
+ return false;
+ }
+
+ public function isFinal()
+ {
+ return false;
+ }
+
+ public function getMethods()
+ {
+ return array();
+ }
+
+ public function getNamespaceName()
+ {
+ $parts = explode("\\", ltrim($this->getName(), "\\"));
+ array_pop($parts);
+ return implode("\\", $parts);
+ }
+
+ public function inNamespace()
+ {
+ return $this->getNamespaceName() !== '';
+ }
+
+ public function getShortName()
+ {
+ $parts = explode("\\", $this->getName());
+ return array_pop($parts);
+ }
+
+ public function implementsInterface($interface)
+ {
+ return false;
+ }
+
+ public function hasInternalAncestor()
+ {
+ return false;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Loader.php b/vendor/mockery/mockery/library/Mockery/Loader.php
new file mode 100644
index 0000000..1afa860
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Loader.php
@@ -0,0 +1,155 @@
+register();
+ *
+ * @author Jonathan H. Wage
+ * @author Roman S. Borschel
+ * @author Matthew Weier O'Phinney
+ * @author Kris Wallsmith
+ * @author Fabien Potencier
+ */
+
+namespace Mockery;
+
+class Loader
+{
+ private $_fileExtension = '.php';
+ private $_namespace;
+ private $_includePath;
+ private $_namespaceSeparator = '\\';
+
+ /**
+ * Creates a new Loader that loads classes of the
+ * specified namespace.
+ *
+ * @param string $ns The namespace to use.
+ */
+ public function __construct($ns = 'Mockery', $includePath = null)
+ {
+ $this->_namespace = $ns;
+ $this->_includePath = $includePath;
+ }
+
+ /**
+ * Sets the namespace separator used by classes in the namespace of this class loader.
+ *
+ * @param string $sep The separator to use.
+ */
+ public function setNamespaceSeparator($sep)
+ {
+ $this->_namespaceSeparator = $sep;
+ }
+
+ /**
+ * Gets the namespace seperator used by classes in the namespace of this class loader.
+ *
+ * @return void
+ */
+ public function getNamespaceSeparator()
+ {
+ return $this->_namespaceSeparator;
+ }
+
+ /**
+ * Sets the base include path for all class files in the namespace of this class loader.
+ *
+ * @param string $includePath
+ */
+ public function setIncludePath($includePath)
+ {
+ $this->_includePath = $includePath;
+ }
+
+ /**
+ * Gets the base include path for all class files in the namespace of this class loader.
+ *
+ * @return string $includePath
+ */
+ public function getIncludePath()
+ {
+ return $this->_includePath;
+ }
+
+ /**
+ * Sets the file extension of class files in the namespace of this class loader.
+ *
+ * @param string $fileExtension
+ */
+ public function setFileExtension($fileExtension)
+ {
+ $this->_fileExtension = $fileExtension;
+ }
+
+ /**
+ * Gets the file extension of class files in the namespace of this class loader.
+ *
+ * @return string $fileExtension
+ */
+ public function getFileExtension()
+ {
+ return $this->_fileExtension;
+ }
+
+ /**
+ * Installs this class loader on the SPL autoload stack.
+ *
+ * @param bool $prepend If true, prepend autoloader on the autoload stack
+ */
+ public function register($prepend = false)
+ {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+ }
+
+ /**
+ * Uninstalls this class loader from the SPL autoloader stack.
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $className The name of the class to load.
+ * @return void
+ */
+ public function loadClass($className)
+ {
+ if ($className === 'Mockery') {
+ require $this->getFullPath('Mockery.php');
+ return;
+ }
+ if (null === $this->_namespace
+ || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) {
+ $fileName = '';
+ $namespace = '';
+ if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) {
+ $namespace = substr($className, 0, $lastNsPos);
+ $className = substr($className, $lastNsPos + 1);
+ $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
+ }
+ $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension;
+ require $this->getFullPath($fileName);
+ }
+ }
+
+ /**
+ * Returns full path for $fileName if _includePath is set, or leaves as-is for PHP's internal search in 'require'.
+ *
+ * @param string $fileName relative to include path.
+ * @return string
+ */
+ private function getFullPath($fileName)
+ {
+ return ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php b/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php
new file mode 100644
index 0000000..b9d172a
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php
@@ -0,0 +1,18 @@
+getClassName(), false)) {
+ return;
+ }
+
+ eval("?>" . $definition->getCode());
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Loader/Loader.php b/vendor/mockery/mockery/library/Mockery/Loader/Loader.php
new file mode 100644
index 0000000..d740181
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Loader/Loader.php
@@ -0,0 +1,10 @@
+path = $path;
+ }
+
+ public function load(MockDefinition $definition)
+ {
+ if (class_exists($definition->getClassName(), false)) {
+ return;
+ }
+
+ $tmpfname = tempnam($this->path, "Mockery");
+ file_put_contents($tmpfname, $definition->getCode());
+
+ require $tmpfname;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Any.php b/vendor/mockery/mockery/library/Mockery/Matcher/Any.php
new file mode 100644
index 0000000..70349e5
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Any.php
@@ -0,0 +1,47 @@
+';
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php b/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php
new file mode 100644
index 0000000..c86c1c0
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php
@@ -0,0 +1,52 @@
+_expected as $exp) {
+ if ($actual === $exp || $actual == $exp) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Closure.php b/vendor/mockery/mockery/library/Mockery/Matcher/Closure.php
new file mode 100644
index 0000000..61cb112
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Closure.php
@@ -0,0 +1,49 @@
+_expected;
+ $result = $closure($actual);
+ return $result === true;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php b/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php
new file mode 100644
index 0000000..d8524f2
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php
@@ -0,0 +1,66 @@
+_expected as $exp) {
+ $match = false;
+ foreach ($values as $val) {
+ if ($exp === $val || $exp == $val) {
+ $match = true;
+ break;
+ }
+ }
+ if ($match === false) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $return = '_expected as $v) {
+ $elements[] = (string) $v;
+ }
+ $return .= implode(', ', $elements) . ']>';
+ return $return;
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php b/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php
new file mode 100644
index 0000000..4440c8b
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php
@@ -0,0 +1,55 @@
+_expected as $method) {
+ if (!method_exists($actual, $method)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '_expected) . ']>';
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php b/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php
new file mode 100644
index 0000000..2a79a11
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php
@@ -0,0 +1,48 @@
+_expected, array_keys($actual));
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $return = '_expected . ']>';
+ return $return;
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php b/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php
new file mode 100644
index 0000000..e5e1d2b
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php
@@ -0,0 +1,48 @@
+_expected, $actual);
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $return = '_expected . ']>';
+ return $return;
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php b/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php
new file mode 100644
index 0000000..62ff8fd
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php
@@ -0,0 +1,60 @@
+_expected = $expected;
+ }
+
+ /**
+ * Check if the actual value matches the expected.
+ * Actual passed by reference to preserve reference trail (where applicable)
+ * back to the original method parameter.
+ *
+ * @param mixed $actual
+ * @return bool
+ */
+ abstract public function match(&$actual);
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ abstract public function __toString();
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php b/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php
new file mode 100644
index 0000000..461de96
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php
@@ -0,0 +1,51 @@
+_expected === $actual;
+ } else {
+ return $this->_expected == $actual;
+ }
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Not.php b/vendor/mockery/mockery/library/Mockery/Matcher/Not.php
new file mode 100644
index 0000000..f8001f3
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Not.php
@@ -0,0 +1,48 @@
+_expected;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php b/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php
new file mode 100644
index 0000000..2058e52
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php
@@ -0,0 +1,52 @@
+_expected as $exp) {
+ if ($actual === $exp || $actual == $exp) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php b/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php
new file mode 100644
index 0000000..fe3c7ec
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php
@@ -0,0 +1,61 @@
+_expected as $k=>$v) {
+ if (!array_key_exists($k, $actual)) {
+ return false;
+ }
+ if ($actual[$k] !== $v) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $return = '_expected as $k=>$v) {
+ $elements[] = $k . '=' . (string) $v;
+ }
+ $return .= implode(', ', $elements) . ']>';
+ return $return;
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Type.php b/vendor/mockery/mockery/library/Mockery/Matcher/Type.php
new file mode 100644
index 0000000..493b1e2
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Type.php
@@ -0,0 +1,54 @@
+_expected);
+ if (function_exists($function)) {
+ return $function($actual);
+ } elseif (is_string($this->_expected)
+ && (class_exists($this->_expected) || interface_exists($this->_expected))) {
+ return $actual instanceof $this->_expected;
+ }
+ return false;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '<' . ucfirst($this->_expected) . '>';
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Mock.php b/vendor/mockery/mockery/library/Mockery/Mock.php
new file mode 100644
index 0000000..3ebc228
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Mock.php
@@ -0,0 +1,704 @@
+_mockery_container = $container;
+ if (!is_null($partialObject)) {
+ $this->_mockery_partial = $partialObject;
+ }
+
+ if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed()) {
+ foreach ($this->mockery_getMethods() as $method) {
+ if ($method->isPublic() && !$method->isStatic()) $this->_mockery_mockableMethods[] = $method->getName();
+ }
+ }
+ }
+
+ /**
+ * Set expected method calls
+ *
+ * @param mixed
+ * @return \Mockery\Expectation
+ */
+ public function shouldReceive()
+ {
+ /** @var array $nonPublicMethods */
+ $nonPublicMethods = $this->getNonPublicMethods();
+
+ $self = $this;
+ $allowMockingProtectedMethods = $this->_mockery_allowMockingProtectedMethods;
+
+ $lastExpectation = \Mockery::parseShouldReturnArgs(
+ $this, func_get_args(), function ($method) use ($self, $nonPublicMethods, $allowMockingProtectedMethods) {
+ $rm = $self->mockery_getMethod($method);
+ if ($rm) {
+ if ($rm->isPrivate()) {
+ throw new \InvalidArgumentException("$method() cannot be mocked as it is a private method");
+ }
+ if (!$allowMockingProtectedMethods && $rm->isProtected()) {
+ throw new \InvalidArgumentException("$method() cannot be mocked as it a protected method and mocking protected methods is not allowed for this mock");
+ }
+ }
+
+ $director = $self->mockery_getExpectationsFor($method);
+ if (!$director) {
+ $director = new \Mockery\ExpectationDirector($method, $self);
+ $self->mockery_setExpectationsFor($method, $director);
+ }
+ $expectation = new \Mockery\Expectation($self, $method);
+ $director->addExpectation($expectation);
+ return $expectation;
+ }
+ );
+ return $lastExpectation;
+ }
+
+ /**
+ * Allows additional methods to be mocked that do not explicitly exist on mocked class
+ * @param String $method name of the method to be mocked
+ * @return Mock
+ */
+ public function shouldAllowMockingMethod($method)
+ {
+ $this->_mockery_mockableMethods[] = $method;
+ return $this;
+ }
+
+ /**
+ * Set mock to ignore unexpected methods and return Undefined class
+ * @param mixed $returnValue the default return value for calls to missing functions on this mock
+ * @return Mock
+ */
+ public function shouldIgnoreMissing($returnValue = null)
+ {
+ $this->_mockery_ignoreMissing = true;
+ $this->_mockery_defaultReturnValue = $returnValue;
+ return $this;
+ }
+
+ public function asUndefined()
+ {
+ $this->_mockery_ignoreMissing = true;
+ $this->_mockery_defaultReturnValue = new \Mockery\Undefined;
+ return $this;
+ }
+
+ /**
+ * @return Mock
+ */
+ public function shouldAllowMockingProtectedMethods()
+ {
+ $this->_mockery_allowMockingProtectedMethods = true;
+ return $this;
+ }
+
+
+ /**
+ * Set mock to defer unexpected methods to it's parent
+ *
+ * This is particularly useless for this class, as it doesn't have a parent,
+ * but included for completeness
+ *
+ * @return Mock
+ */
+ public function shouldDeferMissing()
+ {
+ $this->_mockery_deferMissing = true;
+ return $this;
+ }
+
+ /**
+ * Create an obviously worded alias to shouldDeferMissing()
+ *
+ * @return Mock
+ */
+ public function makePartial()
+ {
+ return $this->shouldDeferMissing();
+ }
+
+ /**
+ * Accepts a closure which is executed with an object recorder which proxies
+ * to the partial source object. The intent being to record the
+ * interactions of a concrete object as a set of expectations on the
+ * current mock object. The partial may then be passed to a second process
+ * to see if it fulfils the same (or exact same) contract as the original.
+ *
+ * @param Closure $closure
+ */
+ public function shouldExpect(\Closure $closure)
+ {
+ $recorder = new \Mockery\Recorder($this, $this->_mockery_partial);
+ $this->_mockery_disableExpectationMatching = true;
+ $closure($recorder);
+ $this->_mockery_disableExpectationMatching = false;
+ return $this;
+ }
+
+ /**
+ * In the event shouldReceive() accepting one or more methods/returns,
+ * this method will switch them from normal expectations to default
+ * expectations
+ *
+ * @return self
+ */
+ public function byDefault()
+ {
+ foreach ($this->_mockery_expectations as $director) {
+ $exps = $director->getExpectations();
+ foreach ($exps as $exp) {
+ $exp->byDefault();
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Capture calls to this mock
+ */
+ public function __call($method, array $args)
+ {
+ $rm = $this->mockery_getMethod($method);
+ if ($rm && $rm->isProtected() && !$this->_mockery_allowMockingProtectedMethods) {
+ if ($rm->isAbstract()) {
+ return;
+ }
+
+ try {
+ $prototype = $rm->getPrototype();
+ if ($prototype->isAbstract()) {
+ return;
+ }
+ } catch (\ReflectionException $re) {
+ // noop - there is no hasPrototype method
+ }
+
+ return call_user_func_array("parent::$method", $args);
+ }
+
+ if (isset($this->_mockery_expectations[$method])
+ && !$this->_mockery_disableExpectationMatching) {
+ $handler = $this->_mockery_expectations[$method];
+
+ try {
+ return $handler->call($args);
+ } catch (\Mockery\Exception\NoMatchingExpectationException $e) {
+ if (!$this->_mockery_ignoreMissing && !$this->_mockery_deferMissing) {
+ throw $e;
+ }
+ }
+ }
+
+ if (!is_null($this->_mockery_partial) && method_exists($this->_mockery_partial, $method)) {
+ return call_user_func_array(array($this->_mockery_partial, $method), $args);
+ } elseif ($this->_mockery_deferMissing && is_callable("parent::$method")) {
+ return call_user_func_array("parent::$method", $args);
+ } elseif ($method == '__toString') {
+ // __toString is special because we force its addition to the class API regardless of the
+ // original implementation. Thus, we should always return a string rather than honor
+ // _mockery_ignoreMissing and break the API with an error.
+ return sprintf("%s#%s", __CLASS__, spl_object_hash($this));
+ } elseif ($this->_mockery_ignoreMissing) {
+ if($this->_mockery_defaultReturnValue instanceof \Mockery\Undefined)
+ return call_user_func_array(array($this->_mockery_defaultReturnValue, $method), $args);
+ else
+ return $this->_mockery_defaultReturnValue;
+ }
+ throw new \BadMethodCallException(
+ 'Method ' . __CLASS__ . '::' . $method . '() does not exist on this mock object'
+ );
+ }
+
+ public static function __callStatic($method, array $args)
+ {
+ try {
+ $associatedRealObject = \Mockery::fetchMock(__CLASS__);
+ return $associatedRealObject->__call($method, $args);
+ } catch (\BadMethodCallException $e) {
+ throw new \BadMethodCallException(
+ 'Static method ' . $associatedRealObject->mockery_getName() . '::' . $method
+ . '() does not exist on this mock object'
+ );
+ }
+ }
+
+ /**
+ * Forward calls to this magic method to the __call method
+ */
+ public function __toString()
+ {
+ return $this->__call('__toString', array());
+ }
+
+ /**public function __set($name, $value)
+ {
+ $this->_mockery_mockableProperties[$name] = $value;
+ return $this;
+ }
+
+ public function __get($name)
+ {
+ if (isset($this->_mockery_mockableProperties[$name])) {
+ return $this->_mockery_mockableProperties[$name];
+ } elseif(isset($this->{$name})) {
+ return $this->{$name};
+ }
+ throw new \InvalidArgumentException (
+ 'Property ' . __CLASS__ . '::' . $name . ' does not exist on this mock object'
+ );
+ }**/
+
+ /**
+ * Iterate across all expectation directors and validate each
+ *
+ * @throws \Mockery\CountValidator\Exception
+ * @return void
+ */
+ public function mockery_verify()
+ {
+ if ($this->_mockery_verified) return true;
+ if (isset($this->_mockery_ignoreVerification)
+ && $this->_mockery_ignoreVerification == true) {
+ return true;
+ }
+ $this->_mockery_verified = true;
+ foreach($this->_mockery_expectations as $director) {
+ $director->verify();
+ }
+ }
+
+ /**
+ * Tear down tasks for this mock
+ *
+ * @return void
+ */
+ public function mockery_teardown()
+ {
+
+ }
+
+ /**
+ * Fetch the next available allocation order number
+ *
+ * @return int
+ */
+ public function mockery_allocateOrder()
+ {
+ $this->_mockery_allocatedOrder += 1;
+ return $this->_mockery_allocatedOrder;
+ }
+
+ /**
+ * Set ordering for a group
+ *
+ * @param mixed $group
+ * @param int $order
+ */
+ public function mockery_setGroup($group, $order)
+ {
+ $this->_mockery_groups[$group] = $order;
+ }
+
+ /**
+ * Fetch array of ordered groups
+ *
+ * @return array
+ */
+ public function mockery_getGroups()
+ {
+ return $this->_mockery_groups;
+ }
+
+ /**
+ * Set current ordered number
+ *
+ * @param int $order
+ */
+ public function mockery_setCurrentOrder($order)
+ {
+ $this->_mockery_currentOrder = $order;
+ return $this->_mockery_currentOrder;
+ }
+
+ /**
+ * Get current ordered number
+ *
+ * @return int
+ */
+ public function mockery_getCurrentOrder()
+ {
+ return $this->_mockery_currentOrder;
+ }
+
+ /**
+ * Validate the current mock's ordering
+ *
+ * @param string $method
+ * @param int $order
+ * @throws \Mockery\Exception
+ * @return void
+ */
+ public function mockery_validateOrder($method, $order)
+ {
+ if ($order < $this->_mockery_currentOrder) {
+ $exception = new \Mockery\Exception\InvalidOrderException(
+ 'Method ' . __CLASS__ . '::' . $method . '()'
+ . ' called out of order: expected order '
+ . $order . ', was ' . $this->_mockery_currentOrder
+ );
+ $exception->setMock($this)
+ ->setMethodName($method)
+ ->setExpectedOrder($order)
+ ->setActualOrder($this->_mockery_currentOrder);
+ throw $exception;
+ }
+ $this->mockery_setCurrentOrder($order);
+ }
+
+ /**
+ * Gets the count of expectations for this mock
+ *
+ * @return int
+ */
+ public function mockery_getExpectationCount()
+ {
+ $count = 0;
+ foreach($this->_mockery_expectations as $director) {
+ $count += $director->getExpectationCount();
+ }
+ return $count;
+ }
+
+ /**
+ * Return the expectations director for the given method
+ *
+ * @var string $method
+ * @return \Mockery\ExpectationDirector|null
+ */
+ public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector $director)
+ {
+ $this->_mockery_expectations[$method] = $director;
+ }
+
+ /**
+ * Return the expectations director for the given method
+ *
+ * @var string $method
+ * @return \Mockery\ExpectationDirector|null
+ */
+ public function mockery_getExpectationsFor($method)
+ {
+ if (isset($this->_mockery_expectations[$method])) {
+ return $this->_mockery_expectations[$method];
+ }
+ }
+
+ /**
+ * Find an expectation matching the given method and arguments
+ *
+ * @var string $method
+ * @var array $args
+ * @return \Mockery\Expectation|null
+ */
+ public function mockery_findExpectation($method, array $args)
+ {
+ if (!isset($this->_mockery_expectations[$method])) {
+ return null;
+ }
+ $director = $this->_mockery_expectations[$method];
+
+ return $director->findExpectation($args);
+ }
+
+ /**
+ * Return the container for this mock
+ *
+ * @return \Mockery\Container
+ */
+ public function mockery_getContainer()
+ {
+ return $this->_mockery_container;
+ }
+
+ /**
+ * Return the name for this mock
+ *
+ * @return string
+ */
+ public function mockery_getName()
+ {
+ return __CLASS__;
+ }
+
+ /**
+ * @return array
+ */
+ public function mockery_getMockableProperties()
+ {
+ return $this->_mockery_mockableProperties;
+ }
+
+ public function __isset($name)
+ {
+ if (false === stripos($name, '_mockery_') && method_exists(get_parent_class($this), '__isset')) {
+ return parent::__isset($name);
+ }
+ }
+
+ public function mockery_getExpectations()
+ {
+ return $this->_mockery_expectations;
+ }
+
+ /**
+ * Calls a parent class method and returns the result. Used in a passthru
+ * expectation where a real return value is required while still taking
+ * advantage of expectation matching and call count verification.
+ *
+ * @param string $name
+ * @param array $args
+ * @return mixed
+ */
+ public function mockery_callSubjectMethod($name, array $args)
+ {
+ return call_user_func_array('parent::' . $name, $args);
+ }
+
+ /**
+ * @return string[]
+ */
+ public function mockery_getMockableMethods()
+ {
+ return $this->_mockery_mockableMethods;
+ }
+
+ /**
+ * @return bool
+ */
+ public function mockery_isAnonymous()
+ {
+ $rfc = new \ReflectionClass($this);
+ return false === $rfc->getParentClass();
+ }
+
+ public function __wakeup()
+ {
+ /**
+ * This does not add __wakeup method support. It's a blind method and any
+ * expected __wakeup work will NOT be performed. It merely cuts off
+ * annoying errors where a __wakeup exists but is not essential when
+ * mocking
+ */
+ }
+
+ public function mockery_getMethod($name)
+ {
+ foreach ($this->mockery_getMethods() as $method) {
+ if ($method->getName() == $name) {
+ return $method;
+ }
+ }
+
+ return null;
+ }
+
+ protected function mockery_getMethods()
+ {
+ if (static::$_mockery_methods) {
+ return static::$_mockery_methods;
+ }
+
+ $methods = array();
+
+ if (isset($this->_mockery_partial)) {
+ $reflected = new \ReflectionObject($this->_mockery_partial);
+ $methods = $reflected->getMethods();
+ } else {
+ $reflected = new \ReflectionClass($this);
+ foreach ($reflected->getMethods() as $method) {
+ try {
+ $methods[] = $method->getPrototype();
+ } catch (\ReflectionException $re) {
+ /**
+ * For some reason, private methods don't have a prototype
+ */
+ if ($method->isPrivate()) {
+ $methods[] = $method;
+ }
+ }
+ }
+ }
+
+ return static::$_mockery_methods = $methods;
+ }
+
+ /**
+ * @return array
+ */
+ private function getNonPublicMethods()
+ {
+ return array_map(
+ function ($method) {
+ return $method->getName();
+ },
+ array_filter($this->mockery_getMethods(), function ($method) {
+ return !$method->isPublic();
+ })
+ );
+ }
+
+}
diff --git a/vendor/mockery/mockery/library/Mockery/MockInterface.php b/vendor/mockery/mockery/library/Mockery/MockInterface.php
new file mode 100644
index 0000000..ebff61c
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/MockInterface.php
@@ -0,0 +1,212 @@
+_mock = $mock;
+ $this->_subject = $subject;
+ }
+
+ /**
+ * Sets the recorded into strict mode where method calls are more strictly
+ * matched against the argument and call count and ordering is also
+ * set as enforceable.
+ *
+ * @return void
+ */
+ public function shouldBeStrict()
+ {
+ $this->_strict = true;
+ }
+
+ /**
+ * Intercept all calls on the subject, and use the call details to create
+ * a new expectation. The actual return value is then returned after being
+ * recorded.
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($method, array $args)
+ {
+ $return = call_user_func_array(array($this->_subject, $method), $args);
+ $expectation = $this->_mock->shouldReceive($method)->andReturn($return);
+ if ($this->_strict) {
+ $exactArgs = array();
+ foreach ($args as $arg) {
+ $exactArgs[] = \Mockery::mustBe($arg);
+ }
+ $expectation->once()->ordered();
+ call_user_func_array(array($expectation, 'with'), $exactArgs);
+ } else {
+ call_user_func_array(array($expectation, 'with'), $args);
+ }
+ return $return;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Undefined.php b/vendor/mockery/mockery/library/Mockery/Undefined.php
new file mode 100644
index 0000000..60e5ee0
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Undefined.php
@@ -0,0 +1,48 @@
+
+
+ Mockery
+ pear.survivethedeepend.com
+ Mockery is a simple yet flexible mock object framework for use in unit testing.
+ Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.
+
+ Pádraic Brady
+ padraic
+ padraic.brady@yahoo.com
+ yes
+
+
+ Dave Marshall
+ davedevelopment
+ dave.marshall@atstsolutions.co.uk
+ yes
+
+ 2014-04-29
+
+
+ 0.9.1
+ 0.9.1
+
+
+ stable
+ stable
+
+ BSD
+ http://github.com/padraic/mockery#readme
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5.3.2
+
+
+ 1.4.0
+
+
+
+
+ Hamcrest
+ hamcrest.googlecode.com/svn/pear
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/mockery/mockery/phpunit.xml.dist b/vendor/mockery/mockery/phpunit.xml.dist
new file mode 100644
index 0000000..f5b07e5
--- /dev/null
+++ b/vendor/mockery/mockery/phpunit.xml.dist
@@ -0,0 +1,31 @@
+
+
+>
+
+
+ ./tests
+
+
+
+
+ ./library/
+
+
+
+
+
+
diff --git a/vendor/mockery/mockery/tests/Bootstrap.php b/vendor/mockery/mockery/tests/Bootstrap.php
new file mode 100644
index 0000000..f685167
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Bootstrap.php
@@ -0,0 +1,85 @@
+=')) {
+
+ /*
+ * Add Mutateme library/ directory to the PHPUnit code coverage
+ * whitelist. This has the effect that only production code source files
+ * appear in the code coverage report and that all production code source
+ * files, even those that are not covered by a test yet, are processed.
+ */
+ PHPUnit_Util_Filter::addDirectoryToWhitelist($library);
+
+ /*
+ * Omit from code coverage reports the contents of the tests directory
+ */
+ foreach (array('.php', '.phtml', '.csv', '.inc') as $suffix) {
+ PHPUnit_Util_Filter::addDirectoryToFilter($tests, $suffix);
+ }
+ PHPUnit_Util_Filter::addDirectoryToFilter(PEAR_INSTALL_DIR);
+ PHPUnit_Util_Filter::addDirectoryToFilter(PHP_LIBDIR);
+}
+
+require __DIR__.'/../vendor/autoload.php';
+
+/*
+ * Unset global variables that are no longer needed.
+ */
+unset($root, $library, $tests, $path);
diff --git a/vendor/mockery/mockery/tests/Mockery/AdhocTest.php b/vendor/mockery/mockery/tests/Mockery/AdhocTest.php
new file mode 100644
index 0000000..daede17
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/AdhocTest.php
@@ -0,0 +1,88 @@
+container = new \Mockery\Container(\Mockery::getDefaultGenerator(), \Mockery::getDefaultLoader());
+ }
+
+ public function teardown()
+ {
+ $this->container->mockery_close();
+ }
+
+ public function testSimplestMockCreation()
+ {
+ $m = $this->container->mock('MockeryTest_NameOfExistingClass');
+ $this->assertTrue($m instanceof MockeryTest_NameOfExistingClass);
+ }
+
+ public function testMockeryInterfaceForClass()
+ {
+ $m = $this->container->mock('SplFileInfo');
+ $this->assertTrue($m instanceof \Mockery\MockInterface);
+ }
+
+ public function testMockeryInterfaceForNonExistingClass()
+ {
+ $m = $this->container->mock('ABC_IDontExist');
+ $this->assertTrue($m instanceof \Mockery\MockInterface);
+ }
+
+ public function testMockeryInterfaceForInterface()
+ {
+ $m = $this->container->mock('MockeryTest_NameOfInterface');
+ $this->assertTrue($m instanceof \Mockery\MockInterface);
+ }
+
+ public function testMockeryInterfaceForAbstract()
+ {
+ $m = $this->container->mock('MockeryTest_NameOfAbstract');
+ $this->assertTrue($m instanceof \Mockery\MockInterface);
+ }
+
+ public function testInvalidCountExceptionThrowsRuntimeExceptionOnIllegalComparativeSymbol()
+ {
+ $this->setExpectedException('Mockery\Exception\RuntimeException');
+ $e = new \Mockery\Exception\InvalidCountException;
+ $e->setExpectedCountComparative('X');
+ }
+
+
+}
+
+class MockeryTest_NameOfExistingClass {}
+
+interface MockeryTest_NameOfInterface
+{
+ public function foo();
+}
+
+abstract class MockeryTest_NameOfAbstract
+{
+ abstract public function foo();
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/ContainerTest.php b/vendor/mockery/mockery/tests/Mockery/ContainerTest.php
new file mode 100644
index 0000000..9bdaf26
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/ContainerTest.php
@@ -0,0 +1,1575 @@
+container = new \Mockery\Container(\Mockery::getDefaultGenerator(), new \Mockery\Loader\EvalLoader());
+ }
+
+ public function teardown()
+ {
+ $this->container->mockery_close();
+ }
+
+ public function testSimplestMockCreation()
+ {
+ $m = $this->container->mock();
+ $m->shouldReceive('foo')->andReturn('bar');
+ $this->assertEquals('bar', $m->foo());
+ }
+
+ public function testGetKeyOfDemeterMockShouldReturnKeyWhenMatchingMock()
+ {
+ $m = $this->container->mock();
+ $m->shouldReceive('foo->bar');
+ $this->assertRegExp(
+ '/Mockery_(\d+)__demeter_foo/',
+ $this->container->getKeyOfDemeterMockFor('foo')
+ );
+ }
+ public function testGetKeyOfDemeterMockShouldReturnNullWhenNoMatchingMock()
+ {
+ $method = 'unknownMethod';
+ $this->assertNull($this->container->getKeyOfDemeterMockFor($method));
+
+ $m = $this->container->mock();
+ $m->shouldReceive('method');
+ $this->assertNull($this->container->getKeyOfDemeterMockFor($method));
+
+ $m->shouldReceive('foo->bar');
+ $this->assertNull($this->container->getKeyOfDemeterMockFor($method));
+ }
+
+
+ public function testNamedMocksAddNameToExceptions()
+ {
+ $m = $this->container->mock('Foo');
+ $m->shouldReceive('foo')->with(1)->andReturn('bar');
+ try {
+ $m->foo();
+ } catch (\Mockery\Exception $e) {
+ $this->assertTrue((bool) preg_match("/Foo/", $e->getMessage()));
+ }
+ }
+
+ public function testSimpleMockWithArrayDefs()
+ {
+ $m = $this->container->mock(array('foo'=>1,'bar'=>2));
+ $this->assertEquals(1, $m->foo());
+ $this->assertEquals(2, $m->bar());
+ }
+
+ public function testSimpleMockWithArrayDefsCanBeOverridden()
+ {
+ // eg. In shared test setup
+ $m = $this->container->mock(array('foo' => 1, 'bar' => 2));
+
+ // and then overridden in one test
+ $m->shouldReceive('foo')->with('baz')->once()->andReturn(2);
+ $m->shouldReceive('bar')->with('baz')->once()->andReturn(42);
+
+ $this->assertEquals(2, $m->foo('baz'));
+ $this->assertEquals(42, $m->bar('baz'));
+ }
+
+ public function testNamedMockWithArrayDefs()
+ {
+ $m = $this->container->mock('Foo', array('foo'=>1,'bar'=>2));
+ $this->assertEquals(1, $m->foo());
+ $this->assertEquals(2, $m->bar());
+ try {
+ $m->f();
+ } catch (BadMethodCallException $e) {
+ $this->assertTrue((bool) preg_match("/Foo/", $e->getMessage()));
+ }
+ }
+
+ public function testNamedMockWithArrayDefsCanBeOverridden()
+ {
+ // eg. In shared test setup
+ $m = $this->container->mock('Foo', array('foo' => 1));
+
+ // and then overridden in one test
+ $m->shouldReceive('foo')->with('bar')->once()->andReturn(2);
+
+ $this->assertEquals(2, $m->foo('bar'));
+
+ try {
+ $m->f();
+ } catch (BadMethodCallException $e) {
+ $this->assertTrue((bool) preg_match("/Foo/", $e->getMessage()));
+ }
+ }
+
+ public function testNamedMockMultipleInterfaces()
+ {
+ $m = $this->container->mock('stdClass, ArrayAccess, Countable', array('foo'=>1,'bar'=>2));
+ $this->assertEquals(1, $m->foo());
+ $this->assertEquals(2, $m->bar());
+ try {
+ $m->f();
+ } catch (BadMethodCallException $e) {
+ $this->assertTrue((bool) preg_match("/stdClass/", $e->getMessage()));
+ $this->assertTrue((bool) preg_match("/ArrayAccess/", $e->getMessage()));
+ $this->assertTrue((bool) preg_match("/Countable/", $e->getMessage()));
+ }
+ }
+
+ public function testNamedMockWithConstructorArgs()
+ {
+ $m = $this->container->mock("MockeryTest_ClassConstructor2[foo]", array($param1 = new stdClass()));
+ $m->shouldReceive("foo")->andReturn(123);
+ $this->assertEquals(123, $m->foo());
+ $this->assertEquals($param1, $m->getParam1());
+ }
+
+ public function testNamedMockWithConstructorArgsAndArrayDefs()
+ {
+ $m = $this->container->mock(
+ "MockeryTest_ClassConstructor2[foo]",
+ array($param1 = new stdClass()),
+ array("foo" => 123)
+ );
+ $this->assertEquals(123, $m->foo());
+ $this->assertEquals($param1, $m->getParam1());
+ }
+
+ public function testNamedMockWithConstructorArgsWithInternalCallToMockedMethod()
+ {
+ $m = $this->container->mock("MockeryTest_ClassConstructor2[foo]", array($param1 = new stdClass()));
+ $m->shouldReceive("foo")->andReturn(123);
+ $this->assertEquals(123, $m->bar());
+ }
+
+ public function testNamedMockWithConstructorArgsButNoQuickDefsShouldLeaveConstructorIntact()
+ {
+ $m = $this->container->mock("MockeryTest_ClassConstructor2", array($param1 = new stdClass()));
+ $m->shouldDeferMissing();
+ $this->assertEquals($param1, $m->getParam1());
+ }
+
+ public function testNamedMockWithShouldDeferMissing()
+ {
+ $m = $this->container->mock("MockeryTest_ClassConstructor2", array($param1 = new stdClass()));
+ $m->shouldDeferMissing();
+ $this->assertEquals('foo', $m->bar());
+ $m->shouldReceive("bar")->andReturn(123);
+ $this->assertEquals(123, $m->bar());
+ }
+
+ /**
+ * @expectedException BadMethodCallException
+ */
+ public function testNamedMockWithShouldDeferMissingThrowsIfNotAvailable()
+ {
+ $m = $this->container->mock("MockeryTest_ClassConstructor2", array($param1 = new stdClass()));
+ $m->shouldDeferMissing();
+ $m->foorbar123();
+ }
+
+ public function testMockingAKnownConcreteClassSoMockInheritsClassType()
+ {
+ $m = $this->container->mock('stdClass');
+ $m->shouldReceive('foo')->andReturn('bar');
+ $this->assertEquals('bar', $m->foo());
+ $this->assertTrue($m instanceof stdClass);
+ }
+
+ public function testMockingAKnownUserClassSoMockInheritsClassType()
+ {
+ $m = $this->container->mock('MockeryTest_TestInheritedType');
+ $this->assertTrue($m instanceof MockeryTest_TestInheritedType);
+ }
+
+ public function testMockingAConcreteObjectCreatesAPartialWithoutError()
+ {
+ $m = $this->container->mock(new stdClass);
+ $m->shouldReceive('foo')->andReturn('bar');
+ $this->assertEquals('bar', $m->foo());
+ $this->assertTrue($m instanceof stdClass);
+ }
+
+ public function testCreatingAPartialAllowsDynamicExpectationsAndPassesThroughUnexpectedMethods()
+ {
+ $m = $this->container->mock(new MockeryTestFoo);
+ $m->shouldReceive('bar')->andReturn('bar');
+ $this->assertEquals('bar', $m->bar());
+ $this->assertEquals('foo', $m->foo());
+ $this->assertTrue($m instanceof MockeryTestFoo);
+ }
+
+ public function testCreatingAPartialAllowsExpectationsToInterceptCallsToImplementedMethods()
+ {
+ $m = $this->container->mock(new MockeryTestFoo2);
+ $m->shouldReceive('bar')->andReturn('baz');
+ $this->assertEquals('baz', $m->bar());
+ $this->assertEquals('foo', $m->foo());
+ $this->assertTrue($m instanceof MockeryTestFoo2);
+ }
+
+ public function testBlockForwardingToPartialObject()
+ {
+ $m = $this->container->mock(new MockeryTestBar1, array('foo'=>1, \Mockery\Container::BLOCKS => array('method1')));
+ $this->assertSame($m, $m->method1());
+ }
+
+ public function testPartialWithArrayDefs()
+ {
+ $m = $this->container->mock(new MockeryTestBar1, array('foo'=>1, \Mockery\Container::BLOCKS => array('method1')));
+ $this->assertEquals(1, $m->foo());
+ }
+
+ public function testPassingClosureAsFinalParameterUsedToDefineExpectations()
+ {
+ $m = $this->container->mock('foo', function ($m) {
+ $m->shouldReceive('foo')->once()->andReturn('bar');
+ });
+ $this->assertEquals('bar', $m->foo());
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testMockingAKnownConcreteFinalClassThrowsErrors_OnlyPartialMocksCanMockFinalElements()
+ {
+ $m = $this->container->mock('MockeryFoo3');
+ }
+
+ public function testMockingAKnownConcreteClassWithFinalMethodsThrowsNoException()
+ {
+ $m = $this->container->mock('MockeryFoo4');
+ }
+
+ /**
+ * @group finalclass
+ */
+ public function testFinalClassesCanBePartialMocks()
+ {
+ $m = $this->container->mock(new MockeryFoo3);
+ $m->shouldReceive('foo')->andReturn('baz');
+ $this->assertEquals('baz', $m->foo());
+ $this->assertFalse($m instanceof MockeryFoo3);
+ }
+
+ public function testSplClassWithFinalMethodsCanBeMocked()
+ {
+ $m = $this->container->mock('SplFileInfo');
+ $m->shouldReceive('foo')->andReturn('baz');
+ $this->assertEquals('baz', $m->foo());
+ $this->assertTrue($m instanceof SplFileInfo);
+
+ }
+
+ public function testSplClassWithFinalMethodsCanBeMockedMultipleTimes()
+ {
+ $this->container->mock('SplFileInfo');
+ $m = $this->container->mock('SplFileInfo');
+ $m->shouldReceive('foo')->andReturn('baz');
+ $this->assertEquals('baz', $m->foo());
+ $this->assertTrue($m instanceof SplFileInfo);
+ }
+
+ public function testClassesWithFinalMethodsCanBeProxyPartialMocks()
+ {
+ $m = $this->container->mock(new MockeryFoo4);
+ $m->shouldReceive('foo')->andReturn('baz');
+ $this->assertEquals('baz', $m->foo());
+ $this->assertEquals('bar', $m->bar());
+ $this->assertTrue($m instanceof MockeryFoo4);
+ }
+
+ public function testClassesWithFinalMethodsCanBeProperPartialMocks()
+ {
+ $m = $this->container->mock('MockeryFoo4[bar]');
+ $m->shouldReceive('bar')->andReturn('baz');
+ $this->assertEquals('baz', $m->foo());
+ $this->assertEquals('baz', $m->bar());
+ $this->assertTrue($m instanceof MockeryFoo4);
+ }
+
+ public function testClassesWithFinalMethodsCanBeProperPartialMocksButFinalMethodsNotPartialed()
+ {
+ $m = $this->container->mock('MockeryFoo4[foo]');
+ $m->shouldReceive('foo')->andReturn('foo');
+ $this->assertEquals('baz', $m->foo()); // partial expectation ignored - will fail callcount assertion
+ $this->assertTrue($m instanceof MockeryFoo4);
+ }
+
+ public function testSplfileinfoClassMockPassesUserExpectations()
+ {
+ $file = $this->container->mock('SplFileInfo[getFilename,getPathname,getExtension,getMTime]', array(__FILE__));
+ $file->shouldReceive('getFilename')->once()->andReturn('foo');
+ $file->shouldReceive('getPathname')->once()->andReturn('path/to/foo');
+ $file->shouldReceive('getExtension')->once()->andReturn('css');
+ $file->shouldReceive('getMTime')->once()->andReturn(time());
+ }
+
+ public function testCanMockInterface()
+ {
+ $m = $this->container->mock('MockeryTest_Interface');
+ $this->assertTrue($m instanceof MockeryTest_Interface);
+ }
+
+ public function testCanMockSpl()
+ {
+ $m = $this->container->mock('\\SplFixedArray');
+ $this->assertTrue($m instanceof \SplFixedArray);
+ }
+
+ public function testCanMockInterfaceWithAbstractMethod()
+ {
+ $m = $this->container->mock('MockeryTest_InterfaceWithAbstractMethod');
+ $this->assertTrue($m instanceof MockeryTest_InterfaceWithAbstractMethod);
+ $m->shouldReceive('foo')->andReturn(1);
+ $this->assertEquals(1, $m->foo());
+ }
+
+ public function testCanMockAbstractWithAbstractProtectedMethod()
+ {
+ $m = $this->container->mock('MockeryTest_AbstractWithAbstractMethod');
+ $this->assertTrue($m instanceof MockeryTest_AbstractWithAbstractMethod);
+ }
+
+ public function testCanMockInterfaceWithPublicStaticMethod()
+ {
+ $m = $this->container->mock('MockeryTest_InterfaceWithPublicStaticMethod');
+ $this->assertTrue($m instanceof MockeryTest_InterfaceWithPublicStaticMethod);
+ }
+
+ public function testCanMockClassWithConstructor()
+ {
+ $m = $this->container->mock('MockeryTest_ClassConstructor');
+ $this->assertTrue($m instanceof MockeryTest_ClassConstructor);
+ }
+
+ public function testCanMockClassWithConstructorNeedingClassArgs()
+ {
+ $m = $this->container->mock('MockeryTest_ClassConstructor2');
+ $this->assertTrue($m instanceof MockeryTest_ClassConstructor2);
+ }
+
+ /**
+ * @group partial
+ */
+ public function testCanPartiallyMockANormalClass()
+ {
+ $m = $this->container->mock('MockeryTest_PartialNormalClass[foo]');
+ $this->assertTrue($m instanceof MockeryTest_PartialNormalClass);
+ $m->shouldReceive('foo')->andReturn('cba');
+ $this->assertEquals('abc', $m->bar());
+ $this->assertEquals('cba', $m->foo());
+ }
+
+ /**
+ * @group partial
+ */
+ public function testCanPartiallyMockAnAbstractClass()
+ {
+ $m = $this->container->mock('MockeryTest_PartialAbstractClass[foo]');
+ $this->assertTrue($m instanceof MockeryTest_PartialAbstractClass);
+ $m->shouldReceive('foo')->andReturn('cba');
+ $this->assertEquals('abc', $m->bar());
+ $this->assertEquals('cba', $m->foo());
+ }
+
+ /**
+ * @group partial
+ */
+ public function testCanPartiallyMockANormalClassWith2Methods()
+ {
+ $m = $this->container->mock('MockeryTest_PartialNormalClass2[foo, baz]');
+ $this->assertTrue($m instanceof MockeryTest_PartialNormalClass2);
+ $m->shouldReceive('foo')->andReturn('cba');
+ $m->shouldReceive('baz')->andReturn('cba');
+ $this->assertEquals('abc', $m->bar());
+ $this->assertEquals('cba', $m->foo());
+ $this->assertEquals('cba', $m->baz());
+ }
+
+ /**
+ * @group partial
+ */
+ public function testCanPartiallyMockAnAbstractClassWith2Methods()
+ {
+ $m = $this->container->mock('MockeryTest_PartialAbstractClass2[foo,baz]');
+ $this->assertTrue($m instanceof MockeryTest_PartialAbstractClass2);
+ $m->shouldReceive('foo')->andReturn('cba');
+ $m->shouldReceive('baz')->andReturn('cba');
+ $this->assertEquals('abc', $m->bar());
+ $this->assertEquals('cba', $m->foo());
+ $this->assertEquals('cba', $m->baz());
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ * @group partial
+ */
+ public function testThrowsExceptionIfSettingExpectationForNonMockedMethodOfPartialMock()
+ {
+ $this->markTestSkipped('For now...');
+ $m = $this->container->mock('MockeryTest_PartialNormalClass[foo]');
+ $this->assertTrue($m instanceof MockeryTest_PartialNormalClass);
+ $m->shouldReceive('bar')->andReturn('cba');
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ * @group partial
+ */
+ public function testThrowsExceptionIfClassOrInterfaceForPartialMockDoesNotExist()
+ {
+ $m = $this->container->mock('MockeryTest_PartialNormalClassXYZ[foo]');
+ }
+
+ /**
+ * @group issue/4
+ */
+ public function testCanMockClassContainingMagicCallMethod()
+ {
+ $m = $this->container->mock('MockeryTest_Call1');
+ $this->assertTrue($m instanceof MockeryTest_Call1);
+ }
+
+ /**
+ * @group issue/4
+ */
+ public function testCanMockClassContainingMagicCallMethodWithoutTypeHinting()
+ {
+ $m = $this->container->mock('MockeryTest_Call2');
+ $this->assertTrue($m instanceof MockeryTest_Call2);
+ }
+
+ /**
+ * @group issue/14
+ */
+ public function testCanMockClassContainingAPublicWakeupMethod()
+ {
+ $m = $this->container->mock('MockeryTest_Wakeup1');
+ $this->assertTrue($m instanceof MockeryTest_Wakeup1);
+ }
+
+ /**
+ * @group issue/18
+ */
+ public function testCanMockClassUsingMagicCallMethodsInPlaceOfNormalMethods()
+ {
+ $m = \Mockery::mock('Gateway');
+ $m->shouldReceive('iDoSomethingReallyCoolHere');
+ $m->iDoSomethingReallyCoolHere();
+ }
+
+ /**
+ * @group issue/18
+ */
+ public function testCanPartialMockObjectUsingMagicCallMethodsInPlaceOfNormalMethods()
+ {
+ $m = \Mockery::mock(new Gateway);
+ $m->shouldReceive('iDoSomethingReallyCoolHere');
+ $m->iDoSomethingReallyCoolHere();
+ }
+
+ /**
+ * @group issue/13
+ */
+ public function testCanMockClassWhereMethodHasReferencedParameter()
+ {
+ $m = \Mockery::mock(new MockeryTest_MethodParamRef);
+ }
+
+ /**
+ * @group issue/13
+ */
+ public function testCanPartiallyMockObjectWhereMethodHasReferencedParameter()
+ {
+ $m = \Mockery::mock(new MockeryTest_MethodParamRef2);
+ }
+
+ /**
+ * @group issue/11
+ */
+ public function testMockingAKnownConcreteClassCanBeGrantedAnArbitraryClassType()
+ {
+ $m = $this->container->mock('alias:MyNamespace\MyClass');
+ $m->shouldReceive('foo')->andReturn('bar');
+ $this->assertEquals('bar', $m->foo());
+ $this->assertTrue($m instanceof MyNamespace\MyClass);
+ }
+
+ /**
+ * @group issue/15
+ */
+ public function testCanMockMultipleInterfaces()
+ {
+ $m = $this->container->mock('MockeryTest_Interface1, MockeryTest_Interface2');
+ $this->assertTrue($m instanceof MockeryTest_Interface1);
+ $this->assertTrue($m instanceof MockeryTest_Interface2);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testMockingMultipleInterfacesThrowsExceptionWhenGivenNonExistingClassOrInterface()
+ {
+ $m = $this->container->mock('DoesNotExist, MockeryTest_Interface2');
+ $this->assertTrue($m instanceof MockeryTest_Interface1);
+ $this->assertTrue($m instanceof MockeryTest_Interface2);
+ }
+
+ /**
+ * @group issue/15
+ */
+ public function testCanMockClassAndApplyMultipleInterfaces()
+ {
+ $m = $this->container->mock('MockeryTestFoo, MockeryTest_Interface1, MockeryTest_Interface2');
+ $this->assertTrue($m instanceof MockeryTestFoo);
+ $this->assertTrue($m instanceof MockeryTest_Interface1);
+ $this->assertTrue($m instanceof MockeryTest_Interface2);
+ }
+
+ /**
+ * @group issue/7
+ *
+ * Noted: We could complicate internally, but a blind class is better built
+ * with a real class noted up front (stdClass is a perfect choice it is
+ * behaviourless). Fine, it's a muddle - but we need to draw a line somewhere.
+ */
+ public function testCanMockStaticMethods()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('alias:MyNamespace\MyClass2');
+ $m->shouldReceive('staticFoo')->andReturn('bar');
+ $this->assertEquals('bar', \MyNameSpace\MyClass2::staticFoo());
+ \Mockery::resetContainer();
+ }
+
+ /**
+ * @group issue/7
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testMockedStaticMethodsObeyMethodCounting()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('alias:MyNamespace\MyClass3');
+ $m->shouldReceive('staticFoo')->once()->andReturn('bar');
+ $this->container->mockery_verify();
+ \Mockery::resetContainer();
+ }
+
+ /**
+ * @expectedException BadMethodCallException
+ */
+ public function testMockedStaticThrowsExceptionWhenMethodDoesNotExist()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('alias:MyNamespace\StaticNoMethod');
+ $this->assertEquals('bar', \MyNameSpace\StaticNoMethod::staticFoo());
+ \Mockery::resetContainer();
+ }
+
+ /**
+ * @group issue/17
+ */
+ public function testMockingAllowsPublicPropertyStubbingOnRealClass()
+ {
+ $m = $this->container->mock('MockeryTestFoo');
+ $m->foo = 'bar';
+ $this->assertEquals('bar', $m->foo);
+ //$this->assertTrue(array_key_exists('foo', $m->mockery_getMockableProperties()));
+ }
+
+ /**
+ * @group issue/17
+ */
+ public function testMockingAllowsPublicPropertyStubbingOnNamedMock()
+ {
+ $m = $this->container->mock('Foo');
+ $m->foo = 'bar';
+ $this->assertEquals('bar', $m->foo);
+ //$this->assertTrue(array_key_exists('foo', $m->mockery_getMockableProperties()));
+ }
+
+ /**
+ * @group issue/17
+ */
+ public function testMockingAllowsPublicPropertyStubbingOnPartials()
+ {
+ $m = $this->container->mock(new stdClass);
+ $m->foo = 'bar';
+ $this->assertEquals('bar', $m->foo);
+ //$this->assertTrue(array_key_exists('foo', $m->mockery_getMockableProperties()));
+ }
+
+ /**
+ * @group issue/17
+ */
+ public function testMockingDoesNotStubNonStubbedPropertiesOnPartials()
+ {
+ $m = $this->container->mock(new MockeryTest_ExistingProperty);
+ $this->assertEquals('bar', $m->foo);
+ $this->assertFalse(array_key_exists('foo', $m->mockery_getMockableProperties()));
+ }
+
+ public function testCreationOfInstanceMock()
+ {
+ $m = $this->container->mock('overload:MyNamespace\MyClass4');
+ $this->assertTrue($m instanceof \MyNamespace\MyClass4);
+ }
+
+ public function testInstantiationOfInstanceMock()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('overload:MyNamespace\MyClass5');
+ $instance = new \MyNamespace\MyClass5;
+ $this->assertTrue($instance instanceof \MyNamespace\MyClass5);
+ \Mockery::resetContainer();
+ }
+
+ public function testInstantiationOfInstanceMockImportsExpectations()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('overload:MyNamespace\MyClass6');
+ $m->shouldReceive('foo')->andReturn('bar');
+ $instance = new \MyNamespace\MyClass6;
+ $this->assertEquals('bar', $instance->foo());
+ \Mockery::resetContainer();
+ }
+
+ public function testInstantiationOfInstanceMocksIgnoresVerificationOfOriginMock()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('overload:MyNamespace\MyClass7');
+ $m->shouldReceive('foo')->once()->andReturn('bar');
+ $this->container->mockery_verify();
+ \Mockery::resetContainer(); //should not throw an exception
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testInstantiationOfInstanceMocksAddsThemToContainerForVerification()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('overload:MyNamespace\MyClass8');
+ $m->shouldReceive('foo')->once();
+ $instance = new \MyNamespace\MyClass8;
+ $this->container->mockery_verify();
+ \Mockery::resetContainer();
+ }
+
+ public function testInstantiationOfInstanceMocksDoesNotHaveCountValidatorCrossover()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('overload:MyNamespace\MyClass9');
+ $m->shouldReceive('foo')->once();
+ $instance1 = new \MyNamespace\MyClass9;
+ $instance2 = new \MyNamespace\MyClass9;
+ $instance1->foo();
+ $instance2->foo();
+ $this->container->mockery_verify();
+ \Mockery::resetContainer();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testInstantiationOfInstanceMocksDoesNotHaveCountValidatorCrossover2()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('overload:MyNamespace\MyClass10');
+ $m->shouldReceive('foo')->once();
+ $instance1 = new \MyNamespace\MyClass10;
+ $instance2 = new \MyNamespace\MyClass10;
+ $instance1->foo();
+ $this->container->mockery_verify();
+ \Mockery::resetContainer();
+ }
+
+ public function testMethodParamsPassedByReferenceHaveReferencePreserved()
+ {
+ $m = $this->container->mock('MockeryTestRef1');
+ $m->shouldReceive('foo')->with(
+ \Mockery::on(function (&$a) {$a += 1;return true;}),
+ \Mockery::any()
+ );
+ $a = 1;
+ $b = 1;
+ $m->foo($a, $b);
+ $this->assertEquals(2, $a);
+ $this->assertEquals(1, $b);
+ }
+
+ /**
+ * Meant to test the same logic as
+ * testCanOverrideExpectedParametersOfExtensionPHPClassesToPreserveRefs,
+ * but:
+ * - doesn't require an extension
+ * - isn't actually known to be used
+ */
+ public function testCanOverrideExpectedParametersOfInternalPHPClassesToPreserveRefs()
+ {
+ \Mockery::getConfiguration()->setInternalClassMethodParamMap(
+ 'DateTime', 'modify', array('&$string')
+ );
+ // @ used to avoid E_STRICT for incompatible signature
+ @$m = $this->container->mock('DateTime');
+ $this->assertInstanceOf("Mockery\MockInterface", $m, "Mocking failed, remove @ error suppresion to debug");
+ $m->shouldReceive('modify')->with(
+ \Mockery::on(function (&$string) {$string = 'foo'; return true;})
+ );
+ $data ='bar';
+ $m->modify($data);
+ $this->assertEquals('foo', $data);
+ $this->container->mockery_verify();
+ \Mockery::resetContainer();
+ \Mockery::getConfiguration()->resetInternalClassMethodParamMaps();
+ }
+
+ /**
+ * Real world version of
+ * testCanOverrideExpectedParametersOfInternalPHPClassesToPreserveRefs
+ */
+ public function testCanOverrideExpectedParametersOfExtensionPHPClassesToPreserveRefs()
+ {
+ if (!class_exists('MongoCollection', false)) $this->markTestSkipped('ext/mongo not installed');
+ \Mockery::getConfiguration()->setInternalClassMethodParamMap(
+ 'MongoCollection', 'insert', array('&$data', '$options')
+ );
+ // @ used to avoid E_STRICT for incompatible signature
+ @$m = $this->container->mock('MongoCollection');
+ $this->assertInstanceOf("Mockery\MockInterface", $m, "Mocking failed, remove @ error suppresion to debug");
+ $m->shouldReceive('insert')->with(
+ \Mockery::on(function (&$data) {$data['_id'] = 123; return true;}),
+ \Mockery::type('array')
+ );
+ $data = array('a'=>1,'b'=>2);
+ $m->insert($data, array());
+ $this->assertTrue(isset($data['_id']));
+ $this->assertEquals(123, $data['_id']);
+ $this->container->mockery_verify();
+ \Mockery::resetContainer();
+ \Mockery::getConfiguration()->resetInternalClassMethodParamMaps();
+ }
+
+ public function testCanCreateNonOverridenInstanceOfPreviouslyOverridenInternalClasses()
+ {
+ \Mockery::getConfiguration()->setInternalClassMethodParamMap(
+ 'DateTime', 'modify', array('&$string')
+ );
+ // @ used to avoid E_STRICT for incompatible signature
+ @$m = $this->container->mock('DateTime');
+ $this->assertInstanceOf("Mockery\MockInterface", $m, "Mocking failed, remove @ error suppresion to debug");
+ $rc = new ReflectionClass($m);
+ $rm = $rc->getMethod('modify');
+ $params = $rm->getParameters();
+ $this->assertTrue($params[0]->isPassedByReference());
+
+ \Mockery::getConfiguration()->resetInternalClassMethodParamMaps();
+
+ $m = $this->container->mock('DateTime');
+ $this->assertInstanceOf("Mockery\MockInterface", $m, "Mocking failed");
+ $rc = new ReflectionClass($m);
+ $rm = $rc->getMethod('modify');
+ $params = $rm->getParameters();
+ $this->assertFalse($params[0]->isPassedByReference());
+
+ \Mockery::resetContainer();
+ \Mockery::getConfiguration()->resetInternalClassMethodParamMaps();
+ }
+
+ /**
+ * @group abstract
+ */
+ public function testCanMockAbstractClassWithAbstractPublicMethod()
+ {
+ $m = $this->container->mock('MockeryTest_AbstractWithAbstractPublicMethod');
+ $this->assertTrue($m instanceof MockeryTest_AbstractWithAbstractPublicMethod);
+ }
+
+ /**
+ * @issue issue/21
+ */
+ public function testClassDeclaringIssetDoesNotThrowException()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('MockeryTest_IssetMethod');
+ $this->container->mockery_verify();
+ \Mockery::resetContainer();
+ }
+
+ /**
+ * @issue issue/21
+ */
+ public function testClassDeclaringUnsetDoesNotThrowException()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('MockeryTest_UnsetMethod');
+ $this->container->mockery_verify();
+ \Mockery::resetContainer();
+ }
+
+ /**
+ * @issue issue/35
+ */
+ public function testCallingSelfOnlyReturnsLastMockCreatedOrCurrentMockBeingProgrammedSinceTheyAreOneAndTheSame()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('MockeryTestFoo');
+ $this->assertFalse($this->container->self() instanceof MockeryTestFoo2);
+ //$m = $this->container->mock('MockeryTestFoo2');
+ //$this->assertTrue($this->container->self() instanceof MockeryTestFoo2);
+ //$m = $this->container->mock('MockeryTestFoo');
+ //$this->assertFalse(\Mockery::self() instanceof MockeryTestFoo2);
+ //$this->assertTrue(\Mockery::self() instanceof MockeryTestFoo);
+ \Mockery::resetContainer();
+ }
+
+ /**
+ * @issue issue/89
+ */
+ public function testCreatingMockOfClassWithExistingToStringMethodDoesntCreateClassWithTwoToStringMethods()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('MockeryTest_WithToString'); // this would fatal
+ $m->shouldReceive("__toString")->andReturn('dave');
+ $this->assertEquals("dave", "$m");
+ }
+
+ public function testGetExpectationCount_freshContainer()
+ {
+ $this->assertEquals(0, $this->container->mockery_getExpectationCount());
+ }
+
+ public function testGetExpectationCount_simplestMock()
+ {
+ $m = $this->container->mock();
+ $m->shouldReceive('foo')->andReturn('bar');
+ $this->assertEquals(1, $this->container->mockery_getExpectationCount());
+ }
+
+ public function testMethodsReturningParamsByReferenceDoesNotErrorOut()
+ {
+ $this->container->mock('MockeryTest_ReturnByRef');
+ $mock = $this->container->mock('MockeryTest_ReturnByRef');
+ $mock->shouldReceive("get")->andReturn($var = 123);
+ $this->assertSame($var, $mock->get());
+ }
+
+ public function testMockCallableTypeHint()
+ {
+ if(PHP_VERSION_ID >= 50400) {
+ $this->container->mock('MockeryTest_MockCallableTypeHint');
+ }
+ }
+
+ public function testCanMockClassWithReservedWordMethod()
+ {
+ if (!extension_loaded("redis")) {
+ $this->markTestSkipped(
+ "phpredis not installed"
+ );;
+ }
+
+ $this->container->mock("Redis");
+ }
+
+ public function testUndeclaredClassIsDeclared()
+ {
+ $this->assertFalse(class_exists("BlahBlah"));
+ $mock = $this->container->mock("BlahBlah");
+ $this->assertInstanceOf("BlahBlah", $mock);
+ }
+
+ public function testUndeclaredClassWithNamespaceIsDeclared()
+ {
+ $this->assertFalse(class_exists("MyClasses\Blah\BlahBlah"));
+ $mock = $this->container->mock("MyClasses\Blah\BlahBlah");
+ $this->assertInstanceOf("MyClasses\Blah\BlahBlah", $mock);
+ }
+
+ public function testUndeclaredClassWithNamespaceIncludingLeadingOperatorIsDeclared()
+ {
+ $this->assertFalse(class_exists("\MyClasses\DaveBlah\BlahBlah"));
+ $mock = $this->container->mock("\MyClasses\DaveBlah\BlahBlah");
+ $this->assertInstanceOf("\MyClasses\DaveBlah\BlahBlah", $mock);
+ }
+
+ public function testMockingPhpredisExtensionClassWorks()
+ {
+ if (!class_exists('Redis')) {
+ $this->markTestSkipped('PHPRedis extension required for this test');
+ }
+ $m = $this->container->mock('Redis');
+ }
+
+ public function testIssetMappingUsingProxiedPartials_CheckNoExceptionThrown()
+ {
+ $var = $this->container->mock(new MockeryTestIsset_Bar());
+ $mock = $this->container->mock(new MockeryTestIsset_Foo($var));
+ $mock->shouldReceive('bar')->once();
+ $mock->bar();
+ $this->container->mockery_teardown(); // closed by teardown()
+ }
+
+ /**
+ * @group traversable1
+ */
+ public function testCanMockInterfacesExtendingTraversable()
+ {
+ $mock = $this->container->mock('MockeryTest_InterfaceWithTraversable');
+ $this->assertInstanceOf('MockeryTest_InterfaceWithTraversable', $mock);
+ $this->assertInstanceOf('ArrayAccess', $mock);
+ $this->assertInstanceOf('Countable', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ }
+
+ /**
+ * @group traversable2
+ */
+ public function testCanMockInterfacesAlongsideTraversable()
+ {
+ $mock = $this->container->mock('stdClass, ArrayAccess, Countable, Traversable');
+ $this->assertInstanceOf('stdClass', $mock);
+ $this->assertInstanceOf('ArrayAccess', $mock);
+ $this->assertInstanceOf('Countable', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ }
+
+ public function testInterfacesCanHaveAssertions()
+ {
+ \Mockery::setContainer($this->container);
+ $m = $this->container->mock('stdClass, ArrayAccess, Countable, Traversable');
+ $m->shouldReceive('foo')->once();
+ $m->foo();
+ $this->container->mockery_verify();
+ \Mockery::resetContainer();
+ }
+
+ public function testMockingIteratorAggregateDoesNotImplementIterator()
+ {
+ $mock = $this->container->mock('MockeryTest_ImplementsIteratorAggregate');
+ $this->assertInstanceOf('IteratorAggregate', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ $this->assertNotInstanceOf('Iterator', $mock);
+ }
+
+ public function testMockingInterfaceThatExtendsIteratorDoesNotImplementIterator()
+ {
+ $mock = $this->container->mock('MockeryTest_InterfaceThatExtendsIterator');
+ $this->assertInstanceOf('Iterator', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ }
+
+ public function testMockingInterfaceThatExtendsIteratorAggregateDoesNotImplementIterator()
+ {
+ $mock = $this->container->mock('MockeryTest_InterfaceThatExtendsIteratorAggregate');
+ $this->assertInstanceOf('IteratorAggregate', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ $this->assertNotInstanceOf('Iterator', $mock);
+ }
+
+ public function testMockingIteratorAggregateDoesNotImplementIteratorAlongside()
+ {
+ $mock = $this->container->mock('IteratorAggregate');
+ $this->assertInstanceOf('IteratorAggregate', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ $this->assertNotInstanceOf('Iterator', $mock);
+ }
+
+ public function testMockingIteratorDoesNotImplementIteratorAlongside()
+ {
+ $mock = $this->container->mock('Iterator');
+ $this->assertInstanceOf('Iterator', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ }
+
+ public function testMockingIteratorDoesNotImplementIterator()
+ {
+ $mock = $this->container->mock('MockeryTest_ImplementsIterator');
+ $this->assertInstanceOf('Iterator', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ }
+
+ public function testMockeryCloseForIllegalIssetFileInclude()
+ {
+ $m = \Mockery::mock('StdClass')
+ ->shouldReceive('get')
+ ->andReturn(false)
+ ->getMock();
+ $m->get();
+ \Mockery::close();
+ }
+
+ public function testMockeryShouldDistinguishBetweenConstructorParamsAndClosures()
+ {
+ $obj = new MockeryTestFoo();
+ $mock = $this->container->mock('MockeryTest_ClassMultipleConstructorParams[dave]',
+ array( &$obj, 'foo' ));
+ }
+
+ /** @group nette */
+ public function testMockeryShouldNotMockCallstaticMagicMethod()
+ {
+ $mock = $this->container->mock('MockeryTest_CallStatic');
+ }
+
+ /**
+ * @issue issue/139
+ */
+ public function testCanMockClassWithOldStyleConstructorAndArguments()
+ {
+ $mock = $this->container->mock('MockeryTest_OldStyleConstructor');
+ }
+
+ /** @group issue/144 */
+ public function testMockeryShouldInterpretEmptyArrayAsConstructorArgs()
+ {
+ $mock = $this->container->mock("EmptyConstructorTest", array());
+ $this->assertSame(0, $mock->numberOfConstructorArgs);
+ }
+
+ /** @group issue/144 */
+ public function testMockeryShouldCallConstructorByDefaultWhenRequestingPartials()
+ {
+ $mock = $this->container->mock("EmptyConstructorTest[foo]");
+ $this->assertSame(0, $mock->numberOfConstructorArgs);
+ }
+
+ /** @group issue/158 */
+ public function testMockeryShouldRespectInterfaceWithMethodParamSelf()
+ {
+ $this->container->mock('MockeryTest_InterfaceWithMethodParamSelf');
+ }
+
+ /** @group issue/162 */
+ public function testMockeryDoesntTryAndMockLowercaseToString()
+ {
+ $this->container->mock('MockeryTest_Lowercase_ToString');
+ }
+
+ /** @group issue/175 */
+ public function testExistingStaticMethodMocking()
+ {
+ \Mockery::setContainer($this->container);
+ $mock = $this->container->mock('MockeryTest_PartialStatic[mockMe]');
+
+ $mock->shouldReceive('mockMe')->with(5)->andReturn(10);
+
+ $this->assertEquals(10, $mock::mockMe(5));
+ $this->assertEquals(3, $mock::keepMe(3));
+ }
+
+ /**
+ * @group issue/154
+ * @expectedException InvalidArgumentException
+ * @expectedExceptionMessage protectedMethod() cannot be mocked as it a protected method and mocking protected methods is not allowed for this mock
+ */
+ public function testShouldThrowIfAttemptingToStubProtectedMethod()
+ {
+ $mock = $this->container->mock('MockeryTest_WithProtectedAndPrivate');
+ $mock->shouldReceive("protectedMethod");
+ }
+
+ /**
+ * @group issue/154
+ * @expectedException InvalidArgumentException
+ * @expectedExceptionMessage privateMethod() cannot be mocked as it is a private method
+ */
+ public function testShouldThrowIfAttemptingToStubPrivateMethod()
+ {
+ $mock = $this->container->mock('MockeryTest_WithProtectedAndPrivate');
+ $mock->shouldReceive("privateMethod");
+ }
+
+ public function testWakeupMagicIsNotMockedToAllowSerialisationInstanceHack()
+ {
+ $mock = $this->container->mock('DateTime');
+ }
+
+ /**
+ * @group issue/154
+ */
+ public function testCanMockMethodsWithRequiredParamsThatHaveDefaultValues()
+ {
+ $mock = $this->container->mock('MockeryTest_MethodWithRequiredParamWithDefaultValue');
+ $mock->shouldIgnoreMissing();
+ $mock->foo(null, 123);
+ }
+
+ /**
+ * @test
+ * @group issue/294
+ * @expectedException Mockery\Exception\RuntimeException
+ * @expectedExceptionMessage Could not load mock DateTime, class already exists
+ */
+ public function testThrowsWhenNamedMockClassExistsAndIsNotMockery()
+ {
+ $builder = new MockConfigurationBuilder();
+ $builder->setName("DateTime");
+ $mock = $this->container->mock($builder);
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(resource(...))
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithResource()
+ {
+ $mock = $this->container->mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo(fopen('php://memory', 'r'));
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(array('myself'=>'array(...)',))
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithCircularArray()
+ {
+ $testArray = array();
+ $testArray['myself'] =& $testArray;
+
+ $mock = $this->container->mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo($testArray);
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(array('a_scalar'=>2,'an_array'=>'array(...)',))
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithNestedArray()
+ {
+ $testArray = array();
+ $testArray['a_scalar'] = 2;
+ $testArray['an_array'] = array(1, 2, 3);
+
+ $mock = $this->container->mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo($testArray);
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(array('a_scalar'=>2,'an_object'=>'object(stdClass)',))
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithNestedObject()
+ {
+ $testArray = array();
+ $testArray['a_scalar'] = 2;
+ $testArray['an_object'] = new \stdClass();
+
+ $mock = $this->container->mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo($testArray);
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(array('a_scalar'=>2,'a_closure'=>'object(Closure
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithNestedClosure()
+ {
+ $testArray = array();
+ $testArray['a_scalar'] = 2;
+ $testArray['a_closure'] = function () {
+ };
+
+ $mock = $this->container->mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo($testArray);
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(array('a_scalar'=>2,'a_resource'=>'resource(...)',))
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithNestedResource()
+ {
+ $testArray = array();
+ $testArray['a_scalar'] = 2;
+ $testArray['a_resource'] = fopen('php://memory', 'r');
+
+ $mock = $this->container->mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo($testArray);
+ }
+
+ /**
+ * @test
+ * @group issue/339
+ */
+ public function canMockClassesThatDescendFromInternalClasses()
+ {
+ $mock = $this->container->mock("MockeryTest_ClassThatDescendsFromInternalClass");
+ $this->assertInstanceOf("DateTime", $mock);
+ }
+
+ /**
+ * @test
+ * @group issue/339
+ */
+ public function canMockClassesThatImplementSerializable()
+ {
+ $mock = $this->container->mock("MockeryTest_ClassThatImplementsSerializable");
+ $this->assertInstanceOf("Serializable", $mock);
+ }
+
+ /**
+ * @test
+ * @group issue/346
+ */
+ public function canMockInternalClassesThatImplementSerializable()
+ {
+ $mock = $this->container->mock("ArrayObject");
+ $this->assertInstanceOf("Serializable", $mock);
+ }
+}
+
+class MockeryTest_CallStatic
+{
+ public static function __callStatic($method, $args) {}
+}
+
+class MockeryTest_ClassMultipleConstructorParams
+{
+ public function __construct($a, $b) {}
+ public function dave() {}
+}
+
+interface MockeryTest_InterfaceWithTraversable extends \ArrayAccess, \Traversable, \Countable
+{
+ public function self();
+}
+
+class MockeryTestIsset_Bar
+{
+ public function doSomething() {}
+}
+
+class MockeryTestIsset_Foo
+{
+ private $var;
+
+ public function __construct($var)
+ {
+ $this->var = $var;
+ }
+
+ public function __get($name)
+ {
+ $this->var->doSomething();
+ }
+
+ public function __isset($name)
+ {
+ return (bool) strlen($this->__get($name));
+ }
+}
+
+class MockeryTest_IssetMethod
+{
+ protected $_properties = array();
+ public function __construct() {}
+ public function __isset($property)
+ {
+ return isset($this->_properties[$property]);
+ }
+}
+
+class MockeryTest_UnsetMethod
+{
+ protected $_properties = array();
+ public function __construct() {}
+ public function __unset($property)
+ {
+ unset($this->_properties[$property]);
+ }
+}
+
+class MockeryTestFoo
+{
+ public function foo() { return 'foo'; }
+}
+
+class MockeryTestFoo2
+{
+ public function foo() { return 'foo'; }
+ public function bar() { return 'bar'; }
+}
+
+final class MockeryFoo3
+{
+ public function foo() { return 'baz'; }
+}
+
+class MockeryFoo4
+{
+ final public function foo() { return 'baz'; }
+ public function bar() { return 'bar'; }
+}
+
+interface MockeryTest_Interface {}
+interface MockeryTest_Interface1 {}
+interface MockeryTest_Interface2 {}
+
+interface MockeryTest_InterfaceWithAbstractMethod
+{
+ public function set();
+}
+
+interface MockeryTest_InterfaceWithPublicStaticMethod
+{
+ public static function self();
+}
+
+abstract class MockeryTest_AbstractWithAbstractMethod
+{
+ abstract protected function set();
+}
+
+class MockeryTest_WithProtectedAndPrivate
+{
+ protected function protectedMethod() {}
+ private function privateMethod() {}
+}
+
+class MockeryTest_ClassConstructor
+{
+ public function __construct($param1) {}
+}
+
+class MockeryTest_ClassConstructor2
+{
+ protected $param1;
+ public function __construct(stdClass $param1) { $this->param1 = $param1; }
+ public function getParam1() { return $this->param1; }
+ public function foo() { return 'foo'; }
+ public function bar() { return $this->foo(); }
+}
+
+class MockeryTest_Call1
+{
+ public function __call($method, array $params) {}
+}
+
+class MockeryTest_Call2
+{
+ public function __call($method, $params) {}
+}
+
+class MockeryTest_Wakeup1
+{
+ public function __construct() {}
+ public function __wakeup() {}
+}
+
+class MockeryTest_ExistingProperty
+{
+ public $foo = 'bar';
+}
+abstract class MockeryTest_AbstractWithAbstractPublicMethod
+{
+ abstract public function foo($a, $b);
+}
+
+// issue/18
+class SoCool
+{
+ public function iDoSomethingReallyCoolHere()
+ {
+ return 3;
+ }
+}
+class Gateway
+{
+ public function __call($method, $args)
+ {
+ $m = new SoCool();
+ return call_user_func_array(array($m, $method), $args);
+ }
+}
+
+class MockeryTestBar1
+{
+ public function method1()
+ {
+ return $this;
+ }
+}
+
+class MockeryTest_ReturnByRef
+{
+ public $i = 0;
+ public function &get()
+ {
+ return $this->$i;
+ }
+}
+
+class MockeryTest_MethodParamRef
+{
+ public function method1(&$foo) {return true;}
+}
+class MockeryTest_MethodParamRef2
+{
+ public function method1(&$foo) {return true;}
+}
+class MockeryTestRef1
+{
+ public function foo(&$a, $b) {}
+}
+
+class MockeryTest_PartialNormalClass
+{
+ public function foo() {return 'abc';}
+ public function bar() {return 'abc';}
+}
+
+abstract class MockeryTest_PartialAbstractClass
+{
+ abstract public function foo();
+ public function bar() {return 'abc';}
+}
+
+class MockeryTest_PartialNormalClass2
+{
+ public function foo() {return 'abc';}
+ public function bar() {return 'abc';}
+ public function baz() {return 'abc';}
+}
+
+abstract class MockeryTest_PartialAbstractClass2
+{
+ abstract public function foo();
+ public function bar() {return 'abc';}
+ abstract public function baz();
+}
+
+class MockeryTest_TestInheritedType {}
+
+if(PHP_VERSION_ID >= 50400) {
+ class MockeryTest_MockCallableTypeHint
+ {
+ public function foo(callable $baz) {$baz();}
+ public function bar(callable $callback = null) {$callback();}
+ }
+}
+
+class MockeryTest_WithToString
+{
+ public function __toString() {}
+}
+
+class MockeryTest_ImplementsIteratorAggregate implements \IteratorAggregate
+{
+ public function getIterator()
+ {
+ return new \ArrayIterator(array());
+ }
+}
+
+class MockeryTest_ImplementsIterator implements \Iterator
+{
+ public function rewind() {}
+ public function current() {}
+ public function key() {}
+ public function next() {}
+ public function valid() {}
+}
+
+class MockeryTest_OldStyleConstructor
+{
+ public function MockeryTest_OldStyleConstructor($arg) {}
+}
+
+class EmptyConstructorTest
+{
+ public $numberOfConstructorArgs;
+
+ public function __construct()
+ {
+ $this->numberOfConstructorArgs = count(func_get_args());
+ }
+
+ public function foo()
+ {
+ }
+}
+
+interface MockeryTest_InterfaceWithMethodParamSelf
+{
+ public function foo(self $bar);
+}
+
+class MockeryTest_Lowercase_ToString
+{
+ public function __tostring() { }
+}
+
+class MockeryTest_PartialStatic
+{
+ public static function mockMe($a)
+ {
+ return $a;
+ }
+
+ public static function keepMe($b)
+ {
+ return $b;
+ }
+}
+
+class MockeryTest_MethodWithRequiredParamWithDefaultValue
+{
+ public function foo(\DateTime $bar = null, $baz) {}
+}
+
+interface MockeryTest_InterfaceThatExtendsIterator extends \Iterator
+{
+ public function foo();
+}
+
+interface MockeryTest_InterfaceThatExtendsIteratorAggregate extends \IteratorAggregate
+{
+ public function foo();
+}
+
+class MockeryTest_ClassThatDescendsFromInternalClass extends \DateTime {}
+
+class MockeryTest_ClassThatImplementsSerializable implements \Serializable
+{
+ public function serialize() {}
+ public function unserialize($serialized) {}
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/DemeterChainTest.php b/vendor/mockery/mockery/tests/Mockery/DemeterChainTest.php
new file mode 100644
index 0000000..b716c3d
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/DemeterChainTest.php
@@ -0,0 +1,170 @@
+mock */
+ private $mock;
+
+ public function setUp()
+ {
+ $this->mock = $this->mock = Mockery::mock('object')->shouldIgnoreMissing();
+ }
+
+ public function tearDown()
+ {
+ $this->mock->mockery_getContainer()->mockery_close();
+ }
+
+ public function testTwoChains()
+ {
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->andReturn('something');
+
+ $this->mock->shouldReceive('getElement->getSecond')
+ ->once()
+ ->andReturn('somethingElse');
+
+ $this->assertEquals(
+ 'something',
+ $this->mock->getElement()->getFirst()
+ );
+ $this->assertEquals(
+ 'somethingElse',
+ $this->mock->getElement()->getSecond()
+ );
+ $this->mock->mockery_getContainer()->mockery_close();
+ }
+
+ public function testTwoChainsWithExpectedParameters()
+ {
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->with('parameter')
+ ->andReturn('something');
+
+ $this->mock->shouldReceive('getElement->getSecond')
+ ->once()
+ ->with('secondParameter')
+ ->andReturn('somethingElse');
+
+ $this->assertEquals(
+ 'something',
+ $this->mock->getElement()->getFirst('parameter')
+ );
+ $this->assertEquals(
+ 'somethingElse',
+ $this->mock->getElement()->getSecond('secondParameter')
+ );
+ $this->mock->mockery_getContainer()->mockery_close();
+ }
+
+ public function testThreeChains()
+ {
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->andReturn('something');
+
+ $this->mock->shouldReceive('getElement->getSecond')
+ ->once()
+ ->andReturn('somethingElse');
+
+ $this->assertEquals(
+ 'something',
+ $this->mock->getElement()->getFirst()
+ );
+ $this->assertEquals(
+ 'somethingElse',
+ $this->mock->getElement()->getSecond()
+ );
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->andReturn('somethingNew');
+ $this->assertEquals(
+ 'somethingNew',
+ $this->mock->getElement()->getFirst()
+ );
+ }
+
+ public function testManyChains()
+ {
+ $this->mock->shouldReceive('getElements->getFirst')
+ ->once()
+ ->andReturn('something');
+
+ $this->mock->shouldReceive('getElements->getSecond')
+ ->once()
+ ->andReturn('somethingElse');
+
+ $this->mock->getElements()->getFirst();
+ $this->mock->getElements()->getSecond();
+ }
+
+ public function testTwoNotRelatedChains()
+ {
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->andReturn('something');
+
+ $this->mock->shouldReceive('getOtherElement->getSecond')
+ ->once()
+ ->andReturn('somethingElse');
+
+ $this->assertEquals(
+ 'somethingElse',
+ $this->mock->getOtherElement()->getSecond()
+ );
+ $this->assertEquals(
+ 'something',
+ $this->mock->getElement()->getFirst()
+ );
+ }
+
+ public function testDemeterChain()
+ {
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->andReturn('somethingElse');
+
+ $this->assertEquals('somethingElse', $this->mock->getElement()->getFirst());
+
+ }
+
+ public function testMultiLevelDemeterChain()
+ {
+ $this->mock->shouldReceive('levelOne->levelTwo->getFirst')
+ ->andReturn('first');
+
+ $this->mock->shouldReceive('levelOne->levelTwo->getSecond')
+ ->andReturn('second');
+
+ $this->assertEquals(
+ 'second',
+ $this->mock->levelOne()->levelTwo()->getSecond()
+ );
+ $this->assertEquals(
+ 'first',
+ $this->mock->levelOne()->levelTwo()->getFirst()
+ );
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/ExpectationTest.php b/vendor/mockery/mockery/tests/Mockery/ExpectationTest.php
new file mode 100644
index 0000000..4415422
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/ExpectationTest.php
@@ -0,0 +1,1885 @@
+container = new \Mockery\Container(\Mockery::getDefaultGenerator(), \Mockery::getDefaultLoader());
+ $this->mock = $this->container->mock('foo');
+ }
+
+ public function teardown()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(true);
+ $this->container->mockery_close();
+ }
+
+ public function testReturnsNullWhenNoArgs()
+ {
+ $this->mock->shouldReceive('foo');
+ $this->assertNull($this->mock->foo());
+ }
+
+ public function testReturnsNullWhenSingleArg()
+ {
+ $this->mock->shouldReceive('foo');
+ $this->assertNull($this->mock->foo(1));
+ }
+
+ public function testReturnsNullWhenManyArgs()
+ {
+ $this->mock->shouldReceive('foo');
+ $this->assertNull($this->mock->foo('foo', array(), new stdClass));
+ }
+
+ public function testReturnsNullIfNullIsReturnValue()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(null);
+ $this->assertNull($this->mock->foo());
+ }
+
+ public function testReturnsNullForMockedExistingClassIfAndreturnnullCalled()
+ {
+ $mock = $this->container->mock('MockeryTest_Foo');
+ $mock->shouldReceive('foo')->andReturn(null);
+ $this->assertNull($mock->foo());
+ }
+
+ public function testReturnsNullForMockedExistingClassIfNullIsReturnValue()
+ {
+ $mock = $this->container->mock('MockeryTest_Foo');
+ $mock->shouldReceive('foo')->andReturnNull();
+ $this->assertNull($mock->foo());
+ }
+
+ public function testReturnsSameValueForAllIfNoArgsExpectationAndNoneGiven()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(1);
+ $this->assertEquals(1, $this->mock->foo());
+ }
+
+ public function testSetsPublicPropertyWhenRequested()
+ {
+ $this->mock->shouldReceive('foo')->andSet('bar', 'baz');
+ $this->mock->foo();
+ $this->assertEquals('baz', $this->mock->bar);
+ }
+
+ public function testSetsPublicPropertyWhenRequestedUsingAlias()
+ {
+ $this->mock->shouldReceive('foo')->set('bar', 'baz');
+ $this->mock->foo();
+ $this->assertEquals('baz', $this->mock->bar);
+ }
+
+ public function testReturnsSameValueForAllIfNoArgsExpectationAndSomeGiven()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(1);
+ $this->assertEquals(1, $this->mock->foo('foo'));
+ }
+
+ public function testReturnsValueFromSequenceSequentially()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(1, 2, 3);
+ $this->mock->foo('foo');
+ $this->assertEquals(2, $this->mock->foo('foo'));
+ }
+
+ public function testReturnsValueFromSequenceSequentiallyAndRepeatedlyReturnsFinalValueOnExtraCalls()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(1, 2, 3);
+ $this->mock->foo('foo');
+ $this->mock->foo('foo');
+ $this->assertEquals(3, $this->mock->foo('foo'));
+ $this->assertEquals(3, $this->mock->foo('foo'));
+ }
+
+ public function testReturnsValueFromSequenceSequentiallyAndRepeatedlyReturnsFinalValueOnExtraCallsWithManyAndReturnCalls()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(1)->andReturn(2, 3);
+ $this->mock->foo('foo');
+ $this->mock->foo('foo');
+ $this->assertEquals(3, $this->mock->foo('foo'));
+ $this->assertEquals(3, $this->mock->foo('foo'));
+ }
+
+ public function testReturnsValueOfClosure()
+ {
+ $this->mock->shouldReceive('foo')->with(5)->andReturnUsing(function ($v) {return $v+1;});
+ $this->assertEquals(6, $this->mock->foo(5));
+ }
+
+ public function testReturnsUndefined()
+ {
+ $this->mock->shouldReceive('foo')->andReturnUndefined();
+ $this->assertTrue($this->mock->foo() instanceof \Mockery\Undefined);
+ }
+
+ public function testReturnsValuesSetAsArray()
+ {
+ $this->mock->shouldReceive('foo')->andReturnValues(array(1,2,3));
+ $this->assertEquals(1, $this->mock->foo());
+ $this->assertEquals(2, $this->mock->foo());
+ $this->assertEquals(3, $this->mock->foo());
+ }
+
+ /**
+ * @expectedException OutOfBoundsException
+ */
+ public function testThrowsException()
+ {
+ $this->mock->shouldReceive('foo')->andThrow(new OutOfBoundsException);
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException OutOfBoundsException
+ */
+ public function testThrowsExceptionBasedOnArgs()
+ {
+ $this->mock->shouldReceive('foo')->andThrow('OutOfBoundsException');
+ $this->mock->foo();
+ }
+
+ public function testThrowsExceptionBasedOnArgsWithMessage()
+ {
+ $this->mock->shouldReceive('foo')->andThrow('OutOfBoundsException', 'foo');
+ try {
+ $this->mock->foo();
+ } catch (OutOfBoundsException $e) {
+ $this->assertEquals('foo', $e->getMessage());
+ }
+ }
+
+ /**
+ * @expectedException OutOfBoundsException
+ */
+ public function testThrowsExceptionSequentially()
+ {
+ $this->mock->shouldReceive('foo')->andThrow(new Exception)->andThrow(new OutOfBoundsException);
+ try {
+ $this->mock->foo();
+ } catch (Exception $e) {}
+ $this->mock->foo();
+ }
+
+ public function testAndThrowExceptions()
+ {
+ $this->mock->shouldReceive('foo')->andThrowExceptions(array(
+ new OutOfBoundsException,
+ new InvalidArgumentException,
+ ));
+
+ try {
+ $this->mock->foo();
+ throw new Exception("Expected OutOfBoundsException, non thrown");
+ } catch (\Exception $e) {
+ $this->assertInstanceOf("OutOfBoundsException", $e, "Wrong or no exception thrown: {$e->getMessage()}");
+ }
+
+ try {
+ $this->mock->foo();
+ throw new Exception("Expected InvalidArgumentException, non thrown");
+ } catch (\Exception $e) {
+ $this->assertInstanceOf("InvalidArgumentException", $e, "Wrong or no exception thrown: {$e->getMessage()}");
+ }
+ }
+
+ /**
+ * @expectedException Mockery\Exception
+ * @expectedExceptionMessage You must pass an array of exception objects to andThrowExceptions
+ */
+ public function testAndThrowExceptionsCatchNonExceptionArgument()
+ {
+ $this->mock
+ ->shouldReceive('foo')
+ ->andThrowExceptions(array('NotAnException'));
+ }
+
+ public function testMultipleExpectationsWithReturns()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->andReturn(10);
+ $this->mock->shouldReceive('bar')->with(2)->andReturn(20);
+ $this->assertEquals(10, $this->mock->foo(1));
+ $this->assertEquals(20, $this->mock->bar(2));
+ }
+
+ public function testExpectsNoArguments()
+ {
+ $this->mock->shouldReceive('foo')->withNoArgs();
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testExpectsNoArgumentsThrowsExceptionIfAnyPassed()
+ {
+ $this->mock->shouldReceive('foo')->withNoArgs();
+ $this->mock->foo(1);
+ }
+
+ public function testExpectsArgumentsArray()
+ {
+ $this->mock->shouldReceive('foo')->withArgs(array(1, 2));
+ $this->mock->foo(1, 2);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testExpectsArgumentsArrayThrowsExceptionIfPassedEmptyArray()
+ {
+ $this->mock->shouldReceive('foo')->withArgs(array());
+ $this->mock->foo(1, 2);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testExpectsArgumentsArrayThrowsExceptionIfNoArgumentsPassed()
+ {
+ $this->mock->shouldReceive('foo')->with();
+ $this->mock->foo(1);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testExpectsArgumentsArrayThrowsExceptionIfPassedWrongArguments()
+ {
+ $this->mock->shouldReceive('foo')->withArgs(array(1, 2));
+ $this->mock->foo(3, 4);
+ }
+
+ public function testExpectsAnyArguments()
+ {
+ $this->mock->shouldReceive('foo')->withAnyArgs();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 'k', new stdClass);
+ }
+
+ public function testExpectsArgumentMatchingRegularExpression()
+ {
+ $this->mock->shouldReceive('foo')->with('/bar/i');
+ $this->mock->foo('xxBARxx');
+ }
+
+ public function testExpectsArgumentMatchingObjectType()
+ {
+ $this->mock->shouldReceive('foo')->with('\stdClass');
+ $this->mock->foo(new stdClass);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testThrowsExceptionOnNoArgumentMatch()
+ {
+ $this->mock->shouldReceive('foo')->with(1);
+ $this->mock->foo(2);
+ }
+
+ public function testNeverCalled()
+ {
+ $this->mock->shouldReceive('foo')->never();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testNeverCalledThrowsExceptionOnCall()
+ {
+ $this->mock->shouldReceive('foo')->never();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testCalledOnce()
+ {
+ $this->mock->shouldReceive('foo')->once();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledOnceThrowsExceptionIfNotCalled()
+ {
+ $this->mock->shouldReceive('foo')->once();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledOnceThrowsExceptionIfCalledTwice()
+ {
+ $this->mock->shouldReceive('foo')->once();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testCalledTwice()
+ {
+ $this->mock->shouldReceive('foo')->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledTwiceThrowsExceptionIfNotCalled()
+ {
+ $this->mock->shouldReceive('foo')->twice();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledOnceThrowsExceptionIfCalledThreeTimes()
+ {
+ $this->mock->shouldReceive('foo')->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testCalledZeroOrMoreTimesAtZeroCalls()
+ {
+ $this->mock->shouldReceive('foo')->zeroOrMoreTimes();
+ $this->container->mockery_verify();
+ }
+
+ public function testCalledZeroOrMoreTimesAtThreeCalls()
+ {
+ $this->mock->shouldReceive('foo')->zeroOrMoreTimes();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testTimesCountCalls()
+ {
+ $this->mock->shouldReceive('foo')->times(4);
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testTimesCountCallThrowsExceptionOnTooFewCalls()
+ {
+ $this->mock->shouldReceive('foo')->times(2);
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testTimesCountCallThrowsExceptionOnTooManyCalls()
+ {
+ $this->mock->shouldReceive('foo')->times(2);
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testCalledAtLeastOnceAtExactlyOneCall()
+ {
+ $this->mock->shouldReceive('foo')->atLeast()->once();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testCalledAtLeastOnceAtExactlyThreeCalls()
+ {
+ $this->mock->shouldReceive('foo')->atLeast()->times(3);
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledAtLeastThrowsExceptionOnTooFewCalls()
+ {
+ $this->mock->shouldReceive('foo')->atLeast()->twice();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testCalledAtMostOnceAtExactlyOneCall()
+ {
+ $this->mock->shouldReceive('foo')->atMost()->once();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testCalledAtMostAtExactlyThreeCalls()
+ {
+ $this->mock->shouldReceive('foo')->atMost()->times(3);
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledAtLeastThrowsExceptionOnTooManyCalls()
+ {
+ $this->mock->shouldReceive('foo')->atMost()->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testExactCountersOverrideAnyPriorSetNonExactCounters()
+ {
+ $this->mock->shouldReceive('foo')->atLeast()->once()->once();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testComboOfLeastAndMostCallsWithOneCall()
+ {
+ $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testComboOfLeastAndMostCallsWithTwoCalls()
+ {
+ $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testComboOfLeastAndMostCallsThrowsExceptionAtTooFewCalls()
+ {
+ $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testComboOfLeastAndMostCallsThrowsExceptionAtTooManyCalls()
+ {
+ $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testCallCountingOnlyAppliesToMatchedExpectations()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->once();
+ $this->mock->shouldReceive('foo')->with(2)->twice();
+ $this->mock->shouldReceive('foo')->with(3);
+ $this->mock->foo(1);
+ $this->mock->foo(2);
+ $this->mock->foo(2);
+ $this->mock->foo(3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCallCountingThrowsExceptionOnAnyMismatch()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->once();
+ $this->mock->shouldReceive('foo')->with(2)->twice();
+ $this->mock->shouldReceive('foo')->with(3);
+ $this->mock->shouldReceive('bar');
+ $this->mock->foo(1);
+ $this->mock->foo(2);
+ $this->mock->foo(3);
+ $this->mock->bar();
+ $this->container->mockery_verify();
+ }
+
+ public function testOrderedCallsWithoutError()
+ {
+ $this->mock->shouldReceive('foo')->ordered();
+ $this->mock->shouldReceive('bar')->ordered();
+ $this->mock->foo();
+ $this->mock->bar();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testOrderedCallsWithOutOfOrderError()
+ {
+ $this->mock->shouldReceive('foo')->ordered();
+ $this->mock->shouldReceive('bar')->ordered();
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testDifferentArgumentsAndOrderingsPassWithoutException()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->ordered();
+ $this->mock->shouldReceive('foo')->with(2)->ordered();
+ $this->mock->foo(1);
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testDifferentArgumentsAndOrderingsThrowExceptionWhenInWrongOrder()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->ordered();
+ $this->mock->shouldReceive('foo')->with(2)->ordered();
+ $this->mock->foo(2);
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+ public function testUnorderedCallsIgnoredForOrdering()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->ordered();
+ $this->mock->shouldReceive('foo')->with(2);
+ $this->mock->shouldReceive('foo')->with(3)->ordered();
+ $this->mock->foo(2);
+ $this->mock->foo(1);
+ $this->mock->foo(2);
+ $this->mock->foo(3);
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ public function testOrderingOfDefaultGrouping()
+ {
+ $this->mock->shouldReceive('foo')->ordered();
+ $this->mock->shouldReceive('bar')->ordered();
+ $this->mock->foo();
+ $this->mock->bar();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testOrderingOfDefaultGroupingThrowsExceptionOnWrongOrder()
+ {
+ $this->mock->shouldReceive('foo')->ordered();
+ $this->mock->shouldReceive('bar')->ordered();
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testOrderingUsingNumberedGroups()
+ {
+ $this->mock->shouldReceive('start')->ordered(1);
+ $this->mock->shouldReceive('foo')->ordered(2);
+ $this->mock->shouldReceive('bar')->ordered(2);
+ $this->mock->shouldReceive('final')->ordered();
+ $this->mock->start();
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->mock->bar();
+ $this->mock->final();
+ $this->container->mockery_verify();
+ }
+
+ public function testOrderingUsingNamedGroups()
+ {
+ $this->mock->shouldReceive('start')->ordered('start');
+ $this->mock->shouldReceive('foo')->ordered('foobar');
+ $this->mock->shouldReceive('bar')->ordered('foobar');
+ $this->mock->shouldReceive('final')->ordered();
+ $this->mock->start();
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->mock->bar();
+ $this->mock->final();
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @group 2A
+ */
+ public function testGroupedUngroupedOrderingDoNotOverlap()
+ {
+ $s = $this->mock->shouldReceive('start')->ordered();
+ $m = $this->mock->shouldReceive('mid')->ordered('foobar');
+ $e = $this->mock->shouldReceive('end')->ordered();
+ $this->assertTrue($s->getOrderNumber() < $m->getOrderNumber());
+ $this->assertTrue($m->getOrderNumber() < $e->getOrderNumber());
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testGroupedOrderingThrowsExceptionWhenCallsDisordered()
+ {
+ $this->mock->shouldReceive('foo')->ordered('first');
+ $this->mock->shouldReceive('bar')->ordered('second');
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testExpectationMatchingWithNoArgsOrderings()
+ {
+ $this->mock->shouldReceive('foo')->withNoArgs()->once()->ordered();
+ $this->mock->shouldReceive('bar')->withNoArgs()->once()->ordered();
+ $this->mock->shouldReceive('foo')->withNoArgs()->once()->ordered();
+ $this->mock->foo();
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testExpectationMatchingWithAnyArgsOrderings()
+ {
+ $this->mock->shouldReceive('foo')->withAnyArgs()->once()->ordered();
+ $this->mock->shouldReceive('bar')->withAnyArgs()->once()->ordered();
+ $this->mock->shouldReceive('foo')->withAnyArgs()->once()->ordered();
+ $this->mock->foo();
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testEnsuresOrderingIsNotCrossMockByDefault()
+ {
+ $this->mock->shouldReceive('foo')->ordered();
+ $mock2 = $this->container->mock('bar');
+ $mock2->shouldReceive('bar')->ordered();
+ $mock2->bar();
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testEnsuresOrderingIsCrossMockWhenGloballyFlagSet()
+ {
+ $this->mock->shouldReceive('foo')->globally()->ordered();
+ $mock2 = $this->container->mock('bar');
+ $mock2->shouldReceive('bar')->globally()->ordered();
+ $mock2->bar();
+ $this->mock->foo();
+ }
+
+ public function testExpectationCastToStringFormatting()
+ {
+ $exp = $this->mock->shouldReceive('foo')->with(1, 'bar', new stdClass, array('Spam' => 'Ham', 'Bar' => 'Baz'));
+ $this->assertEquals('[foo(1, "bar", object(stdClass), array(\'Spam\'=>\'Ham\',\'Bar\'=>\'Baz\',))]', (string) $exp);
+ }
+
+ public function testLongExpectationCastToStringFormatting()
+ {
+ $exp = $this->mock->shouldReceive('foo')->with(array('Spam' => 'Ham', 'Bar' => 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'Bar' , 'Baz', 'End'));
+ $this->assertEquals("[foo(array('Spam'=>'Ham','Bar'=>'Baz',0=>'Bar',1=>'Baz',2=>'Bar',3=>'Baz',4=>'Bar',5=>'Baz',6=>'Bar',7=>'Baz',8=>'Bar',9=>'Baz',10=>'Bar',11=>'Baz',12=>'Bar',13=>'Baz',14=>'Bar',15=>'Baz',16=>'Bar',17=>'Baz',18=>'Bar',19=>'Baz',20=>'Bar',21=>'Baz',22=>'Bar',23=>'Baz',24=>'Bar',25=>'Baz',26=>'Bar',27=>'Baz',28=>'Bar',29=>'Baz',30=>'Bar',31=>'Baz',32=>'Bar',33=>'Baz',34=>'Bar',35=>'Baz',36=>'Bar',37=>'Baz',38=>'Bar',39=>'Baz',40=>'Bar',41=>'Baz',42=>'Bar',43=>'Baz',44=>'Bar',45=>'Baz',46=>'Baz',47=>'Bar',48=>'Baz',49=>'Bar',50=>'Baz',51=>'Bar',52=>'Baz',53=>'Bar',54=>'Baz',55=>'Bar',56=>'Baz',57=>'Baz',58=>'Bar',59=>'Baz',60=>'Bar',61=>'Baz',62=>'Bar',63=>'Baz',64=>'Bar',65=>'Baz',66=>'Bar',67=>'Baz',68=>'Baz',69=>'Bar',70=>'Baz',71=>'Bar',72=>'Baz',73=>'Bar',74=>'Baz',75=>'Bar',76=>'Baz',77=>'Bar',78=>'Baz',79=>'Baz',80=>'Bar',81=>'Baz',82=>'Bar',83=>'Baz',84=>'Bar',85=>'Baz',86=>'Bar',87=>'Baz',88=>'Bar',89=>'Baz',90=>'Baz',91=>'Bar',92=>'Baz',93=>'Bar',94=>'Baz',95=>'Bar',96=>'Baz',97=>'Ba...))]", (string) $exp);
+ }
+
+ public function testMultipleExpectationCastToStringFormatting()
+ {
+ $exp = $this->mock->shouldReceive('foo', 'bar')->with(1);
+ $this->assertEquals('[foo(1), bar(1)]', (string) $exp);
+ }
+
+ public function testGroupedOrderingWithLimitsAllowsMultipleReturnValues()
+ {
+ $this->mock->shouldReceive('foo')->with(2)->once()->andReturn('first');
+ $this->mock->shouldReceive('foo')->with(2)->twice()->andReturn('second/third');
+ $this->mock->shouldReceive('foo')->with(2)->andReturn('infinity');
+ $this->assertEquals('first', $this->mock->foo(2));
+ $this->assertEquals('second/third', $this->mock->foo(2));
+ $this->assertEquals('second/third', $this->mock->foo(2));
+ $this->assertEquals('infinity', $this->mock->foo(2));
+ $this->assertEquals('infinity', $this->mock->foo(2));
+ $this->assertEquals('infinity', $this->mock->foo(2));
+ $this->container->mockery_verify();
+ }
+
+ public function testExpectationsCanBeMarkedAsDefaults()
+ {
+ $this->mock->shouldReceive('foo')->andReturn('bar')->byDefault();
+ $this->assertEquals('bar', $this->mock->foo());
+ $this->container->mockery_verify();
+ }
+
+ public function testDefaultExpectationsValidatedInCorrectOrder()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->once()->andReturn('first')->byDefault();
+ $this->mock->shouldReceive('foo')->with(2)->once()->andReturn('second')->byDefault();
+ $this->assertEquals('first', $this->mock->foo(1));
+ $this->assertEquals('second', $this->mock->foo(2));
+ $this->container->mockery_verify();
+ }
+
+ public function testDefaultExpectationsAreReplacedByLaterConcreteExpectations()
+ {
+ $this->mock->shouldReceive('foo')->andReturn('bar')->once()->byDefault();
+ $this->mock->shouldReceive('foo')->andReturn('bar')->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testDefaultExpectationsCanBeChangedByLaterExpectations()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->andReturn('bar')->once()->byDefault();
+ $this->mock->shouldReceive('foo')->with(2)->andReturn('baz')->once();
+ try {
+ $this->mock->foo(1);
+ $this->fail('Expected exception not thrown');
+ } catch (\Mockery\Exception $e) {}
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testDefaultExpectationsCanBeOrdered()
+ {
+ $this->mock->shouldReceive('foo')->ordered()->byDefault();
+ $this->mock->shouldReceive('bar')->ordered()->byDefault();
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testDefaultExpectationsCanBeOrderedAndReplaced()
+ {
+ $this->mock->shouldReceive('foo')->ordered()->byDefault();
+ $this->mock->shouldReceive('bar')->ordered()->byDefault();
+ $this->mock->shouldReceive('bar')->ordered();
+ $this->mock->shouldReceive('foo')->ordered();
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->container->mockery_verify();
+ }
+
+ public function testByDefaultOperatesFromMockConstruction()
+ {
+ $container = new \Mockery\Container(\Mockery::getDefaultGenerator(), \Mockery::getDefaultLoader());
+ $mock = $container->mock('f', array('foo'=>'rfoo','bar'=>'rbar','baz'=>'rbaz'))->byDefault();
+ $mock->shouldReceive('foo')->andReturn('foobar');
+ $this->assertEquals('foobar', $mock->foo());
+ $this->assertEquals('rbar', $mock->bar());
+ $this->assertEquals('rbaz', $mock->baz());
+ $mock->mockery_verify();
+ }
+
+ public function testByDefaultOnAMockDoesSquatWithoutExpectations()
+ {
+ $container = new \Mockery\Container(\Mockery::getDefaultGenerator(), \Mockery::getDefaultLoader());
+ $mock = $container->mock('f')->byDefault();
+ }
+
+ public function testDefaultExpectationsCanBeOverridden()
+ {
+ $this->mock->shouldReceive('foo')->with('test')->andReturn('bar')->byDefault();
+ $this->mock->shouldReceive('foo')->with('test')->andReturn('newbar')->byDefault();
+ $this->mock->foo('test');
+ $this->assertEquals('newbar', $this->mock->foo('test'));
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testByDefaultPreventedFromSettingDefaultWhenDefaultingExpectationWasReplaced()
+ {
+ $exp = $this->mock->shouldReceive('foo')->andReturn(1);
+ $this->mock->shouldReceive('foo')->andReturn(2);
+ $exp->byDefault();
+ }
+
+ /**
+ * Argument Constraint Tests
+ */
+
+ public function testAnyConstraintMatchesAnyArg()
+ {
+ $this->mock->shouldReceive('foo')->with(1, Mockery::any())->twice();
+ $this->mock->foo(1, 2);
+ $this->mock->foo(1, 'str');
+ $this->container->mockery_verify();
+ }
+
+ public function testAnyConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::any())->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ public function testArrayConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('array'))->once();
+ $this->mock->foo(array());
+ $this->container->mockery_verify();
+ }
+
+ public function testArrayConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('array'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testArrayConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('array'))->once();
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+ public function testBoolConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('bool'))->once();
+ $this->mock->foo(true);
+ $this->container->mockery_verify();
+ }
+
+ public function testBoolConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('bool'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testBoolConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('bool'))->once();
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+ public function testCallableConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('callable'))->once();
+ $this->mock->foo(function () {return 'f';});
+ $this->container->mockery_verify();
+ }
+
+ public function testCallableConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('callable'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testCallableConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('callable'))->once();
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+ public function testDoubleConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('double'))->once();
+ $this->mock->foo(2.25);
+ $this->container->mockery_verify();
+ }
+
+ public function testDoubleConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('double'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testDoubleConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('double'))->once();
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+ public function testFloatConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('float'))->once();
+ $this->mock->foo(2.25);
+ $this->container->mockery_verify();
+ }
+
+ public function testFloatConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('float'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testFloatConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('float'))->once();
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+ public function testIntConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('int'))->once();
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ public function testIntConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('int'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testIntConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('int'))->once();
+ $this->mock->foo('f');
+ $this->container->mockery_verify();
+ }
+
+ public function testLongConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('long'))->once();
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ public function testLongConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('long'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testLongConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('long'))->once();
+ $this->mock->foo('f');
+ $this->container->mockery_verify();
+ }
+
+ public function testNullConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('null'))->once();
+ $this->mock->foo(null);
+ $this->container->mockery_verify();
+ }
+
+ public function testNullConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('null'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testNullConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('null'))->once();
+ $this->mock->foo('f');
+ $this->container->mockery_verify();
+ }
+
+ public function testNumericConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('numeric'))->once();
+ $this->mock->foo('2');
+ $this->container->mockery_verify();
+ }
+
+ public function testNumericConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('numeric'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testNumericConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('numeric'))->once();
+ $this->mock->foo('f');
+ $this->container->mockery_verify();
+ }
+
+ public function testObjectConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('object'))->once();
+ $this->mock->foo(new stdClass);
+ $this->container->mockery_verify();
+ }
+
+ public function testObjectConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('object`'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testObjectConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('object'))->once();
+ $this->mock->foo('f');
+ $this->container->mockery_verify();
+ }
+
+ public function testRealConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('real'))->once();
+ $this->mock->foo(2.25);
+ $this->container->mockery_verify();
+ }
+
+ public function testRealConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('real'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testRealConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('real'))->once();
+ $this->mock->foo('f');
+ $this->container->mockery_verify();
+ }
+
+ public function testResourceConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('resource'))->once();
+ $r = fopen(dirname(__FILE__) . '/_files/file.txt', 'r');
+ $this->mock->foo($r);
+ $this->container->mockery_verify();
+ }
+
+ public function testResourceConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('resource'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testResourceConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('resource'))->once();
+ $this->mock->foo('f');
+ $this->container->mockery_verify();
+ }
+
+ public function testScalarConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('scalar'))->once();
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ public function testScalarConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('scalar'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testScalarConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('scalar'))->once();
+ $this->mock->foo(array());
+ $this->container->mockery_verify();
+ }
+
+ public function testStringConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('string'))->once();
+ $this->mock->foo('2');
+ $this->container->mockery_verify();
+ }
+
+ public function testStringConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('string'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testStringConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('string'))->once();
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+ public function testClassConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('stdClass'))->once();
+ $this->mock->foo(new stdClass);
+ $this->container->mockery_verify();
+ }
+
+ public function testClassConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('stdClass'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testClassConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('stdClass'))->once();
+ $this->mock->foo(new Exception);
+ $this->container->mockery_verify();
+ }
+
+ public function testDucktypeConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::ducktype('quack', 'swim'))->once();
+ $this->mock->foo(new Mockery_Duck);
+ $this->container->mockery_verify();
+ }
+
+ public function testDucktypeConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::ducktype('quack', 'swim'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testDucktypeConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::ducktype('quack', 'swim'))->once();
+ $this->mock->foo(new Mockery_Duck_Nonswimmer);
+ $this->container->mockery_verify();
+ }
+
+ public function testArrayContentConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::subset(array('a'=>1,'b'=>2)))->once();
+ $this->mock->foo(array('a'=>1,'b'=>2,'c'=>3));
+ $this->container->mockery_verify();
+ }
+
+ public function testArrayContentConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::subset(array('a'=>1,'b'=>2)))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testArrayContentConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::subset(array('a'=>1,'b'=>2)))->once();
+ $this->mock->foo(array('a'=>1,'c'=>3));
+ $this->container->mockery_verify();
+ }
+
+ public function testContainsConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::contains(1, 2))->once();
+ $this->mock->foo(array('a'=>1,'b'=>2,'c'=>3));
+ $this->container->mockery_verify();
+ }
+
+ public function testContainsConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::contains(1, 2))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testContainsConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::contains(1, 2))->once();
+ $this->mock->foo(array('a'=>1,'c'=>3));
+ $this->container->mockery_verify();
+ }
+
+ public function testHasKeyConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::hasKey('c'))->once();
+ $this->mock->foo(array('a'=>1,'b'=>2,'c'=>3));
+ $this->container->mockery_verify();
+ }
+
+ public function testHasKeyConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::hasKey('a'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, array('a'=>1), 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testHasKeyConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::hasKey('c'))->once();
+ $this->mock->foo(array('a'=>1,'b'=>3));
+ $this->container->mockery_verify();
+ }
+
+ public function testHasValueConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::hasValue(1))->once();
+ $this->mock->foo(array('a'=>1,'b'=>2,'c'=>3));
+ $this->container->mockery_verify();
+ }
+
+ public function testHasValueConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::hasValue(1))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, array('a'=>1), 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testHasValueConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::hasValue(2))->once();
+ $this->mock->foo(array('a'=>1,'b'=>3));
+ $this->container->mockery_verify();
+ }
+
+ public function testOnConstraintMatchesArgument_ClosureEvaluatesToTrue()
+ {
+ $function = function ($arg) {return $arg % 2 == 0;};
+ $this->mock->shouldReceive('foo')->with(Mockery::on($function))->once();
+ $this->mock->foo(4);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testOnConstraintThrowsExceptionWhenConstraintUnmatched_ClosureEvaluatesToFalse()
+ {
+ $function = function ($arg) {return $arg % 2 == 0;};
+ $this->mock->shouldReceive('foo')->with(Mockery::on($function))->once();
+ $this->mock->foo(5);
+ $this->container->mockery_verify();
+ }
+
+ public function testMustBeConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::mustBe(2))->once();
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ public function testMustBeConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::mustBe(2))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testMustBeConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::mustBe(2))->once();
+ $this->mock->foo('2');
+ $this->container->mockery_verify();
+ }
+
+ public function testMustBeConstraintMatchesObjectArgumentWithEqualsComparisonNotIdentical()
+ {
+ $a = new stdClass; $a->foo = 1;
+ $b = new stdClass; $b->foo = 1;
+ $this->mock->shouldReceive('foo')->with(Mockery::mustBe($a))->once();
+ $this->mock->foo($b);
+ $this->container->mockery_verify();
+ }
+
+ public function testMustBeConstraintNonMatchingCaseWithObject()
+ {
+ $a = new stdClass; $a->foo = 1;
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::mustBe($a))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, $a, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testMustBeConstraintThrowsExceptionWhenConstraintUnmatchedWithObject()
+ {
+ $a = new stdClass; $a->foo = 1;
+ $b = new stdClass; $b->foo = 2;
+ $this->mock->shouldReceive('foo')->with(Mockery::mustBe($a))->once();
+ $this->mock->foo($b);
+ $this->container->mockery_verify();
+ }
+
+ public function testMatchPrecedenceBasedOnExpectedCallsFavouringExplicitMatch()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->once();
+ $this->mock->shouldReceive('foo')->with(Mockery::any())->never();
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+ public function testMatchPrecedenceBasedOnExpectedCallsFavouringAnyMatch()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::any())->once();
+ $this->mock->shouldReceive('foo')->with(1)->never();
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+ public function testReturnNullIfIgnoreMissingMethodsSet()
+ {
+ $this->mock->shouldIgnoreMissing();
+ $this->assertNull($this->mock->g(1,2));
+ }
+
+ public function testReturnUndefinedIfIgnoreMissingMethodsSet()
+ {
+ $this->mock->shouldIgnoreMissing()->asUndefined();
+ $this->assertTrue($this->mock->g(1,2) instanceof \Mockery\Undefined);
+ }
+
+ public function testReturnAsUndefinedAllowsForInfiniteSelfReturningChain()
+ {
+ $this->mock->shouldIgnoreMissing()->asUndefined();
+ $this->assertTrue($this->mock->g(1,2)->a()->b()->c() instanceof \Mockery\Undefined);
+ }
+
+ public function testShouldIgnoreMissingFluentInterface()
+ {
+ $this->assertTrue($this->mock->shouldIgnoreMissing() instanceof \Mockery\MockInterface);
+ }
+
+ public function testShouldIgnoreMissingAsUndefinedFluentInterface()
+ {
+ $this->assertTrue($this->mock->shouldIgnoreMissing()->asUndefined() instanceof \Mockery\MockInterface);
+ }
+
+ public function testShouldIgnoreMissingAsDefinedProxiesToUndefinedAllowingToString()
+ {
+ $this->mock->shouldIgnoreMissing()->asUndefined();
+ $string = "Method call: {$this->mock->g()}";
+ $string = "Mock: {$this->mock}";
+ }
+
+ public function testShouldIgnoreMissingDefaultReturnValue()
+ {
+ $this->mock->shouldIgnoreMissing(1);
+ $this->assertEquals(1,$this->mock->a());
+ }
+
+ /** @issue #253 */
+ public function testShouldIgnoreMissingDefaultSelfAndReturnsSelf()
+ {
+ $this->mock->shouldIgnoreMissing($this->container->self());
+ $this->assertSame($this->mock, $this->mock->a()->b());
+ }
+
+ public function testToStringMagicMethodCanBeMocked()
+ {
+ $this->mock->shouldReceive("__toString")->andReturn('dave');
+ $this->assertEquals("{$this->mock}", "dave");
+ }
+
+ public function testOptionalMockRetrieval()
+ {
+ $m = $this->container->mock('f')->shouldReceive('foo')->with(1)->andReturn(3)->mock();
+ $this->assertTrue($m instanceof \Mockery\MockInterface);
+ }
+
+ public function testNotConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::not(1))->once();
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ public function testNotConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::not(2))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testNotConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::not(2))->once();
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ public function testAnyOfConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::anyOf(1, 2))->twice();
+ $this->mock->foo(2);
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+ public function testAnyOfConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::anyOf(1, 2))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testAnyOfConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::anyOf(1, 2))->once();
+ $this->mock->foo(3);
+ $this->container->mockery_verify();
+ }
+
+ public function testNotAnyOfConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::notAnyOf(1, 2))->once();
+ $this->mock->foo(3);
+ $this->container->mockery_verify();
+ }
+
+ public function testNotAnyOfConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::notAnyOf(1, 2))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 4, 3);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testNotAnyOfConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::notAnyOf(1, 2))->once();
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testGlobalConfigMayForbidMockingNonExistentMethodsOnClasses()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $mock = $this->container->mock('stdClass');
+ $mock->shouldReceive('foo');
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ * @expectedExceptionMessage Mockery's configuration currently forbids mocking
+ */
+ public function testGlobalConfigMayForbidMockingNonExistentMethodsOnAutoDeclaredClasses()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $mock = $this->container->mock('SomeMadeUpClass');
+ $mock->shouldReceive('foo');
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testGlobalConfigMayForbidMockingNonExistentMethodsOnObjects()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $mock = $this->container->mock(new stdClass);
+ $mock->shouldReceive('foo');
+ }
+
+ public function testAnExampleWithSomeExpectationAmends()
+ {
+ $service = $this->container->mock('MyService');
+ $service->shouldReceive('login')->with('user', 'pass')->once()->andReturn(true);
+ $service->shouldReceive('hasBookmarksTagged')->with('php')->once()->andReturn(false);
+ $service->shouldReceive('addBookmark')->with('/^http:/', \Mockery::type('string'))->times(3)->andReturn(true);
+ $service->shouldReceive('hasBookmarksTagged')->with('php')->once()->andReturn(true);
+
+ $this->assertTrue($service->login('user', 'pass'));
+ $this->assertFalse($service->hasBookmarksTagged('php'));
+ $this->assertTrue($service->addBookmark('http://example.com/1', 'some_tag1'));
+ $this->assertTrue($service->addBookmark('http://example.com/2', 'some_tag2'));
+ $this->assertTrue($service->addBookmark('http://example.com/3', 'some_tag3'));
+ $this->assertTrue($service->hasBookmarksTagged('php'));
+
+ $this->container->mockery_verify();
+ }
+
+ public function testAnExampleWithSomeExpectationAmendsOnCallCounts()
+ {
+ $service = $this->container->mock('MyService');
+ $service->shouldReceive('login')->with('user', 'pass')->once()->andReturn(true);
+ $service->shouldReceive('hasBookmarksTagged')->with('php')->once()->andReturn(false);
+ $service->shouldReceive('addBookmark')->with('/^http:/', \Mockery::type('string'))->times(3)->andReturn(true);
+ $service->shouldReceive('hasBookmarksTagged')->with('php')->twice()->andReturn(true);
+
+ $this->assertTrue($service->login('user', 'pass'));
+ $this->assertFalse($service->hasBookmarksTagged('php'));
+ $this->assertTrue($service->addBookmark('http://example.com/1', 'some_tag1'));
+ $this->assertTrue($service->addBookmark('http://example.com/2', 'some_tag2'));
+ $this->assertTrue($service->addBookmark('http://example.com/3', 'some_tag3'));
+ $this->assertTrue($service->hasBookmarksTagged('php'));
+ $this->assertTrue($service->hasBookmarksTagged('php'));
+
+ $this->container->mockery_verify();
+ }
+
+ public function testAnExampleWithSomeExpectationAmendsOnCallCounts_PHPUnitTest()
+ {
+ $service = $this->getMock('MyService2');
+ $service->expects($this->once())->method('login')->with('user', 'pass')->will($this->returnValue(true));
+ $service->expects($this->exactly(3))->method('hasBookmarksTagged')->with('php')
+ ->will($this->onConsecutiveCalls(false, true, true));
+ $service->expects($this->exactly(3))->method('addBookmark')
+ ->with($this->matchesRegularExpression('/^http:/'), $this->isType('string'))
+ ->will($this->returnValue(true));
+
+ $this->assertTrue($service->login('user', 'pass'));
+ $this->assertFalse($service->hasBookmarksTagged('php'));
+ $this->assertTrue($service->addBookmark('http://example.com/1', 'some_tag1'));
+ $this->assertTrue($service->addBookmark('http://example.com/2', 'some_tag2'));
+ $this->assertTrue($service->addBookmark('http://example.com/3', 'some_tag3'));
+ $this->assertTrue($service->hasBookmarksTagged('php'));
+ $this->assertTrue($service->hasBookmarksTagged('php'));
+ }
+
+ public function testMockedMethodsCallableFromWithinOriginalClass()
+ {
+ $mock = $this->container->mock('MockeryTest_InterMethod1[doThird]');
+ $mock->shouldReceive('doThird')->andReturn(true);
+ $this->assertTrue($mock->doFirst());
+ }
+
+ /**
+ * @group issue #20
+ */
+ public function testMockingDemeterChainsPassesMockeryExpectationToCompositeExpectation()
+ {
+ $mock = $this->container->mock('Mockery_Demeterowski');
+ $mock->shouldReceive('foo->bar->baz')->andReturn('Spam!');
+ $demeter = new Mockery_UseDemeter($mock);
+ $this->assertSame('Spam!', $demeter->doit());
+ }
+
+ /**
+ * @group issue #20 - with args in demeter chain
+ */
+ public function testMockingDemeterChainsPassesMockeryExpectationToCompositeExpectationWithArgs()
+ {
+ $mock = $this->container->mock('Mockery_Demeterowski');
+ $mock->shouldReceive('foo->bar->baz')->andReturn('Spam!');
+ $demeter = new Mockery_UseDemeter($mock);
+ $this->assertSame('Spam!', $demeter->doitWithArgs());
+ }
+
+ public function testPassthruEnsuresRealMethodCalledForReturnValues()
+ {
+ $mock = $this->container->mock('MockeryTest_SubjectCall1');
+ $mock->shouldReceive('foo')->once()->passthru();
+ $this->assertEquals('bar', $mock->foo());
+ $this->container->mockery_verify();
+ }
+
+ public function testShouldIgnoreMissingExpectationBasedOnArgs()
+ {
+ $mock = $this->container->mock("MyService2")->shouldIgnoreMissing();
+ $mock->shouldReceive("hasBookmarksTagged")->with("dave")->once();
+ $mock->hasBookmarksTagged("dave");
+ $mock->hasBookmarksTagged("padraic");
+ $this->container->mockery_verify();
+ }
+
+ public function testShouldDeferMissingExpectationBasedOnArgs()
+ {
+ $mock = $this->container->mock("MockeryTest_SubjectCall1")->shouldDeferMissing();
+
+ $this->assertEquals('bar', $mock->foo());
+ $this->assertEquals('bar', $mock->foo("baz"));
+ $this->assertEquals('bar', $mock->foo("qux"));
+
+ $mock->shouldReceive("foo")->with("baz")->twice()->andReturn('123');
+ $this->assertEquals('bar', $mock->foo());
+ $this->assertEquals('123', $mock->foo("baz"));
+ $this->assertEquals('bar', $mock->foo("qux"));
+
+ $mock->shouldReceive("foo")->withNoArgs()->once()->andReturn('456');
+ $this->assertEquals('456', $mock->foo());
+ $this->assertEquals('123', $mock->foo("baz"));
+ $this->assertEquals('bar', $mock->foo("qux"));
+
+ $this->container->mockery_verify();
+ }
+
+ public function testCanReturnSelf()
+ {
+ $this->mock->shouldReceive("foo")->andReturnSelf();
+ $this->assertSame($this->mock, $this->mock->foo());
+ }
+}
+
+class MockeryTest_SubjectCall1
+{
+ public function foo() {return 'bar';}
+}
+
+class MockeryTest_InterMethod1
+{
+ public function doFirst()
+ {
+ return $this->doSecond();
+ }
+
+ private function doSecond()
+ {
+ return $this->doThird();
+ }
+
+ public function doThird()
+ {
+ return false;
+ }
+}
+
+class MyService2
+{
+ public function login($user, $pass) {}
+ public function hasBookmarksTagged($tag) {}
+ public function addBookmark($uri, $tag) {}
+}
+
+class Mockery_Duck
+{
+ public function quack() {}
+ public function swim() {}
+}
+
+class Mockery_Duck_Nonswimmer
+{
+ public function quack() {}
+}
+
+class Mockery_Demeterowski
+{
+ public function foo()
+ {
+ return $this;
+ }
+ public function bar()
+ {
+ return $this;
+ }
+ public function baz()
+ {
+ return 'Ham!';
+ }
+}
+
+class Mockery_UseDemeter
+{
+ public function __construct($demeter)
+ {
+ $this->demeter = $demeter;
+ }
+ public function doit()
+ {
+ return $this->demeter->foo()->bar()->baz();
+ }
+ public function doitWithArgs()
+ {
+ return $this->demeter->foo("foo")->bar("bar")->baz("baz");
+ }
+}
+
+class MockeryTest_Foo
+{
+ public function foo() {}
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/DefinedTargetClassTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/DefinedTargetClassTest.php
new file mode 100644
index 0000000..3c32dfb
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/DefinedTargetClassTest.php
@@ -0,0 +1,23 @@
+assertTrue($target->hasInternalAncestor());
+
+ $target = new DefinedTargetClass(new \ReflectionClass("Mockery\MockeryTest_ClassThatExtendsArrayObject"));
+ $this->assertTrue($target->hasInternalAncestor());
+
+ $target = new DefinedTargetClass(new \ReflectionClass("Mockery\DefinedTargetClassTest"));
+ $this->assertFalse($target->hasInternalAncestor());
+ }
+}
+
+class MockeryTest_ClassThatExtendsArrayObject extends \ArrayObject {}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/MockConfigurationTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/MockConfigurationTest.php
new file mode 100644
index 0000000..952809c
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/MockConfigurationTest.php
@@ -0,0 +1,179 @@
+getMethodsToMock();
+ $this->assertEquals(1, count($methods));
+ $this->assertEquals("bar", $methods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function blackListsAreCaseInsensitive()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array("FOO"));
+
+ $methods = $config->getMethodsToMock();
+ $this->assertEquals(1, count($methods));
+ $this->assertEquals("bar", $methods[0]->getName());
+ }
+
+
+ /**
+ * @test
+ */
+ public function onlyWhiteListedMethodsShouldBeInListToBeMocked()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array(), array('foo'));
+
+ $methods = $config->getMethodsToMock();
+ $this->assertEquals(1, count($methods));
+ $this->assertEquals("foo", $methods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function whitelistOverRulesBlackList()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array("foo"), array("foo"));
+
+ $methods = $config->getMethodsToMock();
+ $this->assertEquals(1, count($methods));
+ $this->assertEquals("foo", $methods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function whiteListsAreCaseInsensitive()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array(), array("FOO"));
+
+ $methods = $config->getMethodsToMock();
+ $this->assertEquals(1, count($methods));
+ $this->assertEquals("foo", $methods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function finalMethodsAreExcluded()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\\ClassWithFinalMethod"));
+
+ $methods = $config->getMethodsToMock();
+ $this->assertEquals(1, count($methods));
+ $this->assertEquals("bar", $methods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function shouldIncludeMethodsFromAllTargets()
+ {
+ $config = new MockConfiguration(array("Mockery\\Generator\\TestInterface", "Mockery\\Generator\\TestInterface2"));
+ $methods = $config->getMethodsToMock();
+ $this->assertEquals(2, count($methods));
+ }
+
+ /**
+ * @test
+ * @expectedException Mockery\Exception
+ */
+ public function shouldThrowIfTargetClassIsFinal()
+ {
+ $config = new MockConfiguration(array("Mockery\\Generator\\TestFinal"));
+ $config->getTargetClass();
+ }
+
+ /**
+ * @test
+ */
+ public function shouldTargetIteratorAggregateIfTryingToMockTraversable()
+ {
+ $config = new MockConfiguration(array("\\Traversable"));
+
+ $interfaces = $config->getTargetInterfaces();
+ $this->assertEquals(1, count($interfaces));
+ $first = array_shift($interfaces);
+ $this->assertEquals("IteratorAggregate", $first->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function shouldTargetIteratorAggregateIfTraversableInTargetsTree()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\TestTraversableInterface"));
+
+ $interfaces = $config->getTargetInterfaces();
+ $this->assertEquals(2, count($interfaces));
+ $this->assertEquals("IteratorAggregate", $interfaces[0]->getName());
+ $this->assertEquals("Mockery\Generator\TestTraversableInterface", $interfaces[1]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function shouldBringIteratorToHeadOfTargetListIfTraversablePresent()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\TestTraversableInterface2"));
+
+ $interfaces = $config->getTargetInterfaces();
+ $this->assertEquals(2, count($interfaces));
+ $this->assertEquals("Iterator", $interfaces[0]->getName());
+ $this->assertEquals("Mockery\Generator\TestTraversableInterface2", $interfaces[1]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function shouldBringIteratorAggregateToHeadOfTargetListIfTraversablePresent()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\TestTraversableInterface3"));
+
+ $interfaces = $config->getTargetInterfaces();
+ $this->assertEquals(2, count($interfaces));
+ $this->assertEquals("IteratorAggregate", $interfaces[0]->getName());
+ $this->assertEquals("Mockery\Generator\TestTraversableInterface3", $interfaces[1]->getName());
+ }
+}
+
+interface TestTraversableInterface extends \Traversable {}
+interface TestTraversableInterface2 extends \Traversable, \Iterator {}
+interface TestTraversableInterface3 extends \Traversable, \IteratorAggregate {}
+
+final class TestFinal {}
+
+interface TestInterface
+{
+ public function foo();
+}
+
+interface TestInterface2
+{
+ public function bar();
+}
+
+class TestSubject
+{
+ public function foo() {}
+ public function bar() {}
+}
+
+class ClassWithFinalMethod
+{
+ final public function foo() {}
+ public function bar() {}
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/CallTypeHintPassTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/CallTypeHintPassTest.php
new file mode 100644
index 0000000..a8bb155
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/CallTypeHintPassTest.php
@@ -0,0 +1,39 @@
+ true,
+ ))->shouldDeferMissing();
+ $code = $pass->apply(static::CODE, $config);
+ $this->assertContains('__call($method, $args)', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function shouldRemoveCallStaticTypeHintIfRequired()
+ {
+ $pass = new CallTypeHintPass;
+ $config = m::mock("Mockery\Generator\MockConfiguration", array(
+ "requiresCallStaticTypeHintRemoval" => true,
+ ))->shouldDeferMissing();
+ $code = $pass->apply(static::CODE, $config);
+ $this->assertContains('__callStatic($method, $args)', $code);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/ClassNamePassTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/ClassNamePassTest.php
new file mode 100644
index 0000000..a0be5a8
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/ClassNamePassTest.php
@@ -0,0 +1,48 @@
+pass = new ClassNamePass();
+ }
+
+ /**
+ * @test
+ */
+ public function shouldRemoveNamespaceDefinition()
+ {
+ $config = new MockConfiguration(array(), array(), array(), "Dave\Dave");
+ $code = $this->pass->apply(static::CODE, $config);
+ $this->assertNotContains('namespace Mockery;', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function shouldReplaceNamespaceIfClassNameIsNamespaced()
+ {
+ $config = new MockConfiguration(array(), array(), array(), "Dave\Dave");
+ $code = $this->pass->apply(static::CODE, $config);
+ $this->assertNotContains('namespace Mockery;', $code);
+ $this->assertContains('namespace Dave;', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function shouldReplaceClassNameWithSpecifiedName()
+ {
+ $config = new MockConfiguration(array(), array(), array(), "Dave");
+ $code = $this->pass->apply(static::CODE, $config);
+ $this->assertContains('class Dave', $code);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InstanceMockPassTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InstanceMockPassTest.php
new file mode 100644
index 0000000..23493de
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InstanceMockPassTest.php
@@ -0,0 +1,24 @@
+setInstanceMock(true);
+ $config = $builder->getMockConfiguration();
+ $pass = new InstanceMockPass;
+ $code = $pass->apply('class Dave { }', $config);
+ $this->assertContains('public function __construct', $code);
+ $this->assertContains('protected $_mockery_ignoreVerification', $code);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InterfacePassTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InterfacePassTest.php
new file mode 100644
index 0000000..9f1dc8b
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InterfacePassTest.php
@@ -0,0 +1,47 @@
+ array(),
+ ));
+
+ $code = $pass->apply(static::CODE, $config);
+ $this->assertEquals(static::CODE, $code);
+ }
+
+ /**
+ * @test
+ */
+ public function shouldAddAnyInterfaceNamesToImplementsDefinition()
+ {
+ $pass = new InterfacePass;
+
+ $config = m::mock("Mockery\Generator\MockConfiguration", array(
+ "getTargetInterfaces" => array(
+ m::mock(array("getName" => "Dave\Dave")),
+ m::mock(array("getName" => "Paddy\Paddy")),
+ ),
+ ));
+
+ $code = $pass->apply(static::CODE, $config);
+
+ $this->assertContains("implements MockInterface, \Dave\Dave, \Paddy\Paddy", $code);
+ }
+
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/HamcrestExpectationTest.php b/vendor/mockery/mockery/tests/Mockery/HamcrestExpectationTest.php
new file mode 100644
index 0000000..24a95bb
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/HamcrestExpectationTest.php
@@ -0,0 +1,64 @@
+container = new \Mockery\Container(\Mockery::getDefaultGenerator(), \Mockery::getDefaultLoader());
+ $this->mock = $this->container->mock('foo');
+ }
+
+
+ public function tearDown()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(true);
+ $this->container->mockery_close();
+ }
+
+ /** Just a quickie roundup of a few Hamcrest matchers to check nothing obvious out of place **/
+
+ public function testAnythingConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(anything())->once();
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ public function testGreaterThanConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(greaterThan(1))->once();
+ $this->mock->foo(2);
+ $this->container->mockery_verify();
+ }
+
+ /**
+ * @expectedException Mockery\Exception
+ */
+ public function testGreaterThanConstraintNotMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(greaterThan(1))->once();
+ $this->mock->foo(1);
+ $this->container->mockery_verify();
+ }
+
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Loader/EvalLoaderTest.php b/vendor/mockery/mockery/tests/Mockery/Loader/EvalLoaderTest.php
new file mode 100644
index 0000000..6081df4
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Loader/EvalLoaderTest.php
@@ -0,0 +1,16 @@
+getLoader()->load($definition);
+
+ $this->assertTrue(class_exists($className));
+ }
+
+ abstract public function getLoader();
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Loader/RequireLoaderTest.php b/vendor/mockery/mockery/tests/Mockery/Loader/RequireLoaderTest.php
new file mode 100644
index 0000000..1d32abb
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Loader/RequireLoaderTest.php
@@ -0,0 +1,16 @@
+register();
+ $expected = array($loader, 'loadClass');
+ $this->assertTrue(in_array($expected, spl_autoload_functions()));
+ }
+
+ public function tearDown()
+ {
+ spl_autoload_unregister('\Mockery\Loader::loadClass');
+ $loader = new \Mockery\Loader;
+ $loader->register();
+ }
+
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockClassWithFinalWakeupTest.php b/vendor/mockery/mockery/tests/Mockery/MockClassWithFinalWakeupTest.php
new file mode 100644
index 0000000..b405c85
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockClassWithFinalWakeupTest.php
@@ -0,0 +1,95 @@
+
+ * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License
+ */
+
+namespace test\Mockery;
+
+use \PHPUnit_Framework_TestCase as TestCase;
+
+class MockClassWithFinalWakeupTest extends TestCase
+{
+
+ protected function setUp()
+ {
+ $this->container = new \Mockery\Container;
+ }
+
+ protected function tearDown()
+ {
+ $this->container->mockery_close();
+ }
+
+ /**
+ * @test
+ *
+ * Test that we are able to create partial mocks of classes that have
+ * a __wakeup method marked as final. As long as __wakeup is not one of the
+ * mocked methods.
+ */
+ public function testCreateMockForClassWithFinalWakeup()
+ {
+ $mock = $this->container->mock("test\Mockery\TestWithFinalWakeup");
+ $this->assertInstanceOf("test\Mockery\TestWithFinalWakeup", $mock);
+ $this->assertEquals('test\Mockery\TestWithFinalWakeup::__wakeup', $mock->__wakeup());
+
+ $mock = $this->container->mock('test\Mockery\SubclassWithFinalWakeup');
+ $this->assertInstanceOf('test\Mockery\SubclassWithFinalWakeup', $mock);
+ $this->assertEquals('test\Mockery\TestWithFinalWakeup::__wakeup', $mock->__wakeup());
+ }
+
+ public function testCreateMockForClassWithNonFinalWakeup()
+ {
+ $mock = $this->container->mock('test\Mockery\TestWithNonFinalWakeup');
+ $this->assertInstanceOf('test\Mockery\TestWithNonFinalWakeup', $mock);
+
+ // Make sure __wakeup is overridden and doesn't return anything.
+ $this->assertNull($mock->__wakeup());
+ }
+
+}
+
+class TestWithFinalWakeup
+{
+
+ public function foo()
+ {
+ return 'foo';
+ }
+
+ public function bar()
+ {
+ return 'bar';
+ }
+
+ final public function __wakeup()
+ {
+ return __METHOD__;
+ }
+}
+
+class SubclassWithFinalWakeup extends TestWithFinalWakeup {}
+
+class TestWithNonFinalWakeup
+{
+ public function __wakeup()
+ {
+ return __METHOD__;
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockClassWithUnknownTypeHintTest.php b/vendor/mockery/mockery/tests/Mockery/MockClassWithUnknownTypeHintTest.php
new file mode 100644
index 0000000..695aed7
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockClassWithUnknownTypeHintTest.php
@@ -0,0 +1,45 @@
+container = new \Mockery\Container;
+ }
+
+ protected function tearDown()
+ {
+ $this->container->mockery_close();
+ }
+
+ /** @test */
+ public function itShouldSuccessfullyBuildTheMock()
+ {
+ $this->container->mock("test\Mockery\HasUnknownClassAsTypeHintOnMethod");
+ }
+
+}
+
+class HasUnknownClassAsTypeHintOnMethod
+{
+ public function foo(\UnknownTestClass\Bar $bar)
+ {
+
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockTest.php b/vendor/mockery/mockery/tests/Mockery/MockTest.php
new file mode 100644
index 0000000..d1d1b63
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockTest.php
@@ -0,0 +1,105 @@
+container = new \Mockery\Container(\Mockery::getDefaultGenerator(), \Mockery::getDefaultLoader());
+ }
+
+ public function teardown()
+ {
+ $this->container->mockery_close();
+ }
+
+ public function testAnonymousMockWorksWithNotAllowingMockingOfNonExistantMethods()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $m = $this->container->mock();
+ $m->shouldReceive("test123")->andReturn(true);
+ assertThat($m->test123(), equalTo(true));
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(true);
+ }
+
+ public function testMockWithNotAllowingMockingOfNonExistentMethodsCanBeGivenAdditionalMethodsToMockEvenIfTheyDontExistOnClass()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $m = $this->container->mock('ExampleClassForTestingNonExistentMethod');
+ $m->shouldAllowMockingMethod('testSomeNonExistentMethod');
+ $m->shouldReceive("testSomeNonExistentMethod")->andReturn(true);
+ assertThat($m->testSomeNonExistentMethod(), equalTo(true));
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(true);
+ }
+
+ public function testShouldAllowMockingMethodReturnsMockInstance()
+ {
+ $m = Mockery::mock('someClass');
+ $this->assertInstanceOf('Mockery\MockInterface', $m->shouldAllowMockingMethod('testFunction'));
+ }
+
+ public function testShouldAllowMockingProtectedMethodReturnsMockInstance()
+ {
+ $m = Mockery::mock('someClass');
+ $this->assertInstanceOf('Mockery\MockInterface', $m->shouldAllowMockingProtectedMethods('testFunction'));
+ }
+
+ public function testMockAddsToString()
+ {
+ $mock = $this->container->mock('ClassWithNoToString');
+ assertThat(hasToString($mock));
+ }
+
+ public function testMockToStringMayBeDeferred()
+ {
+ $mock = $this->container->mock('ClassWithToString')->shouldDeferMissing();
+ assertThat((string)$mock, equalTo("foo"));
+ }
+
+ public function testMockToStringShouldIgnoreMissingAlwaysReturnsString()
+ {
+ $mock = $this->container->mock('ClassWithNoToString')->shouldIgnoreMissing();
+ assertThat(isNonEmptyString((string)$mock));
+
+ $mock->asUndefined();
+ assertThat(isNonEmptyString((string)$mock));
+ }
+}
+
+
+class ExampleClassForTestingNonExistentMethod
+{
+}
+
+class ClassWithToString
+{
+ public function __toString()
+ {
+ return 'foo';
+ }
+}
+
+class ClassWithNoToString
+{
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockeryCanMockMultipleInterfacesWhichOverlapTest.php b/vendor/mockery/mockery/tests/Mockery/MockeryCanMockMultipleInterfacesWhichOverlapTest.php
new file mode 100644
index 0000000..931d0e2
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockeryCanMockMultipleInterfacesWhichOverlapTest.php
@@ -0,0 +1,66 @@
+mock('Mockery\Tests\Evenement_EventEmitter', 'Mockery\Tests\Chatroulette_ConnectionInterface');
+ }
+}
+
+interface Evenement_EventEmitterInterface
+{
+ public function on($name, $callback);
+}
+
+class Evenement_EventEmitter implements Evenement_EventEmitterInterface
+{
+ public function on($name, $callback)
+ {
+ }
+}
+
+interface React_StreamInterface extends Evenement_EventEmitterInterface
+{
+ public function close();
+}
+
+interface React_ReadableStreamInterface extends React_StreamInterface
+{
+ public function pause();
+}
+
+interface React_WritableStreamInterface extends React_StreamInterface
+{
+ public function write($data);
+}
+
+interface Chatroulette_ConnectionInterface
+ extends React_ReadableStreamInterface,
+ React_WritableStreamInterface
+{
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockingProtectedMethodsTest.php b/vendor/mockery/mockery/tests/Mockery/MockingProtectedMethodsTest.php
new file mode 100644
index 0000000..f673232
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockingProtectedMethodsTest.php
@@ -0,0 +1,120 @@
+container = new \Mockery\Container;
+ }
+
+ public function teardown()
+ {
+ $this->container->mockery_close();
+ }
+
+ /**
+ * @test
+ *
+ * This is a regression test, basically we don't want the mock handling
+ * interfering with calling protected methods partials
+ */
+ public function shouldAutomaticallyDeferCallsToProtectedMethodsForPartials()
+ {
+ $mock = $this->container->mock("test\Mockery\TestWithProtectedMethods[foo]");
+ $this->assertEquals("bar", $mock->bar());
+ }
+
+ /**
+ * @test
+ *
+ * This is a regression test, basically we don't want the mock handling
+ * interfering with calling protected methods partials
+ */
+ public function shouldAutomaticallyDeferCallsToProtectedMethodsForRuntimePartials()
+ {
+ $mock = $this->container->mock("test\Mockery\TestWithProtectedMethods")->shouldDeferMissing();
+ $this->assertEquals("bar", $mock->bar());
+ }
+
+ /** @test */
+ public function shouldAutomaticallyIgnoreAbstractProtectedMethods()
+ {
+ $mock = $this->container->mock("test\Mockery\TestWithProtectedMethods")->shouldDeferMissing();
+ $this->assertEquals(null, $mock->foo());
+ }
+
+ /** @test */
+ public function shouldAllowMockingProtectedMethods()
+ {
+ $mock = $this->container->mock("test\Mockery\TestWithProtectedMethods")
+ ->shouldDeferMissing()
+ ->shouldAllowMockingProtectedMethods();
+
+ $mock->shouldReceive("protectedBar")->andReturn("notbar");
+ $this->assertEquals("notbar", $mock->bar());
+ }
+
+ /** @test */
+ public function shouldAllowMockingProtectedMethodOnDefinitionTimePartial()
+ {
+ $mock = $this->container->mock("test\Mockery\TestWithProtectedMethods[protectedBar]")
+ ->shouldAllowMockingProtectedMethods();
+
+ $mock->shouldReceive("protectedBar")->andReturn("notbar");
+ $this->assertEquals("notbar", $mock->bar());
+ }
+
+ /** @test */
+ public function shouldAllowMockingAbstractProtectedMethods()
+ {
+ $mock = $this->container->mock("test\Mockery\TestWithProtectedMethods")
+ ->shouldDeferMissing()
+ ->shouldAllowMockingProtectedMethods();
+
+ $mock->shouldReceive("abstractProtected")->andReturn("abstractProtected");
+ $this->assertEquals("abstractProtected", $mock->foo());
+ }
+}
+
+
+abstract class TestWithProtectedMethods
+{
+ public function foo()
+ {
+ return $this->abstractProtected();
+ }
+
+ abstract protected function abstractProtected();
+
+ public function bar()
+ {
+ return $this->protectedBar();
+ }
+
+ protected function protectedBar()
+ {
+ return 'bar';
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/NamedMockTest.php b/vendor/mockery/mockery/tests/Mockery/NamedMockTest.php
new file mode 100644
index 0000000..4c40a5d
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/NamedMockTest.php
@@ -0,0 +1,52 @@
+assertEquals("Mockery\Dave123", get_class($mock));
+ }
+
+ /** @test */
+ public function itCreatesPassesFurtherArgumentsJustLikeMock()
+ {
+ $mock = Mockery::namedMock("Mockery\Dave456", "DateTime", array(
+ "getDave" => "dave"
+ ));
+
+ $this->assertInstanceOf("DateTime", $mock);
+ $this->assertEquals("dave", $mock->getDave());
+ }
+
+ /**
+ * @test
+ * @expectedException Mockery\Exception
+ * @expectedExceptionMessage The mock named 'Mockery\Dave7' has been already defined with a different mock configuration
+ */
+ public function itShouldThrowIfAttemptingToRedefineNamedMock()
+ {
+ $mock = Mockery::namedMock("Mockery\Dave7");
+ $mock = Mockery::namedMock("Mockery\Dave7", "DateTime");
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/RecorderTest.php b/vendor/mockery/mockery/tests/Mockery/RecorderTest.php
new file mode 100644
index 0000000..705512a
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/RecorderTest.php
@@ -0,0 +1,190 @@
+container = new \Mockery\Container(\Mockery::getDefaultGenerator(), \Mockery::getDefaultLoader());
+ }
+
+ public function teardown()
+ {
+ $this->container->mockery_close();
+ }
+
+ public function testRecorderWithSimpleObject()
+ {
+ $mock = $this->container->mock(new MockeryTestSubject);
+ $mock->shouldExpect(function ($subject) {
+ $user = new MockeryTestSubjectUser($subject);
+ $user->doFoo();
+ });
+
+ $this->assertEquals(1, $mock->foo());
+ $mock->mockery_verify();
+ }
+
+ public function testArgumentsArePassedAsMethodExpectations()
+ {
+ $mock = $this->container->mock(new MockeryTestSubject);
+ $mock->shouldExpect(function ($subject) {
+ $user = new MockeryTestSubjectUser($subject);
+ $user->doBar();
+ });
+
+ $this->assertEquals(4, $mock->bar(2));
+ $mock->mockery_verify();
+ }
+
+ public function testArgumentsLooselyMatchedByDefault()
+ {
+ $mock = $this->container->mock(new MockeryTestSubject);
+ $mock->shouldExpect(function ($subject) {
+ $user = new MockeryTestSubjectUser($subject);
+ $user->doBar();
+ });
+
+ $this->assertEquals(4, $mock->bar('2'));
+ $mock->mockery_verify();
+ }
+
+ public function testMultipleMethodExpectations()
+ {
+ $mock = $this->container->mock(new MockeryTestSubject);
+ $mock->shouldExpect(function ($subject) {
+ $user = new MockeryTestSubjectUser($subject);
+ $user->doFoo();
+ $user->doBar();
+ });
+
+ $this->assertEquals(1, $mock->foo());
+ $this->assertEquals(4, $mock->bar(2));
+ $mock->mockery_verify();
+ }
+
+ public function testRecordingDoesNotSpecifyExactOrderByDefault()
+ {
+ $mock = $this->container->mock(new MockeryTestSubject);
+ $mock->shouldExpect(function ($subject) {
+ $user = new MockeryTestSubjectUser($subject);
+ $user->doFoo();
+ $user->doBar();
+ });
+
+ $this->assertEquals(4, $mock->bar(2));
+ $this->assertEquals(1, $mock->foo());
+ $mock->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testRecordingDoesSpecifyExactOrderInStrictMode()
+ {
+ $mock = $this->container->mock(new MockeryTestSubject);
+ $mock->shouldExpect(function ($subject) {
+ $subject->shouldBeStrict();
+ $user = new MockeryTestSubjectUser($subject);
+ $user->doFoo();
+ $user->doBar();
+ });
+
+ $mock->bar(2);
+ $mock->foo();
+ $mock->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testArgumentsAreMatchedExactlyUnderStrictMode()
+ {
+ $mock = $this->container->mock(new MockeryTestSubject);
+ $mock->shouldExpect(function ($subject) {
+ $subject->shouldBeStrict();
+ $user = new MockeryTestSubjectUser($subject);
+ $user->doBar();
+ });
+
+ $mock->bar('2');
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testThrowsExceptionWhenArgumentsNotExpected()
+ {
+ $mock = $this->container->mock(new MockeryTestSubject);
+ $mock->shouldExpect(function ($subject) {
+ $user = new MockeryTestSubjectUser($subject);
+ $user->doBar();
+ });
+
+ $mock->bar(4);
+ }
+
+ public function testCallCountUnconstrainedByDefault()
+ {
+ $mock = $this->container->mock(new MockeryTestSubject);
+ $mock->shouldExpect(function ($subject) {
+ $user = new MockeryTestSubjectUser($subject);
+ $user->doBar();
+ });
+
+ $mock->bar(2);
+ $this->assertEquals(4, $mock->bar(2));
+ $mock->mockery_verify();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCallCountConstrainedInStrictMode()
+ {
+ $mock = $this->container->mock(new MockeryTestSubject);
+ $mock->shouldExpect(function ($subject) {
+ $subject->shouldBeStrict();
+ $user = new MockeryTestSubjectUser($subject);
+ $user->doBar();
+ });
+
+ $mock->bar(2);
+ $mock->bar(2);
+ $mock->mockery_verify();
+ }
+
+}
+
+class MockeryTestSubject
+{
+ public function foo() { return 1; }
+ public function bar($i) { return $i * 2; }
+}
+
+class MockeryTestSubjectUser
+{
+ public $subject = null;
+ public function __construct($subject) { $this->subject = $subject; }
+ public function doFoo() { return $this->subject->foo(); }
+ public function doBar() { return $this->subject->bar(2); }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Test/Generator/MockConfigurationBuilderTest.php b/vendor/mockery/mockery/tests/Mockery/Test/Generator/MockConfigurationBuilderTest.php
new file mode 100644
index 0000000..60a6257
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Test/Generator/MockConfigurationBuilderTest.php
@@ -0,0 +1,39 @@
+assertContains('abstract', $builder->getMockConfiguration()->getBlackListedMethods());
+
+ // need a builtin for this
+ $this->markTestSkipped("Need a builtin class with a method that is a reserved word");
+ }
+
+ /**
+ * @test
+ */
+ public function magicMethodsAreBlackListedByDefault()
+ {
+ $builder = new MockConfigurationBuilder;
+ $builder->addTarget("Mockery\Generator\ClassWithMagicCall");
+ $methods = $builder->getMockConfiguration()->getMethodsToMock();
+ $this->assertEquals(1, count($methods));
+ $this->assertEquals("foo", $methods[0]->getName());
+ }
+}
+
+class ClassWithMagicCall
+{
+ public function foo() {}
+ public function __call($method, $args) {}
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/WithFormatterExpectationTest.php b/vendor/mockery/mockery/tests/Mockery/WithFormatterExpectationTest.php
new file mode 100644
index 0000000..e51b709
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/WithFormatterExpectationTest.php
@@ -0,0 +1,92 @@
+assertEquals(
+ $expected,
+ Mockery::formatObjects($args)
+ );
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ *
+ * Note that without the patch checked in with this test, rather than throwing
+ * an exception, the program will go into an infinite recursive loop
+ */
+ public function testFormatObjectsWithMockCalledInGetterDoesNotLeadToRecursion()
+ {
+ $mock = Mockery::mock('stdClass');
+ $mock->shouldReceive('doBar')->with('foo');
+ $obj = new ClassWithGetter($mock);
+ $obj->getFoo();
+ }
+
+ public function formatObjectsDataProvider()
+ {
+ return array(
+ array(
+ array(null),
+ ''
+ ),
+ array(
+ array('a string', 98768, array('a', 'nother', 'array')),
+ ''
+ ),
+ );
+ }
+
+ /** @test */
+ public function format_objects_should_not_call_getters_with_params()
+ {
+ $obj = new ClassWithGetterWithParam();
+ $string = Mockery::formatObjects(array($obj));
+
+ $this->assertNotContains('Missing argument 1 for', $string);
+ }
+
+}
+
+class ClassWithGetter
+{
+ private $dep;
+
+ public function __construct($dep)
+ {
+ $this->dep = $dep;
+ }
+
+ public function getFoo()
+ {
+ return $this->dep->doBar('bar', $this);
+ }
+}
+
+class ClassWithGetterWithParam
+{
+ public function getBar($bar) {}
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/_files/file.txt b/vendor/mockery/mockery/tests/Mockery/_files/file.txt
new file mode 100644
index 0000000..e69de29
diff --git a/vendor/nette/nette b/vendor/nette/nette
new file mode 160000
index 0000000..34cdcbf
--- /dev/null
+++ b/vendor/nette/nette
@@ -0,0 +1 @@
+Subproject commit 34cdcbff5b2c22a17e8efeb0a9035d8b7a29a53d
diff --git a/vendor/pdepend/pdepend/CHANGELOG b/vendor/pdepend/pdepend/CHANGELOG
new file mode 100644
index 0000000..5ab6fbd
--- /dev/null
+++ b/vendor/pdepend/pdepend/CHANGELOG
@@ -0,0 +1,416 @@
+PHP_Depend 0.11.0
+-----------------
+
+This release closes a critical bug that let PHP_Depend die with a E_FATAL when
+the used PHP version was 5.4 or greater.
+
+- Fixed #18976391: PHP_Depend's file cache implementation does not work with
+ PHP 5.4. Fixed with commit #06ce51a.
+
+PHP_Depend 0.10.6
+-----------------
+
+This release closes a critical bug in PHP_Depend's parser that produced
+false positiv error messages for classes named like 'True', 'False' or
+'Null'
+
+- Fixed #5ac3e55: Unexpected token: True, line: 348, col: 49, file:...
+
+PHP_Depend 0.10.5
+-----------------
+
+This release closes two minor bugs in PHP_Depend. One incompatibility
+with PHP 5.2.x versions and one bug related to PHP_Depend's log
+behavior when PHP_Depend analyzes unstructured source code. This release
+was published on May the 20th 2011.
+
+- Fixed #13255437: PHP 5.2 Compatibility Issues. Fixed with commit
+ #8d4a095.
+- Fixed #13405179: PHP Depend report is not generated if all files do
+ not contain a class nor a function. Fixed with commit #554ade1.
+
+PHP_Depend 0.10.4
+-----------------
+
+This release contains an improvement in PHP_Depend's memory consumption.
+We have optimized the internal data structures in such a way that the
+memory footprint was reduced by ~30%. These values were measured for
+currently popular frameworks with a medium to large sized code base. The
+tests were run under ubuntu with PHP 5.2.17 and PHP 5.3.6.
+
+PHP_Depend 0.10.3
+-----------------
+
+This release closes a critial bug in PHP_Depend's analyzer locator code
+that prevents PHP_Depend from running on windows. This release was
+published on March the 02th 2011.
+
+- Fixed #10659085: Analyzer locator code does not work on windows. Fixed
+ with commit #0101798.
+
+PHP_Depend 0.10.2
+-----------------
+
+This release of PHP_Depend closes two bugs. One related to the start and
+end line properties of object property nodes in the syntax tree. The
+second fix closes a bug in PHP_Depend's implementation of the WMCi metric.
+Beside these two fixes this release implements three minor features, one
+design issue in the syntax tree api and the other two other features are
+related to the new metrics CE, CA, CBO and NPM.
+
+Additionally we have restructured PHP_Depend's directory structure from a
+custom, freestyle format to a directory layout that is similar to maven's
+convention. With this change we have fixed several issues and workarounds
+in PHP_Depend's build process.
+
+- Fixed #9936901: WMCi calculation is incorrect for overwritten methods.
+ Fixed with commit #69d079a.
+- Fixed #8927377: Invalid Start/End Line/Column for object property access.
+ Fixed with commit #fc57264.
+- Implemented #9069393: Replace optional NULL argument of setPackage()
+ with separate method. Implemented with commit #1282cdb.
+- Implemented #9069871: Implement efferent- and afferent-coupling for
+ classes. Implemented with commit #07537c2.
+- Implemented #9997915: Implement Number of Public Methods metric.
+ Implemented with commit #2dd3ebf.
+
+PHP_Depend 0.10.1
+-----------------
+
+- Fixed #9634613: Notice: Undefined property $___temp___. Fixed with
+ commit #5fb6900.
+
+PHP_Depend 0.10.0
+-----------------
+
+- Fixed #113: PHP fatal error when an unserialized object graph
+ none NodeI instances. Fixed with commit #c0f4384.
+- Implemented #130: Simplify PHP_Depend's ASTCompoundVariable and skip
+ nested ASTCompoundExpression node instance. Implemented in svn revision
+ number #1344.
+- Implemented #131: Add new method isThis() to PHP_Depend's ASTVariable
+ class. Implemented in svn revision #1291.
+- Implemented #132: Housekeeping: Cleanup the PHP_Depend_Input package test
+ code. Done in svn revision #1366.
+- Implemented #139: Implement Post-/Pre- Increment/Decrement. Implemented
+ in svn revision #1317.
+- Implemented #143: Support PHP's alternative control structure syntax.
+ Done in svn revision #1375.
+- Implemented #146: Implement PHP's declare-statement. Done in subversion
+ revision #1375.
+- Implemented #148: Implement cast expressions. Implemented in svn
+ revision #1283.
+- Fixed #163: Alternative syntax end tokens can terminate with closing
+ PHP-tag. Fixed in svn revision #1527.
+- Fixed #164: Faulty implementation of the --ignore path filter fixed.
+ Now this filter only works on the local part of a file or directory
+ name and not on the complete path. Fixed with commit #f75275e.
+- Implemented #170: Rename FunctionNameParserImpl into
+ FunctionNameParserAllVersions. Task scope changed and complete refactoring
+ done. Parser moved into a version specific parser class. Done in subversion
+ revision #.
+- Fixed #176: Calculation of CIS metric is incorrect. Fixed with commit
+ #1193f4a.
+- Implemented #178: Provide configuration option for the cache directory.
+ Implemented with git commit #00ed8ec.
+- Fixed #181: No log generated when parsing Typo3 extension "t3extplorer"
+ (Unexpected token ASCII 39). Indirectly fixed in this release.
+- Fixed #182: Clone is a valid function, method and type name in older
+ php versions. Fixed with git commit #b18bf37.
+- Fixed #189: Invalid Start/End Line/Column for object method
+ invocation. Fixed in commit #c6cc9dd.
+- Fixed #191: New implementation of --ignore only accepts relative paths.
+ Fixed in commit #38e6b52.
+- Fixed #9623949: Also find analyzers in phar archives in the current
+ include_path. Fixed in commit #f53dca9.
+
+PHP_depend 0.9.20
+-----------------
+
+- Fixed #168: Node identifiers are case sensitive. Fixed in subversion
+ revision #1529.
+- Fixed #169: Null, True and False are valid class or interface names.
+ Fixed in subversion revision #1538.
+
+PHP_Depend 0.9.19
+-----------------
+
+- Fixed #162: Parser does not recognize $ string literal in string.
+ Fixed in subversion revision #1379.
+
+PHP_Depend 0.9.18
+-----------------
+
+- Fixed #161: Unexpected token: -> in foreach statement. Fixed in
+ subversion revision #1347.
+
+PHP_Depend 0.9.17
+-----------------
+
+- Fixed #156: Temp Folder /tmp/pdpend_storage-1000 grows very large.
+ Fixed with Sebastian Marek's patch in svn revision #1335.
+
+PHP_Depend 0.9.16
+-----------------
+
+- Fixed #153: Only count those classes and interfaces that are flagged
+ as user defined types. Fixed in subversion revision #1327.
+- Implemented #154: Make execution order of analyzers reproducable.
+ Implemented in svn revision #1331.
+
+PHP_Depend 0.9.15
+-----------------
+
+- Fixed #152: Endless loop bug for identical class and parent name.
+ Fixed in svn revision #1296.
+
+PHP_Depend 0.9.14
+-----------------
+
+- Fixed #149: Exception Message is empty. Fixed in svn revision #1277.
+- Concurrency issue in PHP_Depend's file cache fixed.
+
+PHP_Depend 0.9.13
+-----------------
+
+- Fixed #145: Incorrect require_once statement in ASTSwitchStatement
+ source file. Fixed in svn revision #1262.
+- Fixed #150: Invalid nowdoc substitution has produced broken code.
+ Fixed in svn revision #1266.
+
+PHP_Depend 0.9.12
+-----------------
+
+- Implemented #97: Replace current token approach in CCN- and NPath-Analyzer
+ with AST-Nodes. Implemented in svn revision #1248.
+- Implemented #125: PHP_Depend silently parses list statements. Fixed in
+ svn revision #1223. Thanks to Joey Mazzarelli for providing this patch.
+- Implemented #126: Generate reproducable node identifiers instead of
+ random numbers. Implemented in svn revision #1244.
+- Fixed #128: Variable variables in foreach statement cause an exception.
+ Fixed in svn revision #1237.
+- Fixed #133: Fatal error: Maximum function nesting level of '100' reached,
+ aborting! in /usr/share/pear/PHP/Depend/Util/Log.php on line 109. Fixed
+ in svn revision #1257.
+- Fixed #134: ASTReturnStatement is not derived from ASTStatement. Fixed
+ in svn revision #1250.
+- Fixed #135: Several Statement classes do not inherit ASTStatement. Fixed
+ in svn revision #1255.
+
+PHP_Depend 0.9.11
+-----------------
+
+- Fixed #118: Calculation of the Number Of Overwritten Methods is
+ wrong. Fixed in svn revision #1112.
+- Implemented #121: Parse arguments of the ASTForeachStatement. Implemented
+ in svn revision #1115.
+- Fixed #119: Three test cases fail for PHP lower 5.3. Fixed in svn
+ revision #1114.
+- Critical issue in PHP_Depend's temporary data cache fixed. This bug
+ only occured when running several instances of PHP_Depend in
+ parallel. In this setup the used cache key spl_object_hash() has
+ caused a corrupted cache, because different php process instances
+ have written different data to the same cache file.
+
+PHP_Depend 0.9.10
+-----------------
+
+- Implemented #72: Add NOAM, NOOM and NOCC metrics. Implemented in svn
+ revision #1084.
+- Implemented #74: Make CRAP-index available. Implemented in svn revision
+ #1063.
+- Implemented #105: Support for deep search implement. Implemented in svn
+ revision #1078.
+- Fixed #106: Filter algorithm is broken for namespaced internal classes.
+ Fixed in svn revision #1039.
+- Fixed #110: Duplicate "coupling" directory in test code. Fixed in svn
+ revision #1032.
+- Fixed #111: Dynamic Strings are treated as literal strings. Fixed in svn
+ revision #1037.
+- Fixed #114: Parsing error caused by complex string expressions fixed.
+ Fixed in svn revision #1068.
+- Fixed #115: Summary and PHPUnit Report lists unknown classes. Fixed in
+ svn revision #1101.
+- Fixed #116: Returns reference results in parsing error. Fixed in svn
+ revision #1090.
+- Performance intensive calculation result cached.
+- Test code restructured and improved.
+- Concurrency issue for parallel running pdepend instances fixed.
+
+PHP_Depend 0.9.9
+----------------
+
+- Fixed #108: Parser doesn't set start/end line/column on variables, fixed in
+ svn revision #1015.
+- Implemented #104: Add isStatic() method on ASTMemberPrimaryPrefix node,
+ implemented in svn revision #1013.
+
+PHP_Depend 0.9.8
+----------------
+
+- Implemented #93: Implement an assignment expression, Implemented in svn
+ revision #992.
+- Fixed #94: Parser throws exception for closures that return by reference,
+ fixed in svn revision #962.
+- Fixed #98: Functions with an invalid signature result in an inconsistent
+ object graph, fixed in svn revision #986.
+- Fixed #102: Namespace keyword in type-hint is broken, fixed in svn revision
+ #1010.
+- Fixed #103: The parser does not handle all strings as parameter default value
+ correct, fixed in svn revision #1009.
+
+PHP_Depend 0.9.7
+----------------
+
+- Fixed #95: NPath complexity bug fixed, fixed in svn revision #958.
+
+PHP_Depend 0.9.6
+----------------
+
+- Closed #57: Display caption for abbreviations in overview pyramid, implemented
+ in svn revision #947.
+- Closed #80: Store default value for class properties.
+- Fixed #81: PHP_Depend does not support comma separated property declarations,
+ fixed in svn revision #916.
+- Fixed #82: PHP_Depend does not support comma separated constant definitions,
+ fixed in svn revision #931.
+- Closed #83: Make ClassOrInterfaceReference an ASTNode, implemented in svn
+ revision #917.
+- Closed #85: Use soundex to detect typos in type annotations, implemented in
+ svn revision #937.
+- Fixed #87: The parent keyword is not accepted as parameter type hint, fixed in
+ svn revision #925.
+- Fixed #89: Coupling analyzer reports wrong results, fixed in svn revision #939
+- Fixed #90: Coupling analyzer does not handle PHP 5.3 function chains, fixed in
+ svn revision #943.
+- Fixed #91: Parser throws an exception when __CLASS__ as default value of an
+ array property, fixed in svn revision #944.
+- Closes #92: Use class constants as analyzer identifiers, implemented in svn
+ revision #950.
+
+PHP_Depend 0.9.5
+----------------
+
+- Closed #2: Support PHP 5.3 namespace syntax, implemented since svn
+ revision #789.
+- Closed #61: Catch parser errors and continue processing, implemented
+ in svn revision #880.
+- Closed #63: Make ResultPrinter a configurable option, implemented in
+ svn revision #668.
+- Fixed #64: The single cache directory causes permission denied on
+ UNIX systems, fixed in svn revision #667.
+- Fixed #65: Endless loop for class and interface declarations without
+ body, fixed in svn revision #672.
+- Closed #66: Dependency wiring should be done at the end of the
+ parsing process, implemented in svn revision #855.
+- Fixed #69: Parser does not handle PHP 5.3 class names in function
+ and method bodies, fixed in svn revision #688.
+- Fixed #70: Parser throws an unexpected token exception for closure,
+ fixed in svn revision #726.
+- Fixed #71: Parser throws an unexpected token exception for signed
+ default values, fixed in svn revision #740.
+- Fixed #73: Inconsistent state when an interface and a class with the
+ same name exists, fixed in svn revision #776.
+- Fixed #76: Tokenizer keyword detection is broken, fixed in svn
+ revision #871.
+
+
+PHP_Depend 0.9.4
+----------------
+
+- #40 + Cli debug flag added. PHP_Depend will print additional debug information
+ to STDERR when this cli switch is set. (Closed)
+- #87 + Support for type definitions within comments implemented. (Closed)
+- #88 + Tokens provide information about the start and end column. (Closed)
+- #90 + Support for single file parsing/analyzing implemented (Closed)
+- #92 + Handling of types within instanceof-operator fixed. (Fixed)
+- The ProjectAwareI and NodeAwareI interfaces extend the AnalyzerI interface,
+ which makes analyzer mocking easier.
+- Switch from PHP_Depend specific constants for public, protected, private
+ methods&properties to modifiers compatible with PHP's reflection-extension.
+- Support for static modifier for properties&methods and final for methods
+ added.
+- Support for class final modifier added.
+- Support for chained types like "false|Iterator" or "array(false|Iterator)" in
+ doc comments added.
+
+PHP_Depend 0.9.3
+----------------
+
+- #89 + Source file is never set for methods, properties and constants.
+- #83 + Storage layer for node tokens added, reduces memory consumption.
+- #85 + TextUI displays the execution time and the memory usage(linux only).
+- #82 + Tokenizer cache added, reduces runtime up to 25%.
+- Code restructured, input filters and iterator moved to package "Input".
+- Test suite restructured to reflect the actual project structure.
+
+PHP_Depend 0.9.2
+----------------
+
+- #84 + Critical bug, a backslash could kill PHP_Depend with all PHP Versions lower 5.3.0alpha3
+
+PHP_Depend 0.9.1
+----------------
+
+- Performance improvements
+- #21 + Support for the NPath Complexity metric.
+- #78 + Parser fails for comment in function signature.
+- #79 + Token objects instead of arrays.
+
+PHP_Depend 0.9.0
+----------------
+
+- PHP_Depend works with PHP 5.2.0
+- #19 + Implement a phpunit compatible xml logger.
+- #20 + Add support for class constants.
+- #30 + Improve Lines Of Code.
+
+PHP_Depend 0.8.0
+----------------
+
+- No more features or bug fixes, beta4 seems to be stable.
+
+PHP_Depend 0.8.0beta4
+---------------------
+
+- #29 + Tooltip for the Overview Pyramid.
+- #34 + Support for pattern based package filter.
+- #37 + Remove Logger - XML Config dependency.
+- #38 + The Logger interface should not force a default ctor-signature.
+
+PHP_Depend 0.8.0beta3
+---------------------
+
+- #25 + PHP_Depend should print an error if no @package information is available.
+- #26 + Handle class and interface names case insensitive.
+- #27 + Handle internal classes and interfaces.
+- #28 + Add option --bad-documentation.
+
+PHP_Depend 0.8.0beta2
+---------------------
+
+- #18 + Introduce a CodeAware interface for loggers.
+- #23 + Use an SVG-Template for the jdepend chart.
+- #24 + There is an endless loop for inline html.
+
+PHP_Depend 0.8.0beta1
+---------------------
+
+- New metrics implemented
+ - ClassLevel (wmc, vars, dit, csz, ...)
+ - CodeRank (cr, rcr - PageRank adaption for classes and packages)
+ - Coupling (Fanout, calls)
+ - CyclomaticComplexity (CCN, CCN2)
+ - Dependency (ac, cc, ce, ca, d, a, i)
+ - Hierarchy (clsa, clsc, roots, leafs, maxDIT)
+ - Inheritance (andc, ahh)
+ - NodeCount (nop, noc, nof, noi, nom)
+ - NodeLoc (loc, cloc, ncloc)
+- Pluggable logger architecture.
+- Pluggable metric analyzer architecture.
+
+
+PHP_Depend 0.1.0
+----------------
+
+- Initial proof-of-concept release.
diff --git a/vendor/pdepend/pdepend/LICENSE b/vendor/pdepend/pdepend/LICENSE
new file mode 100644
index 0000000..73a9442
--- /dev/null
+++ b/vendor/pdepend/pdepend/LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 2008-2013, Manuel Pichler .
+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 Manuel Pichler nor the names of his
+ 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.
diff --git a/vendor/pdepend/pdepend/build.properties b/vendor/pdepend/pdepend/build.properties
new file mode 100644
index 0000000..6af7b47
--- /dev/null
+++ b/vendor/pdepend/pdepend/build.properties
@@ -0,0 +1,24 @@
+project.dir =
+project.uri = pdepend.org
+project.name = pdepend
+project.version = 2.0.3
+project.stability = stable
+
+# Disable pear support
+project.pear.uri = pear.example.com
+
+# Include only the symfony di stuff and exclude tests
+vendor.dir.includes = symfony/**/*,composer/**/*,autoload.php
+vendor.dir.excludes = symfony/**/Tests/**/*
+
+# Default coding standard
+codesniffer.standard = PSR2
+
+# TODO: Currently we are in a transition phase, so don't fail here! Remove this in 2.0
+codesniffer.fail.on.violation = true
+
+# Location of the version control system
+project.scm.uri = github.com/${project.name}/${project.name}/commit
+
+# Execute the following command for pdepend profiling
+#profile.command = ${basedir}/src/bin/pdepend '--summary-xml=summary.xml' '--jdepend-xml=jdepend.xml' --jdepend-chart=jdepend.svg --overview-pyramid=pyramid.svg --coderank-mode=inheritance,property,method '/opt/Sources/PHP/Flow3/Packages/Framework/'
diff --git a/vendor/pdepend/pdepend/composer.json b/vendor/pdepend/pdepend/composer.json
new file mode 100644
index 0000000..f731fca
--- /dev/null
+++ b/vendor/pdepend/pdepend/composer.json
@@ -0,0 +1,22 @@
+{
+ "name": "pdepend/pdepend",
+ "description": "Official version of pdepend to be handled with Composer",
+ "license": "BSD-3-Clause",
+ "require": {
+ "php": ">=5.3.7"
+ },
+ "require": {
+ "symfony/dependency-injection": "@stable",
+ "symfony/filesystem": "@stable",
+ "symfony/config": "@stable"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.*@stable",
+ "squizlabs/php_codesniffer": "@stable"
+ },
+ "bin": ["src/bin/pdepend"],
+ "autoload": {
+ "psr-0": {"PDepend\\": "src/main/php/"}
+ }
+}
+
diff --git a/vendor/pdepend/pdepend/scripts/compare.sh b/vendor/pdepend/pdepend/scripts/compare.sh
new file mode 100755
index 0000000..e6d6e73
--- /dev/null
+++ b/vendor/pdepend/pdepend/scripts/compare.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+PHP_BIN=${2:-"php"}
+
+rm -rf ~/.pdepend/*
+$PHP_BIN `which pdepend` --jdepend-xml=/tmp/jdpa0.xml --summary-xml=/tmp/suma0.xml $1
+$PHP_BIN `which pdepend` --jdepend-xml=/tmp/jdpa1.xml --summary-xml=/tmp/suma1.xml $1
+$PHP_BIN src/bin/pdepend --jdepend-xml=/tmp/jdpb0.xml --summary-xml=/tmp/sumb0.xml $1
+$PHP_BIN src/bin/pdepend --jdepend-xml=/tmp/jdpb1.xml --summary-xml=/tmp/sumb1.xml $1
+
+meld /tmp/suma0.xml /tmp/sumb0.xml /tmp/sumb1.xml
+
+meld /tmp/jdpa0.xml /tmp/jdpb0.xml /tmp/jdpb1.xml
diff --git a/vendor/pdepend/pdepend/scripts/update-version.php b/vendor/pdepend/pdepend/scripts/update-version.php
new file mode 100755
index 0000000..e5057f9
--- /dev/null
+++ b/vendor/pdepend/pdepend/scripts/update-version.php
@@ -0,0 +1,188 @@
+#!/usr/bin/env php
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend;
+
+/**
+ * Utility class that we use to recalculate the cache hash/version.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class CacheVersionUpdater
+{
+ /**
+ * The source directory.
+ *
+ * @var string
+ */
+ private $rootDirectory = null;
+
+ /**
+ * The source sub directories that we will process.
+ *
+ * @var array(string)
+ */
+ private $localPaths = array(
+ '/Source',
+ '/Metrics',
+ );
+
+ /**
+ * The target file, where this script will persist the new cache version.
+ *
+ * @var string
+ */
+ private $targetFile = '/Util/Cache/CacheDriver.php';
+
+ /**
+ * Regular expression used to replace a previous cache version.
+ *
+ * @var string
+ */
+ private $targetRegexp = '(@version:[a-f0-9]{32}:@)';
+
+ /**
+ * Constructs a new cache version updater instance.
+ */
+ public function __construct()
+ {
+ $this->rootDirectory = realpath(dirname(__FILE__) . '/../src/main/php/PDepend');
+ }
+
+ /**
+ * Processes all source files and generates a combined version for all files.
+ * The it replaces the old version key within the project source with the
+ * newly calculated value.
+ *
+ * @return void
+ */
+ public function run()
+ {
+ $checksum = '';
+
+ foreach ($this->localPaths as $localPath) {
+ $path = $this->rootDirectory . $localPath;
+ foreach ($this->readFiles($path) as $file) {
+ $checksum = $this->hash($file, $checksum);
+ }
+ }
+
+ $file = $this->rootDirectory . $this->targetFile;
+
+ $code = file_get_contents($file);
+ $code = preg_replace($this->targetRegexp, "@version:{$checksum}:@", $code);
+ file_put_contents($file, $code);
+ }
+
+ /**
+ * Generates a hash value for the given $path in combination with a
+ * previous calculated $checksum.
+ *
+ * @param string $path Path to the current context file.
+ * @param string $checksum Hash/Checksum for all previously parsed files.
+ * @return string
+ */
+ protected function hash($path, $checksum)
+ {
+ return md5($checksum . md5_file($path));
+ }
+
+ /**
+ * Reads all files below the given $path.
+ *
+ * @param string $path The parent directory or a file.
+ * @return array(string)
+ */
+ protected function readFiles($path)
+ {
+ if ($this->accept($path)) {
+ return array($path);
+ }
+ $files = array();
+ foreach ($this->createFileIterator($path) as $file) {
+ if ($this->accept($file)) {
+ $files[] = (string) $file;
+ }
+ }
+ return $files;
+ }
+
+ /**
+ * Does the given path represent a file that has the expected file extension?
+ *
+ * @param string $path Path to a file or directory.
+ * @return boolean
+ */
+ protected function accept($path)
+ {
+ return (is_file($path) && '.php' === substr($path, -4, 4));
+ }
+
+ /**
+ * Creates an iterator with all files below the given directory.
+ *
+ * @param string $path Path to a directory.
+ * @return \Iterator
+ */
+ protected function createFileIterator($path)
+ {
+ return new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator($path)
+ );
+ }
+
+ /**
+ * The main method starts the cache version updater.
+ *
+ * @param array $args Cli arguments.
+ * @return void
+ */
+ public static function main(array $args)
+ {
+ $updater = new CacheVersionUpdater();
+ $updater->run();
+ }
+}
+
+CacheVersionUpdater::main($_SERVER['argv']);
diff --git a/vendor/pdepend/pdepend/src/bin/pdepend b/vendor/pdepend/pdepend/src/bin/pdepend
new file mode 100755
index 0000000..e9b4d8a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/bin/pdepend
@@ -0,0 +1,72 @@
+#!/usr/bin/env php
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+use PDepend\TextUI\Command;
+
+// PEAR/svn workaround
+if (strpos('@php_bin@', '@php_bin') === 0) {
+ set_include_path('.' . PATH_SEPARATOR . dirname(__FILE__) . '/../main/php');
+}
+
+// check for pdepend installed as composer package
+if (file_exists(__DIR__ . '/../../../../autoload.php')) {
+ require_once __DIR__ . '/../../../../autoload.php';
+} else {
+ require_once __DIR__ . '/../../vendor/autoload.php';
+}
+
+// Allow as much memory as possible by default
+if (extension_loaded('suhosin') && is_numeric(ini_get('suhosin.memory_limit'))) {
+ $limit = ini_get('memory_limit');
+ if (preg_match('(^(\d+)([BKMGT]))', $limit, $match)) {
+ $shift = array('B' => 0, 'K' => 10, 'M' => 20, 'G' => 30, 'T' => 40);
+ $limit = ($match[1] * (1 << $shift[$match[2]]));
+ }
+ if (ini_get('suhosin.memory_limit') > $limit && $limit > -1) {
+ ini_set('memory_limit', ini_get('suhosin.memory_limit'));
+ }
+} else {
+ ini_set('memory_limit', -1);
+}
+
+exit(Command::main());
diff --git a/vendor/pdepend/pdepend/src/bin/pdepend.bat b/vendor/pdepend/pdepend/src/bin/pdepend.bat
new file mode 100644
index 0000000..15c7fe5
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/bin/pdepend.bat
@@ -0,0 +1,46 @@
+@echo off
+REM This file is part of PDepend.
+REM
+REM Copyright (c) 2008-2013, Manuel Pichler .
+REM All rights reserved.
+REM
+REM Redistribution and use in source and binary forms, with or without
+REM modification, are permitted provided that the following conditions
+REM are met:
+REM
+REM * Redistributions of source code must retain the above copyright
+REM notice, this list of conditions and the following disclaimer.
+REM
+REM * Redistributions in binary form must reproduce the above copyright
+REM notice, this list of conditions and the following disclaimer in
+REM the documentation and/or other materials provided with the
+REM distribution.
+REM
+REM * Neither the name of Manuel Pichler nor the names of his
+REM contributors may be used to endorse or promote products derived
+REM from this software without specific prior written permission.
+REM
+REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+REM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+REM LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+REM FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+REM COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+REM INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+REM BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+REM LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+REM CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC
+REM LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+REM ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+REM POSSIBILITY OF SUCH DAMAGE.
+REM
+REM $Id$
+REM
+
+
+if "%PHPBIN%" == "" set PHPBIN=@php_bin@
+if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
+GOTO RUN
+:USE_PEAR_PATH
+set PHPBIN=%PHP_PEAR_PHP_BIN%
+:RUN
+"%PHPBIN%" "@bin_dir@\pdepend" %*
diff --git a/vendor/pdepend/pdepend/src/bin/pdepend.php b/vendor/pdepend/pdepend/src/bin/pdepend.php
new file mode 100755
index 0000000..0a6de24
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/bin/pdepend.php
@@ -0,0 +1,67 @@
+#!/usr/bin/env php
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+use PDepend\TextUI\Command;
+
+// PEAR/svn workaround
+if (strpos('@php_bin@', '@php_bin') === 0) {
+ set_include_path('.' . PATH_SEPARATOR . dirname(__FILE__) . '/../main/php');
+}
+
+require_once __DIR__ . '/../../vendor/autoload.php';
+
+// Allow as much memory as possible by default
+if (extension_loaded('suhosin') && is_numeric(ini_get('suhosin.memory_limit'))) {
+ $limit = ini_get('memory_limit');
+ if (preg_match('(^(\d+)([BKMGT]))', $limit, $match)) {
+ $shift = array('B' => 0, 'K' => 10, 'M' => 20, 'G' => 30, 'T' => 40);
+ $limit = ($match[1] * (1 << $shift[$match[2]]));
+ }
+ if (ini_get('suhosin.memory_limit') > $limit && $limit > -1) {
+ ini_set('memory_limit', ini_get('suhosin.memory_limit'));
+ }
+} else {
+ ini_set('memory_limit', -1);
+}
+
+exit(Command::main());
diff --git a/vendor/pdepend/pdepend/src/conf/phar_bootstrap.stub b/vendor/pdepend/pdepend/src/conf/phar_bootstrap.stub
new file mode 100644
index 0000000..481e130
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/conf/phar_bootstrap.stub
@@ -0,0 +1,61 @@
+#!/usr/bin/env php
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+// Map this phar archive
+Phar::mapPhar('${archive.alias}');
+
+// Configure include path to use this phar
+set_include_path('phar://${archive.alias}/' . PATH_SEPARATOR . get_include_path());
+
+// Run command line interface if this is the called file
+if (isset($argv[0]) && realpath($argv[0]) === __FILE__) {
+
+ // Set memory limit to max allowed
+ ini_set('memory_limit', -1);
+
+ // Load command line utility
+ include_once 'phar://${archive.alias}/vendor/autoload.php';
+
+ exit(\PDepend\TextUI\Command::main($argv));
+}
+__HALT_COMPILER();
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Application.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Application.php
new file mode 100644
index 0000000..f4b356a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Application.php
@@ -0,0 +1,198 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+
+/**
+ * PDepend Application
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Application
+{
+ private $container;
+
+ /**
+ * @var string
+ */
+ private $configurationFile;
+
+ /**
+ * @param string $configurationFile
+ */
+ public function setConfigurationFile($configurationFile)
+ {
+ if (!file_exists($configurationFile)) {
+ throw new \InvalidArgumentException(
+ sprintf('The configuration file "%s" doesn\'t exist.', $configurationFile)
+ );
+ }
+
+ $this->configurationFile = $configurationFile;
+ }
+
+ /**
+ * @return \PDepend\Util\Configuration
+ */
+ public function getConfiguration()
+ {
+ return $this->getContainer()->get('pdepend.configuration');
+ }
+
+ /**
+ * @return \PDepend\Engine
+ */
+ public function getEngine()
+ {
+ return $this->getContainer()->get('pdepend.engine');
+ }
+
+ /**
+ * @return \PDepend\TextUI\Runner
+ */
+ public function getRunner()
+ {
+ return $this->getContainer()->get('pdepend.textui.runner'); // TODO: Use standard name? textui is detail.
+ }
+
+ /**
+ * @return \PDepend\Report\ReportGeneratorFactory
+ */
+ public function getReportGeneratorFactory()
+ {
+ return $this->getContainer()->get('pdepend.report_generator_factory');
+ }
+
+ /**
+ * @return \PDepend\Metrics\AnalyzerFactory
+ */
+ public function getAnalyzerFactory()
+ {
+ return $this->getContainer()->get('pdepend.analyzer_factory');
+ }
+
+ private function getContainer()
+ {
+ if ($this->container === null) {
+ $this->container = $this->createContainer();
+ }
+
+ return $this->container;
+ }
+
+ /**
+ * @return \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ private function createContainer()
+ {
+ $extensions = array(new DependencyInjection\PdependExtension());
+
+ $container = new ContainerBuilder(new ParameterBag(array()));
+ $container->prependExtensionConfig('pdepend', array());
+ $container->addCompilerPass(new DependencyInjection\Compiler\ProcessListenerPass());
+
+ $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../../resources'));
+
+ foreach ($extensions as $extension) {
+ $container->registerExtension($extension);
+ }
+
+ if ($this->configurationFile) {
+ $loader->load($this->configurationFile);
+ }
+
+ $container->compile();
+
+ return $container;
+ }
+
+ /**
+ * Returns available logger options and documentation messages.
+ *
+ * @return array(string => string)
+ */
+ public function getAvailableLoggerOptions()
+ {
+ return $this->getAvailableOptionsFor('pdepend.logger');
+ }
+
+ /**
+ * Returns available analyzer options and documentation messages.
+ *
+ * @return array(string => string)
+ */
+ public function getAvailableAnalyzerOptions()
+ {
+ return $this->getAvailableOptionsFor('pdepend.analyzer');
+ }
+
+ /**
+ * @return array(string => string)
+ */
+ private function getAvailableOptionsFor($serviceTag)
+ {
+ $container = $this->getContainer();
+
+ $loggerServices = $container->findTaggedServiceIds($serviceTag);
+
+ $options = array();
+
+ foreach ($loggerServices as $loggerServiceTags) {
+ foreach ($loggerServiceTags as $loggerServiceTag) {
+ if (isset($loggerServiceTag['option']) && isset($loggerServiceTag['message'])) {
+ $options[$loggerServiceTag['option']] = array(
+ 'message' => $loggerServiceTag['message'],
+ 'value' => isset($loggerServiceTag['value']) ? $loggerServiceTag['value'] : 'file'
+ );
+ }
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/DbusUI/ResultPrinter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/DbusUI/ResultPrinter.php
new file mode 100644
index 0000000..fd86587
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/DbusUI/ResultPrinter.php
@@ -0,0 +1,198 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\DbusUI;
+
+// This is just fun and it is not really testable
+// @codeCoverageIgnoreStart
+use PDepend\Metrics\Analyzer;
+use PDepend\ProcessListener;
+use PDepend\Source\Builder\Builder;
+use PDepend\Source\Tokenizer\Tokenizer;
+use PDepend\Source\ASTVisitor\AbstractASTVisitListener;
+
+/**
+ * Fun result printer that uses dbus to show a notification window.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ResultPrinter extends AbstractASTVisitListener implements ProcessListener
+{
+ /**
+ * Time when it the process has started.
+ *
+ * @var integer
+ */
+ private $startTime = 0;
+
+ /**
+ * Number of parsed/analyzed files.
+ *
+ * @var integer
+ */
+ private $parsedFiles = 0;
+
+ /**
+ * Is called when PDepend starts the file parsing process.
+ *
+ * @param \PDepend\Source\Builder\Builder $builder The used node builder instance.
+ * @return void
+ */
+ public function startParseProcess(Builder $builder)
+ {
+ $this->startTime = time();
+ }
+
+ /**
+ * Is called when PDepend has finished the file parsing process.
+ *
+ * @param \PDepend\Source\Builder\Builder $builder The used node builder instance.
+ * @return void
+ */
+ public function endParseProcess(Builder $builder)
+ {
+ }
+
+ /**
+ * Is called when PDepend starts parsing of a new file.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ * @return void
+ */
+ public function startFileParsing(Tokenizer $tokenizer)
+ {
+ }
+
+ /**
+ * Is called when PDepend has finished a file.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ * @return void
+ */
+ public function endFileParsing(Tokenizer $tokenizer)
+ {
+ ++$this->parsedFiles;
+ }
+
+ /**
+ * Is called when PDepend starts the analyzing process.
+ *
+ * @return void
+ */
+ public function startAnalyzeProcess()
+ {
+ }
+
+ /**
+ * Is called when PDepend has finished the analyzing process.
+ *
+ * @return void
+ */
+ public function endAnalyzeProcess()
+ {
+ }
+
+ /**
+ * Is called when PDepend starts the logging process.
+ *
+ * @return void
+ */
+ public function startLogProcess()
+ {
+ }
+
+ /**
+ * Is called when PDepend has finished the logging process.
+ *
+ * @return void
+ */
+ public function endLogProcess()
+ {
+ if (extension_loaded('dbus') === false) {
+ return;
+ }
+
+ $dbus = new Dbus(Dbus::BUS_SESSION);
+ $proxy = $dbus->createProxy(
+ "org.freedesktop.Notifications", // connection name
+ "/org/freedesktop/Notifications", // object
+ "org.freedesktop.Notifications" // interface
+ );
+ $proxy->Notify(
+ 'PDepend',
+ new DBusUInt32(0),
+ 'pdepend',
+ 'PDepend',
+ sprintf(
+ '%d files analyzed in %s minutes...',
+ $this->parsedFiles,
+ (date('i:s', time() - $this->startTime))
+ ),
+ new DBusArray(DBus::STRING, array()),
+ new DBusDict(DBus::VARIANT, array()),
+ 1000
+ );
+ }
+
+ /**
+ * Is called when PDepend starts a new analyzer.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The context analyzer instance.
+ * @return void
+ */
+ public function startAnalyzer(Analyzer $analyzer)
+ {
+ }
+
+ /**
+ * Is called when PDepend has finished one analyzing process.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The context analyzer instance.
+ * @return void
+ */
+ public function endAnalyzer(Analyzer $analyzer)
+ {
+ }
+}
+
+// @codeCoverageIgnoreEnd
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/Compiler/ProcessListenerPass.php b/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/Compiler/ProcessListenerPass.php
new file mode 100644
index 0000000..2fd9aa0
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/Compiler/ProcessListenerPass.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\DependencyInjection\Compiler;
+
+use Symfony\Component\DependencyInjection\Reference;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+
+/**
+ * Find Process Listeners of extensions by 'pdepend.process_listener' tag.
+ *
+ * Listeners are added to the PDepend\Engine service.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ProcessListenerPass implements CompilerPassInterface
+{
+ public function process(ContainerBuilder $container)
+ {
+ $engineDefinition = $container->findDefinition('pdepend.engine');
+
+ $processListenerTags = $container->findTaggedServiceIds('pdepend.process_listener');
+
+ foreach ($processListenerTags as $id => $tags) {
+ $engineDefinition->addMethodCall('addProcessListener', array(new Reference($id)));
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/Configuration.php b/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/Configuration.php
new file mode 100644
index 0000000..ee68d81
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/Configuration.php
@@ -0,0 +1,120 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\DependencyInjection;
+
+use Symfony\Component\Config\Definition\Builder\TreeBuilder;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
+
+use PDepend\Util\FileUtil;
+use PDepend\Util\Workarounds;
+
+/**
+ * This is the class that validates and merges configuration
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Configuration implements ConfigurationInterface
+{
+ /**
+ * @var array(Extension)
+ */
+ private $extensions = array();
+
+ public function __construct(array $extensions)
+ {
+ $this->extensions = $extensions;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getConfigTreeBuilder()
+ {
+ $home = FileUtil::getUserHomeDirOrSysTempDir();
+ $workarounds = new Workarounds();
+
+ $defaultCacheDriver = ($workarounds->hasSerializeReferenceIssue()) ? 'memory' : 'file';
+
+ $treeBuilder = new TreeBuilder();
+ $rootNode = $treeBuilder->root('pdepend');
+
+ $rootNode
+ ->children()
+ ->arrayNode('cache')
+ ->addDefaultsIfNotSet()
+ ->children()
+ ->enumNode('driver')->defaultValue($defaultCacheDriver)->values(array('file', 'memory'))->end()
+ ->scalarNode('location')->defaultValue($home . '/.pdepend')->end()
+ ->end()
+ ->end()
+ ->arrayNode('image_convert')
+ ->addDefaultsIfNotSet()
+ ->children()
+ ->scalarNode('font_size')->defaultValue('11')->end()
+ ->scalarNode('font_family')->defaultValue('Arial')->end()
+ ->end()
+ ->end()
+ ->arrayNode('parser')
+ ->addDefaultsIfNotSet()
+ ->children()
+ ->integerNode('nesting')->defaultValue(65536)->end()
+ ->end()
+ ->end()
+ ->end()
+ ;
+
+ $extensionsNode = $rootNode
+ ->children()
+ ->arrayNode('extensions')
+ ->addDefaultsIfNotSet()
+ ->children();
+
+ foreach ($this->extensions as $extension) {
+ $extensionNode = $extensionsNode->arrayNode($extension->getName());
+ $extension->getConfig($extensionNode);
+ }
+
+ return $treeBuilder;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/Extension.php b/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/Extension.php
new file mode 100644
index 0000000..d6eac3f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/Extension.php
@@ -0,0 +1,136 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\DependencyInjection;
+
+use ReflectionClass;
+use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+
+/**
+ * PDepend base extension class.
+ *
+ * Copied from Behat
+ *
+ * @link https://github.com/Behat/Behat/blob/3.0/src/Behat/Behat/Extension/Extension.php
+ * @author Konstantin Kudryashov
+ */
+abstract class Extension
+{
+ /**
+ * Return name of the extension
+ *
+ * @return string
+ */
+ abstract public function getName();
+
+ /**
+ * Loads a specific configuration.
+ *
+ * @param array $config Extension configuration hash (from behat.yml)
+ * @param ContainerBuilder $container ContainerBuilder instance
+ */
+ public function load(array $config, ContainerBuilder $container)
+ {
+ $path = rtrim($this->getServiceDefinitionsPath(), DIRECTORY_SEPARATOR);
+ $name = $this->getServiceDefinitionsName();
+
+ if (file_exists($path . DIRECTORY_SEPARATOR . ($file = $name . '.xml'))) {
+ $loader = new XmlFileLoader($container, new FileLocator($path));
+ $loader->load($file);
+ }
+ if (file_exists($path . DIRECTORY_SEPARATOR . ($file = $name . '.yml'))) {
+ $loader = new YamlFileLoader($container, new FileLocator($path));
+ $loader->load($file);
+ }
+
+ $container->setParameter($this->getName() . '.parameters', $config);
+ }
+
+ /**
+ * Setups configuration for current extension.
+ *
+ * @param ArrayNodeDefinition $builder
+ */
+ public function getConfig(ArrayNodeDefinition $builder)
+ {
+ $builder
+ ->useAttributeAsKey('name')
+ ->prototype('variable');
+ }
+
+ /**
+ * Returns compiler passes used by this extension.
+ *
+ * @return CompilerPassInterface[]
+ */
+ public function getCompilerPasses()
+ {
+ return array();
+ }
+
+ /**
+ * Returns name of the service definition config without extension and path.
+ *
+ * @return string
+ */
+ protected function getServiceDefinitionsName()
+ {
+ return 'services';
+ }
+
+ /**
+ * Returns service definition configs path.
+ *
+ * @return string
+ */
+ protected function getServiceDefinitionsPath()
+ {
+ $reflection = new ReflectionClass($this);
+
+ return dirname($reflection->getFileName());
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/ExtensionManager.php b/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/ExtensionManager.php
new file mode 100644
index 0000000..5861b9b
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/ExtensionManager.php
@@ -0,0 +1,93 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\DependencyInjection;
+
+/**
+ * Manage activation and registration of extensions for PDepend.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ExtensionManager
+{
+ private $extensions = array();
+
+ /**
+ * Activate an extension based on a class name.
+ *
+ * @throws RuntimeException
+ * @param string $className
+ * @return void
+ */
+ public function activateExtension($className)
+ {
+ if (!class_exists($className)) {
+ throw new \RuntimeException(
+ sprintf(
+ 'Cannot find extension class %s" for PDepend. Maybe the plugin is not installed?',
+ $className
+ )
+ );
+ }
+
+ $extension = new $className;
+
+ if (!($extension instanceof Extension)) {
+ throw new \RuntimeException(
+ sprintf('Class "%s" is not a valid Extension', $className)
+ );
+ }
+
+ $this->extensions[$extension->getName()] = $extension;
+ }
+
+ /**
+ * Return all activated extensions.
+ *
+ * @return array(\PDepend\DependencyInjection\Extension)
+ */
+ public function getActivatedExtensions()
+ {
+ return $this->extensions;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/PdependExtension.php b/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/PdependExtension.php
new file mode 100644
index 0000000..0482288
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/DependencyInjection/PdependExtension.php
@@ -0,0 +1,127 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\DependencyInjection;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\DependencyInjection\Extension\Extension;
+use Symfony\Component\DependencyInjection\Loader;
+
+/**
+ * PDepend DependencyInjection Extension for Symfony DIC
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class PdependExtension extends Extension
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function load(array $configs, ContainerBuilder $container)
+ {
+ $extensionManager = new ExtensionManager();
+
+ foreach ($configs as $config) {
+ if (!isset($config['extensions'])) {
+ continue;
+ }
+
+ foreach ($config['extensions'] as $config) {
+ if (!isset($config['class'])) {
+ continue;
+ }
+
+ $extensionManager->activateExtension($config['class']);
+ }
+ }
+
+ $configuration = new Configuration($extensionManager->getActivatedExtensions());
+ $config = $this->processConfiguration($configuration, $configs);
+
+ $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../../../resources'));
+ $loader->load('services.xml');
+
+ foreach ($extensionManager->getActivatedExtensions() as $extension) {
+ $extensionConfig = $config['extensions'][$extension->getName()];
+
+ $tempContainer = new ContainerBuilder(new ParameterBag(array()));
+ $tempContainer->addObjectResource($extension);
+
+ // load extension into temporary container
+ $extension->load($extensionConfig, $tempContainer);
+
+ // merge temporary container into normal one
+ $container->merge($tempContainer);
+ }
+
+ $settings = $this->createSettings($config);
+
+ $configurationDefinition = $container->findDefinition('pdepend.configuration');
+ $configurationDefinition->setArguments(array($settings));
+ }
+
+ private function createSettings($config)
+ {
+ $settings = new \stdClass();
+
+ $settings->cache = new \stdClass();
+ $settings->cache->driver = $config['cache']['driver'];
+ $settings->cache->location = $config['cache']['location'];
+
+ $settings->imageConvert = new \stdClass();
+ $settings->imageConvert->fontSize = $config['image_convert']['font_size'];
+ $settings->imageConvert->fontFamily = $config['image_convert']['font_family'];
+
+ $settings->parser = new \stdClass();
+ $settings->parser->nesting = $config['parser']['nesting'];
+
+ return $settings;
+ }
+
+ public function getNamespace()
+ {
+ return 'http://pdepend.org/schema/dic/pdepend';
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Engine.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Engine.php
new file mode 100644
index 0000000..5a45c2f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Engine.php
@@ -0,0 +1,688 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend;
+
+use PDepend\Input\CompositeFilter;
+use PDepend\Input\Filter;
+use PDepend\Metrics\AnalyzerClassFileSystemLocator;
+use PDepend\Metrics\AnalyzerFilterAware;
+use PDepend\Metrics\AnalyzerLoader;
+use PDepend\Metrics\AnalyzerFactory;
+use PDepend\Metrics\AnalyzerCacheAware;
+use PDepend\Report\CodeAwareGenerator;
+use PDepend\Source\AST\ASTArtifactList\ArtifactFilter;
+use PDepend\Source\AST\ASTArtifactList\CollectionArtifactFilter;
+use PDepend\Source\AST\ASTArtifactList\NullArtifactFilter;
+use PDepend\Source\ASTVisitor\ASTVisitor;
+use PDepend\Source\Builder\Builder;
+use PDepend\Source\Language\PHP\PHPBuilder;
+use PDepend\Source\Language\PHP\PHPParserGeneric;
+use PDepend\Source\Language\PHP\PHPTokenizerInternal;
+use PDepend\Source\Tokenizer\Tokenizer;
+use PDepend\Util\Configuration;
+use PDepend\Util\Cache\CacheFactory;
+
+/**
+ * PDepend analyzes php class files and generates metrics.
+ *
+ * The PDepend is a php port/adaption of the Java class file analyzer
+ * JDepend.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Engine
+{
+ /**
+ * Marks the storage used for runtime tokens.
+ */
+ const TOKEN_STORAGE = 1;
+
+ /**
+ * Marks the storag engine used for parser artifacts.
+ */
+ const PARSER_STORAGE = 2;
+
+ /**
+ * The system configuration.
+ *
+ * @var \PDepend\Util\Configuration
+ * @since 0.10.0
+ */
+ protected $configuration = null;
+
+ /**
+ * List of source directories.
+ *
+ * @var array(string)
+ */
+ private $directories = array();
+
+ /**
+ * List of source code file names.
+ *
+ * @var array(string)
+ */
+ private $files = array();
+
+ /**
+ * The used code node builder.
+ *
+ * @var \PDepend\Source\Builder\Builder
+ */
+ private $builder = null;
+
+ /**
+ * Generated {@link \PDepend\Source\AST\ASTNamespace} objects.
+ *
+ * @var Iterator
+ */
+ private $namespaces = null;
+
+ /**
+ * List of all registered {@link \PDepend\Report\ReportGenerator} instances.
+ *
+ * @var \PDepend\Report\ReportGenerator[]
+ */
+ private $generators = array();
+
+ /**
+ * A composite filter for input files.
+ *
+ * @var \PDepend\Input\CompositeFilter
+ */
+ private $fileFilter = null;
+
+ /**
+ * A filter for namespace.
+ *
+ * @var \PDepend\Source\AST\ASTArtifactList\ArtifactFilter
+ */
+ private $codeFilter = null;
+
+ /**
+ * Should the parse ignore doc comment annotations?
+ *
+ * @var boolean
+ */
+ private $withoutAnnotations = false;
+
+ /**
+ * List or registered listeners.
+ *
+ * @var \PDepend\ProcessListener[]
+ */
+ private $listeners = array();
+
+ /**
+ * List of analyzer options.
+ *
+ * @var array(string=>mixed)
+ */
+ private $options = array();
+
+ /**
+ * List of all {@link \PDepend\Source\Parser\ParserException} that were caught during
+ * the parsing process.
+ *
+ * @var \PDepend\Source\Parser\ParserException[]
+ */
+ private $parseExceptions = array();
+
+ /**
+ * The configured cache factory.
+ *
+ * @var \PDepend\Util\Cache\CacheFactory
+ * @since 1.0.0
+ */
+ private $cacheFactory;
+
+ /**
+ * @var \PDepend\Metrics\AnalyzerFactory
+ */
+ private $analyzerFactory;
+
+ /**
+ * Constructs a new php depend facade.
+ *
+ * @param \PDepend\Util\Configuration $configuration The system configuration.
+ * @param \PDepend\Util\Cache\CacheFactory $cacheFactory
+ * @param \PDepend\Metrics\AnalyzerFactory $analyzerFactory
+ */
+ public function __construct(
+ Configuration $configuration,
+ CacheFactory $cacheFactory,
+ AnalyzerFactory $analyzerFactory
+ ) {
+ $this->configuration = $configuration;
+
+ $this->codeFilter = new NullArtifactFilter();
+ $this->fileFilter = new CompositeFilter();
+
+ $this->cacheFactory = $cacheFactory;
+ $this->analyzerFactory = $analyzerFactory;
+ }
+
+ /**
+ * Adds the specified directory to the list of directories to be analyzed.
+ *
+ * @param string $directory The php source directory.
+ * @return void
+ */
+ public function addDirectory($directory)
+ {
+ $dir = realpath($directory);
+
+ if (!is_dir($dir)) {
+ throw new \InvalidArgumentException("Invalid directory '{$directory}' added.");
+ }
+
+ $this->directories[] = $dir;
+ }
+
+ /**
+ * Adds a single source code file to the list of files to be analysed.
+ *
+ * @param string $file The source file name.
+ * @return void
+ */
+ public function addFile($file)
+ {
+ $fileName = realpath($file);
+
+ if (!is_file($fileName)) {
+ throw new \InvalidArgumentException(sprintf('The given file "%s" does not exist.', $file));
+ }
+
+ $this->files[] = $fileName;
+ }
+
+ /**
+ * Adds a logger to the output list.
+ *
+ * @param \PDepend\Report\ReportGenerator $generator The logger instance.
+ * @return void
+ */
+ public function addReportGenerator(\PDepend\Report\ReportGenerator $generator)
+ {
+ $this->generators[] = $generator;
+ }
+
+ /**
+ * Adds a new input/file filter.
+ *
+ * @param \PDepend\Input\Filter $filter New input/file filter instance.
+ * @return void
+ */
+ public function addFileFilter(Filter $filter)
+ {
+ $this->fileFilter->append($filter);
+ }
+
+ /**
+ * Sets an additional code filter. These filters could be used to hide
+ * external libraries and global stuff from the PDepend output.
+ *
+ * @param \PDepend\Source\AST\ASTArtifactList\ArtifactFilter $filter
+ * @return void
+ */
+ public function setCodeFilter(ArtifactFilter $filter)
+ {
+ $this->codeFilter = $filter;
+ }
+
+ /**
+ * Sets analyzer options.
+ *
+ * @param array(string=>mixed) $options The analyzer options.
+ * @return void
+ */
+ public function setOptions(array $options = array())
+ {
+ $this->options = $options;
+ }
+
+ /**
+ * Should the parse ignore doc comment annotations?
+ *
+ * @return void
+ */
+ public function setWithoutAnnotations()
+ {
+ $this->withoutAnnotations = true;
+ }
+
+ /**
+ * Adds a process listener.
+ *
+ * @param \PDepend\ProcessListener $listener The listener instance.
+ * @return void
+ */
+ public function addProcessListener(ProcessListener $listener)
+ {
+ if (in_array($listener, $this->listeners, true) === false) {
+ $this->listeners[] = $listener;
+ }
+ }
+
+ /**
+ * Analyzes the registered directories and returns the collection of
+ * analyzed namespace.
+ *
+ * @return \PDepend\Source\AST\ASTNamespace[]
+ */
+ public function analyze()
+ {
+ $this->builder = new PHPBuilder();
+
+ $this->performParseProcess();
+
+ // Get global filter collection
+ $collection = CollectionArtifactFilter::getInstance();
+ $collection->setFilter($this->codeFilter);
+
+ $collection->setFilter();
+
+ $this->performAnalyzeProcess();
+
+ // Set global filter for logging
+ $collection->setFilter($this->codeFilter);
+
+ $namespaces = $this->builder->getNamespaces();
+
+ $this->fireStartLogProcess();
+
+ foreach ($this->generators as $generator) {
+ // Check for code aware loggers
+ if ($generator instanceof CodeAwareGenerator) {
+ $generator->setArtifacts($namespaces);
+ }
+ $generator->close();
+ }
+
+ $this->fireEndLogProcess();
+
+ return ($this->namespaces = $namespaces);
+ }
+
+ /**
+ * Returns the number of analyzed php classes and interfaces.
+ *
+ * @return integer
+ */
+ public function countClasses()
+ {
+ if ($this->namespaces === null) {
+ $msg = 'countClasses() doesn\'t work before the source was analyzed.';
+ throw new \RuntimeException($msg);
+ }
+
+ $classes = 0;
+ foreach ($this->namespaces as $namespace) {
+ $classes += $namespace->getTypes()->count();
+ }
+ return $classes;
+ }
+
+ /**
+ * Returns an array with all {@link \PDepend\Source\Parser\ParserException}
+ * that were caught during the parsing process.
+ *
+ * @return \PDepend\Source\Parser\ParserException[]
+ */
+ public function getExceptions()
+ {
+ return $this->parseExceptions;
+ }
+
+ /**
+ * Returns the number of analyzed namespaces.
+ *
+ * @return integer
+ */
+ public function countNamespaces()
+ {
+ if ($this->namespaces === null) {
+ $msg = 'countNamespaces() doesn\'t work before the source was analyzed.';
+ throw new \RuntimeException($msg);
+ }
+
+ $count = 0;
+ foreach ($this->namespaces as $namespace) {
+ if ($namespace->isUserDefined()) {
+ ++$count;
+ }
+ }
+ return $count;
+ }
+
+ /**
+ * Returns the analyzed namespace for the given name.
+ *
+ * @param string $name
+ * @return \PDepend\Source\AST\ASTNamespace
+ * @throws \OutOfBoundsException
+ * @throws \RuntimeException
+ */
+ public function getNamespace($name)
+ {
+ if ($this->namespaces === null) {
+ $msg = 'getNamespace() doesn\'t work before the source was analyzed.';
+ throw new \RuntimeException($msg);
+ }
+ foreach ($this->namespaces as $namespace) {
+ if ($namespace->getName() === $name) {
+ return $namespace;
+ }
+ }
+ throw new \OutOfBoundsException(sprintf('Unknown namespace "%s".', $name));
+ }
+
+ /**
+ * Returns an array with the analyzed namespace.
+ *
+ * @return \PDepend\Source\AST\ASTNamespace[]
+ * @throws \RuntimeException
+ */
+ public function getNamespaces()
+ {
+ if ($this->namespaces === null) {
+ $msg = 'getNamespaces() doesn\'t work before the source was analyzed.';
+ throw new \RuntimeException($msg);
+ }
+ return $this->namespaces;
+ }
+
+ /**
+ * Send the start parsing process event.
+ *
+ * @param \PDepend\Source\Builder\Builder $builder The used node builder instance.
+ * @return void
+ */
+ protected function fireStartParseProcess(Builder $builder)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startParseProcess($builder);
+ }
+ }
+
+ /**
+ * Send the end parsing process event.
+ *
+ * @param \PDepend\Source\Builder\Builder $builder The used node builder instance.
+ * @return void
+ */
+ protected function fireEndParseProcess(Builder $builder)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endParseProcess($builder);
+ }
+ }
+
+ /**
+ * Sends the start file parsing event.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ * @return void
+ */
+ protected function fireStartFileParsing(Tokenizer $tokenizer)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startFileParsing($tokenizer);
+ }
+ }
+
+ /**
+ * Sends the end file parsing event.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ * @return void
+ */
+ protected function fireEndFileParsing(Tokenizer $tokenizer)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endFileParsing($tokenizer);
+ }
+ }
+
+ /**
+ * Sends the start analyzing process event.
+ *
+ * @return void
+ */
+ protected function fireStartAnalyzeProcess()
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startAnalyzeProcess();
+ }
+ }
+
+ /**
+ * Sends the end analyzing process event.
+ *
+ * @return void
+ */
+ protected function fireEndAnalyzeProcess()
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endAnalyzeProcess();
+ }
+ }
+
+ /**
+ * Sends the start log process event.
+ *
+ * @return void
+ */
+ protected function fireStartLogProcess()
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startLogProcess();
+ }
+ }
+
+ /**
+ * Sends the end log process event.
+ *
+ * @return void
+ */
+ protected function fireEndLogProcess()
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endLogProcess();
+ }
+ }
+
+ /**
+ * This method performs the parsing process of all source files. It expects
+ * that the $_builder property was initialized with a concrete builder
+ * implementation.
+ *
+ * @return void
+ */
+ private function performParseProcess()
+ {
+ // Reset list of thrown exceptions
+ $this->parseExceptions = array();
+
+ $tokenizer = new PHPTokenizerInternal();
+
+ $this->fireStartParseProcess($this->builder);
+
+ foreach ($this->createFileIterator() as $file) {
+ $tokenizer->setSourceFile($file);
+
+ $parser = new PHPParserGeneric(
+ $tokenizer,
+ $this->builder,
+ $this->cacheFactory->create()
+ );
+ $parser->setMaxNestingLevel($this->configuration->parser->nesting);
+
+ // Disable annotation parsing?
+ if ($this->withoutAnnotations === true) {
+ $parser->setIgnoreAnnotations();
+ }
+
+ $this->fireStartFileParsing($tokenizer);
+
+ try {
+ $parser->parse();
+ } catch (\PDepend\Source\Parser\ParserException $e) {
+ $this->parseExceptions[] = $e;
+ }
+ $this->fireEndFileParsing($tokenizer);
+ }
+
+ $this->fireEndParseProcess($this->builder);
+ }
+
+ /**
+ * This method performs the analysing process of the parsed source files. It
+ * creates the required analyzers for the registered listeners and then
+ * applies them to the source tree.
+ *
+ * @return void
+ */
+ private function performAnalyzeProcess()
+ {
+ $analyzerLoader = $this->createAnalyzers($this->options);
+
+ $collection = CollectionArtifactFilter::getInstance();
+
+ $this->fireStartAnalyzeProcess();
+
+ ini_set('xdebug.max_nesting_level', $this->configuration->parser->nesting);
+
+ foreach ($analyzerLoader as $analyzer) {
+ // Add filters if this analyzer is filter aware
+ if ($analyzer instanceof AnalyzerFilterAware) {
+ $collection->setFilter($this->codeFilter);
+ }
+
+ $analyzer->analyze($this->builder->getNamespaces());
+
+ // Remove filters if this analyzer is filter aware
+ $collection->setFilter();
+
+ foreach ($this->generators as $logger) {
+ $logger->log($analyzer);
+ }
+ }
+
+ ini_restore('xdebug.max_nesting_level');
+
+ $this->fireEndAnalyzeProcess();
+ }
+
+ /**
+ * This method will create an iterator instance which contains all files
+ * that are part of the parsing process.
+ *
+ * @return Iterator
+ */
+ private function createFileIterator()
+ {
+ if (count($this->directories) === 0 && count($this->files) === 0) {
+ throw new \RuntimeException('No source directory and file set.');
+ }
+
+ $fileIterator = new \AppendIterator();
+ $fileIterator->append(new \ArrayIterator($this->files));
+
+ foreach ($this->directories as $directory) {
+ $fileIterator->append(
+ new \PDepend\Input\Iterator(
+ new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator($directory . '/')
+ ),
+ $this->fileFilter,
+ $directory
+ )
+ );
+ }
+
+ // TODO: It's important to validate this behavior, imho there is something
+ // wrong in the iterator code used above.
+ // Strange: why is the iterator not unique and why does this loop fix it?
+ $files = array();
+ foreach ($fileIterator as $file) {
+ if (is_string($file)) {
+ $files[$file] = $file;
+ } else {
+ $pathname = realpath($file->getPathname());
+ $files[$pathname] = $pathname;
+ }
+ }
+
+ ksort($files);
+ // END
+
+ return new \ArrayIterator(array_values($files));
+ }
+
+ private function createAnalyzers($options)
+ {
+ $analyzers = $this->analyzerFactory->createRequiredForGenerators($this->generators);
+
+ $cacheKey = md5(serialize($this->files) . serialize($this->directories));
+ $cache = $this->cacheFactory->create($cacheKey);
+
+ foreach ($analyzers as $analyzer) {
+ if ($analyzer instanceof AnalyzerCacheAware) {
+ $analyzer->setCache($cache);
+ }
+ $analyzer->setOptions($options);
+
+ foreach ($this->listeners as $listener) {
+ $analyzer->addAnalyzeListener($listener);
+
+ if ($analyzer instanceof ASTVisitor) {
+ $analyzer->addVisitListener($listener);
+ }
+ }
+ }
+
+ return $analyzers;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Input/CompositeFilter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Input/CompositeFilter.php
new file mode 100644
index 0000000..1b5c688
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Input/CompositeFilter.php
@@ -0,0 +1,89 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Input;
+
+/**
+ * Simple composite pattern implementation that allows to bundle multiple
+ * filter implementations.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class CompositeFilter implements Filter
+{
+ /**
+ * List of aggregated {@link \PDepend\Input\Filter} objects.
+ *
+ * @var \PDepend\Input\Filter[]
+ */
+ protected $filters = array();
+
+ /**
+ * Adds a file filter to this composite.
+ *
+ * @param \PDepend\Input\Filter $filter The new filter object.
+ * @return void
+ */
+ public function append(Filter $filter)
+ {
+ $this->filters[] = $filter;
+ }
+
+ /**
+ * Delegates the given $localPath object to all aggregated filters.
+ * Returns true if this filter accepts the given path.
+ *
+ * @param string $relative The relative path to the specified root.
+ * @param string $absolute The absolute path to a source file.
+ * @return boolean
+ */
+ public function accept($relative, $absolute)
+ {
+ foreach ($this->filters as $filter) {
+ if (false === $filter->accept($relative, $absolute)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Input/ExcludePathFilter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Input/ExcludePathFilter.php
new file mode 100644
index 0000000..43c1487
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Input/ExcludePathFilter.php
@@ -0,0 +1,123 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Input;
+
+/**
+ * Filters a given file path against a blacklist with disallow path fragments.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ExcludePathFilter implements Filter
+{
+ /**
+ * Regular expression that should not match against the relative file paths.
+ *
+ * @var string
+ * @since 0.10.0
+ */
+ protected $relative = '';
+
+ /**
+ * Regular expression that should not match against the absolute file paths.
+ *
+ * @var string
+ * @since 0.10.0
+ */
+ protected $absolute = '';
+
+ /**
+ * Constructs a new exclude path filter instance and accepts an array of
+ * exclude pattern as argument.
+ *
+ * @param array $patterns List of exclude file path patterns.
+ */
+ public function __construct(array $patterns)
+ {
+ $quoted = array_map('preg_quote', $patterns);
+
+ $this->relative = '(' . str_replace('\*', '.*', join('|', $quoted)) . ')i';
+ $this->absolute = '(^(' . str_replace('\*', '.*', join('|', $quoted)) .'))i';
+ }
+
+ /**
+ * Returns true if this filter accepts the given path.
+ *
+ * @param string $relative The relative path to the specified root.
+ * @param string $absolute The absolute path to a source file.
+ *
+ * @return boolean
+ */
+ public function accept($relative, $absolute)
+ {
+ return ($this->notRelative($relative) && $this->notAbsolute($absolute));
+ }
+
+ /**
+ * This method checks if the given $path does not match against the
+ * exclude patterns as an absolute path.
+ *
+ * @param string $path The absolute path to a source file.
+ *
+ * @return boolean
+ * @since 0.10.0
+ */
+ protected function notAbsolute($path)
+ {
+ return (preg_match($this->absolute, $path) === 0);
+ }
+
+ /**
+ * This method checks if the given $path does not match against the
+ * exclude patterns as an relative path.
+ *
+ * @param string $path The relative path to a source file.
+ *
+ * @return boolean
+ * @since 0.10.0
+ */
+ protected function notRelative($path)
+ {
+ return (preg_match($this->relative, $path) === 0);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Input/ExtensionFilter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Input/ExtensionFilter.php
new file mode 100644
index 0000000..fa19720
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Input/ExtensionFilter.php
@@ -0,0 +1,84 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Input;
+
+/**
+ * Whitelist filter that accepts files by their file extension.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ExtensionFilter implements Filter
+{
+ /**
+ * Whitelist of accepted file extensions.
+ *
+ * @var array(string)
+ */
+ protected $extensions = array();
+
+ /**
+ * Constructs a new file extension filter instance with the given list of
+ * allowed file $extensions.
+ *
+ * @param array $extensions List of allowed extension.
+ */
+ public function __construct(array $extensions)
+ {
+ $this->extensions = $extensions;
+ }
+
+ /**
+ * Returns true if this filter accepts the given paths.
+ *
+ * @param string $relative The relative path to the specified root.
+ * @param string $absolute The absolute path to a source file.
+ * @return boolean
+ */
+ public function accept($relative, $absolute)
+ {
+ $extension = pathinfo($relative, PATHINFO_EXTENSION);
+
+ return in_array($extension, $this->extensions);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Input/Filter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Input/Filter.php
new file mode 100644
index 0000000..861edfc
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Input/Filter.php
@@ -0,0 +1,61 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Input;
+
+/**
+ * Base interface for file filters.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface Filter
+{
+ /**
+ * Returns true if this filter accepts the given paths.
+ *
+ * @param string $relative The relative path to the specified root.
+ * @param string $absolute The absolute path to a source file.
+ * @return boolean
+ */
+ public function accept($relative, $absolute);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Input/Iterator.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Input/Iterator.php
new file mode 100644
index 0000000..9c5ad8c
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Input/Iterator.php
@@ -0,0 +1,118 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Input;
+
+/**
+ * Simple utility filter iterator for php source files.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Iterator extends \FilterIterator
+{
+ /**
+ * The associated filter object.
+ *
+ * @var \PDepend\Input\Filter
+ */
+ protected $filter = null;
+
+ /**
+ * Optional root path for the files.
+ *
+ * @var string
+ * @since 0.10.0
+ */
+ protected $rootPath = null;
+
+ /**
+ * Constructs a new file filter iterator.
+ *
+ * @param \Iterator $iterator The inner iterator.
+ * @param \PDepend\Input\Filter $filter The filter object.
+ * @param string $rootPath Optional root path for the files.
+ */
+ public function __construct(\Iterator $iterator, Filter $filter, $rootPath = null)
+ {
+ parent::__construct($iterator);
+
+ $this->filter = $filter;
+ $this->rootPath = $rootPath;
+ }
+
+ /**
+ * Returns true if the file name ends with '.php'.
+ *
+ * @return boolean
+ */
+ public function accept()
+ {
+ return $this->filter->accept($this->getLocalPath(), $this->getFullPath());
+ }
+
+ /**
+ * Returns the full qualified realpath for the currently active file.
+ *
+ * @return string
+ * @since 0.10.0
+ */
+ protected function getFullPath()
+ {
+ return $this->getInnerIterator()->current()->getRealpath();
+ }
+
+ /**
+ * Returns the local path of the current file, if the root path property was
+ * set. If not, this method returns the absolute file path.
+ *
+ * @return string
+ * @since 0.10.0
+ */
+ protected function getLocalPath()
+ {
+ if ($this->rootPath && 0 === strpos($this->getFullPath(), $this->rootPath)) {
+ return substr($this->getFullPath(), strlen($this->rootPath));
+ }
+ return $this->getFullPath();
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AbstractAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AbstractAnalyzer.php
new file mode 100644
index 0000000..b747517
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AbstractAnalyzer.php
@@ -0,0 +1,147 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics;
+
+use PDepend\Source\ASTVisitor\AbstractASTVisitor;
+
+/**
+ * This abstract class provides a base implementation of an analyzer.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+abstract class AbstractAnalyzer extends AbstractASTVisitor implements Analyzer
+{
+ /**
+ * Global options array.
+ *
+ * @var array(string=>mixed)
+ */
+ protected $options = array();
+
+ /**
+ * List or registered listeners.
+ *
+ * @var \PDepend\Metrics\AnalyzerListener[]
+ */
+ private $listeners = array();
+
+ /**
+ * Constructs a new analyzer instance.
+ *
+ * @param array(string=>mixed) $options Global option array, every analyzer
+ * can extract the required options.
+ */
+ public function __construct(array $options = array())
+ {
+ $this->options = $options;
+ }
+
+ /**
+ * Set global options
+ *
+ * @param array(string=>mixed) $options Global option array, every analyzer
+ * can extract the required options.
+ */
+ public function setOptions(array $options = array())
+ {
+ $this->options = $options;
+ }
+
+ /**
+ * Adds a listener to this analyzer.
+ *
+ * @param \PDepend\Metrics\AnalyzerListener $listener The listener instance.
+ * @return void
+ */
+ public function addAnalyzeListener(\PDepend\Metrics\AnalyzerListener $listener)
+ {
+ if (in_array($listener, $this->listeners, true) === false) {
+ $this->listeners[] = $listener;
+ }
+ }
+
+ /**
+ * An analyzer that is active must return true to recognized by
+ * pdepend framework, while an analyzer that does not perform any action
+ * for any reason should return false.
+ *
+ * By default all analyzers are enabled. Overwrite this method to provide
+ * state based disabling/enabling.
+ *
+ * @return boolean
+ * @since 0.9.10
+ */
+ public function isEnabled()
+ {
+ return true;
+ }
+
+ /**
+ * The analyzer implementation should call this method when it starts the
+ * code processing. This method will send an analyzer start event to all
+ * registered listeners.
+ *
+ * @return void
+ */
+ protected function fireStartAnalyzer()
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startAnalyzer($this);
+ }
+ }
+
+ /**
+ * The analyzer implementation should call this method when it has finished
+ * the code processing. This method will send an analyzer end event to all
+ * registered listeners.
+ *
+ * @return void
+ */
+ protected function fireEndAnalyzer()
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endAnalyzer($this);
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AbstractCachingAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AbstractCachingAnalyzer.php
new file mode 100644
index 0000000..304ddbd
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AbstractCachingAnalyzer.php
@@ -0,0 +1,137 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Metrics;
+
+use PDepend\Metrics\AbstractAnalyzer;
+use PDepend\Metrics\AnalyzerCacheAware;
+use PDepend\Source\AST\AbstractASTArtifact;
+use PDepend\Util\Cache\CacheDriver;
+
+/**
+ * This abstract class provides an analyzer that provides the basic infrastructure
+ * for caching.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+abstract class AbstractCachingAnalyzer extends AbstractAnalyzer implements AnalyzerCacheAware
+{
+ /**
+ * Collected node metrics
+ *
+ * @var array
+ */
+ protected $metrics = null;
+
+ /**
+ * Metrics restored from the cache. This property is only used temporary.
+ *
+ * @var array
+ */
+ private $metricsCached = array();
+
+ /**
+ * Injected cache driver.
+ *
+ * @var \PDepend\Util\Cache\CacheDriver
+ */
+ private $cache;
+
+ /**
+ * Setter method for the system wide used cache.
+ *
+ * @param \PDepend\Util\Cache\CacheDriver $cache
+ * @return void
+ */
+ public function setCache(CacheDriver $cache)
+ {
+ $this->cache = $cache;
+ }
+
+ /**
+ * Tries to restore the metrics for a cached node. If this method has
+ * restored the metrics it will return TRUE, otherwise the return
+ * value will be FALSE.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return boolean
+ */
+ protected function restoreFromCache(AbstractASTArtifact $node)
+ {
+ $id = $node->getId();
+ if ($node->isCached() && isset($this->metricsCached[$id])) {
+ $this->metrics[$id] = $this->metricsCached[$id];
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Initializes the previously calculated metrics from the cache.
+ *
+ * @return void
+ */
+ protected function loadCache()
+ {
+ $this->metricsCached = (array) $this->cache
+ ->type('metrics')
+ ->restore(get_class($this));
+ }
+
+ /**
+ * Unloads the metrics cache and stores the current set of metrics in the
+ * cache.
+ *
+ * @return void
+ */
+ protected function unloadCache()
+ {
+ $this->cache
+ ->type('metrics')
+ ->store(get_class($this), $this->metrics);
+
+ $this->metricsCached = array();
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AggregateAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AggregateAnalyzer.php
new file mode 100644
index 0000000..204eaab
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AggregateAnalyzer.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics;
+
+/**
+ * This analyzer interface provides a specialized form that allows an analyzer
+ * to aggregate metrics calculated by other analyzers.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface AggregateAnalyzer extends Analyzer
+{
+ /**
+ * This method must return an array of class names for required
+ * analyzers.
+ *
+ * @return array(string)
+ */
+ public function getRequiredAnalyzers();
+
+ /**
+ * Adds a required sub analyzer.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The sub analyzer instance.
+ * @return void
+ */
+ public function addAnalyzer(Analyzer $analyzer);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer.php
new file mode 100644
index 0000000..74bd7e6
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer.php
@@ -0,0 +1,96 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics;
+
+use PDepend\Source\AST\ASTArtifactList;
+
+/**
+ * Base interface for all analyzer implementations.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface Analyzer
+{
+ /**
+ * Constructs a new analyzer instance.
+ *
+ * @param array(string=>mixed) $options Global option array, every analyzer
+ * can extract the required options.
+ */
+ public function __construct(array $options = array());
+
+ /**
+ * Adds a listener to this analyzer.
+ *
+ * @param \PDepend\Metrics\AnalyzerListener $listener The listener instance.
+ * @return void
+ */
+ public function addAnalyzeListener(AnalyzerListener $listener);
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces);
+
+ /**
+ * An analyzer that is active must return true to recognized by
+ * pdepend framework, while an analyzer that does not perform any action
+ * for any reason should return false.
+ *
+ * @return boolean
+ * @since 0.9.10
+ */
+ public function isEnabled();
+
+ /**
+ * Set global options
+ *
+ * @param array(string=>mixed) $options
+ * @since 2.0.1
+ */
+ public function setOptions(array $options = array());
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/ClassLevelAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/ClassLevelAnalyzer.php
new file mode 100644
index 0000000..ae33be0
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/ClassLevelAnalyzer.php
@@ -0,0 +1,409 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractAnalyzer;
+use PDepend\Metrics\AggregateAnalyzer;
+use PDepend\Metrics\AnalyzerFilterAware;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Source\AST\AbstractASTType;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTProperty;
+use PDepend\Source\AST\ASTTrait;
+
+/**
+ * Generates some class level based metrics. This analyzer is based on the
+ * metrics specified in the following document.
+ *
+ * http://www.aivosto.com/project/help/pm-oo-misc.html
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ClassLevelAnalyzer extends AbstractAnalyzer implements AggregateAnalyzer, AnalyzerFilterAware, AnalyzerNodeAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_IMPLEMENTED_INTERFACES = 'impl',
+ M_CLASS_INTERFACE_SIZE = 'cis',
+ M_CLASS_SIZE = 'csz',
+ M_NUMBER_OF_PUBLIC_METHODS = 'npm',
+ M_PROPERTIES = 'vars',
+ M_PROPERTIES_INHERIT = 'varsi',
+ M_PROPERTIES_NON_PRIVATE = 'varsnp',
+ M_WEIGHTED_METHODS = 'wmc',
+ M_WEIGHTED_METHODS_INHERIT = 'wmci',
+ M_WEIGHTED_METHODS_NON_PRIVATE = 'wmcnp';
+
+ /**
+ * Hash with all calculated node metrics.
+ *
+ *
+ * array(
+ * '0375e305-885a-4e91-8b5c-e25bda005438' => array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * ),
+ * 'e60c22f0-1a63-4c40-893e-ed3b35b84d0b' => array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * )
+ * )
+ *
+ *
+ * @var array(string=>array)
+ */
+ private $nodeMetrics = null;
+
+ /**
+ * The internal used cyclomatic complexity analyzer.
+ *
+ * @var \PDepend\Metrics\Analyzer\CyclomaticComplexityAnalyzer
+ */
+ private $cyclomaticAnalyzer = null;
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ if ($this->nodeMetrics === null) {
+ // First check for the require cc analyzer
+ if ($this->cyclomaticAnalyzer === null) {
+ throw new \RuntimeException('Missing required CC analyzer.');
+ }
+
+ $this->fireStartAnalyzer();
+
+ $this->cyclomaticAnalyzer->analyze($namespaces);
+
+ // Init node metrics
+ $this->nodeMetrics = array();
+
+ // Visit all nodes
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ $this->fireEndAnalyzer();
+ }
+ }
+
+ /**
+ * This method must return an array of class names for required
+ * analyzers.
+ *
+ * @return array(string)
+ */
+ public function getRequiredAnalyzers()
+ {
+ return array('PDepend\\Metrics\\Analyzer\\CyclomaticComplexityAnalyzer');
+ }
+
+ /**
+ * Adds a required sub analyzer.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The sub analyzer instance.
+ * @return void
+ */
+ public function addAnalyzer(\PDepend\Metrics\Analyzer $analyzer)
+ {
+ if ($analyzer instanceof \PDepend\Metrics\Analyzer\CyclomaticComplexityAnalyzer) {
+ $this->cyclomaticAnalyzer = $analyzer;
+ } else {
+ throw new \InvalidArgumentException('CC Analyzer required.');
+ }
+ }
+
+ /**
+ * This method will return an array with all generated metric values
+ * for the given $node. If there are no metrics for the requested
+ * node, this method will return an empty array.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array(string=>mixed)
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ $metrics = array();
+ if (isset($this->nodeMetrics[$artifact->getId()])) {
+ $metrics = $this->nodeMetrics[$artifact->getId()];
+ }
+ return $metrics;
+ }
+
+ /**
+ * Visits a class node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class)
+ {
+ $this->fireStartClass($class);
+
+ $impl = $class->getInterfaces()->count();
+ $varsi = $this->calculateVarsi($class);
+ $wmci = $this->calculateWmciForClass($class);
+
+ $this->nodeMetrics[$class->getId()] = array(
+ self::M_IMPLEMENTED_INTERFACES => $impl,
+ self::M_CLASS_INTERFACE_SIZE => 0,
+ self::M_CLASS_SIZE => 0,
+ self::M_NUMBER_OF_PUBLIC_METHODS => 0,
+ self::M_PROPERTIES => 0,
+ self::M_PROPERTIES_INHERIT => $varsi,
+ self::M_PROPERTIES_NON_PRIVATE => 0,
+ self::M_WEIGHTED_METHODS => 0,
+ self::M_WEIGHTED_METHODS_INHERIT => $wmci,
+ self::M_WEIGHTED_METHODS_NON_PRIVATE => 0
+ );
+
+ foreach ($class->getProperties() as $property) {
+ $property->accept($this);
+ }
+ foreach ($class->getMethods() as $method) {
+ $method->accept($this);
+ }
+
+ $this->fireEndClass($class);
+ }
+
+ /**
+ * Visits a code interface object.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ // Empty visit method, we don't want interface metrics
+ }
+
+ /**
+ * Visits a trait node.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 1.0.0
+ */
+ public function visitTrait(ASTTrait $trait)
+ {
+ $this->fireStartTrait($trait);
+
+ $wmci = $this->calculateWmciForTrait($trait);
+
+ $this->nodeMetrics[$trait->getId()] = array(
+ self::M_IMPLEMENTED_INTERFACES => 0,
+ self::M_CLASS_INTERFACE_SIZE => 0,
+ self::M_CLASS_SIZE => 0,
+ self::M_NUMBER_OF_PUBLIC_METHODS => 0,
+ self::M_PROPERTIES => 0,
+ self::M_PROPERTIES_INHERIT => 0,
+ self::M_PROPERTIES_NON_PRIVATE => 0,
+ self::M_WEIGHTED_METHODS => 0,
+ self::M_WEIGHTED_METHODS_INHERIT => $wmci,
+ self::M_WEIGHTED_METHODS_NON_PRIVATE => 0
+ );
+
+ foreach ($trait->getProperties() as $property) {
+ $property->accept($this);
+ }
+ foreach ($trait->getMethods() as $method) {
+ $method->accept($this);
+ }
+
+ $this->fireEndTrait($trait);
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+
+ $id = $method->getParent()->getId();
+
+ $ccn = $this->cyclomaticAnalyzer->getCcn2($method);
+
+ // Increment Weighted Methods Per Class(WMC) value
+ $this->nodeMetrics[$id][self::M_WEIGHTED_METHODS] += $ccn;
+ // Increment Class Size(CSZ) value
+ ++$this->nodeMetrics[$id][self::M_CLASS_SIZE];
+
+ // Increment Non Private values
+ if ($method->isPublic()) {
+ ++$this->nodeMetrics[$id][self::M_NUMBER_OF_PUBLIC_METHODS];
+ // Increment Non Private WMC value
+ $this->nodeMetrics[$id][self::M_WEIGHTED_METHODS_NON_PRIVATE] += $ccn;
+ // Increment Class Interface Size(CIS) value
+ ++$this->nodeMetrics[$id][self::M_CLASS_INTERFACE_SIZE];
+ }
+
+ $this->fireEndMethod($method);
+ }
+
+ /**
+ * Visits a property node.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ public function visitProperty(ASTProperty $property)
+ {
+ $this->fireStartProperty($property);
+
+ $id = $property->getDeclaringClass()->getId();
+
+ // Increment VARS value
+ ++$this->nodeMetrics[$id][self::M_PROPERTIES];
+ // Increment Class Size(CSZ) value
+ ++$this->nodeMetrics[$id][self::M_CLASS_SIZE];
+
+ // Increment Non Private values
+ if ($property->isPublic()) {
+ // Increment Non Private VARS value
+ ++$this->nodeMetrics[$id][self::M_PROPERTIES_NON_PRIVATE];
+ // Increment Class Interface Size(CIS) value
+ ++$this->nodeMetrics[$id][self::M_CLASS_INTERFACE_SIZE];
+ }
+
+ $this->fireEndProperty($property);
+ }
+
+ /**
+ * Calculates the Variables Inheritance of a class metric, this method only
+ * counts protected and public properties of parent classes.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class The context class instance.
+ * @return integer
+ */
+ private function calculateVarsi(ASTClass $class)
+ {
+ // List of properties, this method only counts not overwritten properties
+ $properties = array();
+ // Collect all properties of the context class
+ foreach ($class->getProperties() as $prop) {
+ $properties[$prop->getName()] = true;
+ }
+
+ foreach ($class->getParentClasses() as $parent) {
+ foreach ($parent->getProperties() as $prop) {
+ if (!$prop->isPrivate() && !isset($properties[$prop->getName()])) {
+ $properties[$prop->getName()] = true;
+ }
+ }
+ }
+ return count($properties);
+ }
+
+ /**
+ * Calculates the Weight Method Per Class metric, this method only counts
+ * protected and public methods of parent classes.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class The context class instance.
+ * @return integer
+ */
+ private function calculateWmciForClass(ASTClass $class)
+ {
+ $ccn = $this->calculateWmci($class);
+
+ foreach ($class->getParentClasses() as $parent) {
+ foreach ($parent->getMethods() as $method) {
+ if ($method->isPrivate()) {
+ continue;
+ }
+ if (isset($ccn[($name = $method->getName())])) {
+ continue;
+ }
+ $ccn[$name] = $this->cyclomaticAnalyzer->getCcn2($method);
+ }
+ }
+
+ return array_sum($ccn);
+ }
+
+ /**
+ * Calculates the Weight Method Per Class metric for a trait.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return integer
+ * @since 1.0.6
+ */
+ private function calculateWmciForTrait(ASTTrait $trait)
+ {
+ return array_sum($this->calculateWmci($trait));
+ }
+
+ /**
+ * Calculates the Weight Method Per Class metric.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ * @return integer[]
+ * @since 1.0.6
+ */
+ private function calculateWmci(AbstractASTType $type)
+ {
+ $ccn = array();
+
+ foreach ($type->getMethods() as $method) {
+ $ccn[$method->getName()] = $this->cyclomaticAnalyzer->getCcn2($method);
+ }
+
+ return $ccn;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer.php
new file mode 100644
index 0000000..6382429
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer.php
@@ -0,0 +1,236 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractAnalyzer;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Metrics\Analyzer\CodeRankAnalyzer\StrategyFactory;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTArtifactList;
+
+/**
+ * Calculates the code rank metric for classes and namespaces.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class CodeRankAnalyzer extends AbstractAnalyzer implements AnalyzerNodeAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_CODE_RANK = 'cr',
+ M_REVERSE_CODE_RANK = 'rcr';
+
+ /**
+ * The used damping factor.
+ */
+ const DAMPING_FACTOR = 0.85;
+
+ /**
+ * Number of loops for the code range calculation.
+ */
+ const ALGORITHM_LOOPS = 25;
+
+ /**
+ * Option key for the code rank mode.
+ */
+ const STRATEGY_OPTION = 'coderank-mode';
+
+ /**
+ * All found nodes.
+ *
+ * @var array(string=>array)
+ */
+ private $nodes = array();
+
+ /**
+ * List of node collect strategies.
+ *
+ * @var \PDepend\Metrics\Analyzer\CodeRankAnalyzer\CodeRankStrategyI[]
+ */
+ private $strategies = array();
+
+ /**
+ * Hash with all calculated node metrics.
+ *
+ *
+ * array(
+ * '0375e305-885a-4e91-8b5c-e25bda005438' => array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * ),
+ * 'e60c22f0-1a63-4c40-893e-ed3b35b84d0b' => array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * )
+ * )
+ *
+ *
+ * @var array(string=>array)
+ */
+ private $nodeMetrics = null;
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ if ($this->nodeMetrics === null) {
+
+ $this->fireStartAnalyzer();
+
+ $factory = new StrategyFactory();
+ if (isset($this->options[self::STRATEGY_OPTION])) {
+ foreach ($this->options[self::STRATEGY_OPTION] as $identifier) {
+ $this->strategies[] = $factory->createStrategy($identifier);
+ }
+ } else {
+ $this->strategies[] = $factory->createDefaultStrategy();
+ }
+
+ // Register all listeners
+ foreach ($this->getVisitListeners() as $listener) {
+ foreach ($this->strategies as $strategy) {
+ $strategy->addVisitListener($listener);
+ }
+ }
+
+ foreach ($namespaces as $namespace) {
+ // Traverse all strategies
+ foreach ($this->strategies as $strategy) {
+ $namespace->accept($strategy);
+ }
+ }
+
+ // Collect all nodes
+ foreach ($this->strategies as $strategy) {
+ $collected = $strategy->getCollectedNodes();
+ $this->nodes = array_merge_recursive($collected, $this->nodes);
+ }
+
+ // Init node metrics
+ $this->nodeMetrics = array();
+
+ // Calculate code rank metrics
+ $this->buildCodeRankMetrics();
+
+ $this->fireEndAnalyzer();
+ }
+ }
+
+ /**
+ * This method will return an array with all generated metric values
+ * for the given $node. If there are no metrics for the requested
+ * node, this method will return an empty array.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array(string=>mixed)
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ if (isset($this->nodeMetrics[$artifact->getId()])) {
+ return $this->nodeMetrics[$artifact->getId()];
+ }
+ return array();
+ }
+
+ /**
+ * Generates the forward and reverse code rank for the given $nodes.
+ *
+ * @return void
+ */
+ protected function buildCodeRankMetrics()
+ {
+ foreach (array_keys($this->nodes) as $id) {
+ $this->nodeMetrics[$id] = array(
+ self::M_CODE_RANK => 0,
+ self::M_REVERSE_CODE_RANK => 0
+ );
+ }
+ foreach ($this->computeCodeRank('out', 'in') as $id => $rank) {
+ $this->nodeMetrics[$id][self::M_CODE_RANK] = $rank;
+ }
+ foreach ($this->computeCodeRank('in', 'out') as $id => $rank) {
+ $this->nodeMetrics[$id][self::M_REVERSE_CODE_RANK] = $rank;
+ }
+ }
+
+ /**
+ * Calculates the code rank for the given $nodes set.
+ *
+ * @param string $id1 Identifier for the incoming edges.
+ * @param string $id2 Identifier for the outgoing edges.
+ *
+ * @return array(string=>float)
+ */
+ protected function computeCodeRank($id1, $id2)
+ {
+ $dampingFactory = self::DAMPING_FACTOR;
+
+ $ranks = array();
+
+ foreach (array_keys($this->nodes) as $name) {
+ $ranks[$name] = 1;
+ }
+
+ for ($i = 0; $i < self::ALGORITHM_LOOPS; $i++) {
+ foreach ($this->nodes as $name => $info) {
+ $rank = 0;
+ foreach ($info[$id1] as $ref) {
+ $previousRank = $ranks[$ref];
+ $refCount = count($this->nodes[$ref][$id2]);
+
+ $rank += ($previousRank / $refCount);
+ }
+ $ranks[$name] = ((1 - $dampingFactory)) + $dampingFactory * $rank;
+ }
+ }
+ return $ranks;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/CodeRankStrategyI.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/CodeRankStrategyI.php
new file mode 100644
index 0000000..3cff180
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/CodeRankStrategyI.php
@@ -0,0 +1,61 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer\CodeRankAnalyzer;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * The code rank strategy provides an interface for dependency collection.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface CodeRankStrategyI extends ASTVisitor
+{
+ /**
+ * Returns the collected nodes.
+ *
+ * @return array(string=>array)
+ */
+ public function getCollectedNodes();
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/InheritanceStrategy.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/InheritanceStrategy.php
new file mode 100644
index 0000000..9806237
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/InheritanceStrategy.php
@@ -0,0 +1,151 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer\CodeRankAnalyzer;
+
+use PDepend\Source\AST\AbstractASTArtifact;
+use PDepend\Source\AST\AbstractASTClassOrInterface;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\ASTVisitor\AbstractASTVisitor;
+
+/**
+ * Collects class and namespace metrics based on inheritance.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class InheritanceStrategy extends AbstractASTVisitor implements CodeRankStrategyI
+{
+ /**
+ * All found nodes.
+ *
+ * @var array(string=>array)
+ */
+ private $nodes = array();
+
+ /**
+ * Returns the collected nodes.
+ *
+ * @return array(string=>array)
+ */
+ public function getCollectedNodes()
+ {
+ return $this->nodes;
+ }
+
+ /**
+ * Visits a code class object.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class)
+ {
+ $this->fireStartClass($class);
+ $this->visitType($class);
+ $this->fireEndClass($class);
+ }
+
+ /**
+ * Visits a code interface object.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ $this->fireStartInterface($interface);
+ $this->visitType($interface);
+ $this->fireEndInterface($interface);
+ }
+
+ /**
+ * Generic visitor method for classes and interfaces. Both visit methods
+ * delegate calls to this method.
+ *
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $type
+ * @return void
+ */
+ protected function visitType(AbstractASTClassOrInterface $type)
+ {
+ $namespace = $type->getNamespace();
+
+ $this->initNode($namespace);
+ $this->initNode($type);
+
+ foreach ($type->getDependencies() as $dependency) {
+
+ $depPkg = $dependency->getNamespace();
+
+ $this->initNode($dependency);
+ $this->initNode($depPkg);
+
+ $this->nodes[$type->getId()]['in'][] = $dependency->getId();
+ $this->nodes[$dependency->getId()]['out'][] = $type->getId();
+
+ // No self references
+ if ($namespace !== $depPkg) {
+ $this->nodes[$namespace->getId()]['in'][] = $depPkg->getId();
+ $this->nodes[$depPkg->getId()]['out'][] = $namespace->getId();
+ }
+ }
+ }
+
+ /**
+ * Initializes the temporary node container for the given $node.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return void
+ */
+ protected function initNode(AbstractASTArtifact $node)
+ {
+ if (!isset($this->nodes[$node->getId()])) {
+ $this->nodes[$node->getId()] = array(
+ 'in' => array(),
+ 'out' => array(),
+ 'name' => $node->getName(),
+ 'type' => get_class($node)
+ );
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/MethodStrategy.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/MethodStrategy.php
new file mode 100644
index 0000000..67d3a87
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/MethodStrategy.php
@@ -0,0 +1,148 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer\CodeRankAnalyzer;
+
+use PDepend\Source\AST\AbstractASTArtifact;
+use PDepend\Source\AST\AbstractASTClassOrInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\ASTVisitor\AbstractASTVisitor;
+
+/**
+ * Collects class and namespace metrics based on class and interface methods.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class MethodStrategy extends AbstractASTVisitor implements CodeRankStrategyI
+{
+ /**
+ * All found nodes.
+ *
+ * @var array(string=>array)
+ */
+ private $nodes = array();
+
+ /**
+ * Returns the collected nodes.
+ *
+ * @return array(string=>array)
+ */
+ public function getCollectedNodes()
+ {
+ return $this->nodes;
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+
+ // Get owner type
+ $type = $method->getParent();
+
+ if (($depType = $method->getReturnClass()) !== null) {
+ $this->processType($type, $depType);
+ }
+ foreach ($method->getExceptionClasses() as $depType) {
+ $this->processType($type, $depType);
+ }
+ foreach ($method->getDependencies() as $depType) {
+ $this->processType($type, $depType);
+ }
+
+ $this->fireEndMethod($method);
+ }
+
+ /**
+ * Extracts the coupling information between the two given types and their
+ * parent namespacess.
+ *
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $type
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $dependency
+ * @return void
+ */
+ private function processType(AbstractASTClassOrInterface $type, AbstractASTClassOrInterface $dependency)
+ {
+ if ($type !== $dependency) {
+ $this->initNode($type);
+ $this->initNode($dependency);
+
+ $this->nodes[$type->getId()]['in'][] = $dependency->getId();
+ $this->nodes[$dependency->getId()]['out'][] = $type->getId();
+ }
+
+ $namespace = $type->getNamespace();
+ $dependencyNamespace = $dependency->getNamespace();
+
+ if ($namespace !== $dependencyNamespace) {
+ $this->initNode($namespace);
+ $this->initNode($dependencyNamespace);
+
+ $this->nodes[$namespace->getId()]['in'][] = $dependencyNamespace->getId();
+ $this->nodes[$dependencyNamespace->getId()]['out'][] = $namespace->getId();
+ }
+ }
+
+ /**
+ * Initializes the temporary node container for the given $node.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return void
+ */
+ private function initNode(AbstractASTArtifact $node)
+ {
+ if (!isset($this->nodes[$node->getId()])) {
+ $this->nodes[$node->getId()] = array(
+ 'in' => array(),
+ 'out' => array(),
+ 'name' => $node->getName(),
+ 'type' => get_class($node)
+ );
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/PropertyStrategy.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/PropertyStrategy.php
new file mode 100644
index 0000000..247ebcd
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/PropertyStrategy.php
@@ -0,0 +1,130 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer\CodeRankAnalyzer;
+
+use PDepend\Source\AST\AbstractASTArtifact;
+use PDepend\Source\AST\ASTProperty;
+use PDepend\Source\ASTVisitor\AbstractASTVisitor;
+
+/**
+ * Collects class and namespace metrics based on class properties.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class PropertyStrategy extends AbstractASTVisitor implements CodeRankStrategyI
+{
+ /**
+ * All found nodes.
+ *
+ * @var array(string=>array)
+ */
+ private $nodes = array();
+
+ /**
+ * Returns the collected nodes.
+ *
+ * @return array(string=>array)
+ */
+ public function getCollectedNodes()
+ {
+ return $this->nodes;
+ }
+
+ /**
+ * Visits a property node.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ public function visitProperty(ASTProperty $property)
+ {
+ $this->fireStartProperty($property);
+
+ if (($depClass = $property->getClass()) === null) {
+ $this->fireEndProperty($property);
+ return;
+ }
+
+ $depNamespace = $depClass->getNamespace();
+
+ $class = $property->getDeclaringClass();
+ $namespace = $class->getNamespace();
+
+ if ($depClass !== $class) {
+ $this->initNode($class);
+ $this->initNode($depClass);
+
+ $this->nodes[$class->getId()]['in'][] = $depClass->getId();
+ $this->nodes[$depClass->getId()]['out'][] = $class->getId();
+ }
+
+ if ($depNamespace !== $namespace) {
+ $this->initNode($namespace);
+ $this->initNode($depNamespace);
+
+ $this->nodes[$namespace->getId()]['in'][] = $depNamespace->getId();
+ $this->nodes[$depNamespace->getId()]['out'][] = $namespace->getId();
+ }
+
+ $this->fireEndProperty($property);
+ }
+
+ /**
+ * Initializes the temporary node container for the given $node.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return void
+ */
+ protected function initNode(AbstractASTArtifact $node)
+ {
+ if (!isset($this->nodes[$node->getId()])) {
+ $this->nodes[$node->getId()] = array(
+ 'in' => array(),
+ 'out' => array(),
+ 'name' => $node->getName(),
+ 'type' => get_class($node)
+ );
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/StrategyFactory.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/StrategyFactory.php
new file mode 100644
index 0000000..73cf850
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/StrategyFactory.php
@@ -0,0 +1,125 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer\CodeRankAnalyzer;
+
+/**
+ * Factory for the different code rank strategies.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class StrategyFactory
+{
+ /**
+ * The identifier for the inheritance strategy.
+ */
+ const STRATEGY_INHERITANCE = 'inheritance';
+
+ /**
+ * The identifier for the property strategy.
+ */
+ const STRATEGY_PROPERTY = 'property';
+
+ /**
+ * The identifier for the method strategy.
+ */
+ const STRATEGY_METHOD = 'method';
+
+ /**
+ * The default strategy.
+ *
+ * @var string
+ */
+ private $defaultStrategy = self::STRATEGY_INHERITANCE;
+
+ /**
+ * List of all valid properties.
+ *
+ * @var array(string)
+ */
+ private $validStrategies = array(
+ self::STRATEGY_INHERITANCE,
+ self::STRATEGY_METHOD,
+ self::STRATEGY_PROPERTY
+ );
+
+ /**
+ * Creates the default code rank strategy.
+ *
+ * @return \PDepend\Metrics\Analyzer\CodeRankAnalyzer\CodeRankStrategyI
+ */
+ public function createDefaultStrategy()
+ {
+ return $this->createStrategy($this->defaultStrategy);
+ }
+
+ /**
+ * Creates a code rank strategy for the given identifier.
+ *
+ * @param string $strategyName The strategy identifier.
+ * @return \PDepend\Metrics\Analyzer\CodeRankAnalyzer\CodeRankStrategyI
+ * @throws \InvalidArgumentException If the given $id is not valid or
+ * no matching class declaration exists.
+ */
+ public function createStrategy($strategyName)
+ {
+ if (in_array($strategyName, $this->validStrategies) === false) {
+ throw new \InvalidArgumentException(
+ sprintf('Cannot load file for identifier "%s".', $strategyName)
+ );
+ }
+
+ // Prepare identifier
+ $name = ucfirst(strtolower($strategyName));
+
+ $className = "PDepend\\Metrics\\Analyzer\\CodeRankAnalyzer\\{$name}Strategy";
+
+ if (false === class_exists($className)) {
+ $fileName = "PDepend/Metrics/Analyzer/CodeRankAnalyzer/{$name}Strategy.php";
+
+ include_once $fileName;
+ }
+
+ return new $className();
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CohesionAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CohesionAnalyzer.php
new file mode 100644
index 0000000..70b98c0
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CohesionAnalyzer.php
@@ -0,0 +1,155 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractAnalyzer;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTArtifactList;
+
+/**
+ * This analyzer implements several metrics that describe cohesion of classes
+ * and namespaces.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class CohesionAnalyzer extends AbstractAnalyzer implements AnalyzerNodeAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_LCOM4 = 'lcom4';
+
+ /**
+ * Collected cohesion metrics for classes.
+ *
+ * @var array
+ */
+ private $nodeMetrics = array();
+
+ /**
+ * This method will return an array with all generated metric values
+ * for the node with the given $id identifier. If there are no
+ * metrics for the requested node, this method will return an empty array.
+ *
+ *
+ * array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * )
+ *
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array(string=>mixed)
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ if (isset($this->nodeMetrics[$artifact->getId()])) {
+ return $this->nodeMetrics[$artifact->getId()];
+ }
+ return array();
+ }
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ *
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ $this->fireStartAnalyzer();
+
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ $this->fireEndAnalyzer();
+ }
+
+ /*
+ public function visitProperty(\PDepend\Source\AST\ASTProperty $property)
+ {
+ $this->fireStartProperty($property);
+ echo ltrim($property->getName(), '$'), PHP_EOL;
+ $this->fireEndProperty($property);
+ }
+
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+
+ $prefixes = $method->findChildrenOfType(
+ 'PDepend\\Source\\AST\\ASTMemberPrimaryPrefix'
+ );
+ foreach ($prefixes as $prefix) {
+ $variable = $prefix->getChild(0);
+ if ($variable instanceof \PDepend\Source\AST\ASTVariable
+ && $variable->isThis()
+ ) {
+ echo "\$this->";
+ } elseif ($variable instanceof \PDepend\Source\AST\ASTSelfReference) {
+ echo "self::";
+ } else {
+ continue;
+ }
+
+ $next = $prefix->getChild(1);
+ if ($next instanceof \PDepend\Source\AST\ASTMemberPrimaryPrefix) {
+ $next = $next->getChild(0);
+ }
+
+ if ($next instanceof \PDepend\Source\AST\ASTPropertyPostfix) {
+ echo $next->getImage(), PHP_EOL;
+ } elseif ($next instanceof \PDepend\Source\AST\ASTMethodPostfix) {
+ echo $next->getImage(), '()', PHP_EOL;
+ }
+ }
+
+ $this->fireEndMethod($method);
+ }
+ */
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CouplingAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CouplingAnalyzer.php
new file mode 100644
index 0000000..2305a03
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CouplingAnalyzer.php
@@ -0,0 +1,455 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractAnalyzer;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Metrics\AnalyzerProjectAware;
+use PDepend\Source\AST\AbstractASTCallable;
+use PDepend\Source\AST\AbstractASTType;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTInvocation;
+use PDepend\Source\AST\ASTMemberPrimaryPrefix;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTProperty;
+
+/**
+ * This analyzer collects coupling values for the hole project. It calculates
+ * all function and method calls and the fanout, that means the
+ * number of referenced types.
+ *
+ * The FANOUT calculation is based on the definition used by the apache maven
+ * project.
+ *
+ *
+ *
field declarations (Uses doc comment annotations)
+ *
formal parameters and return types (The return type uses doc comment
+ * annotations)
+ *
+ * http://www.jajakarta.org/turbine/en/turbine/maven/reference/metrics.html
+ *
+ * The implemented algorithm counts each type only once for a method and function.
+ * Any type that is either a supertype or a subtype of the class is not counted.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class CouplingAnalyzer extends AbstractAnalyzer implements AnalyzerNodeAware, AnalyzerProjectAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_CALLS = 'calls',
+ M_FANOUT = 'fanout',
+ M_CA = 'ca',
+ M_CBO = 'cbo',
+ M_CE = 'ce';
+
+ /**
+ * Has this analyzer already processed the source under test?
+ *
+ * @var boolean
+ * @since 0.10.2
+ */
+ private $uninitialized = true;
+
+ /**
+ * The number of method or function calls.
+ *
+ * @var integer
+ */
+ private $calls = 0;
+
+ /**
+ * Number of fanouts.
+ *
+ * @var integer
+ */
+ private $fanout = 0;
+
+ /**
+ * Temporary map that is used to hold the id combinations of dependee and
+ * depender.
+ *
+ * @var array(string=>array)
+ * @since 0.10.2
+ */
+ private $dependencyMap = array();
+
+ /**
+ * This array holds a mapping between node identifiers and an array with
+ * the node's metrics.
+ *
+ * @var array(string=>array)
+ * @since 0.10.2
+ */
+ private $nodeMetrics = array();
+
+ /**
+ * Provides the project summary as an array.
+ *
+ *
+ * array(
+ * 'calls' => 23,
+ * 'fanout' => 42
+ * )
+ *
+ *
+ * @return array(string=>mixed)
+ */
+ public function getProjectMetrics()
+ {
+ return array(
+ self::M_CALLS => $this->calls,
+ self::M_FANOUT => $this->fanout
+ );
+ }
+
+ /**
+ * This method will return an array with all generated metric values
+ * for the given node instance. If there are no metrics for the given node
+ * this method will return an empty array.
+ *
+ *
+ * array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * )
+ *
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array(string=>mixed)
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ if (isset($this->nodeMetrics[$artifact->getId()])) {
+ return $this->nodeMetrics[$artifact->getId()];
+ }
+ return array();
+ }
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ if ($this->uninitialized) {
+ $this->doAnalyze($namespaces);
+ $this->uninitialized = false;
+ }
+ }
+
+ /**
+ * This method traverses all namespaces in the given iterator and calculates
+ * the coupling metrics for them.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ * @since 0.10.2
+ */
+ private function doAnalyze($namespaces)
+ {
+ $this->fireStartAnalyzer();
+ $this->reset();
+
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ $this->postProcessTemporaryCouplingMap();
+ $this->fireEndAnalyzer();
+ }
+
+ /**
+ * This method resets all internal state variables before the analyzer can
+ * start the object tree traversal.
+ *
+ * @return void
+ * @since 0.10.2
+ */
+ private function reset()
+ {
+ $this->calls = 0;
+ $this->fanout = 0;
+ $this->nodeMetrics = array();
+ $this->dependencyMap = array();
+ }
+
+ /**
+ * This method takes the temporary coupling map with node IDs and calculates
+ * the concrete node metrics.
+ *
+ * @return void
+ * @since 0.10.2
+ */
+ private function postProcessTemporaryCouplingMap()
+ {
+ foreach ($this->dependencyMap as $id => $metrics) {
+ $afferentCoupling = count($metrics['ca']);
+ $efferentCoupling = count($metrics['ce']);
+
+ $this->nodeMetrics[$id] = array(
+ self::M_CA => $afferentCoupling,
+ self::M_CBO => $efferentCoupling,
+ self::M_CE => $efferentCoupling
+ );
+
+ $this->fanout += $efferentCoupling;
+ }
+
+ $this->dependencyMap = array();
+ }
+
+ /**
+ * Visits a function node.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function visitFunction(ASTFunction $function)
+ {
+ $this->fireStartFunction($function);
+
+ $fanouts = array();
+ if (($type = $function->getReturnClass()) !== null) {
+ $fanouts[] = $type;
+ ++$this->fanout;
+ }
+ foreach ($function->getExceptionClasses() as $type) {
+ if (in_array($type, $fanouts, true) === false) {
+ $fanouts[] = $type;
+ ++$this->fanout;
+ }
+ }
+ foreach ($function->getDependencies() as $type) {
+ if (in_array($type, $fanouts, true) === false) {
+ $fanouts[] = $type;
+ ++$this->fanout;
+ }
+ }
+
+ foreach ($fanouts as $fanout) {
+ $this->initDependencyMap($fanout);
+
+ $this->dependencyMap[$fanout->getId()]['ca'][$function->getId()] = true;
+ }
+
+ $this->countCalls($function);
+
+ $this->fireEndFunction($function);
+ }
+
+ /**
+ * Visit method for classes that will be called by PDepend during the
+ * analysis phase with the current context class.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ * @since 0.10.2
+ */
+ public function visitClass(ASTClass $class)
+ {
+ $this->initDependencyMap($class);
+ return parent::visitClass($class);
+ }
+
+ /**
+ * Visit method for interfaces that will be called by PDepend during the
+ * analysis phase with the current context interface.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ * @since 0.10.2
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ $this->initDependencyMap($interface);
+ return parent::visitInterface($interface);
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+
+ $declaringClass = $method->getParent();
+
+ $this->calculateCoupling(
+ $declaringClass,
+ $method->getReturnClass()
+ );
+
+ foreach ($method->getExceptionClasses() as $type) {
+ $this->calculateCoupling($declaringClass, $type);
+ }
+ foreach ($method->getDependencies() as $type) {
+ $this->calculateCoupling($declaringClass, $type);
+ }
+
+ $this->countCalls($method);
+
+ $this->fireEndMethod($method);
+ }
+
+ /**
+ * Visits a property node.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ public function visitProperty(ASTProperty $property)
+ {
+ $this->fireStartProperty($property);
+
+ $this->calculateCoupling(
+ $property->getDeclaringClass(),
+ $property->getClass()
+ );
+
+ $this->fireEndProperty($property);
+ }
+
+ /**
+ * Calculates the coupling between the given types.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $declaringType
+ * @param \PDepend\Source\AST\AbstractASTType $coupledType
+ * @return void
+ * @since 0.10.2
+ */
+ private function calculateCoupling(
+ AbstractASTType $declaringType,
+ AbstractASTType $coupledType = null
+ ) {
+ $this->initDependencyMap($declaringType);
+
+ if (null === $coupledType) {
+ return;
+ }
+ if ($coupledType->isSubtypeOf($declaringType)
+ || $declaringType->isSubtypeOf($coupledType)
+ ) {
+ return;
+ }
+
+ $this->initDependencyMap($coupledType);
+
+ $this->dependencyMap[
+ $declaringType->getId()
+ ]['ce'][
+ $coupledType->getId()
+ ] = true;
+
+ $this->dependencyMap[
+ $coupledType->getId()
+ ]['ca'][
+ $declaringType->getId()
+ ] = true;
+ }
+
+ /**
+ * This method will initialize a temporary coupling container for the given
+ * given class or interface instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ * @return void
+ * @since 0.10.2
+ */
+ private function initDependencyMap(AbstractASTType $type)
+ {
+ if (isset($this->dependencyMap[$type->getId()])) {
+ return;
+ }
+
+ $this->dependencyMap[$type->getId()] = array(
+ 'ce' => array(),
+ 'ca' => array()
+ );
+ }
+
+ /**
+ * Counts all calls within the given $callable
+ *
+ * @param \PDepend\Source\AST\AbstractASTCallable $callable
+ * @return void
+ */
+ private function countCalls(AbstractASTCallable $callable)
+ {
+ $invocations = $callable->findChildrenOfType('PDepend\\Source\\AST\\ASTInvocation');
+
+ $invoked = array();
+
+ foreach ($invocations as $invocation) {
+ $parents = $invocation->getParentsOfType('PDepend\\Source\\AST\\ASTMemberPrimaryPrefix');
+
+ $image = '';
+ foreach ($parents as $parent) {
+ $child = $parent->getChild(0);
+ if ($child !== $invocation) {
+ $image .= $child->getImage() . '.';
+ }
+ }
+ $image .= $invocation->getImage() . '()';
+
+ $invoked[$image] = $image;
+ }
+
+ $this->calls += count($invoked);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CrapIndexAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CrapIndexAnalyzer.php
new file mode 100644
index 0000000..62a29bb
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CrapIndexAnalyzer.php
@@ -0,0 +1,272 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractAnalyzer;
+use PDepend\Metrics\AggregateAnalyzer;
+use PDepend\Metrics\Analyzer\CyclomaticComplexityAnalyzer;
+use PDepend\Metrics\Analyzer;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Source\AST\AbstractASTCallable;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTMethod;
+
+/**
+ * This analyzer calculates the C.R.A.P. index for methods an functions when a
+ * clover coverage report was supplied. This report can be supplied by using the
+ * command line option --coverage-report=.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class CrapIndexAnalyzer extends AbstractAnalyzer implements AggregateAnalyzer, AnalyzerNodeAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_CRAP_INDEX = 'crap',
+ M_COVERAGE = 'cov';
+
+ /**
+ * The report option name.
+ */
+ const REPORT_OPTION = 'coverage-report';
+
+ /**
+ * Calculated crap metrics.
+ *
+ * @var array(string=>array)
+ */
+ private $metrics = null;
+
+ /**
+ * The coverage report instance representing the supplied coverage report
+ * file.
+ *
+ * @var \PDepend\Util\Coverage\Report
+ */
+ private $report = null;
+
+ /**
+ *
+ * @var \PDepend\Metrics\Analyzer\CyclomaticComplexityAnalyzer
+ */
+ private $ccnAnalyzer = array();
+
+ /**
+ * Returns true when this analyzer is enabled.
+ *
+ * @return boolean
+ */
+ public function isEnabled()
+ {
+ return isset($this->options[self::REPORT_OPTION]);
+ }
+
+ /**
+ * Returns the calculated metrics for the given node or an empty array
+ * when no metrics exist for the given node.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array(string=>float)
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ if (isset($this->metrics[$artifact->getId()])) {
+ return $this->metrics[$artifact->getId()];
+ }
+ return array();
+ }
+
+ /**
+ * Returns an array with analyzer class names that are required by the crap
+ * index analyzers.
+ *
+ * @return array(string)
+ */
+ public function getRequiredAnalyzers()
+ {
+ return array('PDepend\\Metrics\\Analyzer\\CyclomaticComplexityAnalyzer');
+ }
+
+ /**
+ * Adds an analyzer that this analyzer depends on.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer
+ * @return void
+ */
+ public function addAnalyzer(Analyzer $analyzer)
+ {
+ $this->ccnAnalyzer = $analyzer;
+ }
+
+ /**
+ * Performs the crap index analysis.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ if ($this->isEnabled() && $this->metrics === null) {
+ $this->doAnalyze($namespaces);
+ }
+ }
+
+ /**
+ * Performs the crap index analysis.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ private function doAnalyze($namespaces)
+ {
+ $this->metrics = array();
+
+ $this->ccnAnalyzer->analyze($namespaces);
+
+ $this->fireStartAnalyzer();
+
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ $this->fireEndAnalyzer();
+ }
+
+ /**
+ * Visits the given method.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ if ($method->isAbstract() === false) {
+ $this->visitCallable($method);
+ }
+ }
+
+ /**
+ * Visits the given function.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function visitFunction(ASTFunction $function)
+ {
+ $this->visitCallable($function);
+ }
+
+ /**
+ * Visits the given callable instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTCallable $callable
+ * @return void
+ */
+ private function visitCallable(AbstractASTCallable $callable)
+ {
+ $this->metrics[$callable->getId()] = array(
+ self::M_CRAP_INDEX => $this->calculateCrapIndex($callable),
+ self::M_COVERAGE => $this->calculateCoverage($callable)
+ );
+ }
+
+ /**
+ * Calculates the crap index for the given callable.
+ *
+ * @param \PDepend\Source\AST\AbstractASTCallable $callable
+ * @return float
+ */
+ private function calculateCrapIndex(AbstractASTCallable $callable)
+ {
+ $report = $this->createOrReturnCoverageReport();
+
+ $complexity = $this->ccnAnalyzer->getCcn2($callable);
+ $coverage = $report->getCoverage($callable);
+
+ if ($coverage == 0) {
+ return pow($complexity, 2) + $complexity;
+ } elseif ($coverage > 99.5) {
+ return $complexity;
+ }
+ return pow($complexity, 2) * pow(1 - $coverage / 100, 3) + $complexity;
+ }
+
+ /**
+ * Calculates the code coverage for the given callable object.
+ *
+ * @param \PDepend\Source\AST\AbstractASTCallable $callable
+ * @return float
+ */
+ private function calculateCoverage(AbstractASTCallable $callable)
+ {
+ return $this->createOrReturnCoverageReport()->getCoverage($callable);
+ }
+
+ /**
+ * Returns a previously created report instance or creates a new report
+ * instance.
+ *
+ * @return \PDepend\Util\Coverage\Report
+ */
+ private function createOrReturnCoverageReport()
+ {
+ if ($this->report === null) {
+ $this->report = $this->createCoverageReport();
+ }
+ return $this->report;
+ }
+
+ /**
+ * Creates a new coverage report instance.
+ *
+ * @return \PDepend\Util\Coverage\Report
+ */
+ private function createCoverageReport()
+ {
+ $factory = new \PDepend\Util\Coverage\Factory();
+ return $factory->create($this->options['coverage-report']);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CyclomaticComplexityAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CyclomaticComplexityAnalyzer.php
new file mode 100644
index 0000000..218ac75
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/CyclomaticComplexityAnalyzer.php
@@ -0,0 +1,464 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractCachingAnalyzer;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Metrics\AnalyzerProjectAware;
+use PDepend\Source\AST\AbstractASTCallable;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+
+/**
+ * This class calculates the Cyclomatic Complexity Number(CCN) for the project,
+ * methods and functions.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class CyclomaticComplexityAnalyzer extends AbstractCachingAnalyzer implements AnalyzerNodeAware, AnalyzerProjectAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_CYCLOMATIC_COMPLEXITY_1 = 'ccn',
+ M_CYCLOMATIC_COMPLEXITY_2 = 'ccn2';
+
+ /**
+ * The project Cyclomatic Complexity Number.
+ *
+ * @var integer
+ */
+ private $ccn = 0;
+
+ /**
+ * Extended Cyclomatic Complexity Number(CCN2) for the project.
+ *
+ * @var integer
+ */
+ private $ccn2 = 0;
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ if ($this->metrics === null) {
+ $this->loadCache();
+ $this->fireStartAnalyzer();
+
+ // Init node metrics
+ $this->metrics = array();
+
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ $this->fireEndAnalyzer();
+ $this->unloadCache();
+ }
+ }
+
+ /**
+ * Returns the cyclomatic complexity for the given $node instance.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $node
+ * @return integer
+ */
+ public function getCcn(ASTArtifact $node)
+ {
+ $metrics = $this->getNodeMetrics($node);
+ if (isset($metrics[self::M_CYCLOMATIC_COMPLEXITY_1])) {
+ return $metrics[self::M_CYCLOMATIC_COMPLEXITY_1];
+ }
+ return 0;
+ }
+
+ /**
+ * Returns the extended cyclomatic complexity for the given $node
+ * instance.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $node
+ * @return integer
+ */
+ public function getCcn2(ASTArtifact $node)
+ {
+ $metrics = $this->getNodeMetrics($node);
+ if (isset($metrics[self::M_CYCLOMATIC_COMPLEXITY_2])) {
+ return $metrics[self::M_CYCLOMATIC_COMPLEXITY_2];
+ }
+ return 0;
+ }
+
+ /**
+ * This method will return an array with all generated metric values
+ * for the given $node. If there are no metrics for the requested
+ * node, this method will return an empty array.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ if (isset($this->metrics[$artifact->getId()])) {
+ return $this->metrics[$artifact->getId()];
+ }
+ return array();
+ }
+
+ /**
+ * Provides the project summary metrics as an array.
+ *
+ * @return array
+ */
+ public function getProjectMetrics()
+ {
+ return array(
+ self::M_CYCLOMATIC_COMPLEXITY_1 => $this->ccn,
+ self::M_CYCLOMATIC_COMPLEXITY_2 => $this->ccn2
+ );
+ }
+
+ /**
+ * Visits a function node.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function visitFunction(ASTFunction $function)
+ {
+ $this->fireStartFunction($function);
+
+ if (false === $this->restoreFromCache($function)) {
+ $this->calculateComplexity($function);
+ }
+ $this->updateProjectMetrics($function->getId());
+
+ $this->fireEndFunction($function);
+ }
+
+ /**
+ * Visits a code interface object.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ // Empty visit method, we don't want interface metrics
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+
+ if (false === $this->restoreFromCache($method)) {
+ $this->calculateComplexity($method);
+ }
+ $this->updateProjectMetrics($method->getId());
+
+ $this->fireEndMethod($method);
+ }
+
+ /**
+ * Visits methods, functions or closures and calculated their complexity.
+ *
+ * @param \PDepend\Source\AST\AbstractASTCallable $callable
+ * @return void
+ * @since 0.9.8
+ */
+ public function calculateComplexity(AbstractASTCallable $callable)
+ {
+ $data = array(
+ self::M_CYCLOMATIC_COMPLEXITY_1 => 1,
+ self::M_CYCLOMATIC_COMPLEXITY_2 => 1
+ );
+
+ foreach ($callable->getChildren() as $child) {
+ $data = $child->accept($this, $data);
+ }
+
+ $this->metrics[$callable->getId()] = $data;
+ }
+
+ /**
+ * Stores the complexity of a node and updates the corresponding project
+ * values.
+ *
+ * @param string $nodeId Identifier of the analyzed item.
+ *
+ * @return void
+ * @since 1.0.0
+ */
+ private function updateProjectMetrics($nodeId)
+ {
+ $this->ccn += $this->metrics[$nodeId][self::M_CYCLOMATIC_COMPLEXITY_1];
+ $this->ccn2 += $this->metrics[$nodeId][self::M_CYCLOMATIC_COMPLEXITY_2];
+ }
+
+ /**
+ * Visits a boolean AND-expression.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitBooleanAndExpression($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits a boolean OR-expression.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitBooleanOrExpression($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits a switch label.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitSwitchLabel($node, $data)
+ {
+ if (!$node->isDefault()) {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_1];
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+ }
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits a catch statement.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitCatchStatement($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_1];
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits an elseif statement.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitElseIfStatement($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_1];
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits a for statement.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitForStatement($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_1];
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits a foreach statement.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitForeachStatement($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_1];
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits an if statement.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitIfStatement($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_1];
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits a logical AND expression.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitLogicalAndExpression($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits a logical OR expression.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitLogicalOrExpression($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits a ternary operator.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitConditionalExpression($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_1];
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits a while-statement.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.8
+ */
+ public function visitWhileStatement($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_1];
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+
+ return $this->visit($node, $data);
+ }
+
+ /**
+ * Visits a do/while-statement.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param array(string=>integer) $data The previously calculated ccn values.
+ *
+ * @return array(string=>integer)
+ * @since 0.9.12
+ */
+ public function visitDoWhileStatement($node, $data)
+ {
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_1];
+ ++$data[self::M_CYCLOMATIC_COMPLEXITY_2];
+
+ return $this->visit($node, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/DependencyAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/DependencyAnalyzer.php
new file mode 100644
index 0000000..3759d66
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/DependencyAnalyzer.php
@@ -0,0 +1,480 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractAnalyzer;
+use PDepend\Source\AST\AbstractASTArtifact;
+use PDepend\Source\AST\AbstractASTClassOrInterface;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTNamespace;
+
+/**
+ * This visitor generates the metrics for the analyzed namespaces.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class DependencyAnalyzer extends AbstractAnalyzer
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_NUMBER_OF_CLASSES = 'tc',
+ M_NUMBER_OF_CONCRETE_CLASSES = 'cc',
+ M_NUMBER_OF_ABSTRACT_CLASSES = 'ac',
+ M_AFFERENT_COUPLING = 'ca',
+ M_EFFERENT_COUPLING = 'ce',
+ M_ABSTRACTION = 'a',
+ M_INSTABILITY = 'i',
+ M_DISTANCE = 'd';
+ /**
+ * Hash with all calculated node metrics.
+ *
+ *
+ * array(
+ * '0375e305-885a-4e91-8b5c-e25bda005438' => array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * ),
+ * 'e60c22f0-1a63-4c40-893e-ed3b35b84d0b' => array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * )
+ * )
+ *
+ *
+ * @var array(string=>array)
+ */
+ private $nodeMetrics = null;
+
+ protected $nodeSet = array();
+
+ private $efferentNodes = array();
+
+ private $afferentNodes = array();
+
+ /**
+ * All collected cycles for the input code.
+ *
+ *
+ * array(
+ * => array(
+ * \PDepend\Source\AST\ASTNamespace {},
+ * \PDepend\Source\AST\ASTNamespace {},
+ * ),
+ * => array(
+ * \PDepend\Source\AST\ASTNamespace {},
+ * \PDepend\Source\AST\ASTNamespace {},
+ * ),
+ * )
+ *
+ *
+ * @var array(string=>array)
+ */
+ private $collectedCycles = array();
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ if ($this->nodeMetrics === null) {
+
+ $this->fireStartAnalyzer();
+
+ $this->nodeMetrics = array();
+
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ $this->postProcess();
+
+ $this->calculateAbstractness();
+ $this->calculateInstability();
+ $this->calculateDistance();
+
+ $this->fireEndAnalyzer();
+ }
+ }
+
+ /**
+ * Returns the statistics for the requested node.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return array
+ */
+ public function getStats(AbstractASTArtifact $node)
+ {
+ $stats = array();
+ if (isset($this->nodeMetrics[$node->getId()])) {
+ $stats = $this->nodeMetrics[$node->getId()];
+ }
+ return $stats;
+ }
+
+ /**
+ * Returns an array of all afferent nodes.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return \PDepend\Source\AST\AbstractASTArtifact[]
+ */
+ public function getAfferents(AbstractASTArtifact $node)
+ {
+ $afferents = array();
+ if (isset($this->afferentNodes[$node->getId()])) {
+ $afferents = $this->afferentNodes[$node->getId()];
+ }
+ return $afferents;
+ }
+
+ /**
+ * Returns an array of all efferent nodes.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return \PDepend\Source\AST\AbstractASTArtifact[]
+ */
+ public function getEfferents(AbstractASTArtifact $node)
+ {
+ $efferents = array();
+ if (isset($this->efferentNodes[$node->getId()])) {
+ $efferents = $this->efferentNodes[$node->getId()];
+ }
+ return $efferents;
+ }
+
+ /**
+ * Returns an array of nodes that build a cycle for the requested node or it
+ * returns null if no cycle exists .
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return \PDepend\Source\AST\AbstractASTArtifact[]
+ */
+ public function getCycle(AbstractASTArtifact $node)
+ {
+ if (array_key_exists($node->getId(), $this->collectedCycles)) {
+ return $this->collectedCycles[$node->getId()];
+ }
+
+ $list = array();
+ if ($this->collectCycle($list, $node)) {
+ $this->collectedCycles[$node->getId()] = $list;
+ } else {
+ $this->collectedCycles[$node->getId()] = null;
+ }
+
+ return $this->collectedCycles[$node->getId()];
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+
+ $namespace = $method->getParent()->getNamespace();
+ foreach ($method->getDependencies() as $dependency) {
+ $this->collectDependencies($namespace, $dependency->getNamespace());
+ }
+
+ $this->fireEndMethod($method);
+ }
+
+ /**
+ * Visits a namespace node.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function visitNamespace(ASTNamespace $namespace)
+ {
+ $this->fireStartNamespace($namespace);
+
+ $this->initNamespaceMetric($namespace);
+
+ $this->nodeSet[$namespace->getId()] = $namespace;
+
+ foreach ($namespace->getTypes() as $type) {
+ $type->accept($this);
+ }
+
+ $this->fireEndNamespace($namespace);
+ }
+
+ /**
+ * Visits a class node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class)
+ {
+ $this->fireStartClass($class);
+ $this->visitType($class);
+ $this->fireEndClass($class);
+ }
+
+ /**
+ * Visits an interface node.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ $this->fireStartInterface($interface);
+ $this->visitType($interface);
+ $this->fireEndInterface($interface);
+ }
+
+ /**
+ * Generic visit method for classes and interfaces. Both visit methods
+ * delegate calls to this method.
+ *
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $type
+ * @return void
+ */
+ protected function visitType(AbstractASTClassOrInterface $type)
+ {
+ $id = $type->getNamespace()->getId();
+
+ // Increment total classes count
+ ++$this->nodeMetrics[$id][self::M_NUMBER_OF_CLASSES];
+
+ // Check for abstract or concrete class
+ if ($type->isAbstract()) {
+ ++$this->nodeMetrics[$id][self::M_NUMBER_OF_ABSTRACT_CLASSES];
+ } else {
+ ++$this->nodeMetrics[$id][self::M_NUMBER_OF_CONCRETE_CLASSES];
+ }
+
+
+ foreach ($type->getDependencies() as $dependency) {
+ $this->collectDependencies(
+ $type->getNamespace(),
+ $dependency->getNamespace()
+ );
+ }
+
+ foreach ($type->getMethods() as $method) {
+ $method->accept($this);
+ }
+ }
+
+ /**
+ * Collects the dependencies between the two given namespaces.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespaceA
+ * @param \PDepend\Source\AST\ASTNamespace $namespaceB
+ *
+ * @return void
+ */
+ private function collectDependencies(ASTNamespace $namespaceA, ASTNamespace $namespaceB)
+ {
+ $idA = $namespaceA->getId();
+ $idB = $namespaceB->getId();
+
+ if ($idB === $idA) {
+ return;
+ }
+
+ // Create a container for this dependency
+ $this->initNamespaceMetric($namespaceB);
+
+ if (!in_array($idB, $this->nodeMetrics[$idA][self::M_EFFERENT_COUPLING])) {
+ $this->nodeMetrics[$idA][self::M_EFFERENT_COUPLING][] = $idB;
+ $this->nodeMetrics[$idB][self::M_AFFERENT_COUPLING][] = $idA;
+ }
+ }
+
+ /**
+ * Initializes the node metric record for the given $namespace.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ protected function initNamespaceMetric(ASTNamespace $namespace)
+ {
+ $id = $namespace->getId();
+
+ if (!isset($this->nodeMetrics[$id])) {
+ $this->nodeSet[$id] = $namespace;
+
+ $this->nodeMetrics[$id] = array(
+ self::M_NUMBER_OF_CLASSES => 0,
+ self::M_NUMBER_OF_CONCRETE_CLASSES => 0,
+ self::M_NUMBER_OF_ABSTRACT_CLASSES => 0,
+ self::M_AFFERENT_COUPLING => array(),
+ self::M_EFFERENT_COUPLING => array(),
+ self::M_ABSTRACTION => 0,
+ self::M_INSTABILITY => 0,
+ self::M_DISTANCE => 0
+ );
+ }
+ }
+
+ /**
+ * Post processes all analyzed nodes.
+ *
+ * @return void
+ */
+ protected function postProcess()
+ {
+ foreach ($this->nodeMetrics as $id => $metrics) {
+
+ $this->afferentNodes[$id] = array();
+ foreach ($metrics[self::M_AFFERENT_COUPLING] as $caId) {
+ $this->afferentNodes[$id][] = $this->nodeSet[$caId];
+ }
+ sort($this->afferentNodes[$id]);
+
+ $this->efferentNodes[$id] = array();
+ foreach ($metrics[self::M_EFFERENT_COUPLING] as $ceId) {
+ $this->efferentNodes[$id][] = $this->nodeSet[$ceId];
+ }
+ sort($this->efferentNodes[$id]);
+
+ $afferent = count($metrics[self::M_AFFERENT_COUPLING]);
+ $efferent = count($metrics[self::M_EFFERENT_COUPLING]);
+
+ $this->nodeMetrics[$id][self::M_AFFERENT_COUPLING] = $afferent;
+ $this->nodeMetrics[$id][self::M_EFFERENT_COUPLING] = $efferent;
+ }
+ }
+
+ /**
+ * Calculates the abstractness for all analyzed nodes.
+ *
+ * @return void
+ */
+ protected function calculateAbstractness()
+ {
+ foreach ($this->nodeMetrics as $id => $metrics) {
+ if ($metrics[self::M_NUMBER_OF_CLASSES] !== 0) {
+ $this->nodeMetrics[$id][self::M_ABSTRACTION] = (
+ $metrics[self::M_NUMBER_OF_ABSTRACT_CLASSES] /
+ $metrics[self::M_NUMBER_OF_CLASSES]
+ );
+ }
+
+ }
+ }
+
+ /**
+ * Calculates the instability for all analyzed nodes.
+ *
+ * @return void
+ */
+ protected function calculateInstability()
+ {
+ foreach ($this->nodeMetrics as $id => $metrics) {
+ // Count total incoming and outgoing dependencies
+ $total = (
+ $metrics[self::M_AFFERENT_COUPLING] +
+ $metrics[self::M_EFFERENT_COUPLING]
+ );
+
+ if ($total !== 0) {
+ $this->nodeMetrics[$id][self::M_INSTABILITY] = (
+ $metrics[self::M_EFFERENT_COUPLING] / $total
+ );
+ }
+ }
+ }
+
+ /**
+ * Calculates the distance to an optimal value.
+ *
+ * @return void
+ */
+ protected function calculateDistance()
+ {
+ foreach ($this->nodeMetrics as $id => $metrics) {
+ $this->nodeMetrics[$id][self::M_DISTANCE] = abs(
+ ($metrics[self::M_ABSTRACTION] + $metrics[self::M_INSTABILITY]) - 1
+ );
+ }
+ }
+
+ /**
+ * Collects a single cycle that is reachable by this namespace. All namespaces
+ * that are part of the cylce are stored in the given $list array.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] &$list
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return boolean If this method detects a cycle the return value is true
+ * otherwise this method will return false.
+ */
+ protected function collectCycle(array &$list, ASTNamespace $namespace)
+ {
+ if (in_array($namespace, $list, true)) {
+ $list[] = $namespace;
+ return true;
+ }
+
+ $list[] = $namespace;
+
+ foreach ($this->getEfferents($namespace) as $efferent) {
+ if ($this->collectCycle($list, $efferent)) {
+ return true;
+ }
+ }
+
+ if (is_int($idx = array_search($namespace, $list, true))) {
+ unset($list[$idx]);
+ }
+ return false;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/HierarchyAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/HierarchyAnalyzer.php
new file mode 100644
index 0000000..21c4ae2
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/HierarchyAnalyzer.php
@@ -0,0 +1,318 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractAnalyzer;
+use PDepend\Metrics\AnalyzerFilterAware;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Metrics\AnalyzerProjectAware;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTNamespace;
+
+/**
+ * This analyzer calculates class/namespace hierarchy metrics.
+ *
+ * This analyzer expects that a node list filter is set, before it starts the
+ * analyze process. This filter will suppress PHP internal and external library
+ * stuff.
+ *
+ * This analyzer is based on the following metric set:
+ * - http://www.aivosto.com/project/help/pm-oo-misc.html
+ *
+ * This analyzer is based on the following metric set:
+ * - http://www.aivosto.com/project/help/pm-oo-misc.html
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class HierarchyAnalyzer extends AbstractAnalyzer implements AnalyzerFilterAware, AnalyzerNodeAware, AnalyzerProjectAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_NUMBER_OF_ABSTRACT_CLASSES = 'clsa',
+ M_NUMBER_OF_CONCRETE_CLASSES = 'clsc',
+ M_NUMBER_OF_ROOT_CLASSES = 'roots',
+ M_NUMBER_OF_LEAF_CLASSES = 'leafs';
+
+ /**
+ * Number of all analyzed functions.
+ *
+ * @var integer
+ */
+ private $fcs = 0;
+
+ /**
+ * Number of all analyzer methods.
+ *
+ * @var integer
+ */
+ private $mts = 0;
+
+ /**
+ * Number of all analyzed classes.
+ *
+ * @var integer
+ */
+ private $cls = 0;
+
+ /**
+ * Number of all analyzed abstract classes.
+ *
+ * @var integer
+ */
+ private $clsa = 0;
+
+ /**
+ * Number of all analyzed interfaces.
+ *
+ * @var integer
+ */
+ private $interfs = 0;
+
+ /**
+ * Number of all root classes within the analyzed source code.
+ *
+ * @var array(string=>boolean)
+ */
+ private $roots = array();
+
+ /**
+ * Number of all none leaf classes within the analyzed source code
+ *
+ * @var array(string=>boolean)
+ */
+ private $noneLeafs = array();
+
+ /**
+ * Hash with all calculated node metrics.
+ *
+ *
+ * array(
+ * '0375e305-885a-4e91-8b5c-e25bda005438' => array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * ),
+ * 'e60c22f0-1a63-4c40-893e-ed3b35b84d0b' => array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * )
+ * )
+ *
+ *
+ * @var array(string=>array)
+ */
+ private $nodeMetrics = null;
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ if ($this->nodeMetrics === null) {
+
+ $this->fireStartAnalyzer();
+
+ // Init node metrics
+ $this->nodeMetrics = array();
+
+ // Visit all nodes
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ $this->fireEndAnalyzer();
+ }
+ }
+
+ /**
+ * Provides the project summary metrics as an array.
+ *
+ * @return array(string=>mixed)
+ */
+ public function getProjectMetrics()
+ {
+ // Count none leaf classes
+ $noneLeafs = count($this->noneLeafs);
+
+ return array(
+ self::M_NUMBER_OF_ABSTRACT_CLASSES => $this->clsa,
+ self::M_NUMBER_OF_CONCRETE_CLASSES => $this->cls - $this->clsa,
+ self::M_NUMBER_OF_ROOT_CLASSES => count($this->roots),
+ self::M_NUMBER_OF_LEAF_CLASSES => $this->cls - $noneLeafs,
+ );
+ }
+
+ /**
+ * This method will return an array with all generated metric values
+ * for the given $node instance. If there are no metrics for the
+ * requested node, this method will return an empty array.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array(string=>mixed)
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ if (isset($this->nodeMetrics[$artifact->getId()])) {
+ return $this->nodeMetrics[$artifact->getId()];
+ }
+ return array();
+ }
+
+ /**
+ * Calculates metrics for the given $class instance.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class)
+ {
+ if (false === $class->isUserDefined()) {
+ return;
+ }
+
+ $this->fireStartClass($class);
+
+ ++$this->cls;
+
+ if ($class->isAbstract()) {
+ ++$this->clsa;
+ }
+
+ $parentClass = $class->getParentClass();
+ if ($parentClass !== null) {
+ if ($parentClass->getParentClass() === null) {
+ $this->roots[$parentClass->getId()] = true;
+ }
+ $this->noneLeafs[$parentClass->getId()] = true;
+ }
+
+ // Store node metric
+ $this->nodeMetrics[$class->getId()] = array();
+
+ foreach ($class->getMethods() as $method) {
+ $method->accept($this);
+ }
+ foreach ($class->getProperties() as $property) {
+ $property->accept($this);
+ }
+
+ $this->fireEndClass($class);
+ }
+
+ /**
+ * Calculates metrics for the given $function instance.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function visitFunction(ASTFunction $function)
+ {
+ $this->fireStartFunction($function);
+ ++$this->fcs;
+ $this->fireEndFunction($function);
+ }
+
+ /**
+ * Calculates metrics for the given $interface instance.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ $this->fireStartInterface($interface);
+
+ ++$this->interfs;
+
+ foreach ($interface->getMethods() as $method) {
+ $method->accept($this);
+ }
+
+ $this->fireEndInterface($interface);
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+ ++$this->mts;
+ $this->fireEndMethod($method);
+ }
+
+ /**
+ * Calculates metrics for the given $namespace instance.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function visitNamespace(ASTNamespace $namespace)
+ {
+ $this->fireStartNamespace($namespace);
+
+ foreach ($namespace->getTypes() as $type) {
+ $type->accept($this);
+ }
+
+ foreach ($namespace->getFunctions() as $function) {
+ $function->accept($this);
+ }
+
+ $this->fireEndNamespace($namespace);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/InheritanceAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/InheritanceAnalyzer.php
new file mode 100644
index 0000000..a6b0c1e
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/InheritanceAnalyzer.php
@@ -0,0 +1,355 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractAnalyzer;
+use PDepend\Metrics\AnalyzerFilterAware;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Metrics\AnalyzerProjectAware;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTClass;
+
+/**
+ * This analyzer provides two project related inheritance metrics.
+ *
+ * ANDC - Average Number of Derived Classes: The average number of direct
+ * subclasses of a class. This metric only covers classes in the analyzed system,
+ * no library or environment classes are covered.
+ *
+ * AHH - Average Hierarchy Height: The computed average of all inheritance
+ * trees within the analyzed system, external classes or interfaces are ignored.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class InheritanceAnalyzer extends AbstractAnalyzer implements
+ AnalyzerNodeAware,
+ AnalyzerFilterAware,
+ AnalyzerProjectAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_AVERAGE_NUMBER_DERIVED_CLASSES = 'andc',
+ M_AVERAGE_HIERARCHY_HEIGHT = 'ahh',
+ M_DEPTH_OF_INHERITANCE_TREE = 'dit',
+ M_NUMBER_OF_ADDED_METHODS = 'noam',
+ M_NUMBER_OF_OVERWRITTEN_METHODS = 'noom',
+ M_NUMBER_OF_DERIVED_CLASSES = 'nocc',
+ M_MAXIMUM_INHERITANCE_DEPTH = 'maxDIT';
+
+ /**
+ * Contains the max inheritance depth for all root classes within the
+ * analyzed system. The array size is equal to the number of analyzed root
+ * classes.
+ *
+ * @var array(integer)
+ */
+ private $rootClasses = null;
+
+ /**
+ * The maximum depth of inheritance tree value within the analyzed source code.
+ *
+ * @var integer
+ */
+ private $maxDIT = 0;
+
+ /**
+ * The average number of derived classes.
+ *
+ * @var float
+ */
+ private $andc = 0;
+
+ /**
+ * The average hierarchy height.
+ *
+ * @var float
+ */
+ private $ahh = 0;
+
+ /**
+ * Total number of classes.
+ *
+ * @var integer
+ */
+ private $numberOfClasses = 0;
+
+ /**
+ * Total number of derived classes.
+ *
+ * @var integer
+ */
+ private $numberOfDerivedClasses = 0;
+
+ /**
+ * Metrics calculated for a single source node.
+ *
+ * @var array(string=>array)
+ */
+ private $nodeMetrics = null;
+
+ /**
+ * This method will return an array with all generated metric values
+ * for the given $node. If there are no metrics for the requested
+ * node, this method will return an empty array.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array(string=>mixed)
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ if (isset($this->nodeMetrics[$artifact->getId()])) {
+ return $this->nodeMetrics[$artifact->getId()];
+ }
+ return array();
+ }
+
+ /**
+ * Provides the project summary as an array.
+ *
+ *
+ * array(
+ * 'andc' => 0.73,
+ * 'ahh' => 0.56
+ * )
+ *
+ *
+ * @return array(string=>mixed)
+ */
+ public function getProjectMetrics()
+ {
+ return array(
+ self::M_AVERAGE_NUMBER_DERIVED_CLASSES => $this->andc,
+ self::M_AVERAGE_HIERARCHY_HEIGHT => $this->ahh,
+ self::M_MAXIMUM_INHERITANCE_DEPTH => $this->maxDIT,
+ );
+ }
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ if ($this->nodeMetrics === null) {
+ $this->nodeMetrics = array();
+
+ $this->fireStartAnalyzer();
+ $this->doAnalyze($namespaces);
+ $this->fireEndAnalyzer();
+ }
+ }
+
+ /**
+ * Calculates several inheritance related metrics for the given source
+ * namespaces.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ * @since 0.9.10
+ */
+ private function doAnalyze($namespaces)
+ {
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ if ($this->numberOfClasses > 0) {
+ $this->andc = $this->numberOfDerivedClasses / $this->numberOfClasses;
+ }
+ if (($count = count($this->rootClasses)) > 0) {
+ $this->ahh = array_sum($this->rootClasses) / $count;
+ }
+ }
+
+ /**
+ * Visits a class node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class)
+ {
+ if (!$class->isUserDefined()) {
+ return;
+ }
+
+ $this->fireStartClass($class);
+
+ $this->initNodeMetricsForClass($class);
+
+ $this->calculateNumberOfDerivedClasses($class);
+ $this->calculateNumberOfAddedAndOverwrittenMethods($class);
+ $this->calculateDepthOfInheritanceTree($class);
+
+ $this->fireEndClass($class);
+ }
+
+ /**
+ * Calculates the number of derived classes.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ * @since 0.9.5
+ */
+ private function calculateNumberOfDerivedClasses(ASTClass $class)
+ {
+ $id = $class->getId();
+ if (isset($this->derivedClasses[$id]) === false) {
+ $this->derivedClasses[$id] = 0;
+ }
+
+ $parentClass = $class->getParentClass();
+ if ($parentClass !== null && $parentClass->isUserDefined()) {
+ $id = $parentClass->getId();
+
+ ++$this->numberOfDerivedClasses;
+ ++$this->nodeMetrics[$id][self::M_NUMBER_OF_DERIVED_CLASSES];
+ }
+ }
+
+ /**
+ * Calculates the maximum HIT for the given class.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ * @since 0.9.10
+ */
+ private function calculateDepthOfInheritanceTree(ASTClass $class)
+ {
+ $dit = 0;
+ $id = $class->getId();
+ $root = $class->getId();
+
+ foreach ($class->getParentClasses() as $parent) {
+ if (!$parent->isUserDefined()) {
+ ++$dit;
+ }
+ ++$dit;
+ $root = $parent->getId();
+ }
+
+ // Collect max dit value
+ $this->maxDIT = max($this->maxDIT, $dit);
+
+ if (empty($this->rootClasses[$root]) || $this->rootClasses[$root] < $dit) {
+ $this->rootClasses[$root] = $dit;
+ }
+ $this->nodeMetrics[$id][self::M_DEPTH_OF_INHERITANCE_TREE] = $dit;
+ }
+
+ /**
+ * Calculates two metrics. The number of added methods and the number of
+ * overwritten methods.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ * @since 0.9.10
+ */
+ private function calculateNumberOfAddedAndOverwrittenMethods(ASTClass $class)
+ {
+ $parentClass = $class->getParentClass();
+ if ($parentClass === null) {
+ return;
+ }
+
+ $parentMethodNames = array();
+ foreach ($parentClass->getAllMethods() as $method) {
+ $parentMethodNames[$method->getName()] = $method->isAbstract();
+ }
+
+ $numberOfAddedMethods = 0;
+ $numberOfOverwrittenMethods = 0;
+
+ foreach ($class->getAllMethods() as $method) {
+ if ($method->getParent() !== $class) {
+ continue;
+ }
+
+ if (isset($parentMethodNames[$method->getName()])) {
+ if (!$parentMethodNames[$method->getName()]) {
+ ++$numberOfOverwrittenMethods;
+ }
+ } else {
+ ++$numberOfAddedMethods;
+ }
+ }
+
+ $id = $class->getId();
+
+ $this->nodeMetrics[$id][self::M_NUMBER_OF_ADDED_METHODS] = $numberOfAddedMethods;
+ $this->nodeMetrics[$id][self::M_NUMBER_OF_OVERWRITTEN_METHODS] = $numberOfOverwrittenMethods;
+ }
+
+ /**
+ * Initializes a empty metric container for the given class node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ * @since 0.9.10
+ */
+ private function initNodeMetricsForClass(ASTClass $class)
+ {
+ $id = $class->getId();
+ if (isset($this->nodeMetrics[$id])) {
+ return;
+ }
+
+ ++$this->numberOfClasses;
+
+ $this->nodeMetrics[$id] = array(
+ self::M_DEPTH_OF_INHERITANCE_TREE => 0,
+ self::M_NUMBER_OF_ADDED_METHODS => 0,
+ self::M_NUMBER_OF_DERIVED_CLASSES => 0,
+ self::M_NUMBER_OF_OVERWRITTEN_METHODS => 0
+ );
+
+ foreach ($class->getParentClasses() as $parent) {
+ $this->initNodeMetricsForClass($parent);
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/NPathComplexityAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/NPathComplexityAnalyzer.php
new file mode 100644
index 0000000..4276574
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/NPathComplexityAnalyzer.php
@@ -0,0 +1,567 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractCachingAnalyzer;
+use PDepend\Metrics\AnalyzerFilterAware;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Source\AST\AbstractASTCallable;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTBooleanAndExpression;
+use PDepend\Source\AST\ASTBooleanOrExpression;
+use PDepend\Source\AST\ASTConditionalExpression;
+use PDepend\Source\AST\ASTExpression;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTLogicalAndExpression;
+use PDepend\Source\AST\ASTLogicalOrExpression;
+use PDepend\Source\AST\ASTLogicalXorExpression;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTStatement;
+use PDepend\Source\AST\ASTSwitchLabel;
+use PDepend\Util\MathUtil;
+
+/**
+ * This analyzer calculates the NPath complexity of functions and methods. The
+ * NPath complexity metric measures the acyclic execution paths through a method
+ * or function. See Nejmeh, Communications of the ACM Feb 1988 pp 188-200.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class NPathComplexityAnalyzer extends AbstractCachingAnalyzer implements AnalyzerFilterAware, AnalyzerNodeAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_NPATH_COMPLEXITY = 'npath';
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ if ($this->metrics === null) {
+ $this->loadCache();
+ $this->fireStartAnalyzer();
+
+ $this->metrics = array();
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ $this->fireEndAnalyzer();
+ $this->unloadCache();
+ }
+ }
+
+ /**
+ * This method will return an array with all generated metric values
+ * for the node with the given $id identifier. If there are no
+ * metrics for the requested node, this method will return an empty array.
+ *
+ *
+ * array(
+ * 'npath' => '17'
+ * )
+ *
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ $metric = array();
+ if (isset($this->metrics[$artifact->getId()])) {
+ $metric = array(self::M_NPATH_COMPLEXITY => $this->metrics[$artifact->getId()]);
+ }
+ return $metric;
+ }
+
+ /**
+ * Visits a code interface object.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ // Empty visit method, we don't want interface metrics
+ }
+
+ /**
+ * Visits a function node.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function visitFunction(ASTFunction $function)
+ {
+ $this->fireStartFunction($function);
+
+ if (false === $this->restoreFromCache($function)) {
+ $this->calculateComplexity($function);
+ }
+
+ $this->fireEndFunction($function);
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ *
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+
+ if (false === $this->restoreFromCache($method)) {
+ $this->calculateComplexity($method);
+ }
+
+ $this->fireEndMethod($method);
+ }
+
+ /**
+ * This method will calculate the NPath complexity for the given callable
+ * instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTCallable $callable
+ * @return void
+ * @since 0.9.12
+ */
+ protected function calculateComplexity(AbstractASTCallable $callable)
+ {
+ $npath = '1';
+ foreach ($callable->getChildren() as $child) {
+ $stmt = $child->accept($this, $npath);
+ $npath = MathUtil::mul($npath, $stmt);
+ }
+
+ $this->metrics[$callable->getId()] = $npath;
+ }
+
+ /**
+ * This method calculates the NPath Complexity of a conditional-statement,
+ * the meassured value is then returned as a string.
+ *
+ *
+ * ? :
+ *
+ * -- NP(?) = NP() + NP() + NP() + 2 --
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode
+ * @param string $data
+ * @return string
+ * @since 0.9.12
+ */
+ public function visitConditionalExpression($node, $data)
+ {
+ // New PHP 5.3 ifsetor-operator $x ?: $y
+ if (count($node->getChildren()) === 1) {
+ $npath = '4';
+ } else {
+ $npath = '3';
+ }
+
+ foreach ($node->getChildren() as $child) {
+ if (($cn = $this->sumComplexity($child)) === '0') {
+ $cn = '1';
+ }
+ $npath = MathUtil::add($npath, $cn);
+ }
+
+ return MathUtil::mul($npath, $data);
+ }
+
+ /**
+ * This method calculates the NPath Complexity of a do-while-statement, the
+ * meassured value is then returned as a string.
+ *
+ *
+ * do
+ *
+ * while ()
+ * S;
+ *
+ * -- NP(do) = NP() + NP() + 1 --
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param string $data The previously calculated npath value.
+ *
+ * @return string
+ * @since 0.9.12
+ */
+ public function visitDoWhileStatement($node, $data)
+ {
+ $stmt = $node->getChild(0)->accept($this, 1);
+ $expr = $this->sumComplexity($node->getChild(1));
+
+ $npath = MathUtil::add($expr, $stmt);
+ $npath = MathUtil::add($npath, '1');
+
+ return MathUtil::mul($npath, $data);
+ }
+
+ /**
+ * This method calculates the NPath Complexity of an elseif-statement, the
+ * meassured value is then returned as a string.
+ *
+ *
+ * elseif ()
+ *
+ * S;
+ *
+ * -- NP(elseif) = NP() + NP() + 1 --
+ *
+ *
+ * elseif ()
+ *
+ * else
+ *
+ * S;
+ *
+ * -- NP(if) = NP() + NP() + NP( --
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param string $data The previously calculated npath value.
+ *
+ * @return string
+ * @since 0.9.12
+ */
+ public function visitElseIfStatement($node, $data)
+ {
+ $npath = $this->sumComplexity($node->getChild(0));
+ foreach ($node->getChildren() as $child) {
+ if ($child instanceof ASTStatement) {
+ $expr = $child->accept($this, 1);
+ $npath = MathUtil::add($npath, $expr);
+ }
+ }
+
+ if (!$node->hasElse()) {
+ $npath = MathUtil::add($npath, '1');
+ }
+
+ return MathUtil::mul($npath, $data);
+ }
+
+ /**
+ * This method calculates the NPath Complexity of a for-statement, the
+ * meassured value is then returned as a string.
+ *
+ *
+ * for (; ; )
+ *
+ * S;
+ *
+ * -- NP(for) = NP() + NP() + NP() + NP() + 1 --
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param string $data The previously calculated npath value.
+ *
+ * @return string
+ * @since 0.9.12
+ */
+ public function visitForStatement($node, $data)
+ {
+ $npath = '1';
+ foreach ($node->getChildren() as $child) {
+ if ($child instanceof ASTStatement) {
+ $stmt = $child->accept($this, 1);
+ $npath = MathUtil::add($npath, $stmt);
+ } elseif ($child instanceof ASTExpression) {
+ $expr = $this->sumComplexity($child);
+ $npath = MathUtil::add($npath, $expr);
+ }
+ }
+
+ return MathUtil::mul($npath, $data);
+ }
+
+ /**
+ * This method calculates the NPath Complexity of a for-statement, the
+ * meassured value is then returned as a string.
+ *
+ *
+ * fpreach ()
+ *
+ * S;
+ *
+ * -- NP(foreach) = NP() + NP() + 1 --
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param string $data The previously calculated npath value.
+ *
+ * @return string
+ * @since 0.9.12
+ */
+ public function visitForeachStatement($node, $data)
+ {
+ $npath = $this->sumComplexity($node->getChild(0));
+ $npath = MathUtil::add($npath, '1');
+
+ foreach ($node->getChildren() as $child) {
+ if ($child instanceof ASTStatement) {
+ $stmt = $child->accept($this, 1);
+ $npath = MathUtil::add($npath, $stmt);
+ }
+ }
+
+ return MathUtil::mul($npath, $data);
+ }
+
+ /**
+ * This method calculates the NPath Complexity of an if-statement, the
+ * meassured value is then returned as a string.
+ *
+ *
+ * if ()
+ *
+ * S;
+ *
+ * -- NP(if) = NP() + NP() + 1 --
+ *
+ *
+ * if ()
+ *
+ * else
+ *
+ * S;
+ *
+ * -- NP(if) = NP() + NP() + NP( --
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param string $data The previously calculated npath value.
+ *
+ * @return string
+ * @since 0.9.12
+ */
+ public function visitIfStatement($node, $data)
+ {
+ $npath = $this->sumComplexity($node->getChild(0));
+
+ foreach ($node->getChildren() as $child) {
+ if ($child instanceof ASTStatement) {
+ $stmt = $child->accept($this, 1);
+ $npath = MathUtil::add($npath, $stmt);
+ }
+ }
+
+ if (!$node->hasElse()) {
+ $npath = MathUtil::add($npath, '1');
+ }
+
+ return MathUtil::mul($npath, $data);
+ }
+
+ /**
+ * This method calculates the NPath Complexity of a return-statement, the
+ * meassured value is then returned as a string.
+ *
+ *
+ * return ;
+ *
+ * -- NP(return) = NP() --
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param string $data The previously calculated npath value.
+ *
+ * @return string
+ * @since 0.9.12
+ */
+ public function visitReturnStatement($node, $data)
+ {
+ if (($npath = $this->sumComplexity($node)) === '0') {
+ return $data;
+ }
+ return MathUtil::mul($npath, $data);
+ }
+
+ /**
+ * This method calculates the NPath Complexity of a switch-statement, the
+ * meassured value is then returned as a string.
+ *
+ *
+ * switch ()
+ *
+ *
+ * ...
+ *
+ *
+ * -- NP(switch) = NP() + NP() + NP() ... --
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param string $data The previously calculated npath value.
+ *
+ * @return string
+ * @since 0.9.12
+ */
+ public function visitSwitchStatement($node, $data)
+ {
+ $npath = $this->sumComplexity($node->getChild(0));
+ foreach ($node->getChildren() as $child) {
+ if ($child instanceof ASTSwitchLabel) {
+ $label = $child->accept($this, 1);
+ $npath = MathUtil::add($npath, $label);
+ }
+ }
+ return MathUtil::mul($npath, $data);
+ }
+
+ /**
+ * This method calculates the NPath Complexity of a try-catch-statement, the
+ * meassured value is then returned as a string.
+ *
+ *
+ * try
+ *
+ * catch
+ *
+ *
+ * -- NP(try) = NP() + NP() --
+ *
+ *
+ * try
+ *
+ * catch
+ *
+ * catch
+ *
+ * ...
+ *
+ * -- NP(try) = NP() + NP() + NP() ... --
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param string $data The previously calculated npath value.
+ *
+ * @return string
+ * @since 0.9.12
+ */
+ public function visitTryStatement($node, $data)
+ {
+ $npath = '0';
+ foreach ($node->getChildren() as $child) {
+ if ($child instanceof ASTStatement) {
+ $stmt = $child->accept($this, 1);
+ $npath = MathUtil::add($npath, $stmt);
+ }
+ }
+ return MathUtil::mul($npath, $data);
+ }
+
+ /**
+ * This method calculates the NPath Complexity of a while-statement, the
+ * meassured value is then returned as a string.
+ *
+ *
+ * while ()
+ *
+ * S;
+ *
+ * -- NP(while) = NP() + NP() + 1 --
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ * @param string $data The previously calculated npath value.
+ *
+ * @return string
+ * @since 0.9.12
+ */
+ public function visitWhileStatement($node, $data)
+ {
+ $expr = $this->sumComplexity($node->getChild(0));
+ $stmt = $node->getChild(1)->accept($this, 1);
+
+ $npath = MathUtil::add($expr, $stmt);
+ $npath = MathUtil::add($npath, '1');
+
+ return MathUtil::mul($npath, $data);
+ }
+
+ /**
+ * Calculates the expression sum of the given node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The currently visited node.
+ *
+ * @return string
+ * @since 0.9.12
+ * @todo I don't like this method implementation, it should be possible to
+ * implement this method with more visitor behavior for the boolean
+ * and logical expressions.
+ */
+ public function sumComplexity($node)
+ {
+ $sum = '0';
+ if ($node instanceof ASTConditionalExpression) {
+ $sum = MathUtil::add($sum, $node->accept($this, 1));
+ } elseif ($node instanceof ASTBooleanAndExpression
+ || $node instanceof ASTBooleanOrExpression
+ || $node instanceof ASTLogicalAndExpression
+ || $node instanceof ASTLogicalOrExpression
+ || $node instanceof ASTLogicalXorExpression
+ ) {
+ $sum = MathUtil::add($sum, '1');
+ } else {
+ foreach ($node->getChildren() as $child) {
+ $expr = $this->sumComplexity($child);
+ $sum = MathUtil::add($sum, $expr);
+ }
+ }
+ return $sum;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/NodeCountAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/NodeCountAnalyzer.php
new file mode 100644
index 0000000..fbc2b7a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/NodeCountAnalyzer.php
@@ -0,0 +1,329 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractAnalyzer;
+use PDepend\Metrics\AnalyzerFilterAware;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Metrics\AnalyzerProjectAware;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTNamespace;
+
+/**
+ * This analyzer collects different count metrics for code artifacts like
+ * classes, methods, functions or namespaces.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class NodeCountAnalyzer extends AbstractAnalyzer implements AnalyzerFilterAware, AnalyzerNodeAware, AnalyzerProjectAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_NUMBER_OF_PACKAGES = 'nop',
+ M_NUMBER_OF_CLASSES = 'noc',
+ M_NUMBER_OF_INTERFACES = 'noi',
+ M_NUMBER_OF_METHODS = 'nom',
+ M_NUMBER_OF_FUNCTIONS = 'nof';
+
+ /**
+ * Number Of Packages.
+ *
+ * @var integer
+ */
+ private $nop = 0;
+
+ /**
+ * Number Of Classes.
+ *
+ * @var integer
+ */
+ private $noc = 0;
+
+ /**
+ * Number Of Interfaces.
+ *
+ * @var integer
+ */
+ private $noi = 0;
+
+ /**
+ * Number Of Methods.
+ *
+ * @var integer
+ */
+ private $nom = 0;
+
+ /**
+ * Number Of Functions.
+ *
+ * @var integer
+ */
+ private $nof = 0;
+
+ /**
+ * Collected node metrics
+ *
+ * @var array(string=>array)
+ */
+ private $nodeMetrics = null;
+
+ /**
+ * This method will return an array with all generated metric values
+ * for the given $node instance. If there are no metrics for the
+ * requested node, this method will return an empty array.
+ *
+ *
+ * array(
+ * 'noc' => 23,
+ * 'nom' => 17,
+ * 'nof' => 42
+ * )
+ *
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array(string=>mixed)
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ $metrics = array();
+ if (isset($this->nodeMetrics[$artifact->getId()])) {
+ $metrics = $this->nodeMetrics[$artifact->getId()];
+ }
+ return $metrics;
+ }
+
+ /**
+ * Provides the project summary as an array.
+ *
+ *
+ * array(
+ * 'nop' => 23,
+ * 'noc' => 17,
+ * 'noi' => 23,
+ * 'nom' => 42,
+ * 'nof' => 17
+ * )
+ *
+ *
+ * @return array(string=>mixed)
+ */
+ public function getProjectMetrics()
+ {
+ return array(
+ self::M_NUMBER_OF_PACKAGES => $this->nop,
+ self::M_NUMBER_OF_CLASSES => $this->noc,
+ self::M_NUMBER_OF_INTERFACES => $this->noi,
+ self::M_NUMBER_OF_METHODS => $this->nom,
+ self::M_NUMBER_OF_FUNCTIONS => $this->nof
+ );
+ }
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ // Check for previous run
+ if ($this->nodeMetrics === null) {
+
+ $this->fireStartAnalyzer();
+
+ $this->nodeMetrics = array();
+
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ $this->fireEndAnalyzer();
+ }
+ }
+
+ /**
+ * Visits a class node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class)
+ {
+ if (false === $class->isUserDefined()) {
+ return;
+ }
+
+ $this->fireStartClass($class);
+
+ // Update global class count
+ ++$this->noc;
+
+ $id = $class->getNamespace()->getId();
+ ++$this->nodeMetrics[$id][self::M_NUMBER_OF_CLASSES];
+
+ $this->nodeMetrics[$class->getId()] = array(
+ self::M_NUMBER_OF_METHODS => 0
+ );
+
+ foreach ($class->getMethods() as $method) {
+ $method->accept($this);
+ }
+
+ $this->fireEndClass($class);
+ }
+
+ /**
+ * Visits a function node.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function visitFunction(ASTFunction $function)
+ {
+ $this->fireStartFunction($function);
+
+ // Update global function count
+ ++$this->nof;
+
+ $id = $function->getNamespace()->getId();
+ ++$this->nodeMetrics[$id][self::M_NUMBER_OF_FUNCTIONS];
+
+ $this->fireEndFunction($function);
+ }
+
+ /**
+ * Visits a code interface object.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ if (false === $interface->isUserDefined()) {
+ return;
+ }
+
+ $this->fireStartInterface($interface);
+
+ // Update global class count
+ ++$this->noi;
+
+ $id = $interface->getNamespace()->getId();
+ ++$this->nodeMetrics[$id][self::M_NUMBER_OF_INTERFACES];
+
+ $this->nodeMetrics[$interface->getId()] = array(
+ self::M_NUMBER_OF_METHODS => 0
+ );
+
+ foreach ($interface->getMethods() as $method) {
+ $method->accept($this);
+ }
+
+ $this->fireEndInterface($interface);
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+
+ // Update global method count
+ ++$this->nom;
+
+ $parent = $method->getParent();
+
+ // Update parent class or interface
+ $parentId = $parent->getId();
+ ++$this->nodeMetrics[$parentId][self::M_NUMBER_OF_METHODS];
+
+ $id = $parent->getNamespace()->getId();
+ ++$this->nodeMetrics[$id][self::M_NUMBER_OF_METHODS];
+
+ $this->fireEndMethod($method);
+ }
+
+ /**
+ * Visits a namespace node.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function visitNamespace(ASTNamespace $namespace)
+ {
+ $this->fireStartNamespace($namespace);
+
+ ++$this->nop;
+
+ $this->nodeMetrics[$namespace->getId()] = array(
+ self::M_NUMBER_OF_CLASSES => 0,
+ self::M_NUMBER_OF_INTERFACES => 0,
+ self::M_NUMBER_OF_METHODS => 0,
+ self::M_NUMBER_OF_FUNCTIONS => 0
+ );
+
+
+ foreach ($namespace->getClasses() as $class) {
+ $class->accept($this);
+ }
+ foreach ($namespace->getInterfaces() as $interface) {
+ $interface->accept($this);
+ }
+ foreach ($namespace->getFunctions() as $function) {
+ $function->accept($this);
+ }
+
+ $this->fireEndNamespace($namespace);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/NodeLocAnalyzer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/NodeLocAnalyzer.php
new file mode 100644
index 0000000..742a9d7
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/Analyzer/NodeLocAnalyzer.php
@@ -0,0 +1,485 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics\Analyzer;
+
+use PDepend\Metrics\AbstractCachingAnalyzer;
+use PDepend\Metrics\AnalyzerFilterAware;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Metrics\AnalyzerProjectAware;
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTCompilationUnit;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\Tokenizer\Tokens;
+
+/**
+ * This analyzer collects different lines of code metrics.
+ *
+ * It collects the total Lines Of Code(loc), the None Comment Lines Of
+ * Code(ncloc), the Comment Lines Of Code(cloc) and a approximated
+ * Executable Lines Of Code(eloc) for files, classes, interfaces,
+ * methods, properties and function.
+ *
+ * The current implementation has a limitation, that affects inline comments.
+ * The following code will suppress one line of code.
+ *
+ *
+ * function foo() {
+ * foobar(); // Bad behaviour...
+ * }
+ *
+ *
+ * The same rule applies to class methods. mapi, PLEASE, FIX THIS ISSUE.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class NodeLocAnalyzer extends AbstractCachingAnalyzer implements
+ AnalyzerNodeAware,
+ AnalyzerFilterAware,
+ AnalyzerProjectAware
+{
+ /**
+ * Metrics provided by the analyzer implementation.
+ */
+ const M_LINES_OF_CODE = 'loc',
+ M_COMMENT_LINES_OF_CODE = 'cloc',
+ M_EXECUTABLE_LINES_OF_CODE = 'eloc',
+ M_LOGICAL_LINES_OF_CODE = 'lloc',
+ M_NON_COMMENT_LINES_OF_CODE = 'ncloc';
+
+ /**
+ * Collected project metrics.
+ *
+ * @var array(string=>integer)
+ */
+ private $projectMetrics = array(
+ self::M_LINES_OF_CODE => 0,
+ self::M_COMMENT_LINES_OF_CODE => 0,
+ self::M_EXECUTABLE_LINES_OF_CODE => 0,
+ self::M_LOGICAL_LINES_OF_CODE => 0,
+ self::M_NON_COMMENT_LINES_OF_CODE => 0
+ );
+
+ /**
+ * Executable lines of code in a class. The method calculation increases
+ * this property with each method's ELOC value.
+ *
+ * @var integer
+ * @since 0.9.12
+ */
+ private $classExecutableLines = 0;
+
+ /**
+ * Logical lines of code in a class. The method calculation increases this
+ * property with each method's LLOC value.
+ *
+ * @var integer
+ * @since 0.9.13
+ */
+ private $classLogicalLines = 0;
+
+ /**
+ * This method will return an array with all generated metric values
+ * for the given $node instance. If there are no metrics for the
+ * requested node, this method will return an empty array.
+ *
+ *
+ * array(
+ * 'loc' => 23,
+ * 'cloc' => 17,
+ * 'eloc' => 17,
+ * 'ncloc' => 42
+ * )
+ *
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array
+ */
+ public function getNodeMetrics(ASTArtifact $artifact)
+ {
+ $metrics = array();
+ if (isset($this->metrics[$artifact->getId()])) {
+ $metrics = $this->metrics[$artifact->getId()];
+ }
+ return $metrics;
+ }
+
+ /**
+ * Provides the project summary as an array.
+ *
+ *
+ * array(
+ * 'loc' => 23,
+ * 'cloc' => 17,
+ * 'ncloc' => 42
+ * )
+ *
+ *
+ * @return array
+ */
+ public function getProjectMetrics()
+ {
+ return $this->projectMetrics;
+ }
+
+ /**
+ * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[] $namespaces
+ * @return void
+ */
+ public function analyze($namespaces)
+ {
+ if ($this->metrics === null) {
+ $this->loadCache();
+ $this->fireStartAnalyzer();
+
+ $this->metrics = array();
+ foreach ($namespaces as $namespace) {
+ $namespace->accept($this);
+ }
+
+ $this->fireEndAnalyzer();
+ $this->unloadCache();
+ }
+ }
+
+ /**
+ * Visits a class node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class)
+ {
+ $this->fireStartClass($class);
+
+ $class->getCompilationUnit()->accept($this);
+
+ $this->classExecutableLines = 0;
+ $this->classLogicalLines = 0;
+
+ foreach ($class->getMethods() as $method) {
+ $method->accept($this);
+ }
+
+ if ($this->restoreFromCache($class)) {
+ return $this->fireEndClass($class);
+ }
+
+ list($cloc) = $this->linesOfCode($class->getTokens(), true);
+
+ $loc = $class->getEndLine() - $class->getStartLine() + 1;
+ $ncloc = $loc - $cloc;
+
+ $this->metrics[$class->getId()] = array(
+ self::M_LINES_OF_CODE => $loc,
+ self::M_COMMENT_LINES_OF_CODE => $cloc,
+ self::M_EXECUTABLE_LINES_OF_CODE => $this->classExecutableLines,
+ self::M_LOGICAL_LINES_OF_CODE => $this->classLogicalLines,
+ self::M_NON_COMMENT_LINES_OF_CODE => $ncloc,
+ );
+
+ $this->fireEndClass($class);
+ }
+
+ /**
+ * Visits a file node.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit
+ * @return void
+ */
+ public function visitCompilationUnit(ASTCompilationUnit $compilationUnit)
+ {
+ // Skip for dummy files
+ if ($compilationUnit->getFileName() === null) {
+ return;
+ }
+ // Check for initial file
+ $id = $compilationUnit->getId();
+ if (isset($this->metrics[$id])) {
+ return;
+ }
+
+ $this->fireStartFile($compilationUnit);
+
+ if ($this->restoreFromCache($compilationUnit)) {
+ $this->updateProjectMetrics($id);
+ return $this->fireEndFile($compilationUnit);
+ }
+
+ list($cloc, $eloc, $lloc) = $this->linesOfCode($compilationUnit->getTokens());
+
+ $loc = $compilationUnit->getEndLine();
+ $ncloc = $loc - $cloc;
+
+ $this->metrics[$id] = array(
+ self::M_LINES_OF_CODE => $loc,
+ self::M_COMMENT_LINES_OF_CODE => $cloc,
+ self::M_EXECUTABLE_LINES_OF_CODE => $eloc,
+ self::M_LOGICAL_LINES_OF_CODE => $lloc,
+ self::M_NON_COMMENT_LINES_OF_CODE => $ncloc
+ );
+
+ $this->updateProjectMetrics($id);
+
+ $this->fireEndFile($compilationUnit);
+ }
+
+ /**
+ * Visits a function node.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function visitFunction(ASTFunction $function)
+ {
+ $this->fireStartFunction($function);
+
+ $function->getCompilationUnit()->accept($this);
+
+ if ($this->restoreFromCache($function)) {
+ return $this->fireEndFunction($function);
+ }
+
+ list($cloc, $eloc, $lloc) = $this->linesOfCode(
+ $function->getTokens(),
+ true
+ );
+
+ $loc = $function->getEndLine() - $function->getStartLine() + 1;
+ $ncloc = $loc - $cloc;
+
+ $this->metrics[$function->getId()] = array(
+ self::M_LINES_OF_CODE => $loc,
+ self::M_COMMENT_LINES_OF_CODE => $cloc,
+ self::M_EXECUTABLE_LINES_OF_CODE => $eloc,
+ self::M_LOGICAL_LINES_OF_CODE => $lloc,
+ self::M_NON_COMMENT_LINES_OF_CODE => $ncloc
+ );
+
+ $this->fireEndFunction($function);
+ }
+
+ /**
+ * Visits a code interface object.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ $this->fireStartInterface($interface);
+
+ $interface->getCompilationUnit()->accept($this);
+
+ foreach ($interface->getMethods() as $method) {
+ $method->accept($this);
+ }
+
+ if ($this->restoreFromCache($interface)) {
+ return $this->fireEndInterface($interface);
+ }
+
+ list($cloc) = $this->linesOfCode($interface->getTokens(), true);
+
+ $loc = $interface->getEndLine() - $interface->getStartLine() + 1;
+ $ncloc = $loc - $cloc;
+
+ $this->metrics[$interface->getId()] = array(
+ self::M_LINES_OF_CODE => $loc,
+ self::M_COMMENT_LINES_OF_CODE => $cloc,
+ self::M_EXECUTABLE_LINES_OF_CODE => 0,
+ self::M_LOGICAL_LINES_OF_CODE => 0,
+ self::M_NON_COMMENT_LINES_OF_CODE => $ncloc
+ );
+
+ $this->fireEndInterface($interface);
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+
+ if ($this->restoreFromCache($method)) {
+ return $this->fireEndMethod($method);
+ }
+
+ if ($method->isAbstract()) {
+ $cloc = 0;
+ $eloc = 0;
+ $lloc = 0;
+ } else {
+ list($cloc, $eloc, $lloc) = $this->linesOfCode(
+ $method->getTokens(),
+ true
+ );
+ }
+ $loc = $method->getEndLine() - $method->getStartLine() + 1;
+ $ncloc = $loc - $cloc;
+
+ $this->metrics[$method->getId()] = array(
+ self::M_LINES_OF_CODE => $loc,
+ self::M_COMMENT_LINES_OF_CODE => $cloc,
+ self::M_EXECUTABLE_LINES_OF_CODE => $eloc,
+ self::M_LOGICAL_LINES_OF_CODE => $lloc,
+ self::M_NON_COMMENT_LINES_OF_CODE => $ncloc
+ );
+
+ $this->classExecutableLines += $eloc;
+ $this->classLogicalLines += $lloc;
+
+ $this->fireEndMethod($method);
+ }
+
+ /**
+ * Updates the project metrics based on the node metrics identifier by the
+ * given $id.
+ *
+ * @param string $id The unique identifier of a node.
+ * @return void
+ */
+ private function updateProjectMetrics($id)
+ {
+ foreach ($this->metrics[$id] as $metric => $value) {
+ $this->projectMetrics[$metric] += $value;
+ }
+ }
+
+ /**
+ * Counts the Comment Lines Of Code (CLOC) and a pseudo Executable Lines Of
+ * Code (ELOC) values.
+ *
+ * ELOC = Non Whitespace Lines + Non Comment Lines
+ *
+ *
+ * array(
+ * 0 => 23, // Comment Lines Of Code
+ * 1 => 42 // Executable Lines Of Code
+ * )
+ *
+ *
+ * @param array $tokens The raw token stream.
+ * @param boolean $search Optional boolean flag, search start.
+ * @return array
+ */
+ private function linesOfCode(array $tokens, $search = false)
+ {
+ $clines = array();
+ $elines = array();
+ $llines = 0;
+
+ $count = count($tokens);
+ if ($search === true) {
+ for ($i = 0; $i < $count; ++$i) {
+ $token = $tokens[$i];
+
+ if ($token->type === Tokens::T_CURLY_BRACE_OPEN) {
+ break;
+ }
+ }
+ } else {
+ $i = 0;
+ }
+
+ for (; $i < $count; ++$i) {
+ $token = $tokens[$i];
+
+ if ($token->type === Tokens::T_COMMENT
+ || $token->type === Tokens::T_DOC_COMMENT
+ ) {
+ $lines =& $clines;
+ } else {
+ $lines =& $elines;
+ }
+
+ switch ($token->type) {
+
+ // These statement are terminated by a semicolon
+ //case \PDepend\Source\Tokenizer\Tokens::T_RETURN:
+ //case \PDepend\Source\Tokenizer\Tokens::T_THROW:
+
+ case Tokens::T_IF:
+ case Tokens::T_TRY:
+ case Tokens::T_CASE:
+ case Tokens::T_GOTO:
+ case Tokens::T_CATCH:
+ case Tokens::T_WHILE:
+ case Tokens::T_ELSEIF:
+ case Tokens::T_SWITCH:
+ case Tokens::T_DEFAULT:
+ case Tokens::T_FOREACH:
+ case Tokens::T_FUNCTION:
+ case Tokens::T_SEMICOLON:
+ ++$llines;
+ break;
+
+ case Tokens::T_DO:
+ case Tokens::T_FOR:
+ // Because statements at least require one semicolon
+ --$llines;
+ break;
+ }
+
+ if ($token->startLine === $token->endLine) {
+ $lines[$token->startLine] = true;
+ } else {
+ for ($j = $token->startLine; $j <= $token->endLine; ++$j) {
+ $lines[$j] = true;
+ }
+ }
+ unset($lines);
+ }
+ return array(count($clines), count($elines), $llines);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerCacheAware.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerCacheAware.php
new file mode 100644
index 0000000..ff60c41
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerCacheAware.php
@@ -0,0 +1,66 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Metrics;
+
+use PDepend\Util\Cache\CacheDriver;
+
+/**
+ * Simple marker interface that is used to mark an analyzer as cache aware. This
+ * means that the loading infrastructure code will inject an instance of
+ * {@link \PDepend\Util\Cache\CacheDriver} into this analyzer.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+interface AnalyzerCacheAware extends Analyzer
+{
+ /**
+ * Setter method for the system wide used cache.
+ *
+ * @param \PDepend\Util\Cache\CacheDriver $cache
+ * @return void
+ */
+ public function setCache(CacheDriver $cache);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerFactory.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerFactory.php
new file mode 100644
index 0000000..e70d30d
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerFactory.php
@@ -0,0 +1,88 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Creates Analyzer instances
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class AnalyzerFactory
+{
+ /**
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ private $container;
+
+ /**
+ * Create a new Analyzer Factory
+ *
+ * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
+ */
+ public function __construct(ContainerInterface $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * Create and configure all analyzers required for given set of loggers.
+ *
+ * @param \PDepend\Report\ReportGenerator[] $generators
+ * @return \PDepend\Metrics\Analyzer[]
+ */
+ public function createRequiredForGenerators(array $generators)
+ {
+ $analyzers = array();
+
+ foreach ($generators as $logger) {
+ foreach ($logger->getAcceptedAnalyzers() as $type) {
+ $analyzers[$type] = $this->container->get($type);
+ }
+ }
+
+ return $analyzers;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerFilterAware.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerFilterAware.php
new file mode 100644
index 0000000..4c5be56
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerFilterAware.php
@@ -0,0 +1,56 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics;
+
+/**
+ * Simple marker interface that is used to mark an analyzer as namespace filter
+ * aware. This means that a defined namespace filter for external dependencies
+ * on namespaces an its classes and interfaces must be set before this analyzer
+ * starts.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface AnalyzerFilterAware extends Analyzer
+{
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerIterator.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerIterator.php
new file mode 100644
index 0000000..3b9cb79
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerIterator.php
@@ -0,0 +1,75 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.10
+ */
+
+namespace PDepend\Metrics;
+
+/**
+ * Filter iterator that only returns enabled {@link \PDepend\Metrics\Analyzer}
+ * instances.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.10
+ */
+class AnalyzerIterator extends \FilterIterator
+{
+ /**
+ * Constructs a new iterator instance.
+ *
+ * @param \PDepend\Metrics\Analyzer[] $analyzers
+ */
+ public function __construct(array $analyzers)
+ {
+ parent::__construct(new \ArrayIterator($analyzers));
+ }
+
+ /**
+ * Returns true when the current analyzer instance is enabled.
+ *
+ * @return boolean
+ */
+ public function accept()
+ {
+ return $this->getInnerIterator()->current()->isEnabled();
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerListener.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerListener.php
new file mode 100644
index 0000000..3338ac1
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerListener.php
@@ -0,0 +1,71 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics;
+
+use PDepend\Source\ASTVisitor\ASTVisitListener;
+
+/**
+ * An implementation of this listener can be used to recieve informations about
+ * the current metric analyzer.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface AnalyzerListener extends ASTVisitListener
+{
+ /**
+ * This method is called when the analyzer starts code processing.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The context analyzer instance.
+ * @return void
+ */
+ public function startAnalyzer(Analyzer $analyzer);
+
+ /**
+ * This method is called when the analyzer has finished code processing.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The context analyzer instance.
+ * @return void
+ */
+ public function endAnalyzer(Analyzer $analyzer);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerNodeAware.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerNodeAware.php
new file mode 100644
index 0000000..997cbc8
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerNodeAware.php
@@ -0,0 +1,72 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics;
+
+use PDepend\Source\AST\ASTArtifact;
+
+/**
+ * Marker interface that marks a result set as node metrics aware.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface AnalyzerNodeAware extends Analyzer
+{
+ /**
+ * This method will return an array with all generated metric values
+ * for the node with the given $id identifier. If there are no
+ * metrics for the requested node, this method will return an empty array.
+ *
+ *
+ * array(
+ * 'loc' => 42,
+ * 'ncloc' => 17,
+ * 'cc' => 12
+ * )
+ *
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $artifact
+ * @return array(string=>mixed)
+ */
+ public function getNodeMetrics(ASTArtifact $artifact);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerProjectAware.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerProjectAware.php
new file mode 100644
index 0000000..06d310a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Metrics/AnalyzerProjectAware.php
@@ -0,0 +1,70 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Metrics;
+
+/**
+ * This interface is used to mark a result set as project summary aware.
+ *
+ * A result set that implements this interface provides overview or calculated
+ * values for the complete analyzed source code.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface AnalyzerProjectAware extends Analyzer
+{
+ /**
+ * Provides the project summary as an array.
+ *
+ *
+ * array(
+ * 'loc' => 1742,
+ * 'nop' => 23,
+ * 'noc' => 17
+ * )
+ *
+ *
+ * @return array(string=>mixed)
+ */
+ public function getProjectMetrics();
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/ProcessListener.php b/vendor/pdepend/pdepend/src/main/php/PDepend/ProcessListener.php
new file mode 100644
index 0000000..aee8631
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/ProcessListener.php
@@ -0,0 +1,120 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend;
+
+// @codeCoverageIgnoreStart
+use PDepend\Metrics\AnalyzerListener;
+use PDepend\Source\Builder\Builder;
+use PDepend\Source\Tokenizer\Tokenizer;
+use PDepend\Source\ASTVisitor\ASTVisitListener;
+
+/**
+ * This listener can be used to get informations about the current pdepend process.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface ProcessListener extends ASTVisitListener, AnalyzerListener
+{
+ /**
+ * Is called when PDepend starts the file parsing process.
+ *
+ * @param \PDepend\Source\Builder\Builder $builder The used node builder instance.
+ * @return void
+ */
+ public function startParseProcess(Builder $builder);
+
+ /**
+ * Is called when PDepend has finished the file parsing process.
+ *
+ * @param \PDepend\Source\Builder\Builder $builder The used node builder instance.
+ * @return void
+ */
+ public function endParseProcess(Builder $builder);
+
+ /**
+ * Is called when PDepend starts parsing of a new file.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ * @return void
+ */
+ public function startFileParsing(Tokenizer $tokenizer);
+
+ /**
+ * Is called when PDepend has finished a file.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ * @return void
+ */
+ public function endFileParsing(Tokenizer $tokenizer);
+
+ /**
+ * Is called when PDepend starts the analyzing process.
+ *
+ * @return void
+ */
+ public function startAnalyzeProcess();
+
+ /**
+ * Is called when PDepend has finished the analyzing process.
+ *
+ * @return void
+ */
+ public function endAnalyzeProcess();
+
+ /**
+ * Is called when PDepend starts the logging process.
+ *
+ * @return void
+ */
+ public function startLogProcess();
+
+ /**
+ * Is called when PDepend has finished the logging process.
+ *
+ * @return void
+ */
+ public function endLogProcess();
+}
+
+// @codeCoverageIgnoreEnd
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/CodeAwareGenerator.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/CodeAwareGenerator.php
new file mode 100644
index 0000000..29f7e84
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/CodeAwareGenerator.php
@@ -0,0 +1,62 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Report;
+
+use PDepend\Source\AST\ASTArtifactList;
+
+/**
+ * A logger that implements this interface needs the analyzed code structure.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface CodeAwareGenerator extends ReportGenerator
+{
+ /**
+ * Sets the context code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTArtifactList $artifacts
+ * @return void
+ */
+ public function setArtifacts(ASTArtifactList $artifacts);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/FileAwareGenerator.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/FileAwareGenerator.php
new file mode 100644
index 0000000..8616c7c
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/FileAwareGenerator.php
@@ -0,0 +1,61 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Report;
+
+/**
+ * Marker interface for a log file aware logger.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface FileAwareGenerator extends ReportGenerator
+{
+ /**
+ * Sets the output log file.
+ *
+ * @param string $logFile The output log file.
+ *
+ * @return void
+ */
+ public function setLogFile($logFile);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Jdepend/Chart.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Jdepend/Chart.php
new file mode 100644
index 0000000..55de8cf
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Jdepend/Chart.php
@@ -0,0 +1,248 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Report\Jdepend;
+
+use PDepend\Metrics\Analyzer;
+use PDepend\Metrics\Analyzer\DependencyAnalyzer;
+use PDepend\Report\CodeAwareGenerator;
+use PDepend\Report\FileAwareGenerator;
+use PDepend\Report\NoLogOutputException;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\ASTVisitor\AbstractASTVisitor;
+use PDepend\Util\FileUtil;
+use PDepend\Util\ImageConvert;
+
+/**
+ * Generates a chart with the aggregated metrics.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Chart extends AbstractASTVisitor implements CodeAwareGenerator, FileAwareGenerator
+{
+ /**
+ * The output file name.
+ *
+ * @var string
+ */
+ private $logFile = null;
+
+ /**
+ * The context source code.
+ *
+ * @var \PDepend\Source\AST\ASTArtifactList
+ */
+ private $code = null;
+
+ /**
+ * The context analyzer instance.
+ *
+ * @var \PDepend\Metrics\Analyzer\DependencyAnalyzer
+ */
+ private $analyzer = null;
+
+ /**
+ * Sets the output log file.
+ *
+ * @param string $logFile The output log file.
+ *
+ * @return void
+ */
+ public function setLogFile($logFile)
+ {
+ $this->logFile = $logFile;
+ }
+
+ /**
+ * Returns an array with accepted analyzer types. These types can be
+ * concrete analyzer classes or one of the descriptive analyzer interfaces.
+ *
+ * @return array(string)
+ */
+ public function getAcceptedAnalyzers()
+ {
+ return array('pdepend.analyzer.dependency');
+ }
+
+ /**
+ * Sets the context code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTArtifactList $artifacts
+ * @return void
+ */
+ public function setArtifacts(ASTArtifactList $artifacts)
+ {
+ $this->code = $artifacts;
+ }
+
+ /**
+ * Adds an analyzer to log. If this logger accepts the given analyzer it
+ * with return true, otherwise the return value is false.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The analyzer to log.
+ * @return boolean
+ */
+ public function log(Analyzer $analyzer)
+ {
+ if ($analyzer instanceof DependencyAnalyzer) {
+ $this->analyzer = $analyzer;
+
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Closes the logger process and writes the output file.
+ *
+ * @return void
+ * @throws \PDepend\Report\NoLogOutputException If the no log target exists.
+ */
+ public function close()
+ {
+ // Check for configured log file
+ if ($this->logFile === null) {
+ throw new NoLogOutputException($this);
+ }
+
+ $bias = 0.1;
+
+ $svg = new \DOMDocument('1.0', 'UTF-8');
+ $svg->load(dirname(__FILE__) . '/chart.svg');
+
+ $bad = $svg->getElementById('jdepend.bad');
+ $good = $svg->getElementById('jdepend.good');
+ $layer = $svg->getElementById('jdepend.layer');
+ $legendTemplate = $svg->getElementById('jdepend.legend');
+
+ $max = 0;
+ $min = 0;
+
+ $items = array();
+ foreach ($this->code as $namespace) {
+
+ if (!$namespace->isUserDefined()) {
+ continue;
+ }
+
+ $metrics = $this->analyzer->getStats($namespace);
+
+ if (count($metrics) === 0) {
+ continue;
+ }
+
+ $size = $metrics['cc'] + $metrics['ac'];
+ if ($size > $max) {
+ $max = $size;
+ } elseif ($min === 0 || $size < $min) {
+ $min = $size;
+ }
+
+ $items[] = array(
+ 'size' => $size,
+ 'abstraction' => $metrics['a'],
+ 'instability' => $metrics['i'],
+ 'distance' => $metrics['d'],
+ 'name' => $namespace->getName()
+ );
+ }
+
+ $diff = (($max - $min) / 10);
+
+ // Sort items by size
+ usort(
+ $items,
+ create_function('$a, $b', 'return ($a["size"] - $b["size"]);')
+ );
+
+ foreach ($items as $item) {
+ if ($item['distance'] < $bias) {
+ $ellipse = $good->cloneNode(true);
+ } else {
+ $ellipse = $bad->cloneNode(true);
+ }
+ $r = 15;
+ if ($diff !== 0) {
+ $r = 5 + (($item['size'] - $min) / $diff);
+ }
+
+ $a = $r / 15;
+ $e = (50 - $r) + ($item['abstraction'] * 320);
+ $f = (20 - $r + 190) - ($item['instability'] * 190);
+
+ $transform = "matrix({$a}, 0, 0, {$a}, {$e}, {$f})";
+
+ $ellipse->removeAttribute('xml:id');
+ $ellipse->setAttribute('id', uniqid('pdepend_'));
+ $ellipse->setAttribute('title', $item['name']);
+ $ellipse->setAttribute('transform', $transform);
+
+ $layer->appendChild($ellipse);
+
+ $result = preg_match('#\\\\([^\\\\]+)$#', $item['name'], $found);
+ if ($result && count($found)) {
+ $angle = rand(0, 314) / 100 - 1.57;
+ $legend = $legendTemplate->cloneNode(true);
+ $legend->removeAttribute('xml:id');
+ $legend->setAttribute('x', $e + $r * (1 + cos($angle)));
+ $legend->setAttribute('y', $f + $r * (1 + sin($angle)));
+ $legend->nodeValue = $found[1];
+ $legendTemplate->parentNode->appendChild($legend);
+ }
+
+ }
+
+ $bad->parentNode->removeChild($bad);
+ $good->parentNode->removeChild($good);
+ $legendTemplate->parentNode->removeChild($legendTemplate);
+
+ $temp = FileUtil::getSysTempDir();
+ $temp .= '/' . uniqid('pdepend_') . '.svg';
+ $svg->save($temp);
+
+ ImageConvert::convert($temp, $this->logFile);
+
+ // Remove temp file
+ unlink($temp);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Jdepend/Xml.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Jdepend/Xml.php
new file mode 100644
index 0000000..d611cd3
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Jdepend/Xml.php
@@ -0,0 +1,351 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Report\Jdepend;
+
+use PDepend\Metrics\Analyzer;
+use PDepend\Metrics\Analyzer\DependencyAnalyzer;
+use PDepend\Report\CodeAwareGenerator;
+use PDepend\Report\FileAwareGenerator;
+use PDepend\Report\NoLogOutputException;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTNamespace;
+use PDepend\Source\ASTVisitor\AbstractASTVisitor;
+
+/**
+ * Generates an xml document with the aggregated metrics. The format is borrowed
+ * from JDepend.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Xml extends AbstractASTVisitor implements CodeAwareGenerator, FileAwareGenerator
+{
+ /**
+ * The output log file.
+ *
+ * @var string
+ */
+ private $logFile = null;
+
+ /**
+ * The raw {@link \PDepend\Source\AST\ASTNamespace} instances.
+ *
+ * @var \PDepend\Source\AST\ASTArtifactList
+ */
+ protected $code = null;
+
+ /**
+ * Set of all analyzed files.
+ *
+ * @var \PDepend\Source\AST\ASTCompilationUnit[]
+ */
+ protected $fileSet = array();
+
+ /**
+ * List of all generated project metrics.
+ *
+ * @var array(string=>mixed)
+ */
+ protected $projectMetrics = array();
+
+ /**
+ * List of all collected node metrics.
+ *
+ * @var array(string=>array)
+ */
+ protected $nodeMetrics = array();
+
+ /**
+ * The dependency result set.
+ *
+ * @var DependencyAnalyzer
+ */
+ protected $analyzer = null;
+
+ /**
+ * The Packages dom element.
+ *
+ * @var \DOMElement
+ */
+ protected $packages = null;
+
+ /**
+ * The Cycles dom element.
+ *
+ * @var \DOMElement
+ */
+ protected $cycles = null;
+
+ /**
+ * The concrete classes element for the current package.
+ *
+ * @var \DOMElement
+ */
+ protected $concreteClasses = null;
+
+ /**
+ * The abstract classes element for the current package.
+ *
+ * @var \DOMElement
+ */
+ protected $abstractClasses = null;
+
+ /**
+ * Sets the output log file.
+ *
+ * @param string $logFile The output log file.
+ *
+ * @return void
+ */
+ public function setLogFile($logFile)
+ {
+ $this->logFile = $logFile;
+ }
+
+ /**
+ * Returns an array with accepted analyzer types. These types can be
+ * concrete analyzer classes or one of the descriptive analyzer interfaces.
+ *
+ * @return array(string)
+ */
+ public function getAcceptedAnalyzers()
+ {
+ return array('pdepend.analyzer.dependency');
+ }
+
+ /**
+ * Sets the context code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTArtifactList $artifacts
+ * @return void
+ */
+ public function setArtifacts(ASTArtifactList $artifacts)
+ {
+ $this->code = $artifacts;
+ }
+
+ /**
+ * Adds an analyzer to log. If this logger accepts the given analyzer it
+ * with return true, otherwise the return value is false.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The analyzer to log.
+ * @return boolean
+ */
+ public function log(Analyzer $analyzer)
+ {
+ if ($analyzer instanceof DependencyAnalyzer) {
+ $this->analyzer = $analyzer;
+
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Closes the logger process and writes the output file.
+ *
+ * @return void
+ * @throws \PDepend\Report\NoLogOutputException If the no log target exists.
+ */
+ public function close()
+ {
+ // Check for configured output
+ if ($this->logFile === null) {
+ throw new NoLogOutputException($this);
+ }
+
+ $dom = new \DOMDocument('1.0', 'UTF-8');
+
+ $dom->formatOutput = true;
+
+ $jdepend = $dom->createElement('PDepend');
+
+ $this->packages = $jdepend->appendChild($dom->createElement('Packages'));
+ $this->cycles = $jdepend->appendChild($dom->createElement('Cycles'));
+
+ foreach ($this->code as $node) {
+ $node->accept($this);
+ }
+
+ $dom->appendChild($jdepend);
+ $dom->save($this->logFile);
+ }
+
+ /**
+ * Visits a class node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class)
+ {
+ if (!$class->isUserDefined()) {
+ return;
+ }
+
+ $doc = $this->packages->ownerDocument;
+
+ $classXml = $doc->createElement('Class');
+ $classXml->setAttribute('sourceFile', (string) $class->getCompilationUnit());
+ $classXml->appendChild($doc->createTextNode($class->getName()));
+
+ if ($class->isAbstract()) {
+ $this->abstractClasses->appendChild($classXml);
+ } else {
+ $this->concreteClasses->appendChild($classXml);
+ }
+ }
+
+ /**
+ * Visits a code interface object.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ if (!$interface->isUserDefined()) {
+ return;
+ }
+
+ $doc = $this->abstractClasses->ownerDocument;
+
+ $classXml = $doc->createElement('Class');
+ $classXml->setAttribute('sourceFile', (string) $interface->getCompilationUnit());
+ $classXml->appendChild($doc->createTextNode($interface->getName()));
+
+ $this->abstractClasses->appendChild($classXml);
+ }
+
+ /**
+ * Visits a package node.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function visitNamespace(ASTNamespace $namespace)
+ {
+ if (!$namespace->isUserDefined()) {
+ return;
+ }
+
+ $stats = $this->analyzer->getStats($namespace);
+ if (count($stats) === 0) {
+ return;
+ }
+
+ $doc = $this->packages->ownerDocument;
+
+ $this->concreteClasses = $doc->createElement('ConcreteClasses');
+ $this->abstractClasses = $doc->createElement('AbstractClasses');
+
+ $packageXml = $doc->createElement('Package');
+ $packageXml->setAttribute('name', $namespace->getName());
+
+ $statsXml = $doc->createElement('Stats');
+ $statsXml->appendChild($doc->createElement('TotalClasses'))
+ ->appendChild($doc->createTextNode($stats['tc']));
+ $statsXml->appendChild($doc->createElement('ConcreteClasses'))
+ ->appendChild($doc->createTextNode($stats['cc']));
+ $statsXml->appendChild($doc->createElement('AbstractClasses'))
+ ->appendChild($doc->createTextNode($stats['ac']));
+ $statsXml->appendChild($doc->createElement('Ca'))
+ ->appendChild($doc->createTextNode($stats['ca']));
+ $statsXml->appendChild($doc->createElement('Ce'))
+ ->appendChild($doc->createTextNode($stats['ce']));
+ $statsXml->appendChild($doc->createElement('A'))
+ ->appendChild($doc->createTextNode($stats['a']));
+ $statsXml->appendChild($doc->createElement('I'))
+ ->appendChild($doc->createTextNode($stats['i']));
+ $statsXml->appendChild($doc->createElement('D'))
+ ->appendChild($doc->createTextNode($stats['d']));
+
+ $dependsUpon = $doc->createElement('DependsUpon');
+ foreach ($this->analyzer->getEfferents($namespace) as $efferent) {
+ $efferentXml = $doc->createElement('Package');
+ $efferentXml->appendChild($doc->createTextNode($efferent->getName()));
+
+ $dependsUpon->appendChild($efferentXml);
+ }
+
+ $usedBy = $doc->createElement('UsedBy');
+ foreach ($this->analyzer->getAfferents($namespace) as $afferent) {
+ $afferentXml = $doc->createElement('Package');
+ $afferentXml->appendChild($doc->createTextNode($afferent->getName()));
+
+ $usedBy->appendChild($afferentXml);
+ }
+
+ $packageXml->appendChild($statsXml);
+ $packageXml->appendChild($this->concreteClasses);
+ $packageXml->appendChild($this->abstractClasses);
+ $packageXml->appendChild($dependsUpon);
+ $packageXml->appendChild($usedBy);
+
+ if (($cycles = $this->analyzer->getCycle($namespace)) !== null) {
+ $cycleXml = $doc->createElement('Package');
+ $cycleXml->setAttribute('Name', $namespace->getName());
+
+ foreach ($cycles as $cycle) {
+ $cycleXml->appendChild($doc->createElement('Package'))
+ ->appendChild($doc->createTextNode($cycle->getName()));
+ }
+
+ $this->cycles->appendChild($cycleXml);
+ }
+
+ foreach ($namespace->getTypes() as $type) {
+ $type->accept($this);
+ }
+
+ if ($this->concreteClasses->firstChild === null
+ && $this->abstractClasses->firstChild === null
+ ) {
+ return;
+ }
+
+ $this->packages->appendChild($packageXml);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Jdepend/chart.svg b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Jdepend/chart.svg
new file mode 100644
index 0000000..8f18905
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Jdepend/chart.svg
@@ -0,0 +1,587 @@
+
+
+
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/NoLogOutputException.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/NoLogOutputException.php
new file mode 100644
index 0000000..c3550f4
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/NoLogOutputException.php
@@ -0,0 +1,66 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Report;
+
+/**
+ * This type of exception is thrown, if a required log target/log file wasn't
+ * configured for the current logger instance.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class NoLogOutputException extends \LogicException
+{
+ /**
+ * Creates a new log target exception for the given log instance.
+ *
+ * @param \PDepend\Report\ReportGenerator $logger
+ */
+ public function __construct(ReportGenerator $logger)
+ {
+ $className = get_class($logger);
+ $message = "The log target is not configured for '{$className}'.";
+
+ parent::__construct($message);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Overview/Pyramid.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Overview/Pyramid.php
new file mode 100644
index 0000000..4f6ac45
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Overview/Pyramid.php
@@ -0,0 +1,333 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Report\Overview;
+
+use PDepend\Metrics\Analyzer;
+use PDepend\Metrics\Analyzer\CyclomaticComplexityAnalyzer;
+use PDepend\Metrics\Analyzer\CouplingAnalyzer;
+use PDepend\Metrics\Analyzer\InheritanceAnalyzer;
+use PDepend\Metrics\Analyzer\NodeCountAnalyzer;
+use PDepend\Metrics\Analyzer\NodeLocAnalyzer;
+use PDepend\Report\FileAwareGenerator;
+use PDepend\Report\NoLogOutputException;
+use PDepend\Util\FileUtil;
+use PDepend\Util\ImageConvert;
+
+/**
+ * This logger generates a system overview pyramid, as described in the book
+ * Object-Oriented Metrics in Practice.
+ *
+ * http://www.springer.com/computer/programming/book/978-3-540-24429-5
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Pyramid implements FileAwareGenerator
+{
+ /**
+ * The output file name.
+ *
+ * @var string
+ */
+ private $logFile = null;
+
+ /**
+ * The used coupling analyzer.
+ *
+ * @var \PDepend\Metrics\Analyzer\CouplingAnalyzer
+ */
+ private $coupling = null;
+
+ /**
+ * The used cyclomatic complexity analyzer.
+ *
+ * @var \PDepend\Metrics\Analyzer\CyclomaticComplexityAnalyzer
+ */
+ private $cyclomaticComplexity = null;
+
+ /**
+ * The used inheritance analyzer.
+ *
+ * @var \PDepend\Metrics\Analyzer\InheritanceAnalyzer
+ */
+ private $inheritance = null;
+
+ /**
+ * The used node count analyzer.
+ *
+ * @var \PDepend\Metrics\Analyzer\NodeCountAnalyzer
+ */
+ private $nodeCount = null;
+
+ /**
+ * The used node loc analyzer.
+ *
+ * @var \PDepend\Metrics\Analyzer\NodeLocAnalyzer
+ */
+ private $nodeLoc = null;
+
+ /**
+ * Holds defined thresholds for the computed proportions. This set is based
+ * on java thresholds, we should find better values for php projects.
+ *
+ * @var array(string => array)
+ */
+ private $thresholds = array(
+ 'cyclo-loc' => array(0.16, 0.20, 0.24),
+ 'loc-nom' => array(7, 10, 13),
+ 'nom-noc' => array(4, 7, 10),
+ 'noc-nop' => array(6, 17, 26),
+ 'calls-nom' => array(2.01, 2.62, 3.2),
+ 'fanout-calls' => array(0.56, 0.62, 0.68),
+ 'andc' => array(0.25, 0.41, 0.57),
+ 'ahh' => array(0.09, 0.21, 0.32)
+ );
+
+ /**
+ * Sets the output log file.
+ *
+ * @param string $logFile The output log file.
+ *
+ * @return void
+ */
+ public function setLogFile($logFile)
+ {
+ $this->logFile = $logFile;
+ }
+
+ /**
+ * Returns an array with accepted analyzer types. These types can be
+ * concrete analyzer classes or one of the descriptive analyzer interfaces.
+ *
+ * @return array(string)
+ */
+ public function getAcceptedAnalyzers()
+ {
+ return array(
+ 'pdepend.analyzer.coupling',
+ 'pdepend.analyzer.cyclomatic_complexity',
+ 'pdepend.analyzer.inheritance',
+ 'pdepend.analyzer.node_count',
+ 'pdepend.analyzer.node_loc',
+ );
+ }
+
+ /**
+ * Adds an analyzer to log. If this logger accepts the given analyzer it
+ * with return true, otherwise the return value is false.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The analyzer to log.
+ * @return boolean
+ */
+ public function log(Analyzer $analyzer)
+ {
+ if ($analyzer instanceof CyclomaticComplexityAnalyzer) {
+ $this->cyclomaticComplexity = $analyzer;
+ } elseif ($analyzer instanceof CouplingAnalyzer) {
+ $this->coupling = $analyzer;
+ } elseif ($analyzer instanceof InheritanceAnalyzer) {
+ $this->inheritance = $analyzer;
+ } elseif ($analyzer instanceof NodeCountAnalyzer) {
+ $this->nodeCount = $analyzer;
+ } elseif ($analyzer instanceof NodeLocAnalyzer) {
+ $this->nodeLoc = $analyzer;
+ } else {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Closes the logger process and writes the output file.
+ *
+ * @return void
+ * @throws \PDepend\Report\NoLogOutputException
+ */
+ public function close()
+ {
+ // Check for configured log file
+ if ($this->logFile === null) {
+ throw new NoLogOutputException($this);
+ }
+
+ $metrics = $this->collectMetrics();
+ $proportions = $this->computeProportions($metrics);
+
+ $svg = new \DOMDocument('1.0', 'UTF-8');
+ $svg->load(dirname(__FILE__) . '/pyramid.svg');
+
+ $items = array_merge($metrics, $proportions);
+ foreach ($items as $name => $value) {
+ $svg->getElementById("pdepend.{$name}")->nodeValue = $value;
+
+ if (($threshold = $this->computeThreshold($name, $value)) === null) {
+ continue;
+ }
+ if (($color = $svg->getElementById("threshold.{$threshold}")) === null) {
+ continue;
+ }
+ if (($rect = $svg->getElementById("rect.{$name}")) === null) {
+ continue;
+ }
+ preg_match('/fill:(#[^;"]+)/', $color->getAttribute('style'), $match);
+
+ $style = $rect->getAttribute('style');
+ $style = preg_replace('/fill:#[^;"]+/', "fill:{$match[1]}", $style);
+ $rect->setAttribute('style', $style);
+ }
+
+ $temp = FileUtil::getSysTempDir();
+ $temp .= '/' . uniqid('pdepend_') . '.svg';
+ $svg->save($temp);
+
+ ImageConvert::convert($temp, $this->logFile);
+
+ // Remove temp file
+ unlink($temp);
+ }
+
+ /**
+ * Computes the threshold (low, average, high) for the given value and metric.
+ * If no threshold is defined for the given name, this method will return
+ * null.
+ *
+ * @param string $name The metric/field identfier.
+ * @param mixed $value The metric/field value.
+ * @return string
+ */
+ private function computeThreshold($name, $value)
+ {
+ if (!isset($this->thresholds[$name])) {
+ return null;
+ }
+
+ $threshold = $this->thresholds[$name];
+ if ($value <= $threshold[0]) {
+ return 'low';
+ } elseif ($value >= $threshold[2]) {
+ return 'high';
+ } else {
+ $low = $value - $threshold[0];
+ $avg = $threshold[1] - $value;
+
+ if ($low < $avg) {
+ return 'low';
+ }
+ }
+ return 'average';
+ }
+
+ /**
+ * Computes the proportions between the given metrics.
+ *
+ * @param array $metrics The aggregated project metrics.
+ * @return array(string => float)
+ */
+ private function computeProportions(array $metrics)
+ {
+ $orders = array(
+ array('cyclo', 'loc', 'nom', 'noc', 'nop'),
+ array('fanout', 'calls', 'nom')
+ );
+
+ $proportions = array();
+ foreach ($orders as $names) {
+ for ($i = 1, $c = count($names); $i < $c; ++$i) {
+ $value1 = $metrics[$names[$i]];
+ $value2 = $metrics[$names[$i - 1]];
+
+ $identifier = "{$names[$i - 1]}-{$names[$i]}";
+
+ $proportions[$identifier] = 0;
+ if ($value1 > 0) {
+ $proportions[$identifier] = round($value2 / $value1, 3);
+ }
+ }
+ }
+
+ return $proportions;
+ }
+
+ /**
+ * Aggregates the required metrics from the registered analyzers.
+ *
+ * @return array(string => mixed)
+ * @throws \RuntimeException If one of the required analyzers isn't set.
+ */
+ private function collectMetrics()
+ {
+ if ($this->coupling === null) {
+ throw new \RuntimeException('Missing Coupling analyzer.');
+ }
+ if ($this->cyclomaticComplexity === null) {
+ throw new \RuntimeException('Missing Cyclomatic Complexity analyzer.');
+ }
+ if ($this->inheritance === null) {
+ throw new \RuntimeException('Missing Inheritance analyzer.');
+ }
+ if ($this->nodeCount === null) {
+ throw new \RuntimeException('Missing Node Count analyzer.');
+ }
+ if ($this->nodeLoc === null) {
+ throw new \RuntimeException('Missing Node LOC analyzer.');
+ }
+
+ $coupling = $this->coupling->getProjectMetrics();
+ $cyclomatic = $this->cyclomaticComplexity->getProjectMetrics();
+ $inheritance = $this->inheritance->getProjectMetrics();
+ $nodeCount = $this->nodeCount->getProjectMetrics();
+ $nodeLoc = $this->nodeLoc->getProjectMetrics();
+
+ return array(
+ 'cyclo' => $cyclomatic['ccn2'],
+ 'loc' => $nodeLoc['eloc'],
+ 'nom' => ($nodeCount['nom'] + $nodeCount['nof']),
+ 'noc' => $nodeCount['noc'],
+ 'nop' => $nodeCount['nop'],
+ 'ahh' => round($inheritance['ahh'], 3),
+ 'andc' => round($inheritance['andc'], 3),
+ 'fanout' => $coupling['fanout'],
+ 'calls' => $coupling['calls']
+ );
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Overview/pyramid.svg b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Overview/pyramid.svg
new file mode 100644
index 0000000..8d341c5
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Overview/pyramid.svg
@@ -0,0 +1,769 @@
+
+
+
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/ReportGenerator.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/ReportGenerator.php
new file mode 100644
index 0000000..418b9e6
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/ReportGenerator.php
@@ -0,0 +1,79 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Report;
+
+use PDepend\Metrics\Analyzer;
+
+/**
+ * Base interface for all PDepend report generators.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface ReportGenerator
+{
+ /**
+ * Adds an analyzer to log. If this logger accepts the given analyzer it
+ * with return true, otherwise the return value is false.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The analyzer to log.
+ * @return boolean
+ */
+ public function log(Analyzer $analyzer);
+
+ /**
+ * Closes the logger process and writes the output file.
+ *
+ * @return void
+ * @throws \PDepend\Report\NoLogOutputException If the no log target exists.
+ */
+ public function close();
+
+ /**
+ * Returns an array with accepted analyzer types. These types can be
+ * concrete analyzer classes or one of the descriptive analyzer interfaces.
+ *
+ * @return array(string)
+ */
+ public function getAcceptedAnalyzers();
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/ReportGeneratorFactory.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/ReportGeneratorFactory.php
new file mode 100644
index 0000000..fccd15b
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/ReportGeneratorFactory.php
@@ -0,0 +1,118 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Report;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * This factory creates singleton instances of available loggers.
+ *
+ * The identifiers are used to find a matching service in the DIC
+ * that is tagged with 'pdepend.logger' and has an option attribute
+ * named after the identifier, prefixed with --:
+ *
+ * Identifier "my-custom-logger" searchs for:
+ *
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ReportGeneratorFactory
+{
+ /**
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ private $container;
+
+ public function __construct(ContainerInterface $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * Creates a new generator or returns an existing instance for the given
+ * $identifier.
+ *
+ * @param string $identifier The generator identifier.
+ * @param string $fileName The log output file name.
+ * @return \PDepend\Report\ReportGenerator
+ * @throws \RuntimeException
+ */
+ public function createGenerator($identifier, $fileName)
+ {
+ if (!isset($this->instances[$identifier])) {
+ $loggerServices = $this->container->findTaggedServiceIds('pdepend.logger');
+
+ $logger = null;
+
+ foreach ($loggerServices as $id => $loggerServiceTags) {
+ foreach ($loggerServiceTags as $loggerServiceTag) {
+ if ($loggerServiceTag['option'] === '--' . $identifier) {
+ $logger = $this->container->get($id);
+ }
+ }
+ }
+
+ if (!$logger) {
+ throw new \RuntimeException(sprintf('Unknown generator with identifier "%s".', $identifier));
+ }
+
+ // TODO: Refactor this into an external log configurator or a similar
+ // concept.
+ if ($logger instanceof FileAwareGenerator) {
+ $logger->setLogFile($fileName);
+ }
+
+ $this->instances[$identifier] = $logger;
+ }
+ return $this->instances[$identifier];
+ }
+
+ /**
+ * Set of created logger instances.
+ *
+ * @var \PDepend\Report\ReportGenerator[]
+ */
+ protected $instances = array();
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Summary/Xml.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Summary/Xml.php
new file mode 100644
index 0000000..95ca5b0
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Report/Summary/Xml.php
@@ -0,0 +1,415 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Report\Summary;
+
+use PDepend\Metrics\Analyzer;
+use PDepend\Metrics\AnalyzerNodeAware;
+use PDepend\Metrics\AnalyzerProjectAware;
+use PDepend\Report\CodeAwareGenerator;
+use PDepend\Report\FileAwareGenerator;
+use PDepend\Report\NoLogOutputException;
+use PDepend\Source\AST\AbstractASTArtifact;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTCompilationUnit;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTNamespace;
+use PDepend\Source\ASTVisitor\AbstractASTVisitor;
+
+/**
+ * This logger generates a summary xml document with aggregated project, class,
+ * method and file metrics.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Xml extends AbstractASTVisitor implements CodeAwareGenerator, FileAwareGenerator
+{
+ /**
+ * The log output file.
+ *
+ * @var string
+ */
+ private $logFile = null;
+
+ /**
+ * The raw {@link \PDepend\Source\AST\ASTNamespace} instances.
+ *
+ * @var \PDepend\Source\AST\ASTArtifactList
+ */
+ protected $code = null;
+
+ /**
+ * Set of all analyzed files.
+ *
+ * @var \PDepend\Source\AST\ASTCompilationUnit[]
+ */
+ protected $fileSet = array();
+
+ /**
+ * List of all analyzers that implement the node aware interface
+ * {@link \PDepend\Metrics\AnalyzerNodeAware}.
+ *
+ * @var \PDepend\Metrics\AnalyzerNodeAware[]
+ */
+ private $nodeAwareAnalyzers = array();
+
+ /**
+ * List of all analyzers that implement the node aware interface
+ * {@link \PDepend\Metrics\AnalyzerProjectAware}.
+ *
+ * @var \PDepend\Metrics\AnalyzerProjectAware[]
+ */
+ private $projectAwareAnalyzers = array();
+
+ /**
+ * The internal used xml stack.
+ *
+ * @var DOMElement[]
+ */
+ private $xmlStack = array();
+
+ /**
+ * Sets the output log file.
+ *
+ * @param string $logFile The output log file.
+ *
+ * @return void
+ */
+ public function setLogFile($logFile)
+ {
+ $this->logFile = $logFile;
+ }
+
+ /**
+ * Returns an array with accepted analyzer types. These types can be
+ * concrete analyzer classes or one of the descriptive analyzer interfaces.
+ *
+ * @return array(string)
+ */
+ public function getAcceptedAnalyzers()
+ {
+ return array(
+ 'pdepend.analyzer.cyclomatic_complexity',
+ 'pdepend.analyzer.node_loc',
+ 'pdepend.analyzer.npath_complexity',
+ 'pdepend.analyzer.inheritance',
+ 'pdepend.analyzer.node_count',
+ 'pdepend.analyzer.hierarchy',
+ 'pdepend.analyzer.crap_index',
+ 'pdepend.analyzer.code_rank',
+ 'pdepend.analyzer.coupling',
+ 'pdepend.analyzer.class_level',
+ 'pdepend.analyzer.cohesion',
+ );
+ }
+
+ /**
+ * Sets the context code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTArtifactList $artifacts
+ * @return void
+ */
+ public function setArtifacts(ASTArtifactList $artifacts)
+ {
+ $this->code = $artifacts;
+ }
+
+ /**
+ * Adds an analyzer to log. If this logger accepts the given analyzer it
+ * with return true, otherwise the return value is false.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The analyzer to log.
+ * @return boolean
+ */
+ public function log(Analyzer $analyzer)
+ {
+ $accepted = false;
+ if ($analyzer instanceof AnalyzerProjectAware) {
+ $this->projectAwareAnalyzers[] = $analyzer;
+
+ $accepted = true;
+ }
+ if ($analyzer instanceof AnalyzerNodeAware) {
+ $this->nodeAwareAnalyzers[] = $analyzer;
+
+ $accepted = true;
+ }
+ return $accepted;
+ }
+
+ /**
+ * Closes the logger process and writes the output file.
+ *
+ * @return void
+ * @throws \PDepend\Report\NoLogOutputException If the no log target exists.
+ */
+ public function close()
+ {
+ if ($this->logFile === null) {
+ throw new NoLogOutputException($this);
+ }
+
+ $dom = new \DOMDocument('1.0', 'UTF-8');
+
+ $dom->formatOutput = true;
+
+ $metrics = $dom->createElement('metrics');
+ $metrics->setAttribute('generated', date('Y-m-d\TH:i:s'));
+ $metrics->setAttribute('pdepend', '@package_version@');
+
+ foreach ($this->getProjectMetrics() as $name => $value) {
+ $metrics->setAttribute($name, $value);
+ }
+
+ array_push($this->xmlStack, $metrics);
+
+ foreach ($this->code as $node) {
+ $node->accept($this);
+ }
+
+ if (count($this->fileSet) > 0) {
+ $filesXml = $dom->createElement('files');
+ foreach ($this->fileSet as $file) {
+ $fileXml = $dom->createElement('file');
+ $fileXml->setAttribute('name', $file->getFileName());
+
+ $this->writeNodeMetrics($fileXml, $file);
+
+ $filesXml->appendChild($fileXml);
+ }
+ $metrics->insertBefore($filesXml, $metrics->firstChild);
+ }
+
+ $dom->appendChild($metrics);
+
+ $dom->save($this->logFile);
+ }
+
+ /**
+ * Returns an array with all collected project metrics.
+ *
+ * @return array(string=>mixed)
+ * @since 0.9.10
+ */
+ private function getProjectMetrics()
+ {
+ $projectMetrics = array();
+ foreach ($this->projectAwareAnalyzers as $analyzer) {
+ $projectMetrics = array_merge(
+ $projectMetrics,
+ $analyzer->getProjectMetrics()
+ );
+ }
+ ksort($projectMetrics);
+
+ return $projectMetrics;
+ }
+
+ /**
+ * Visits a class node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class)
+ {
+ if (!$class->isUserDefined()) {
+ return;
+ }
+
+ $xml = end($this->xmlStack);
+ $doc = $xml->ownerDocument;
+
+ $classXml = $doc->createElement('class');
+ $classXml->setAttribute('name', $class->getName());
+
+ $this->writeNodeMetrics($classXml, $class);
+ $this->writeFileReference($classXml, $class->getCompilationUnit());
+
+ $xml->appendChild($classXml);
+
+ array_push($this->xmlStack, $classXml);
+
+ foreach ($class->getMethods() as $method) {
+ $method->accept($this);
+ }
+ foreach ($class->getProperties() as $property) {
+ $property->accept($this);
+ }
+
+ array_pop($this->xmlStack);
+ }
+
+ /**
+ * Visits a function node.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function visitFunction(ASTFunction $function)
+ {
+ $xml = end($this->xmlStack);
+ $doc = $xml->ownerDocument;
+
+ $functionXml = $doc->createElement('function');
+ $functionXml->setAttribute('name', $function->getName());
+
+ $this->writeNodeMetrics($functionXml, $function);
+ $this->writeFileReference($functionXml, $function->getCompilationUnit());
+
+ $xml->appendChild($functionXml);
+ }
+
+ /**
+ * Visits a code interface object.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ // Empty implementation, because we don't want interface methods.
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $xml = end($this->xmlStack);
+ $doc = $xml->ownerDocument;
+
+ $methodXml = $doc->createElement('method');
+ $methodXml->setAttribute('name', $method->getName());
+
+ $this->writeNodeMetrics($methodXml, $method);
+
+ $xml->appendChild($methodXml);
+ }
+
+ /**
+ * Visits a namespace node.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function visitNamespace(ASTNamespace $namespace)
+ {
+ $xml = end($this->xmlStack);
+ $doc = $xml->ownerDocument;
+
+ $packageXml = $doc->createElement('package');
+ $packageXml->setAttribute('name', $namespace->getName());
+
+ $this->writeNodeMetrics($packageXml, $namespace);
+
+ array_push($this->xmlStack, $packageXml);
+
+ foreach ($namespace->getTypes() as $type) {
+ $type->accept($this);
+ }
+ foreach ($namespace->getFunctions() as $function) {
+ $function->accept($this);
+ }
+
+ array_pop($this->xmlStack);
+
+ if ($packageXml->firstChild === null) {
+ return;
+ }
+
+ $xml->appendChild($packageXml);
+ }
+
+ /**
+ * Aggregates all metrics for the given $node instance and adds them
+ * to the \DOMElement
+ *
+ * @param \DOMElement $xml
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return void
+ */
+ protected function writeNodeMetrics(\DOMElement $xml, AbstractASTArtifact $node)
+ {
+ $metrics = array();
+ foreach ($this->nodeAwareAnalyzers as $analyzer) {
+ $metrics = array_merge($metrics, $analyzer->getNodeMetrics($node));
+ }
+ ksort($metrics);
+
+ foreach ($metrics as $name => $value) {
+ $xml->setAttribute($name, $value);
+ }
+ }
+
+ /**
+ * Appends a file reference element to the given $xml element.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * @param \DOMElement $xml The parent xml element.
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit The code file instance.
+ * @return void
+ */
+ protected function writeFileReference(\DOMElement $xml, ASTCompilationUnit $compilationUnit = null)
+ {
+ if (in_array($compilationUnit, $this->fileSet, true) === false) {
+ $this->fileSet[] = $compilationUnit;
+ }
+
+ $fileXml = $xml->ownerDocument->createElement('file');
+ $fileXml->setAttribute('name', $compilationUnit->getFileName());
+
+ $xml->appendChild($fileXml);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTAllocationExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTAllocationExpression.php
new file mode 100644
index 0000000..ab25723
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTAllocationExpression.php
@@ -0,0 +1,82 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * An instance of this class represents an object allocation.
+ *
+ *
+ * function foo()
+ * {
+ * // -------------
+ * new bar\Baz();
+ * // -------------
+ *
+ * // ---------
+ * new Foo();
+ * // ---------
+ * }
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTAllocationExpression extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitAllocationExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArguments.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArguments.php
new file mode 100644
index 0000000..f547d2d
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArguments.php
@@ -0,0 +1,80 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents arguments as they are supplied to functions or
+ * constructors invocations.
+ *
+ *
+ * // ------------
+ * Foo::bar($x, $y, $z);
+ * // ------------
+ *
+ * // ------------
+ * $foo->bar($x, $y, $z);
+ * // ------------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTArguments extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitArguments($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArray.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArray.php
new file mode 100644
index 0000000..13b06f5
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArray.php
@@ -0,0 +1,78 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents an array expression.
+ *
+ *
+ * // -------------------------------------
+ * $array = array( 1, 2, 3, array( $a, $b, $c ) );
+ * // -------------------------------------
+ *
+ * // ---------------------------
+ * $array = [ 1, 2, 3, [ $a, $b, $c ] ];
+ * // ---------------------------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTArray extends \PDepend\Source\AST\ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitArray($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArrayElement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArrayElement.php
new file mode 100644
index 0000000..31e30bc
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArrayElement.php
@@ -0,0 +1,112 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a single array element expression.
+ *
+ *
+ * // _ ______ __________________________
+ * // __ ___ __________
+ * $array = array( 1, 2 => 3, array( $a, &$b, 1 => &$c ) );
+ *
+ * // _ ______ _____________________
+ * // __ ___ ________
+ * $array = [ 1, 2 => 3, [ $a, &$b, 1 => &$c ] ];
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTArrayElement extends \PDepend\Source\AST\ASTExpression
+{
+ /**
+ * This method will return true when the element value is passed by
+ * reference.
+ *
+ * @return boolean
+ */
+ public function isByReference()
+ {
+ return $this->getMetadataBoolean(5);
+ }
+
+ /**
+ * This method can be used to mark the element value as passed by reference.
+ *
+ * @return void
+ */
+ public function setByReference()
+ {
+ return $this->setMetadataBoolean(5, true);
+ }
+
+ /**
+ * Returns the total number of the used property bag.
+ *
+ * @return integer
+ * @since 0.10.4
+ * @see \PDepend\Source\AST\ASTNode#getMetadataSize()
+ */
+ protected function getMetadataSize()
+ {
+ return 6;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitArrayElement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArrayIndexExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArrayIndexExpression.php
new file mode 100644
index 0000000..0329168
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArrayIndexExpression.php
@@ -0,0 +1,80 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This node class represents a array-expression.
+ *
+ *
+ * ------
+ * $x[42];
+ * ------
+ *
+ * -----------
+ * $this->foo[23][42];
+ * -----------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTArrayIndexExpression extends ASTIndexExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitArrayIndexExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifact.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifact.php
new file mode 100644
index 0000000..2f00956
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifact.php
@@ -0,0 +1,76 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * Abstract base class for code item.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface ASTArtifact
+{
+ /**
+ * Returns the artifact name.
+ *
+ * @return string
+ */
+ public function getName();
+
+ /**
+ * Returns a id for this code node.
+ *
+ * @return string
+ */
+ public function getId();
+
+ /**
+ * ASTVisitor method for node tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @return void
+ */
+ public function accept(ASTVisitor $visitor);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList.php
new file mode 100644
index 0000000..00c846b
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList.php
@@ -0,0 +1,228 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\AST\ASTArtifactList\CollectionArtifactFilter;
+
+/**
+ * Iterator for code nodes.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTArtifactList implements \ArrayAccess, \Iterator, \Countable
+{
+ /**
+ * List of {@link \PDepend\Source\AST\ASTArtifact} objects in
+ * this iterator.
+ *
+ * @var \PDepend\Source\AST\ASTArtifact[]
+ */
+ private $artifacts = array();
+
+ /**
+ * Total number of available nodes.
+ *
+ * @var integer
+ */
+ private $count = 0;
+
+ /**
+ * Current internal offset.
+ *
+ * @var integer
+ */
+ private $offset = 0;
+
+ /**
+ * Constructs a new node iterator from the given {@link \PDepend\Source\AST\ASTArtifact}
+ * node array.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact[] $artifacts
+ */
+ public function __construct(array $artifacts)
+ {
+ $filter = CollectionArtifactFilter::getInstance();
+
+ $nodeKeys = array();
+ foreach ($artifacts as $artifact) {
+ $id = $artifact->getId();
+
+ if (isset($nodeKeys[$id])) {
+ continue;
+ }
+
+ if ($filter->accept($artifact)) {
+ $nodeKeys[$id] = $id;
+ $this->artifacts[] = $artifact;
+
+ ++$this->count;
+ }
+ }
+ }
+
+ /**
+ * Returns the number of {@link \PDepend\Source\AST\ASTArtifact}
+ * objects in this iterator.
+ *
+ * @return integer
+ */
+ public function count()
+ {
+ return count($this->artifacts);
+ }
+
+ /**
+ * Returns the current node or false
+ *
+ * @return \PDepend\Source\AST\ASTArtifact
+ */
+ public function current()
+ {
+ if ($this->offset >= $this->count) {
+ return false;
+ }
+ return $this->artifacts[$this->offset];
+ }
+
+ /**
+ * Returns the name of the current {@link \PDepend\Source\AST\ASTArtifact}.
+ *
+ * @return string
+ */
+ public function key()
+ {
+ return $this->artifacts[$this->offset]->getName();
+ }
+
+ /**
+ * Moves the internal pointer to the next {@link \PDepend\Source\AST\ASTArtifact}.
+ *
+ * @return void
+ */
+ public function next()
+ {
+ ++$this->offset;
+ }
+
+ /**
+ * Rewinds the internal pointer.
+ *
+ * @return void
+ */
+ public function rewind()
+ {
+ $this->offset = 0;
+ }
+
+ /**
+ * Returns true while there is a next {@link \PDepend\Source\AST\ASTArtifact}.
+ *
+ * @return boolean
+ */
+ public function valid()
+ {
+ return ($this->offset < $this->count);
+ }
+
+ /**
+ * Whether a offset exists
+ *
+ * @param mixed $offset An offset to check for.
+ *
+ * @return boolean Returns true on success or false on failure. The return
+ * value will be casted to boolean if non-boolean was returned.
+ * @since 1.0.0
+ * @link http://php.net/manual/en/arrayaccess.offsetexists.php
+ */
+ public function offsetExists($offset)
+ {
+ return isset($this->artifacts[$offset]);
+ }
+
+ /**
+ * Offset to retrieve
+ *
+ * @param mixed $offset
+ * @return \PDepend\Source\AST\ASTArtifact Can return all value types.
+ * @throws \OutOfBoundsException
+ * @since 1.0.0
+ * @link http://php.net/manual/en/arrayaccess.offsetget.php
+ */
+ public function offsetGet($offset)
+ {
+ if (isset($this->artifacts[$offset])) {
+ return $this->artifacts[$offset];
+ }
+ throw new \OutOfBoundsException("The offset {$offset} does not exist.");
+ }
+
+ /**
+ * Offset to set
+ *
+ * @param mixed $offset
+ * @param mixed $value
+ * @return void
+ * @throws \BadMethodCallException
+ * @since 1.0.0
+ * @link http://php.net/manual/en/arrayaccess.offsetset.php
+ */
+ public function offsetSet($offset, $value)
+ {
+ throw new \BadMethodCallException('Not supported operation.');
+ }
+
+ /**
+ * Offset to unset
+ *
+ * @param mixed $offset
+ * @return void
+ * @throws \BadMethodCallException
+ * @since 1.0.0
+ * @link http://php.net/manual/en/arrayaccess.offsetunset.php
+ */
+ public function offsetUnset($offset)
+ {
+ throw new \BadMethodCallException('Not supported operation.');
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/ArtifactFilter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/ArtifactFilter.php
new file mode 100644
index 0000000..baee725
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/ArtifactFilter.php
@@ -0,0 +1,63 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST\ASTArtifactList;
+
+use PDepend\Source\AST\ASTArtifact;
+
+/**
+ * Base interface for {@link \PDepend\Source\AST\ASTArtifactList} filters.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface ArtifactFilter
+{
+ /**
+ * Returns true if the given node should be part of the node iterator,
+ * otherwise this method will return false.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $node
+ * @return boolean
+ */
+ public function accept(ASTArtifact $node);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/CollectionArtifactFilter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/CollectionArtifactFilter.php
new file mode 100644
index 0000000..0fef5bc
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/CollectionArtifactFilter.php
@@ -0,0 +1,120 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST\ASTArtifactList;
+
+use PDepend\Source\AST\ASTArtifact;
+
+/**
+ * Static composite filter for code nodes. This class is used for an overall
+ * filtering.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ *
+ * @fixme Never ever use a singleton!!!
+ */
+final class CollectionArtifactFilter implements ArtifactFilter
+{
+ /**
+ * Singleton instance of this filter.
+ *
+ * @var \PDepend\Source\AST\ASTArtifactList\CollectionArtifactFilter
+ */
+ private static $instance = null;
+
+ /**
+ * Singleton method for this filter class.
+ *
+ * @return \PDepend\Source\AST\ASTArtifactList\CollectionArtifactFilter
+ */
+ public static function getInstance()
+ {
+ if (self::$instance === null) {
+ self::$instance = new CollectionArtifactFilter();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructs a new static filter.
+ *
+ * @access private
+ */
+ public function __construct()
+ {
+ }
+
+ /**
+ * An optional configured filter instance.
+ *
+ * @var \PDepend\Source\AST\ASTArtifactList\ArtifactFilter
+ */
+ private $filter = null;
+
+ /**
+ * Sets the used filter instance.
+ *
+ * @param \PDepend\Source\AST\ASTArtifactList\ArtifactFilter $filter
+ * @return void
+ * @since 0.9.12
+ */
+ public function setFilter(ArtifactFilter $filter = null)
+ {
+ $this->filter = $filter;
+ }
+
+ /**
+ * Returns true if the given node should be part of the node iterator,
+ * otherwise this method will return false.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $node
+ * @return boolean
+ */
+ public function accept(ASTArtifact $node)
+ {
+ if ($this->filter === null) {
+ return true;
+ }
+ return $this->filter->accept($node);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/NullArtifactFilter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/NullArtifactFilter.php
new file mode 100644
index 0000000..96cf42c
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/NullArtifactFilter.php
@@ -0,0 +1,66 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST\ASTArtifactList;
+
+use PDepend\Source\AST\ASTArtifact;
+
+/**
+ * This is a simple NULL-implementation of the code filter interface.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class NullArtifactFilter implements ArtifactFilter
+{
+ /**
+ * Returns true if the given node should be part of the node iterator,
+ * otherwise this method will return false.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $node
+ * @return boolean
+ */
+ public function accept(ASTArtifact $node)
+ {
+ return true;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/PackageArtifactFilter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/PackageArtifactFilter.php
new file mode 100644
index 0000000..8b05e05
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTArtifactList/PackageArtifactFilter.php
@@ -0,0 +1,102 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST\ASTArtifactList;
+
+use PDepend\Source\AST\ASTArtifact;
+use PDepend\Source\AST\AbstractASTClassOrInterface;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTNamespace;
+
+/**
+ * This class implements a filter that is based on the namespace.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class PackageArtifactFilter implements ArtifactFilter
+{
+ /**
+ * Regexp with ignorable namespace names and namespace name fragments.
+ *
+ * @var string
+ */
+ private $pattern = '';
+
+ /**
+ * Constructs a new namespace filter for the given list of namespace names.
+ *
+ * @param array(string) $namespaces
+ */
+ public function __construct(array $namespaces)
+ {
+ $patterns = array();
+ foreach ($namespaces as $namespace) {
+ $patterns[] = str_replace('\*', '\S*', preg_quote($namespace));
+ }
+ $this->pattern = '#^(' . join('|', $patterns) . ')$#D';
+ }
+
+ /**
+ * Returns true if the given node should be part of the node iterator,
+ * otherwise this method will return false.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact $node
+ * @return boolean
+ */
+ public function accept(ASTArtifact $node)
+ {
+ $namespace = null;
+ // NOTE: This looks a little bit ugly and it seems better to exclude
+ // \PDepend\Source\AST\ASTMethod and \PDepend\Source\AST\ASTProperty,
+ // but when PDepend supports more node types, this could produce errors.
+ if ($node instanceof AbstractASTClassOrInterface) {
+ $namespace = $node->getNamespace()->getName();
+ } elseif ($node instanceof ASTFunction) {
+ $namespace = $node->getNamespace()->getName();
+ } elseif ($node instanceof ASTNamespace) {
+ $namespace = $node->getName();
+ }
+
+ return (preg_match($this->pattern, $namespace) === 0);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTAssignmentExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTAssignmentExpression.php
new file mode 100644
index 0000000..8018c45
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTAssignmentExpression.php
@@ -0,0 +1,67 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents any kind of assignment.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTAssignmentExpression extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitAssignmentExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTBooleanAndExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTBooleanAndExpression.php
new file mode 100644
index 0000000..06ecd12
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTBooleanAndExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a boolean and-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTBooleanAndExpression extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitBooleanAndExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTBooleanOrExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTBooleanOrExpression.php
new file mode 100644
index 0000000..7e9c21a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTBooleanOrExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a boolean or-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTBooleanOrExpression extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitBooleanOrExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTBreakStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTBreakStatement.php
new file mode 100644
index 0000000..0102946
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTBreakStatement.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a break-statement.
+ *
+ *
+ * ------
+ * break;
+ * ------
+ *
+ * ---------
+ * break 42;
+ * ---------
+ *
+ * ----------------------
+ * break $this->foobar();
+ * ----------------------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTBreakStatement extends \PDepend\Source\AST\ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitBreakStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCastExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCastExpression.php
new file mode 100644
index 0000000..0dd654a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCastExpression.php
@@ -0,0 +1,181 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.15
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a cast-expression node.
+ *
+ *
+ * // ----------
+ * $foo = (int) $bar;
+ * // ----------
+ *
+ * // -----------
+ * $foo = (bool) $bar;
+ * // -----------
+ *
+ * // ------------
+ * $foo = (array) $bar;
+ * // ------------
+ *
+ * // ------------
+ * $foo = (unset) $bar;
+ * // ------------
+ *
+ * // -------------
+ * $foo = (double) $bar;
+ * // -------------
+ *
+ * // -------------
+ * $foo = (string) $bar;
+ * // -------------
+ *
+ * // -------------
+ * $foo = (object) $bar;
+ * // -------------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.15
+ */
+class ASTCastExpression extends \PDepend\Source\AST\ASTUnaryExpression
+{
+ /**
+ * Constructs a new cast-expression node.
+ *
+ * @param string $image The original cast image.
+ */
+ public function __construct($image)
+ {
+ parent::__construct(preg_replace('(\s+)', '', strtolower($image)));
+ }
+
+ /**
+ * Returns true when this node represents an array cast-expression.
+ *
+ * @return boolean
+ */
+ public function isArray()
+ {
+ return ($this->getImage() === '(array)');
+ }
+
+ /**
+ * Returns true when this node represents an object cast-expression.
+ *
+ * @return boolean
+ */
+ public function isObject()
+ {
+ return ($this->getImage() === '(object)');
+ }
+
+ /**
+ * Returns true when this node represents a boolean cast-expression.
+ *
+ * @return boolean
+ */
+ public function isBoolean()
+ {
+ return ($this->getImage() === '(bool)' || $this->getImage() === '(boolean)');
+ }
+
+ /**
+ * Returns true when this node represents an integer cast-expression.
+ *
+ * @return boolean
+ */
+ public function isInteger()
+ {
+ return ($this->getImage() === '(int)' || $this->getImage() === '(integer)');
+ }
+
+ /**
+ * Returns true when this node represents a float cast-expression.
+ *
+ * @return boolean
+ */
+ public function isFloat()
+ {
+ return ($this->getImage() === '(real)'
+ || $this->getImage() === '(float)'
+ || $this->getImage() === '(double)'
+ );
+ }
+
+ /**
+ * Returns true when this node represents a string cast-expression.
+ *
+ * @return boolean
+ */
+ public function isString()
+ {
+ return (strcmp('(string)', $this->getImage()) === 0);
+ }
+
+ /**
+ * Returns true when this node represents an unset cast-expression.
+ *
+ * @return boolean
+ */
+ public function isUnset()
+ {
+ return ($this->getImage() === '(unset)');
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitCastExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCatchStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCatchStatement.php
new file mode 100644
index 0000000..56c3d86
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCatchStatement.php
@@ -0,0 +1,67 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a catch-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTCatchStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitCatchStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClass.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClass.php
new file mode 100644
index 0000000..0250558
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClass.php
@@ -0,0 +1,204 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * Represents a php class node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTClass extends AbstractASTClassOrInterface
+{
+ /**
+ * List of associated properties.
+ *
+ * @var \PDepend\Source\AST\ASTProperty[]
+ */
+ private $properties = null;
+
+ /**
+ * Returns true if this is an abstract class or an interface.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ return (($this->modifiers & State::IS_EXPLICIT_ABSTRACT) === State::IS_EXPLICIT_ABSTRACT);
+ }
+
+ /**
+ * This method will return true when this class is declared as final.
+ *
+ * @return boolean
+ */
+ public function isFinal()
+ {
+ return (($this->modifiers & State::IS_FINAL) === State::IS_FINAL);
+ }
+
+ /**
+ * Returns all properties for this class.
+ *
+ * @return \PDepend\Source\AST\ASTProperty[]
+ */
+ public function getProperties()
+ {
+ if ($this->properties === null) {
+ $this->properties = array();
+
+ $declarations = $this->findChildrenOfType('PDepend\\Source\\AST\\ASTFieldDeclaration');
+ foreach ($declarations as $declaration) {
+ $declarators = $declaration->findChildrenOfType('PDepend\\Source\\AST\\ASTVariableDeclarator');
+
+ foreach ($declarators as $declarator) {
+
+ $property = new ASTProperty($declaration, $declarator);
+ $property->setDeclaringClass($this);
+ $property->setCompilationUnit($this->getCompilationUnit());
+
+ $this->properties[] = $property;
+ }
+ }
+ }
+
+ return new ASTArtifactList($this->properties);
+ }
+
+ /**
+ * Checks that this user type is a subtype of the given $type instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ * @return boolean
+ */
+ public function isSubtypeOf(AbstractASTType $type)
+ {
+ if ($type === $this) {
+ return true;
+ } elseif ($type instanceof ASTInterface) {
+ foreach ($this->getInterfaces() as $interface) {
+ if ($interface === $type) {
+ return true;
+ }
+ }
+ } elseif (($parent = $this->getParentClass()) !== null) {
+ if ($parent === $type) {
+ return true;
+ }
+ return $parent->isSubtypeOf($type);
+ }
+ return false;
+ }
+
+ /**
+ * Returns the declared modifiers for this type.
+ *
+ * @return integer
+ * @since 0.9.4
+ */
+ public function getModifiers()
+ {
+ return $this->modifiers;
+ }
+
+ /**
+ * This method sets a OR combined integer of the declared modifiers for this
+ * node.
+ *
+ * This method will throw an exception when the value of given $modifiers
+ * contains an invalid/unexpected modifier
+ *
+ * @param integer $modifiers
+ * @return void
+ * @throws \BadMethodCallException
+ * @throws \InvalidArgumentException
+ * @since 0.9.4
+ */
+ public function setModifiers($modifiers)
+ {
+ if ($this->modifiers !== 0) {
+ throw new \BadMethodCallException(
+ 'Cannot overwrite previously set class modifiers.'
+ );
+ }
+
+ $expected = ~State::IS_EXPLICIT_ABSTRACT
+ & ~State::IS_IMPLICIT_ABSTRACT
+ & ~State::IS_FINAL;
+
+ if (($expected & $modifiers) !== 0) {
+ throw new \InvalidArgumentException('Invalid class modifier given.');
+ }
+
+ $this->modifiers = $modifiers;
+ }
+
+ /**
+ * ASTVisitor method for node tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @return void
+ */
+ public function accept(ASTVisitor $visitor)
+ {
+ $visitor->visitClass($this);
+ }
+
+ /**
+ * The magic wakeup method will be called by PHP's runtime environment when
+ * a serialized instance of this class was unserialized. This implementation
+ * of the wakeup method will register this object in the the global class
+ * context.
+ *
+ * @return void
+ * @since 0.10.0
+ */
+ public function __wakeup()
+ {
+ parent::__wakeup();
+
+ $this->context->registerClass($this);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassFqnPostfix.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassFqnPostfix.php
new file mode 100644
index 0000000..f6225da
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassFqnPostfix.php
@@ -0,0 +1,81 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 2.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This class represents the full qualified class name postfix.
+ *
+ *
+ * // -----
+ * Foo::class
+ * // -----
+ *
+ * // -----
+ * $bar:: class;
+ * // -----
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 2.0.0
+ */
+class ASTClassFqnPostfix extends ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitClassFqnPostfix($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassOrInterfaceRecursiveInheritanceException.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassOrInterfaceRecursiveInheritanceException.php
new file mode 100644
index 0000000..4ab1e00
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassOrInterfaceRecursiveInheritanceException.php
@@ -0,0 +1,71 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This type of exception will be thrown when an inheritance hierarchy is
+ * recursive, so that .
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTClassOrInterfaceRecursiveInheritanceException extends \RuntimeException
+{
+ /**
+ * Constructs a new exception instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $type
+ */
+ public function __construct(AbstractASTClassOrInterface $type)
+ {
+ parent::__construct(
+ sprintf(
+ 'Type %s\%s is part of an endless inheritance hierarchy.',
+ preg_replace('(\W+)', '\\', $type->getNamespace()->getName()),
+ $type->getName()
+ )
+ );
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassOrInterfaceReference.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassOrInterfaceReference.php
new file mode 100644
index 0000000..b045ee5
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassOrInterfaceReference.php
@@ -0,0 +1,126 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.5
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\Builder\BuilderContext;
+
+/**
+ * This class is used as a placeholder for unknown classes or interfaces. It
+ * will resolve the concrete type instance on demand.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.5
+ */
+class ASTClassOrInterfaceReference extends ASTType
+{
+ /**
+ * The global AST builder context.
+ *
+ * @var \PDepend\Source\Builder\BuilderContext
+ */
+ protected $context = null;
+
+ /**
+ * An already loaded type instance.
+ *
+ * @var \PDepend\Source\AST\AbstractASTClassOrInterface
+ */
+ protected $typeInstance = null;
+
+ /**
+ * Constructs a new type holder instance.
+ *
+ * @param \PDepend\Source\Builder\BuilderContext $context
+ * @param string $qualifiedName
+ */
+ public function __construct(BuilderContext $context, $qualifiedName)
+ {
+ parent::__construct($qualifiedName);
+
+ $this->context = $context;
+ }
+
+ /**
+ * Returns the concrete type instance associated with with this placeholder.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ */
+ public function getType()
+ {
+ if ($this->typeInstance === null) {
+ $this->typeInstance = $this->context->getClassOrInterface(
+ $this->getImage()
+ );
+ }
+ return $this->typeInstance;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitClassOrInterfaceReference($this, $data);
+ }
+
+ /**
+ * Magic method which returns the names of all those properties that should
+ * be cached for this node instance.
+ *
+ * @return array
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array_merge(array('context'), parent::__sleep());
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassOrInterfaceReferenceIterator.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassOrInterfaceReferenceIterator.php
new file mode 100644
index 0000000..5540241
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassOrInterfaceReferenceIterator.php
@@ -0,0 +1,89 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This is a special implementation of the node iterator that will translate
+ * a list of given {@link \PDepend\Source\AST\ASTClassOrInterfaceReference} holders
+ * into a list of unique {@link \PDepend\Source\AST\AbstractASTClassOrInterface}
+ * instances.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTClassOrInterfaceReferenceIterator extends ASTArtifactList
+{
+ /**
+ * Constructs a new reference iterator instance.
+ *
+ * @param \PDepend\Source\AST\ASTClassOrInterfaceReference[] $references List of
+ * references to concrete type instances.
+ */
+ public function __construct(array $references)
+ {
+ parent::__construct($this->createClassesAndInterfaces($references));
+ }
+
+ /**
+ * This method creates a set of {@link \PDepend\Source\AST\AbstractASTClassOrInterface}
+ * objects from the given reference array.
+ *
+ * @param \PDepend\Source\AST\ASTClassOrInterfaceReference[] $references
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface[]
+ */
+ protected function createClassesAndInterfaces(array $references)
+ {
+ $classesAndInterfaces = array();
+
+ foreach ($references as $reference) {
+ $classOrInterface = $reference->getType();
+
+ if (isset($classesAndInterfaces[$classOrInterface->getId()])) {
+ continue;
+ }
+ $classesAndInterfaces[$classOrInterface->getId()] = $classOrInterface;
+ }
+
+ return $classesAndInterfaces;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassReference.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassReference.php
new file mode 100644
index 0000000..5e4a00f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClassReference.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.5
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This is a classes only version of the class or interface reference .
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.5
+ */
+class ASTClassReference extends ASTClassOrInterfaceReference
+{
+ /**
+ * Returns the concrete type instance associated with with this placeholder.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ */
+ public function getType()
+ {
+ if ($this->typeInstance === null) {
+ $this->typeInstance = $this->context->getClass($this->getImage());
+ }
+ return $this->typeInstance;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitClassReference($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCloneExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCloneExpression.php
new file mode 100644
index 0000000..d470f60
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCloneExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a clone-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTCloneExpression extends \PDepend\Source\AST\ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitCloneExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClosure.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClosure.php
new file mode 100644
index 0000000..25dc3e3
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTClosure.php
@@ -0,0 +1,145 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a closure-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTClosure extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * This method will return true when this closure returns by
+ * reference.
+ *
+ * @return boolean
+ */
+ public function returnsByReference()
+ {
+ return $this->getMetadataBoolean(5);
+ }
+
+ /**
+ * This method can be used to flag this closure as returns by reference.
+ *
+ * @param boolean $returnsReference Does this closure return by reference?
+ *
+ * @return void
+ */
+ public function setReturnsByReference($returnsReference)
+ {
+ $this->setMetadataBoolean(5, (boolean) $returnsReference);
+ }
+
+ /**
+ * Returns whether this closure was defined as static or not.
+ *
+ * This method will return TRUE when the closure was declared as
+ * followed:
+ *
+ *
+ * $closure = static function( $e ) {
+ * return pow( $e, 2 );
+ * }
+ *
+ *
+ * And it will return FALSE when we declare the closure as usual:
+ *
+ *
+ * $closure = function( $e ) {
+ * return pow( $e, 2 );
+ * }
+ *
+ *
+ * @return boolean
+ * @since 1.0.0
+ */
+ public function isStatic()
+ {
+ return $this->getMetadataBoolean(6);
+ }
+
+ /**
+ * This method can be used to flag this closure instance as static.
+ *
+ * @param boolean $static Whether this closure is static or not.
+ *
+ * @return void
+ * @since 1.0.0
+ */
+ public function setStatic($static)
+ {
+ $this->setMetadataBoolean(6, (boolean) $static);
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitClosure($this, $data);
+ }
+
+ /**
+ * Returns the total number of the used property bag.
+ *
+ * @return integer
+ * @since 1.0.0
+ * @see \PDepend\Source\AST\ASTNode#getMetadataSize()
+ */
+ protected function getMetadataSize()
+ {
+ return 7;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTComment.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTComment.php
new file mode 100644
index 0000000..d210c09
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTComment.php
@@ -0,0 +1,67 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a comment.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTComment extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitComment($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompilationUnit.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompilationUnit.php
new file mode 100644
index 0000000..1fa6c5e
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompilationUnit.php
@@ -0,0 +1,404 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+use PDepend\Util\Cache\CacheDriver;
+
+/**
+ * This class provides an interface to a single source file.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTCompilationUnit extends AbstractASTArtifact
+{
+ /**
+ * The internal used cache instance.
+ *
+ * @var \PDepend\Util\Cache\CacheDriver
+ * @since 0.10.0
+ */
+ protected $cache = null;
+
+ /**
+ * The unique identifier for this function.
+ *
+ * @var string
+ */
+ protected $id = null;
+
+ /**
+ * The source file name/path.
+ *
+ * @var string
+ */
+ protected $fileName = null;
+
+ /**
+ * The comment for this type.
+ *
+ * @var string
+ */
+ protected $docComment = null;
+
+ /**
+ * The files start line. This property must always have the value 1.
+ *
+ * @var integer
+ * @since 0.10.0
+ */
+ protected $startLine = 0;
+
+ /**
+ * The files end line.
+ *
+ * @var integer
+ * @since 0.10.0
+ */
+ protected $endLine = 0;
+
+ /**
+ * List of classes, interfaces and functions that parsed from this file.
+ *
+ * @var \PDepend\Source\AST\AbstractASTArtifact[]
+ * @since 0.10.0
+ */
+ protected $childNodes = array();
+
+ /**
+ * Was this file instance restored from the cache?
+ *
+ * @var boolean
+ * @since 0.10.0
+ */
+ protected $cached = false;
+
+ /**
+ * Normalized code in this file.
+ *
+ * @var string
+ */
+ private $source = null;
+
+ /**
+ * Constructs a new source file instance.
+ *
+ * @param string $fileName The source file name/path.
+ */
+ public function __construct($fileName)
+ {
+ if ($fileName !== null) {
+ $this->fileName = realpath($fileName);
+ }
+ }
+
+ /**
+ * Returns the physical file name for this object.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->fileName;
+ }
+
+ /**
+ * Returns the physical file name for this object.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->fileName;
+ }
+
+ /**
+ * Returns a id for this code node.
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * Sets the unique identifier for this file instance.
+ *
+ * @param string $id Identifier for this file.
+ * @return void
+ * @since 0.9.12
+ */
+ public function setId($id)
+ {
+ $this->id = $id;
+ }
+
+ /**
+ * Setter method for the used parser and token cache.
+ *
+ * @param \PDepend\Util\Cache\CacheDriver $cache
+ * @return \PDepend\Source\AST\ASTCompilationUnit
+ * @since 0.10.0
+ */
+ public function setCache(CacheDriver $cache)
+ {
+ $this->cache = $cache;
+ return $this;
+ }
+
+ /**
+ * Returns normalized source code with stripped whitespaces.
+ *
+ * @return array(integer=>string)
+ */
+ public function getSource()
+ {
+ $this->readSource();
+ return $this->source;
+ }
+
+ /**
+ * Returns an array with all tokens within this file.
+ *
+ * @return array(array)
+ */
+ public function getTokens()
+ {
+ return (array) $this->cache
+ ->type('tokens')
+ ->restore($this->getId());
+ }
+
+ /**
+ * Sets the tokens for this file.
+ *
+ * @param array(array) $tokens The generated tokens.
+ *
+ * @return void
+ */
+ public function setTokens(array $tokens)
+ {
+ return $this->cache
+ ->type('tokens')
+ ->store($this->getId(), $tokens);
+ }
+
+ /**
+ * Returns the doc comment for this item or null.
+ *
+ * @return string
+ */
+ public function getDocComment()
+ {
+ return $this->docComment;
+ }
+
+ /**
+ * Sets the doc comment for this item.
+ *
+ * @param string $docComment The doc comment block.
+ *
+ * @return void
+ */
+ public function setDocComment($docComment)
+ {
+ $this->docComment = $docComment;
+ }
+
+ /**
+ * Adds a source item that was parsed from this source file.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $artifact
+ * @return void
+ * @since 0.10.0
+ */
+ public function addChild(AbstractASTArtifact $artifact)
+ {
+ $this->childNodes[$artifact->getId()] = $artifact;
+ }
+
+ /**
+ * Returns the start line number for this source file. For an existing file
+ * this value must always be 1, while it can be 0 for a
+ * not existing dummy file.
+ *
+ * @return integer
+ * @since 0.10.0
+ */
+ public function getStartLine()
+ {
+ if ($this->startLine === 0) {
+ $this->readSource();
+ }
+ return $this->startLine;
+ }
+
+ /**
+ * Returns the start line number for this source file. For an existing file
+ * this value must always be greater 0, while it can be 0
+ * for a not existing dummy file.
+ *
+ * @return integer
+ * @since 0.10.0
+ */
+ public function getEndLine()
+ {
+ if ($this->endLine === 0) {
+ $this->readSource();
+ }
+ return $this->endLine;
+ }
+
+ /**
+ * This method will return true when this file instance was restored
+ * from the cache and not currently parsed. Otherwise this method will return
+ * false.
+ *
+ * @return boolean
+ * @since 0.10.0
+ */
+ public function isCached()
+ {
+ return $this->cached;
+ }
+
+ /**
+ * ASTVisitor method for node tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @return void
+ */
+ public function accept(ASTVisitor $visitor)
+ {
+ $visitor->visitCompilationUnit($this);
+ }
+
+ /**
+ * The magic sleep method will be called by PHP's runtime environment right
+ * before it serializes an instance of this class. This method returns an
+ * array with those property names that should be serialized.
+ *
+ * @return array(string)
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array(
+ 'cache',
+ 'childNodes',
+ 'docComment',
+ 'endLine',
+ 'fileName',
+ 'startLine',
+ 'id'
+ );
+ }
+
+ /**
+ * The magic wakeup method will is called by PHP's runtime environment when
+ * a serialized instance of this class was unserialized. This implementation
+ * of the wakeup method restores the references between all parsed entities
+ * in this source file and this file instance.
+ *
+ * @return void
+ * @since 0.10.0
+ * @see \PDepend\Source\AST\ASTCompilationUnit::$childNodes
+ */
+ public function __wakeup()
+ {
+ $this->cached = true;
+
+ foreach ($this->childNodes as $childNode) {
+ $childNode->setCompilationUnit($this);
+ }
+ }
+
+ /**
+ * Returns the string representation of this class.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return ($this->fileName === null ? '' : $this->fileName);
+ }
+
+ /**
+ * Reads the source file if required.
+ *
+ * @return void
+ */
+ protected function readSource()
+ {
+ if ($this->source === null && file_exists($this->fileName)) {
+ $source = file_get_contents($this->fileName);
+
+ $this->source = str_replace(array("\r\n", "\r"), "\n", $source);
+
+ $this->startLine = 1;
+ $this->endLine = substr_count($this->source, "\n") + 1;
+ }
+ }
+
+ // Deprecated methods
+ // @codeCoverageIgnoreStart
+
+ /**
+ * This method can be called by the PDepend runtime environment or a
+ * utilizing component to free up memory. This methods are required for
+ * PHP version < 5.3 where cyclic references can not be resolved
+ * automatically by PHP's garbage collector.
+ *
+ * @return void
+ * @since 0.9.12
+ * @deprecated Since 0.10.0
+ */
+ public function free()
+ {
+ fwrite(STDERR, __METHOD__ . ' is deprecated since version 0.10.0' . PHP_EOL);
+ }
+
+ // @codeCoverageIgnoreEnd
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompilationUnitNotFoundException.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompilationUnitNotFoundException.php
new file mode 100644
index 0000000..a344347
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompilationUnitNotFoundException.php
@@ -0,0 +1,65 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This type of exception will be thrown when the source file of a code object
+ * is accessed, but this property is not available.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+class ASTCompilationUnitNotFoundException extends \RuntimeException
+{
+ /**
+ * Constructs a new exception instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $owner
+ */
+ public function __construct(AbstractASTArtifact $owner)
+ {
+ parent::__construct('The mandatory parent was not defined.');
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompoundExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompoundExpression.php
new file mode 100644
index 0000000..fa611fd
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompoundExpression.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a compound expression node.
+ *
+ *
+ * // -----
+ * Foo::${BAR}();
+ * // -----
+ *
+ * // -----
+ * Foo::$${BAR}();
+ * // -----
+ *
+ * // -----
+ * $foo->{BAR}();
+ * // -----
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTCompoundExpression extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitCompoundExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompoundVariable.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompoundVariable.php
new file mode 100644
index 0000000..09513b9
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompoundVariable.php
@@ -0,0 +1,79 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a compound variable node.
+ *
+ *
+ * // ------
+ * Foo::${BAR}();
+ * // ------
+ *
+ * // ------
+ * Foo::$${BAR}();
+ * // ------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTCompoundVariable extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitCompoundVariable($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConditionalExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConditionalExpression.php
new file mode 100644
index 0000000..85f3acd
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConditionalExpression.php
@@ -0,0 +1,75 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a conditional expression.
+ *
+ *
+ * --------------
+ * $x = ($foo ? 42 : 23)
+ * --------------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTConditionalExpression extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitConditionalExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstant.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstant.php
new file mode 100644
index 0000000..745215a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstant.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a constant node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTConstant extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitConstant($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstantDeclarator.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstantDeclarator.php
new file mode 100644
index 0000000..c54400d
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstantDeclarator.php
@@ -0,0 +1,135 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a single constant declarator within a constant
+ * definition.
+ *
+ *
+ * class Foo
+ * {
+ * // --------
+ * const BAR = 42;
+ * // --------
+ * }
+ *
+ *
+ * Or in a comma separated constant defintion:
+ *
+ *
+ * class Foo
+ * {
+ * // --------
+ * const BAR = 42,
+ * // --------
+ *
+ * // --------------
+ * const BAZ = 'Foobar',
+ * // --------------
+ *
+ * // ----------
+ * const FOO = 3.14;
+ * // ----------
+ * }
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTConstantDeclarator extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * The initial declaration value for this node or null.
+ *
+ * @var \PDepend\Source\AST\ASTValue
+ */
+ protected $value = null;
+
+ /**
+ * Returns the initial declaration value for this node.
+ *
+ * @return \PDepend\Source\AST\ASTValue
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Sets the declared default value for this constant node.
+ *
+ * @param \PDepend\Source\AST\ASTValue $value
+ * @return void
+ */
+ public function setValue(ASTValue $value)
+ {
+ $this->value = $value;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitConstantDeclarator($this, $data);
+ }
+
+ /**
+ * Magic sleep method that returns an array with those property names that
+ * should be cached for this node instance.
+ *
+ * @return array(string)
+ */
+ public function __sleep()
+ {
+ return array_merge(array('value'), parent::__sleep());
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstantDefinition.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstantDefinition.php
new file mode 100644
index 0000000..0675750
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstantDefinition.php
@@ -0,0 +1,77 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a single constant definition as it can occure in
+ * class definition or interface declaration.
+ *
+ *
+ * class Foo
+ * {
+ * // ------------------------
+ * const FOO = 42, BAR = 23;
+ * // ------------------------
+ * }
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTConstantDefinition extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitConstantDefinition($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstantPostfix.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstantPostfix.php
new file mode 100644
index 0000000..c380457
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTConstantPostfix.php
@@ -0,0 +1,74 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a constant postfix expression..
+ *
+ *
+ * // ---
+ * Foo::BAR;
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTConstantPostfix extends \PDepend\Source\AST\ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitConstantPostfix($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTContinueStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTContinueStatement.php
new file mode 100644
index 0000000..f09a86c
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTContinueStatement.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a continue-statement.
+ *
+ *
+ * ---------
+ * continue;
+ * ---------
+ *
+ * ------------
+ * continue 42;
+ * ------------
+ *
+ * -------------------------
+ * continue $this->foobar();
+ * -------------------------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTContinueStatement extends \PDepend\Source\AST\ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitContinueStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTDeclareStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTDeclareStatement.php
new file mode 100644
index 0000000..f129880
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTDeclareStatement.php
@@ -0,0 +1,130 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a declare-statement.
+ *
+ *
+ * -------------------------------
+ * declare(encoding='ISO-8859-1');
+ * -------------------------------
+ *
+ * -------------------
+ * declare(ticks=42) {
+ * // ...
+ * }
+ * -
+ *
+ * ------------------
+ * declare(ticks=42):
+ * // ...
+ * enddeclare;
+ * -----------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+class ASTDeclareStatement extends \PDepend\Source\AST\ASTStatement
+{
+ /**
+ * The parsed declare values.
+ *
+ * @var \PDepend\Source\AST\ASTValue[]
+ */
+ protected $values = array();
+
+ /**
+ * Returns all values/parameters for this declare statement.
+ *
+ * @return \PDepend\Source\AST\ASTValue[]
+ */
+ public function getValues()
+ {
+ return $this->values;
+ }
+
+ /**
+ * Adds a parameter/value for this declare-statement.
+ *
+ * @param string $name
+ * @param \PDepend\Source\AST\ASTValue $value
+ *
+ * @return void
+ */
+ public function addValue($name, ASTValue $value)
+ {
+ $this->values[$name] = $value;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.10.0
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitDeclareStatement($this, $data);
+ }
+
+ /**
+ * The magic sleep method will be called by PHP's runtime environment right
+ * before an instance of this class gets serialized. It should return an
+ * array with those property names that should be serialized for this class.
+ *
+ * @return array(string)
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array_merge(array('values'), parent::__sleep());
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTDoWhileStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTDoWhileStatement.php
new file mode 100644
index 0000000..6e4b555
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTDoWhileStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a do/while-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTDoWhileStatement extends \PDepend\Source\AST\ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitDoWhileStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTEchoStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTEchoStatement.php
new file mode 100644
index 0000000..739d756
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTEchoStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents an echo-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTEchoStatement extends \PDepend\Source\AST\ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitEchoStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTElseIfStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTElseIfStatement.php
new file mode 100644
index 0000000..3aa366f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTElseIfStatement.php
@@ -0,0 +1,84 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents an elseif-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTElseIfStatement extends \PDepend\Source\AST\ASTStatement
+{
+ /**
+ * Returns true when this elseif-statement is followed by an
+ * else-statement.
+ *
+ * @return boolean
+ * @since 0.9.12
+ */
+ public function hasElse()
+ {
+ if (count($this->nodes) === 3) {
+ return (count($this->nodes) === 3);
+ }
+ return false;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitElseIfStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTEvalExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTEvalExpression.php
new file mode 100644
index 0000000..1558e98
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTEvalExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents an eval-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTEvalExpression extends \PDepend\Source\AST\ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitEvalExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTExitExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTExitExpression.php
new file mode 100644
index 0000000..3599367
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTExitExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents an exit-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTExitExpression extends \PDepend\Source\AST\ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitExitExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTExpression.php
new file mode 100644
index 0000000..8f5675f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class encapsultes any expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTExpression extends ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFieldDeclaration.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFieldDeclaration.php
new file mode 100644
index 0000000..cfe8042
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFieldDeclaration.php
@@ -0,0 +1,181 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\AST\State;
+
+/**
+ * This class represents a field or property declaration of a class.
+ *
+ *
+ * // Simple field declaration
+ * class Foo {
+ * protected $foo;
+ * }
+ *
+ * // Field declaration with multiple properties
+ * class Foo {
+ * protected $foo = 23
+ * $bar = 42,
+ * $baz = null;
+ * }
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTFieldDeclaration extends ASTNode
+{
+ /**
+ * This method returns a OR combined integer of the declared modifiers for
+ * this property.
+ *
+ * @return integer
+ */
+ public function getModifiers()
+ {
+ return $this->getMetadataInteger(5);
+ }
+
+ /**
+ * This method sets a OR combined integer of the declared modifiers for this
+ * node.
+ *
+ * This method will throw an exception when the value of given $modifiers
+ * contains an invalid/unexpected modifier
+ *
+ * @param integer $modifiers The declared modifiers for this node.
+ *
+ * @return void
+ * @throws \InvalidArgumentException If the given modifier contains unexpected values.
+ */
+ public function setModifiers($modifiers)
+ {
+ $expected = ~State::IS_PUBLIC
+ & ~State::IS_PROTECTED
+ & ~State::IS_PRIVATE
+ & ~State::IS_STATIC;
+
+ if (($expected & $modifiers) !== 0) {
+ throw new \InvalidArgumentException(
+ 'Invalid field modifiers given, allowed modifiers are ' .
+ 'IS_PUBLIC, IS_PROTECTED, IS_PRIVATE and IS_STATIC.'
+ );
+ }
+
+ $this->setMetadataInteger(5, $modifiers);
+ }
+
+ /**
+ * Returns true if this node is marked as public, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isPublic()
+ {
+ return (($this->getModifiers() & State::IS_PUBLIC) === State::IS_PUBLIC);
+ }
+
+ /**
+ * Returns true if this node is marked as protected, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isProtected()
+ {
+ return (($this->getModifiers() & State::IS_PROTECTED) === State::IS_PROTECTED);
+ }
+
+ /**
+ * Returns true if this node is marked as private, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isPrivate()
+ {
+ return (($this->getModifiers() & State::IS_PRIVATE) === State::IS_PRIVATE);
+ }
+
+ /**
+ * Returns true when this node is declared as static, otherwise
+ * the returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isStatic()
+ {
+ return (($this->getModifiers() & State::IS_STATIC) === State::IS_STATIC);
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitFieldDeclaration($this, $data);
+ }
+
+ /**
+ * Returns the total number of the used property bag.
+ *
+ * @return integer
+ * @since 0.10.4
+ * @see \PDepend\Source\AST\ASTNode#getMetadataSize()
+ */
+ protected function getMetadataSize()
+ {
+ return 6;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFinallyStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFinallyStatement.php
new file mode 100644
index 0000000..fe16b20
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFinallyStatement.php
@@ -0,0 +1,67 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This node class represents a finally-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTFinallyStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitFinallyStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForInit.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForInit.php
new file mode 100644
index 0000000..5ae4319
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForInit.php
@@ -0,0 +1,73 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represent the init part of a for-statement.
+ *
+ *
+ * ------------------------
+ * for ($x = 0, $y = 23, $z = 42; $x < $y; ++$x) {}
+ * ------------------------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTForInit extends ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitForInit($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForStatement.php
new file mode 100644
index 0000000..aec584c
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a for-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTForStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitForStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForUpdate.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForUpdate.php
new file mode 100644
index 0000000..cf84197
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForUpdate.php
@@ -0,0 +1,75 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represent the update part of a for-statement.
+ *
+ *
+ * -------------------------------
+ * for ($x = 0, $y = 23, $z = 42; $x < $y; ++$x, $y = $x + 1, $z = $x + 2) {}
+ * -------------------------------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTForUpdate extends ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitForUpdate($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForeachStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForeachStatement.php
new file mode 100644
index 0000000..7597434
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTForeachStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a foreach-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTForeachStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitForeachStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFormalParameter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFormalParameter.php
new file mode 100644
index 0000000..4cdf43e
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFormalParameter.php
@@ -0,0 +1,107 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This class represents a formal parameter within the signature of a function,
+ * method or closure.
+ *
+ * Formal parameters can include a type hint, a by reference identifier and a
+ * default value. The only mandatory part is the parameter identifier.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTFormalParameter extends ASTNode
+{
+ /**
+ * This method will return true when the parameter is passed by
+ * reference.
+ *
+ * @return boolean
+ */
+ public function isPassedByReference()
+ {
+ return $this->getMetadataBoolean(5);
+ }
+
+ /**
+ * This method can be used to mark this parameter as passed by reference.
+ *
+ * @return void
+ */
+ public function setPassedByReference()
+ {
+ return $this->setMetadataBoolean(5, true);
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitFormalParameter($this, $data);
+ }
+
+ /**
+ * Returns the total number of the used property bag.
+ *
+ * @return integer
+ * @since 0.10.4
+ * @see \PDepend\Source\AST\ASTNode#getMetadataSize()
+ */
+ protected function getMetadataSize()
+ {
+ return 6;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFormalParameters.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFormalParameters.php
new file mode 100644
index 0000000..6acffe4
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFormalParameters.php
@@ -0,0 +1,87 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This ast class represents a list for formal parameters. This means the
+ * parameters of a method, function or closure declaration.
+ *
+ *
+ * // --
+ * function foo() {}
+ * // --
+ *
+ * // --------
+ * $x = function($x, $y) {}
+ * // --------
+ *
+ * class Foo {
+ * // -----------------
+ * public function bar(Foo $obj = null) {}
+ * // -----------------
+ * }
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTFormalParameters extends ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitFormalParameters($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFunction.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFunction.php
new file mode 100644
index 0000000..cb5b781
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFunction.php
@@ -0,0 +1,176 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\Builder\BuilderContext;
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * Represents a php function node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTFunction extends AbstractASTCallable
+{
+ /**
+ * The parent namespace for this function.
+ *
+ * @var \PDepend\Source\AST\ASTNamespace
+ * @since 0.10.0
+ */
+ private $namespace = null;
+
+ /**
+ * The currently used builder context.
+ *
+ * @var \PDepend\Source\Builder\BuilderContext
+ * @since 0.10.0
+ */
+ protected $context = null;
+
+ /**
+ * The name of the parent namespace for this function. We use this property
+ * to restore the parent namespace while we unserialize a cached object tree.
+ *
+ * @var string
+ */
+ protected $namespaceName = null;
+
+ /**
+ * Sets the currently active builder context.
+ *
+ * @param \PDepend\Source\Builder\BuilderContext $context Current builder context.
+ * @return \PDepend\Source\AST\ASTFunction
+ * @since 0.10.0
+ */
+ public function setContext(BuilderContext $context)
+ {
+ $this->context = $context;
+ return $this;
+ }
+
+ /**
+ * Returns the parent namespace for this function.
+ *
+ * @return \PDepend\Source\AST\ASTNamespace
+ */
+ public function getNamespace()
+ {
+ return $this->namespace;
+ }
+
+ /**
+ * Sets the parent namespace for this function.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function setNamespace(ASTNamespace $namespace)
+ {
+ $this->namespaceName = $namespace->getName();
+ $this->namespace = $namespace;
+ }
+
+ /**
+ * Resets the namespace associated with this function node.
+ *
+ * @return void
+ * @since 0.10.2
+ */
+ public function unsetNamespace()
+ {
+ $this->namespaceName = null;
+ $this->namespace = null;
+ }
+
+ /**
+ * Returns the name of the parent namespace/package or NULL when this
+ * function does not belong to a namespace.
+ *
+ * @return string
+ * @since 0.10.0
+ */
+ public function getNamespaceName()
+ {
+ return $this->namespaceName;
+ }
+
+ /**
+ * ASTVisitor method for node tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @return void
+ */
+ public function accept(ASTVisitor $visitor)
+ {
+ $visitor->visitFunction($this);
+ }
+
+ /**
+ * The magic sleep method will be called by the PHP engine when this class
+ * gets serialized. It returns an array with those properties that should be
+ * cached for all function instances.
+ *
+ * @return array(string)
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array_merge(array('context', 'namespaceName'), parent::__sleep());
+ }
+
+ /**
+ * The magic wakeup method will be called by PHP's runtime environment when
+ * a serialized instance of this class was unserialized. This implementation
+ * of the wakeup method will register this object in the the global function
+ * context.
+ *
+ * @return void
+ * @since 0.10.0
+ */
+ public function __wakeup()
+ {
+ $this->context->registerFunction($this);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFunctionPostfix.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFunctionPostfix.php
new file mode 100644
index 0000000..2559204
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTFunctionPostfix.php
@@ -0,0 +1,79 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a function postfix expression.
+ *
+ *
+ * //-------
+ * foo($bar);
+ * //-------
+ *
+ * //--------
+ * $foo($bar);
+ * //--------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTFunctionPostfix extends ASTInvocation
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitFunctionPostfix($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTGlobalStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTGlobalStatement.php
new file mode 100644
index 0000000..71de448
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTGlobalStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a global-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTGlobalStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitGlobalStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTGotoStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTGotoStatement.php
new file mode 100644
index 0000000..c502391
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTGotoStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a goto-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTGotoStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitGotoStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTHeredoc.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTHeredoc.php
new file mode 100644
index 0000000..39d152e
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTHeredoc.php
@@ -0,0 +1,87 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a here-/nowdoc node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTHeredoc extends ASTExpression
+{
+ /**
+ * Delimiter used for this heredoc instance.
+ *
+ * @var string
+ */
+ protected $delimiter = null;
+
+ /**
+ * Sets the delimiter used for this heredoc instance.
+ *
+ * @param string $delimiter The heredoc delimiter.
+ *
+ * @return void
+ */
+ public function setDelimiter($delimiter)
+ {
+ $this->delimiter = $delimiter;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitHeredoc($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIdentifier.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIdentifier.php
new file mode 100644
index 0000000..d765709
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIdentifier.php
@@ -0,0 +1,70 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * A static identifier as it can be used to access a function, method, constant
+ * or property.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTIdentifier extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitIdentifier($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIfStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIfStatement.php
new file mode 100644
index 0000000..b2991a7
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIfStatement.php
@@ -0,0 +1,81 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents an if-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTIfStatement extends ASTStatement
+{
+ /**
+ * Returns true when this if-statement is followed by an
+ * else-statement.
+ *
+ * @return boolean
+ * @since 0.9.12
+ */
+ public function hasElse()
+ {
+ return (count($this->nodes) === 3);
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitIfStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIncludeExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIncludeExpression.php
new file mode 100644
index 0000000..bd12256
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIncludeExpression.php
@@ -0,0 +1,108 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a include- or include_once-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTIncludeExpression extends ASTExpression
+{
+ /**
+ * Does this node represent a include_once-expression?
+ *
+ * @var boolean
+ */
+ protected $once = false;
+
+ /**
+ * Does this node represent a include_once-expression?
+ *
+ * @return boolean
+ */
+ public function isOnce()
+ {
+ return $this->once;
+ }
+
+ /**
+ * Flags this node as a include_once-expression.
+ *
+ * @return void
+ */
+ public function setOnce()
+ {
+ $this->once = true;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitIncludeExpression($this, $data);
+ }
+
+ /**
+ * The magic sleep method will be called by PHP's runtime environment right
+ * before an instance of this class gets serialized. It should return an
+ * array with those property names that should be serialized for this class.
+ *
+ * @return array(string)
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array_merge(array('once'), parent::__sleep());
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIndexExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIndexExpression.php
new file mode 100644
index 0000000..7f5a7a7
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIndexExpression.php
@@ -0,0 +1,56 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This is an abstract base class for index nodes.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+abstract class ASTIndexExpression extends ASTExpression
+{
+
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTInstanceOfExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTInstanceOfExpression.php
new file mode 100644
index 0000000..26ee92f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTInstanceOfExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents an instanceof expression node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTInstanceOfExpression extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitInstanceOfExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTInterface.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTInterface.php
new file mode 100644
index 0000000..d481d47
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTInterface.php
@@ -0,0 +1,145 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * Representation of a code interface.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTInterface extends AbstractASTClassOrInterface
+{
+ /**
+ * The modifiers for this interface instance, by default an interface is
+ * always abstract.
+ *
+ * @var integer
+ */
+ protected $modifiers = State::IS_IMPLICIT_ABSTRACT;
+
+ /**
+ * Returns true if this is an abstract class or an interface.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ return true;
+ }
+
+ /**
+ * Sets a reference onto the parent class of this class node.
+ *
+ * @param \PDepend\Source\AST\ASTClassReference
+ * @return void
+ * @throws \BadMethodCallException
+ * @since 0.9.5
+ */
+ public function setParentClassReference(\PDepend\Source\AST\ASTClassReference $classReference)
+ {
+ throw new \BadMethodCallException(
+ 'Unsupported method ' . __METHOD__ . '() called.'
+ );
+ }
+
+ /**
+ * Checks that this user type is a subtype of the given $type instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ * @return boolean
+ */
+ public function isSubtypeOf(AbstractASTType $type)
+ {
+ if ($type === $this) {
+ return true;
+ } elseif ($type instanceof ASTInterface) {
+ foreach ($this->getInterfaces() as $interface) {
+ if ($interface === $type) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns the declared modifiers for this type.
+ *
+ * @return integer
+ * @since 0.9.4
+ */
+ public function getModifiers()
+ {
+ return $this->modifiers;
+ }
+
+ /**
+ * ASTVisitor method for node tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @return void
+ */
+ public function accept(ASTVisitor $visitor)
+ {
+ $visitor->visitInterface($this);
+ }
+
+ /**
+ * The magic wakeup method will be called by PHP's runtime environment when
+ * a serialized instance of this class was unserialized. This implementation
+ * of the wakeup method will register this object in the the global class
+ * context.
+ *
+ * @return void
+ * @since 0.10.0
+ */
+ public function __wakeup()
+ {
+ parent::__wakeup();
+
+ $this->context->registerInterface($this);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTInvocation.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTInvocation.php
new file mode 100644
index 0000000..738215d
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTInvocation.php
@@ -0,0 +1,60 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+// @codeCoverageIgnoreStart
+
+/**
+ * This is an abstract base class for invocation nodes.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+abstract class ASTInvocation extends ASTExpression
+{
+
+}
+
+// @codeCoverageIgnoreEnd
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIssetExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIssetExpression.php
new file mode 100644
index 0000000..8c154a9
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTIssetExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents an isste-expression/function.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTIssetExpression extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitIssetExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLabelStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLabelStatement.php
new file mode 100644
index 0000000..c10fe09
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLabelStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a label-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTLabelStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitLabelStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTListExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTListExpression.php
new file mode 100644
index 0000000..df7d4a2
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTListExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a list-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTListExpression extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitListExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLiteral.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLiteral.php
new file mode 100644
index 0000000..802c74a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLiteral.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a literal node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTLiteral extends ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitLiteral($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLogicalAndExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLogicalAndExpression.php
new file mode 100644
index 0000000..6f315d4
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLogicalAndExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a logical and-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTLogicalAndExpression extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitLogicalAndExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLogicalOrExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLogicalOrExpression.php
new file mode 100644
index 0000000..408fabf
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLogicalOrExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a logical or-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTLogicalOrExpression extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitLogicalOrExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLogicalXorExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLogicalXorExpression.php
new file mode 100644
index 0000000..ef951df
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTLogicalXorExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a logical xor-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTLogicalXorExpression extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitLogicalXorExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTMemberPrimaryPrefix.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTMemberPrimaryPrefix.php
new file mode 100644
index 0000000..e04d0d8
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTMemberPrimaryPrefix.php
@@ -0,0 +1,99 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * Primary prefix expression as it is used to access class or interface members
+ * like methods, properties and constants.
+ *
+ *
+ * //--------
+ * Foo::bar();
+ * //--------
+ *
+ * //---------
+ * Foo::$bar();
+ * //---------
+ *
+ * //---------
+ * $obj->bar();
+ * //---------
+ *
+ * //----------
+ * $obj->$bar();
+ * //----------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTMemberPrimaryPrefix extends ASTNode
+{
+ /**
+ * Returns true when this member primary prefix represents a static
+ * property or method access.
+ *
+ * @return boolean
+ */
+ public function isStatic()
+ {
+ return ($this->getImage() === '::');
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitMemberPrimaryPrefix($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTMethod.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTMethod.php
new file mode 100644
index 0000000..6fbbb45
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTMethod.php
@@ -0,0 +1,233 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * Represents a php method node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTMethod extends AbstractASTCallable
+{
+ /**
+ * The parent type object.
+ *
+ * @var \PDepend\Source\AST\AbstractASTType
+ */
+ protected $parent = null;
+
+ /**
+ * Defined modifiers for this property node.
+ *
+ * @var integer
+ */
+ protected $modifiers = 0;
+
+ /**
+ * This method returns a OR combined integer of the declared modifiers for
+ * this method.
+ *
+ * @return integer
+ * @since 1.0.0
+ */
+ public function getModifiers()
+ {
+ return $this->modifiers;
+ }
+
+ /**
+ * This method sets a OR combined integer of the declared modifiers for this
+ * node.
+ *
+ * This method will throw an exception when the value of given $modifiers
+ * contains an invalid/unexpected modifier
+ *
+ * @param integer $modifiers
+ * @return void
+ * @throws \InvalidArgumentException If the given modifier contains unexpected values.
+ * @since 0.9.4
+ */
+ public function setModifiers($modifiers)
+ {
+ $expected = ~State::IS_PUBLIC
+ & ~State::IS_PROTECTED
+ & ~State::IS_PRIVATE
+ & ~State::IS_STATIC
+ & ~State::IS_ABSTRACT
+ & ~State::IS_FINAL;
+
+ if (($expected & $modifiers) !== 0) {
+ throw new \InvalidArgumentException('Invalid method modifier given.');
+ }
+
+ $this->modifiers = $modifiers;
+ }
+
+ /**
+ * Returns true if this is an abstract method.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ return (($this->modifiers & State::IS_ABSTRACT) === State::IS_ABSTRACT);
+ }
+
+ /**
+ * Returns true if this node is marked as public, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isPublic()
+ {
+ return (($this->modifiers & State::IS_PUBLIC) === State::IS_PUBLIC);
+ }
+
+ /**
+ * Returns true if this node is marked as protected, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isProtected()
+ {
+ return (($this->modifiers & State::IS_PROTECTED) === State::IS_PROTECTED);
+ }
+
+ /**
+ * Returns true if this node is marked as private, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isPrivate()
+ {
+ return (($this->modifiers & State::IS_PRIVATE) === State::IS_PRIVATE);
+ }
+
+ /**
+ * Returns true when this node is declared as static, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isStatic()
+ {
+ return (($this->modifiers & State::IS_STATIC) === State::IS_STATIC);
+ }
+
+ /**
+ * Returns true when this node is declared as final, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isFinal()
+ {
+ return (($this->modifiers & State::IS_FINAL) === State::IS_FINAL);
+ }
+
+ /**
+ * Returns the parent type object or null
+ *
+ * @return \PDepend\Source\AST\AbstractASTType|null
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Sets the parent type object.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $parent
+ * @return void
+ */
+ public function setParent(AbstractASTType $parent = null)
+ {
+ $this->parent = $parent;
+ }
+
+ /**
+ * Returns the source file where this method was declared.
+ *
+ * @return \PDepend\Source\AST\ASTCompilationUnit
+ * @throws \PDepend\Source\AST\ASTCompilationUnitNotFoundException When no parent was set.
+ * @since 0.10.0
+ */
+ public function getCompilationUnit()
+ {
+ if ($this->parent === null) {
+ throw new ASTCompilationUnitNotFoundException($this);
+ }
+ return $this->parent->getCompilationUnit();
+ }
+
+ /**
+ * ASTVisitor method for node tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @return void
+ */
+ public function accept(ASTVisitor $visitor)
+ {
+ $visitor->visitMethod($this);
+ }
+
+ /**
+ * The magic sleep method will be called by the PHP engine when this class
+ * gets serialized. It returns an array with those properties that should be
+ * cached for method instances.
+ *
+ * @return array(string)
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array_merge(array('modifiers'), parent::__sleep());
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTMethodPostfix.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTMethodPostfix.php
new file mode 100644
index 0000000..4dd2c86
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTMethodPostfix.php
@@ -0,0 +1,79 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a method postfix expression..
+ *
+ *
+ * // ---------
+ * Foo::bar($baz);
+ * // ---------
+ *
+ * // ----------
+ * Foo::$bar($baz);
+ * // ----------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTMethodPostfix extends ASTInvocation
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitMethodPostfix($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTNamespace.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTNamespace.php
new file mode 100644
index 0000000..7585dc5
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTNamespace.php
@@ -0,0 +1,319 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * Represents a php namespace node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTNamespace extends AbstractASTArtifact
+{
+ /**
+ * The namespace name.
+ *
+ * @var string
+ */
+ protected $name = '';
+
+ /**
+ * The unique identifier for this function.
+ *
+ * @var string
+ */
+ protected $id = null;
+
+ /**
+ * List of all {@link \PDepend\Source\AST\AbstractASTClassOrInterface}
+ * objects for this namespace.
+ *
+ * @var \PDepend\Source\AST\AbstractASTClassOrInterface[]
+ */
+ protected $types = array();
+
+ /**
+ * List of all standalone {@link \PDepend\Source\AST\ASTFunction} objects
+ * in this namespace.
+ *
+ * @var \PDepend\Source\AST\ASTFunction[]
+ */
+ protected $functions = array();
+
+ /**
+ * Does this namespace contain user defined functions, classes or interfaces?
+ *
+ * @var boolean
+ */
+ private $userDefined = null;
+
+ /**
+ * Constructs a new namespace for the given $name
+ *
+ * @param string $name
+ */
+ public function __construct($name)
+ {
+ $this->name = $name;
+ $this->id = spl_object_hash($this);
+ }
+
+ /**
+ * Returns the namespace name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns a id for this code node.
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * Returns true when at least one artifact function or a
+ * class/method is user defined. Otherwise this method will return
+ * false.
+ *
+ * @return boolean
+ * @since 0.9.10
+ */
+ public function isUserDefined()
+ {
+ if ($this->userDefined === null) {
+ $this->userDefined = $this->checkUserDefined();
+ }
+ return $this->userDefined;
+ }
+
+ /**
+ * Returns true when at least one artifact function or a
+ * class/method is user defined. Otherwise this method will return
+ * false.
+ *
+ * @return boolean
+ * @since 0.9.10
+ */
+ private function checkUserDefined()
+ {
+ foreach ($this->types as $type) {
+ if ($type->isUserDefined()) {
+ return true;
+ }
+ }
+ return (count($this->functions) > 0);
+ }
+
+ /**
+ * Returns an array with all {@link \PDepend\Source\AST\ASTTrait}
+ * instances declared in this namespace.
+ *
+ * @return array
+ * @since 1.0.0
+ */
+ public function getTraits()
+ {
+ return $this->getTypesOfType('PDepend\\Source\\AST\\ASTTrait');
+ }
+
+ /**
+ * Returns an iterator with all {@link \PDepend\Source\AST\ASTClass}
+ * instances within this namespace.
+ *
+ * @return \PDepend\Source\AST\ASTClass[]
+ */
+ public function getClasses()
+ {
+ return $this->getTypesOfType('PDepend\\Source\\AST\\ASTClass');
+ }
+
+ /**
+ * Returns an iterator with all {@link \PDepend\Source\AST\ASTInterface}
+ * instances within this namespace.
+ *
+ * @return \PDepend\Source\AST\ASTInterface[]
+ */
+ public function getInterfaces()
+ {
+ return $this->getTypesOfType('PDepend\\Source\\AST\\ASTInterface');
+ }
+
+ /**
+ * Returns an iterator with all types of the given $className in this
+ * namespace.
+ *
+ * @param string $className The class/type we are looking for.
+ * @return \PDepend\Source\AST\ASTArtifactList
+ * @since 1.0.0
+ */
+ private function getTypesOfType($className)
+ {
+ $types = array();
+ foreach ($this->types as $type) {
+ if (get_class($type) === $className) {
+ $types[] = $type;
+ }
+ }
+ return new ASTArtifactList($types);
+ }
+
+ /**
+ * Returns all {@link \PDepend\Source\AST\AbstractASTType} objects in
+ * this namespace.
+ *
+ * @return \PDepend\Source\AST\AbstractASTType[]
+ */
+ public function getTypes()
+ {
+ return new ASTArtifactList($this->types);
+ }
+
+ /**
+ * Adds the given type to this namespace and returns the input type instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ * @return \PDepend\Source\AST\AbstractASTType
+ */
+ public function addType(AbstractASTType $type)
+ {
+ // Skip if this namespace already contains this type
+ if (in_array($type, $this->types, true)) {
+ return $type;
+ }
+
+ if ($type->getNamespace() !== null) {
+ $type->getNamespace()->removeType($type);
+ }
+
+ // Set this as class namespace
+ $type->setNamespace($this);
+ // Append class to internal list
+ $this->types[$type->getId()] = $type;
+
+ return $type;
+ }
+
+ /**
+ * Removes the given type instance from this namespace.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ * @return void
+ */
+ public function removeType(AbstractASTType $type)
+ {
+ if (($index = array_search($type, $this->types, true)) !== false) {
+ // Remove class from internal list
+ unset($this->types[$index]);
+ // Remove this as parent
+ $type->unsetNamespace();
+ }
+ }
+
+ /**
+ * Returns all {@link \PDepend\Source\AST\ASTFunction} objects in this
+ * namespace.
+ *
+ * @return \PDepend\Source\AST\ASTFunction[]
+ */
+ public function getFunctions()
+ {
+ return new ASTArtifactList($this->functions);
+ }
+
+ /**
+ * Adds the given function to this namespace and returns the input instance.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return \PDepend\Source\AST\ASTFunction
+ */
+ public function addFunction(ASTFunction $function)
+ {
+ if ($function->getNamespace() !== null) {
+ $function->getNamespace()->removeFunction($function);
+ }
+
+ $function->setNamespace($this);
+ // Append function to internal list
+ $this->functions[$function->getId()] = $function;
+
+ return $function;
+ }
+
+ /**
+ * Removes the given function from this namespace.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function removeFunction(ASTFunction $function)
+ {
+ if (($index = array_search($function, $this->functions, true)) !== false) {
+ // Remove function from internal list
+ unset($this->functions[$index]);
+ // Remove this as parent
+ $function->unsetNamespace();
+ }
+ }
+
+ /**
+ * ASTVisitor method for node tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @return void
+ */
+ public function accept(ASTVisitor $visitor)
+ {
+ $visitor->visitNamespace($this);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTNode.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTNode.php
new file mode 100644
index 0000000..fccba93
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTNode.php
@@ -0,0 +1,540 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This is an abstract base implementation of the ast node interface.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+abstract class ASTNode
+{
+ /**
+ * Parsed child nodes of this node.
+ *
+ * @var \PDepend\Source\AST\ASTNode[]
+ */
+ protected $nodes = array();
+
+ /**
+ * The parent node of this node or null when this node is the root
+ * of a node tree.
+ *
+ * @var \PDepend\Source\AST\ASTNode
+ */
+ protected $parent = null;
+
+ /**
+ * An optional doc comment for this node.
+ *
+ * @var string
+ */
+ protected $comment = null;
+
+ /**
+ * Metadata for this node instance, serialized in a string. This string
+ * contains the start, end line, and the start, end column and the node
+ * image in a colon seperated string.
+ *
+ * @var string
+ * @since 0.10.4
+ */
+ protected $metadata = '::::';
+
+ /**
+ * Constructs a new ast node instance.
+ *
+ * @param string $image The source image for this node.
+ */
+ public function __construct($image = null)
+ {
+ $this->metadata = str_repeat(':', $this->getMetadataSize() - 1);
+
+ $this->setImage($image);
+ }
+
+ /**
+ * Sets the image for this ast node.
+ *
+ * @param string $image The image for this node.
+ *
+ * @return void
+ * @since 0.10.4
+ */
+ public function setImage($image)
+ {
+ $this->setMetadata(4, $image);
+ }
+
+ /**
+ * Returns the source image of this ast node.
+ *
+ * @return string
+ */
+ public function getImage()
+ {
+ return $this->getMetadata(4);
+ }
+
+ /**
+ * Sets the start line for this ast node.
+ *
+ * @param integer $startLine The node start line.
+ *
+ * @return void
+ * @since 0.9.12
+ */
+ public function setStartLine($startLine)
+ {
+ $this->setMetadataInteger(0, $startLine);
+ }
+
+ /**
+ * Returns the start line for this ast node.
+ *
+ * @return integer
+ */
+ public function getStartLine()
+ {
+ return $this->getMetadataInteger(0);
+ }
+
+ /**
+ * Sets the start column for this ast node.
+ *
+ * @param integer $startColumn The node start column.
+ *
+ * @return void
+ * @since 0.9.12
+ */
+ public function setStartColumn($startColumn)
+ {
+ $this->setMetadataInteger(2, $startColumn);
+ }
+
+ /**
+ * Returns the start column for this ast node.
+ *
+ * @return integer
+ */
+ public function getStartColumn()
+ {
+ return $this->getMetadataInteger(2);
+ }
+
+ /**
+ * Sets the node's end line.
+ *
+ * @param integer $endLine The node's end line.
+ *
+ * @return void
+ * @since 0.9.12
+ */
+ public function setEndLine($endLine)
+ {
+ $this->setMetadataInteger(1, $endLine);
+ }
+
+ /**
+ * Returns the end line for this ast node.
+ *
+ * @return integer
+ */
+ public function getEndLine()
+ {
+ return $this->getMetadataInteger(1);
+ }
+
+ /**
+ * Sets the node's end column.
+ *
+ * @param integer $endColumn The node's end column.
+ *
+ * @return void
+ * @since 0.9.12
+ */
+ public function setEndColumn($endColumn)
+ {
+ $this->setMetadataInteger(3, $endColumn);
+ }
+
+ /**
+ * Returns the end column for this ast node.
+ *
+ * @return integer
+ */
+ public function getEndColumn()
+ {
+ return $this->getMetadataInteger(3);
+ }
+
+ /**
+ * For better performance we have moved the single setter methods for the
+ * node columns and lines into this configure method.
+ *
+ * @param integer $startLine The node's start line.
+ * @param integer $endLine The node's end line.
+ * @param integer $startColumn The node's start column.
+ * @param integer $endColumn The node's end column.
+ *
+ * @return void
+ * @since 0.9.10
+ */
+ public function configureLinesAndColumns(
+ $startLine,
+ $endLine,
+ $startColumn,
+ $endColumn
+ ) {
+ $this->setMetadataInteger(0, $startLine);
+ $this->setMetadataInteger(1, $endLine);
+ $this->setMetadataInteger(2, $startColumn);
+ $this->setMetadataInteger(3, $endColumn);
+ }
+
+ /**
+ * Returns an integer value that was stored under the given index.
+ *
+ * @param integer $index The property instance.
+ *
+ * @return integer
+ * @since 0.10.4
+ */
+ protected function getMetadataInteger($index)
+ {
+ return (int) $this->getMetadata($index);
+ }
+
+ /**
+ * Stores an integer value under the given index in the internally used data
+ * string.
+ *
+ * @param integer $index The property instance.
+ * @param integer $value The property value.
+ *
+ * @return void
+ * @since 0.10.4
+ */
+ protected function setMetadataInteger($index, $value)
+ {
+ $this->setMetadata($index, $value);
+ }
+
+ /**
+ * Returns a boolean value that was stored under the given index.
+ *
+ * @param integer $index The property instance.
+ *
+ * @return boolean
+ * @since 0.10.4
+ */
+ protected function getMetadataBoolean($index)
+ {
+ return (bool) $this->getMetadata($index);
+ }
+
+ /**
+ * Stores a boolean value under the given index in the internally used data
+ * string.
+ *
+ * @param integer $index The property instance.
+ * @param boolean $value The property value.
+ *
+ * @return void
+ * @since 0.10.4
+ */
+ protected function setMetadataBoolean($index, $value)
+ {
+ $this->setMetadata($index, $value ? 1 : 0);
+ }
+
+ /**
+ * Returns the value that was stored under the given index.
+ *
+ * @param integer $index The property instance.
+ *
+ * @return mixed
+ * @since 0.10.4
+ */
+ protected function getMetadata($index)
+ {
+ $metadata = explode(':', $this->metadata, $this->getMetadataSize());
+ return $metadata[$index];
+ }
+
+ /**
+ * Stores the given value under the given index in an internal storage
+ * container.
+ *
+ * @param integer $index The property index.
+ * @param mixed $value The property value.
+ *
+ * @return void
+ * @since 0.10.4
+ */
+ protected function setMetadata($index, $value)
+ {
+ $metadata = explode(':', $this->metadata, $this->getMetadataSize());
+ $metadata[$index] = $value;
+
+ $this->metadata = join(':', $metadata);
+ }
+
+ /**
+ * Returns the total number of the used property bag.
+ *
+ * @return integer
+ * @since 0.10.4
+ */
+ protected function getMetadataSize()
+ {
+ return 5;
+ }
+
+ /**
+ * Returns the node instance for the given index or throws an exception.
+ *
+ * @param integer $index Index of the requested node.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \OutOfBoundsException When no node exists at the given index.
+ */
+ public function getChild($index)
+ {
+ if (isset($this->nodes[$index])) {
+ return $this->nodes[$index];
+ }
+ throw new \OutOfBoundsException(
+ sprintf(
+ 'No node found at index %d in node of type: %s',
+ $index,
+ get_class($this)
+ )
+ );
+ }
+
+ /**
+ * This method returns all direct children of the actual node.
+ *
+ * @return \PDepend\Source\AST\ASTNode[]
+ */
+ public function getChildren()
+ {
+ return $this->nodes;
+ }
+
+ /**
+ * This method will search recursive for the first child node that is an
+ * instance of the given $targetType. The returned value will be
+ * null if no child exists for that.
+ *
+ * @param string $targetType Searched class or interface type.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ */
+ public function getFirstChildOfType($targetType)
+ {
+ foreach ($this->nodes as $node) {
+ if ($node instanceof $targetType) {
+ return $node;
+ }
+ if (($child = $node->getFirstChildOfType($targetType)) !== null) {
+ return $child;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * This method will search recursive for all child nodes that are an
+ * instance of the given $targetType. The returned value will be
+ * an empty array if no child exists for that.
+ *
+ * @param string $targetType Searched class or interface type.
+ * @param array &$results Already found node instances. This parameter
+ * is only for internal usage.
+ *
+ * @return \PDepend\Source\AST\ASTNode[]
+ */
+ public function findChildrenOfType($targetType, array &$results = array())
+ {
+ foreach ($this->nodes as $node) {
+ if ($node instanceof $targetType) {
+ $results[] = $node;
+ }
+ $node->findChildrenOfType($targetType, $results);
+ }
+ return $results;
+ }
+
+ /**
+ * This method adds a new child node at the first position of the children.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The new child node.
+ *
+ * @return void
+ * @since 0.10.2
+ */
+ public function prependChild(\PDepend\Source\AST\ASTNode $node)
+ {
+ array_unshift($this->nodes, $node);
+ $node->setParent($this);
+ }
+
+ /**
+ * This method adds a new child node to this node instance.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The new child node.
+ *
+ * @return void
+ */
+ public function addChild(\PDepend\Source\AST\ASTNode $node)
+ {
+ $this->nodes[] = $node;
+ $node->setParent($this);
+ }
+
+ /**
+ * Returns the parent node of this node or null when this node is
+ * the root of a node tree.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Traverses up the node tree and finds all parent nodes that are instances
+ * of $parentType.
+ *
+ * @param string $parentType Class/interface type you are looking for,
+ *
+ * @return \PDepend\Source\AST\ASTNode[]
+ */
+ public function getParentsOfType($parentType)
+ {
+ $parents = array();
+
+ $parentNode = $this->parent;
+ while (is_object($parentNode)) {
+ if ($parentNode instanceof $parentType) {
+ array_unshift($parents, $parentNode);
+ }
+ $parentNode = $parentNode->getParent();
+ }
+ return $parents;
+ }
+
+ /**
+ * Sets the parent node of this node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The parent node of this node.
+ *
+ * @return void
+ */
+ public function setParent(\PDepend\Source\AST\ASTNode $node)
+ {
+ $this->parent = $node;
+ }
+
+ /**
+ * Returns a doc comment for this node or null when no comment was
+ * found.
+ *
+ * @return string
+ */
+ public function getComment()
+ {
+ return $this->comment;
+ }
+
+ /**
+ * Sets the raw doc comment for this node.
+ *
+ * @param string $comment The doc comment block for this node.
+ *
+ * @return void
+ */
+ public function setComment($comment)
+ {
+ $this->comment = $comment;
+ }
+
+ /**
+ * The magic sleep method will be called by PHP's runtime environment right
+ * before an instance of this class gets serialized. It should return an
+ * array with those property names that should be serialized for this class.
+ *
+ * @return array
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array(
+ 'comment',
+ 'metadata',
+ 'nodes'
+ );
+ }
+
+ /**
+ * The magic wakeup method will be called by PHP's runtime environment when
+ * a previously serialized object gets unserialized. This implementation of
+ * the wakeup method restores the dependencies between an ast node and the
+ * node's children.
+ *
+ * @return void
+ * @since 0.10.0
+ */
+ public function __wakeup()
+ {
+ foreach ($this->nodes as $node) {
+ $node->parent = $this;
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTParameter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTParameter.php
new file mode 100644
index 0000000..31c07e8
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTParameter.php
@@ -0,0 +1,395 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * An instance of this class represents a function or method parameter within
+ * the analyzed source code.
+ *
+ *
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTParameter extends AbstractASTArtifact
+{
+ /**
+ * The parent function or method instance.
+ *
+ * @var \PDepend\Source\AST\AbstractASTCallable
+ */
+ private $declaringFunction = null;
+
+ /**
+ * The parameter position.
+ *
+ * @var integer
+ */
+ private $position = 0;
+
+ /**
+ * Is this parameter optional or mandatory?
+ *
+ * @var boolean
+ */
+ private $optional = false;
+
+ /**
+ * The wrapped formal parameter instance.
+ *
+ * @var \PDepend\Source\AST\ASTFormalParameter
+ */
+ private $formalParameter = null;
+
+ /**
+ * The wrapped variable declarator instance.
+ *
+ * @var \PDepend\Source\AST\ASTVariableDeclarator
+ */
+ private $variableDeclarator = null;
+
+ /**
+ * Constructs a new parameter instance for the given AST node.
+ *
+ * @param \PDepend\Source\AST\ASTFormalParameter $formalParameter
+ */
+ public function __construct(\PDepend\Source\AST\ASTFormalParameter $formalParameter)
+ {
+ $this->formalParameter = $formalParameter;
+ $this->variableDeclarator = $formalParameter->getFirstChildOfType(
+ 'PDepend\\Source\\AST\\ASTVariableDeclarator'
+ );
+
+ $this->id = spl_object_hash($this);
+ }
+
+ /**
+ * Returns the item name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->variableDeclarator->getImage();
+ }
+
+ /**
+ * Returns the line number where the item declaration can be found.
+ *
+ * @return integer
+ */
+ public function getStartLine()
+ {
+ return $this->formalParameter->getStartLine();
+ }
+
+ /**
+ * Returns the line number where the item declaration ends.
+ *
+ * @return integer The last source line for this item.
+ */
+ public function getEndLine()
+ {
+ return $this->formalParameter->getEndLine();
+ }
+
+ /**
+ * Returns the parent function or method instance or null
+ *
+ * @return \PDepend\Source\AST\AbstractASTCallable
+ * @since 0.9.5
+ */
+ public function getDeclaringFunction()
+ {
+ return $this->declaringFunction;
+ }
+
+ /**
+ * Sets the parent function or method object.
+ *
+ * @param \PDepend\Source\AST\AbstractASTCallable $function
+ * @return void
+ * @since 0.9.5
+ */
+ public function setDeclaringFunction(AbstractASTCallable $function)
+ {
+ $this->declaringFunction = $function;
+ }
+
+ /**
+ * This method will return the class where the parent method was declared.
+ * The returned value will be null if the parent is a function.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ * @since 0.9.5
+ */
+ public function getDeclaringClass()
+ {
+ // TODO: Review this for refactoring, maybe create a empty getParent()?
+ if ($this->declaringFunction instanceof ASTMethod) {
+ return $this->declaringFunction->getParent();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the parameter position in the method/function signature.
+ *
+ * @return integer
+ */
+ public function getPosition()
+ {
+ return $this->position;
+ }
+
+ /**
+ * Sets the parameter position in the method/function signature.
+ *
+ * @param integer $position The parameter position.
+ *
+ * @return void
+ */
+ public function setPosition($position)
+ {
+ $this->position = $position;
+ }
+
+ /**
+ * Returns the class type of this parameter. This method will return
+ * null for all scalar type, only classes or interfaces are used.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ * @since 0.9.5
+ */
+ public function getClass()
+ {
+ $classReference = $this->formalParameter->getFirstChildOfType(
+ 'PDepend\\Source\\AST\\ASTClassOrInterfaceReference'
+ );
+ if ($classReference === null) {
+ return null;
+ }
+ return $classReference->getType();
+ }
+
+ /**
+ * This method will return true when the parameter is passed by
+ * reference.
+ *
+ * @return boolean
+ * @since 0.9.5
+ */
+ public function isPassedByReference()
+ {
+ return $this->formalParameter->isPassedByReference();
+ }
+
+ /**
+ * This method will return true when the parameter was declared with
+ * the array type hint, otherwise the it will return false.
+ *
+ * @return boolean
+ * @since 0.9.5
+ */
+ public function isArray()
+ {
+ $node = $this->formalParameter->getChild(0);
+ return ($node instanceof \PDepend\Source\AST\ASTTypeArray);
+ }
+
+ /**
+ * This method will return true when current parameter is a simple
+ * scalar or it is an array or type explicit declared with a default
+ * value null.
+ *
+ * @return boolean
+ * @since 0.9.5
+ */
+ public function allowsNull()
+ {
+ return (
+ (
+ $this->isArray() === false
+ && $this->getClass() === null
+ ) || (
+ $this->isDefaultValueAvailable() === true
+ && $this->getDefaultValue() === null
+ )
+ );
+ }
+
+ /**
+ * This method will return true when this parameter is optional and
+ * can be left blank on invocation.
+ *
+ * @return boolean
+ * @since 0.9.5
+ */
+ public function isOptional()
+ {
+ return $this->optional;
+ }
+
+ /**
+ * This method can be used to mark a parameter optional. Note that a
+ * parameter is only optional when it has a default value an no following
+ * parameter has no default value.
+ *
+ * @param boolean $optional Boolean flag that marks this parameter a
+ * optional or not.
+ *
+ * @return void
+ * @since 0.9.5
+ */
+ public function setOptional($optional)
+ {
+ $this->optional = (boolean) $optional;
+ }
+
+ /**
+ * This method will return true when the parameter declaration
+ * contains a default value.
+ *
+ * @return boolean
+ * @since 0.9.5
+ */
+ public function isDefaultValueAvailable()
+ {
+ $value = $this->variableDeclarator->getValue();
+ if ($value === null) {
+ return false;
+ }
+ return $value->isValueAvailable();
+ }
+
+ /**
+ * This method will return the declared default value for this parameter.
+ * Please note that this method will return null when no default
+ * value was declared, therefore you should combine calls to this method and
+ * {@link \PDepend\Source\AST\ASTParameter::isDefaultValueAvailable()} to
+ * detect a NULL-value.
+ *
+ * @return mixed
+ * @since 0.9.5
+ */
+ public function getDefaultValue()
+ {
+ $value = $this->variableDeclarator->getValue();
+ if ($value === null) {
+ return null;
+ }
+ return $value->getValue();
+ }
+
+ /**
+ * ASTVisitor method for node tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @return void
+ */
+ public function accept(ASTVisitor $visitor)
+ {
+ $visitor->visitParameter($this);
+ }
+
+ /**
+ * This method returns a string representation of this parameter.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $required = $this->isOptional() ? 'optional' : 'required';
+ $reference = $this->isPassedByReference() ? '&' : '';
+
+ $typeHint = '';
+ if ($this->isArray() === true) {
+ $typeHint = ' array';
+ } elseif ($this->getClass() !== null) {
+ $typeHint = ' ' . $this->getClass()->getName();
+ }
+
+ $default = '';
+ if ($this->isDefaultValueAvailable()) {
+ $default = ' = ';
+
+ $value = $this->getDefaultValue();
+ if ($value === null) {
+ $default .= 'NULL';
+ $typeHint .= ($typeHint !== '' ? ' or NULL' : '');
+ } elseif ($value === false) {
+ $default .= 'false';
+ } elseif ($value === true) {
+ $default .= 'true';
+ } elseif (is_array($value) === true) {
+ $default .= 'Array';
+ } elseif (is_string($value) === true) {
+ $default .= "'" . $value . "'";
+ } else {
+ $default .= $value;
+ }
+ }
+
+ return sprintf(
+ 'Parameter #%d [ <%s>%s %s%s%s ]',
+ $this->position,
+ $required,
+ $typeHint,
+ $reference,
+ $this->getName(),
+ $default
+ );
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTParentReference.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTParentReference.php
new file mode 100644
index 0000000..900eb1e
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTParentReference.php
@@ -0,0 +1,130 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This is a special reference container that is used whenever the keyword
+ * parent is used to reference a class or interface.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+final class ASTParentReference extends ASTClassOrInterfaceReference
+{
+ /**
+ * The source image of this node.
+ */
+ const IMAGE = 'parent';
+
+ /**
+ * The wrapped reference node.
+ *
+ * @var \PDepend\Source\AST\ASTClassOrInterfaceReference
+ */
+ protected $reference = null;
+
+ /**
+ * Constructs a new type holder instance.
+ *
+ * @param \PDepend\Source\AST\ASTClassOrInterfaceReference $reference The type
+ * instance that reference the concrete target of self.
+ *
+ * @todo Call parent constructor, otherwise this could cause bad side effects.
+ */
+ public function __construct(ASTClassOrInterfaceReference $reference)
+ {
+ $this->reference = $reference;
+ }
+
+ /**
+ * Returns the visual representation for this node type.
+ *
+ * @return string
+ * @since 0.10.4
+ */
+ public function getImage()
+ {
+ return self::IMAGE;
+ }
+
+ /**
+ * Returns the concrete type instance associated with with this placeholder.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ */
+ public function getType()
+ {
+ return $this->reference->getType();
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitParentReference($this, $data);
+ }
+
+ /**
+ * The magic sleep method will be called by PHP's runtime environment right
+ * before an instance of this class gets serialized. It should return an
+ * array with those property names that should be serialized for this class.
+ *
+ * @return array(string)
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array_merge(array('reference'), parent::__sleep());
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPostfixExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPostfixExpression.php
new file mode 100644
index 0000000..8b0edc0
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPostfixExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This node class represents a postfix-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+class ASTPostfixExpression extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitPostfixExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPreDecrementExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPreDecrementExpression.php
new file mode 100644
index 0000000..4690d41
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPreDecrementExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This node class represents a pre-decrement-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+class ASTPreDecrementExpression extends ASTUnaryExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitPreDecrementExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPreIncrementExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPreIncrementExpression.php
new file mode 100644
index 0000000..60021e0
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPreIncrementExpression.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This node class represents a pre-increment-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+class ASTPreIncrementExpression extends ASTUnaryExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitPreIncrementExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPrimitiveType.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPrimitiveType.php
new file mode 100644
index 0000000..6c75c3d
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPrimitiveType.php
@@ -0,0 +1,81 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents primitive types like integer, float, boolean, string
+ * etc.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTPrimitiveType extends ASTType
+{
+ /**
+ * This method will return true when this type is a php primitive.
+ * For this concrete implementation the return value will be always true.
+ *
+ * @return boolean
+ */
+ public function isPrimitive()
+ {
+ return true;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitPrimitiveType($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTProperty.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTProperty.php
new file mode 100644
index 0000000..1030ed0
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTProperty.php
@@ -0,0 +1,369 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This code class represents a class property.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTProperty extends AbstractASTArtifact
+{
+ /**
+ * The parent type object.
+ *
+ * @var ASTClass
+ */
+ private $declaringClass = null;
+
+ /**
+ * The wrapped field declaration instance.
+ *
+ * @var \PDepend\Source\AST\ASTFieldDeclaration
+ * @since 0.9.6
+ */
+ private $fieldDeclaration = null;
+
+ /**
+ * The wrapped variable declarator instance.
+ *
+ * @var \PDepend\Source\AST\ASTVariableDeclarator
+ * @since 0.9.6
+ */
+ private $variableDeclarator = null;
+
+ /**
+ * Constructs a new item for the given field declaration and variable
+ * declarator.
+ *
+ * @param \PDepend\Source\AST\ASTFieldDeclaration $fieldDeclaration The context
+ * field declaration where this property was declared in the source.
+ * @param \PDepend\Source\AST\ASTVariableDeclarator $variableDeclarator The context
+ * variable declarator for this property instance.
+ */
+ public function __construct(
+ \PDepend\Source\AST\ASTFieldDeclaration $fieldDeclaration,
+ \PDepend\Source\AST\ASTVariableDeclarator $variableDeclarator
+ ) {
+ $this->fieldDeclaration = $fieldDeclaration;
+ $this->variableDeclarator = $variableDeclarator;
+
+ $this->id = spl_object_hash($this);
+ }
+
+ /**
+ * Returns the item name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->variableDeclarator->getImage();
+ }
+
+ /**
+ * This method returns a OR combined integer of the declared modifiers for
+ * this property.
+ *
+ * @return integer
+ * @since 0.9.6
+ */
+ public function getModifiers()
+ {
+ return $this->fieldDeclaration->getModifiers();
+ }
+
+ /**
+ * Returns true if this node is marked as public, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isPublic()
+ {
+ return $this->fieldDeclaration->isPublic();
+ }
+
+ /**
+ * Returns true if this node is marked as protected, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isProtected()
+ {
+ return $this->fieldDeclaration->isProtected();
+ }
+
+ /**
+ * Returns true if this node is marked as private, otherwise the
+ * returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isPrivate()
+ {
+ return $this->fieldDeclaration->isPrivate();
+ }
+
+ /**
+ * Returns true when this node is declared as static, otherwise
+ * the returned value will be false.
+ *
+ * @return boolean
+ */
+ public function isStatic()
+ {
+ return $this->fieldDeclaration->isStatic();
+ }
+
+ /**
+ * This method will return true when this property doc comment
+ * contains an array type hint, otherwise the it will return false.
+ *
+ * @return boolean
+ * @since 0.9.6
+ */
+ public function isArray()
+ {
+ $typeNode = $this->fieldDeclaration->getFirstChildOfType(
+ 'PDepend\\Source\\AST\\ASTType'
+ );
+ if ($typeNode === null) {
+ return false;
+ }
+ return $typeNode->isArray();
+ }
+
+ /**
+ * This method will return true when this property doc comment
+ * contains a primitive type hint, otherwise the it will return false.
+ *
+ * @return boolean
+ * @since 0.9.6
+ */
+ public function isPrimitive()
+ {
+ $typeNode = $this->fieldDeclaration->getFirstChildOfType(
+ 'PDepend\\Source\\AST\\ASTType'
+ );
+ if ($typeNode === null) {
+ return false;
+ }
+ return $typeNode->isPrimitive();
+ }
+
+ /**
+ * Returns the type of this property. This method will return null
+ * for all scalar type, only class properties will have a type.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ * @since 0.9.5
+ */
+ public function getClass()
+ {
+ $reference = $this->fieldDeclaration->getFirstChildOfType(
+ 'PDepend\\Source\\AST\\ASTClassOrInterfaceReference'
+ );
+ if ($reference === null) {
+ return null;
+ }
+ return $reference->getType();
+ }
+
+ /**
+ * Returns the doc comment for this item or null.
+ *
+ * @return string
+ */
+ public function getDocComment()
+ {
+ return $this->fieldDeclaration->getComment();
+ }
+
+ /**
+ * Returns the line number where the property declaration can be found.
+ *
+ * @return integer
+ * @since 0.9.6
+ */
+ public function getStartLine()
+ {
+ return $this->variableDeclarator->getStartLine();
+ }
+
+ /**
+ * Returns the column number where the property declaration starts.
+ *
+ * @return integer
+ * @since 0.9.8
+ */
+ public function getStartColumn()
+ {
+ return $this->variableDeclarator->getStartColumn();
+ }
+
+ /**
+ * Returns the line number where the property declaration ends.
+ *
+ * @return integer
+ * @since 0.9.6
+ */
+ public function getEndLine()
+ {
+ return $this->variableDeclarator->getEndLine();
+ }
+
+ /**
+ * Returns the column number where the property declaration ends.
+ *
+ * @return integer
+ * @since 0.9.8
+ */
+ public function getEndColumn()
+ {
+ return $this->variableDeclarator->getEndColumn();
+ }
+
+ /**
+ * This method will return the class where this property was declared.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ * @since 0.9.6
+ */
+ public function getDeclaringClass()
+ {
+ return $this->declaringClass;
+ }
+
+ /**
+ * Sets the declaring class object.
+ *
+ * @param \PDepend\Source\AST\ASTClass $declaringClass
+ * @return void
+ * @since 0.9.6
+ */
+ public function setDeclaringClass(ASTClass $declaringClass)
+ {
+ $this->declaringClass = $declaringClass;
+ }
+
+ /**
+ * This method will return true when the parameter declaration
+ * contains a default value.
+ *
+ * @return boolean
+ * @since 0.9.6
+ */
+ public function isDefaultValueAvailable()
+ {
+ $value = $this->variableDeclarator->getValue();
+ if ($value === null) {
+ return false;
+ }
+ return $value->isValueAvailable();
+ }
+
+ /**
+ * This method will return the default value for this property instance or
+ * null when this property was only declared and not initialized.
+ *
+ * @return mixed
+ * @since 0.9.6
+ */
+ public function getDefaultValue()
+ {
+ $value = $this->variableDeclarator->getValue();
+ if ($value === null) {
+ return null;
+ }
+ return $value->getValue();
+ }
+
+ /**
+ * ASTVisitor method for node tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @return void
+ */
+ public function accept(ASTVisitor $visitor)
+ {
+ $visitor->visitProperty($this);
+ }
+
+ /**
+ * This method returns a string representation of this parameter.
+ *
+ * @return string
+ * @since 0.9.6
+ */
+ public function __toString()
+ {
+ $default = ($this->isDefault() === true ? ' ' : '');
+ $static = '';
+
+ if ($this->isStatic() === true) {
+ $default = '';
+ $static = ' static';
+ }
+
+ $visibility = ' public';
+ if ($this->isProtected() === true) {
+ $visibility = ' protected';
+ } elseif ($this->isPrivate() === true) {
+ $visibility = ' private';
+ }
+
+ return sprintf(
+ 'Property [%s%s%s %s ]%s',
+ $default,
+ $visibility,
+ $static,
+ $this->getName(),
+ PHP_EOL
+ );
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPropertyPostfix.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPropertyPostfix.php
new file mode 100644
index 0000000..eb89dad
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTPropertyPostfix.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a property postfix expression..
+ *
+ *
+ * // ----
+ * Foo::$bar;
+ * // ----
+ *
+ * // -----
+ * Foo::$$bar;
+ * // -----
+ *
+ * // ---
+ * $foo->bar;
+ * // ---
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTPropertyPostfix extends ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitPropertyPostfix($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTRequireExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTRequireExpression.php
new file mode 100644
index 0000000..ac19810
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTRequireExpression.php
@@ -0,0 +1,108 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a require- or require_once-expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTRequireExpression extends ASTExpression
+{
+ /**
+ * Does this node represent a require_once-expression?
+ *
+ * @var boolean
+ */
+ protected $once = false;
+
+ /**
+ * Does this node represent a require_once-expression?
+ *
+ * @return boolean
+ */
+ public function isOnce()
+ {
+ return $this->once;
+ }
+
+ /**
+ * Flags this node as a require_once-expression.
+ *
+ * @return void
+ */
+ public function setOnce()
+ {
+ $this->once = true;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitRequireExpression($this, $data);
+ }
+
+ /**
+ * The magic sleep method will be called by PHP's runtime environment right
+ * before an instance of this class gets serialized. It should return an
+ * array with those property names that should be serialized for this class.
+ *
+ * @return array(string)
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array_merge(array('once'), parent::__sleep());
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTReturnStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTReturnStatement.php
new file mode 100644
index 0000000..7461514
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTReturnStatement.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a return statement node.
+ *
+ *
+ * // -------
+ * return;
+ * // -------
+ *
+ * // ----------
+ * return 42;
+ * // ----------
+ *
+ * // ---------------------------------------------
+ * return $this->createValue($this->getValue());
+ * // ---------------------------------------------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTReturnStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitReturnStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTScope.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTScope.php
new file mode 100644
index 0000000..35c1ada
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTScope.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a method/function scope.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTScope extends ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitScope($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTScopeStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTScopeStatement.php
new file mode 100644
index 0000000..6f52fe1
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTScopeStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a program scope statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTScopeStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitScopeStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTSelfReference.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTSelfReference.php
new file mode 100644
index 0000000..1723979
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTSelfReference.php
@@ -0,0 +1,149 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\AST\AbstractASTClassOrInterface;
+use PDepend\Source\ASTVisitor\ASTVisitor;
+use PDepend\Source\Builder\BuilderContext;
+
+/**
+ * This is a special reference container that is used whenever the keyword
+ * self is used to reference a class or interface.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTSelfReference extends ASTClassOrInterfaceReference
+{
+ /**
+ * The source image of this node.
+ */
+ const IMAGE = 'self';
+
+ /**
+ * The currently used builder context.
+ *
+ * @var \PDepend\Source\Builder\BuilderContext
+ * @since 0.10.0
+ */
+ protected $context = null;
+
+ /**
+ * The full qualified class name, including the namespace or namespace name.
+ *
+ * @var string
+ * @since 0.10.0
+ * @todo To reduce memory usage, move property into new metadata string
+ */
+ protected $qualifiedName = null;
+
+ /**
+ * Constructs a new type holder instance.
+ *
+ * @param \PDepend\Source\Builder\BuilderContext $context
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface
+ */
+ public function __construct(BuilderContext $context, AbstractASTClassOrInterface $target)
+ {
+ $this->context = $context;
+ $this->typeInstance = $target;
+ }
+
+ /**
+ * Returns the visual representation for this node type.
+ *
+ * @return string
+ * @since 0.10.4
+ */
+ public function getImage()
+ {
+ return self::IMAGE;
+ }
+
+ /**
+ * Returns the class or interface instance that this node instance represents.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ * @since 0.10.0
+ */
+ public function getType()
+ {
+ if ($this->typeInstance == null) {
+ $this->typeInstance = $this->context
+ ->getClassOrInterface($this->qualifiedName);
+ }
+ return $this->typeInstance;
+ }
+
+ /**
+ * The magic sleep method will be called by PHP's runtime environment right
+ * before an instance of this class gets serialized. It should return an
+ * array with those property names that should be serialized for this class.
+ *
+ * @return array
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ $this->qualifiedName = $this->getType()->getNamespaceName() . '\\' .
+ $this->getType()->getName();
+
+ return array_merge(array('qualifiedName'), parent::__sleep());
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitSelfReference($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTShiftLeftExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTShiftLeftExpression.php
new file mode 100644
index 0000000..6685928
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTShiftLeftExpression.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class encapsultes a shift left expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.1
+ */
+class ASTShiftLeftExpression extends ASTExpression
+{
+ /**
+ * The default image for this node.
+ */
+ const IMAGE = '<<';
+
+ /**
+ * Returns the source image of this ast node.
+ *
+ * @return string
+ */
+ public function getImage()
+ {
+ return self::IMAGE;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitShiftLeftExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTShiftRightExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTShiftRightExpression.php
new file mode 100644
index 0000000..447407f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTShiftRightExpression.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class encapsultes a shift right expression.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.1
+ */
+class ASTShiftRightExpression extends ASTExpression
+{
+ /**
+ * The default image for this node.
+ */
+ const IMAGE = '>>';
+
+ /**
+ * Returns the source image of this ast node.
+ *
+ * @return string
+ */
+ public function getImage()
+ {
+ return self::IMAGE;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitShiftRightExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStatement.php
new file mode 100644
index 0000000..c870678
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This is node represents a single statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTStatement extends ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStaticReference.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStaticReference.php
new file mode 100644
index 0000000..60fd5b3
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStaticReference.php
@@ -0,0 +1,86 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This is a special reference container that is used whenever the keyword
+ * static is used to reference a class or interface.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTStaticReference extends ASTSelfReference
+{
+ /**
+ * The source image of this node.
+ */
+ const IMAGE = 'static';
+
+ /**
+ * Returns the visual representation for this node type.
+ *
+ * @return string
+ * @since 0.10.4
+ */
+ public function getImage()
+ {
+ return self::IMAGE;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitStaticReference($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStaticVariableDeclaration.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStaticVariableDeclaration.php
new file mode 100644
index 0000000..446d8d7
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStaticVariableDeclaration.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a static variable declaration.
+ *
+ *
+ * function foo()
+ * {
+ * // First declaration
+ * static $foo;
+ * // Second declaration
+ * static $bar = array();
+ * // Third declaration
+ * static $baz = array(),
+ * $foobar = null,
+ * $barbaz;
+ * }
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTStaticVariableDeclaration extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitStaticVariableDeclaration($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTString.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTString.php
new file mode 100644
index 0000000..1a957bb
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTString.php
@@ -0,0 +1,81 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.10
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents PHP strings that can embed various other expressions.
+ *
+ *
+ * $string = "Manuel $Pichler <{$email}>";
+ *
+ * // \PDepend\Source\AST\ASTString
+ * // |-- ASTLiteral - "Manuel ")
+ * // |-- ASTVariable - $Pichler
+ * // |-- ASTLiteral - " <"
+ * // |-- ASTCompoundExpression - {...}
+ * // | |-- ASTVariable - $email
+ * // |-- ASTLiteral - ">"
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.10
+ */
+class ASTString extends ASTNode
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitString($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStringIndexExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStringIndexExpression.php
new file mode 100644
index 0000000..710350b
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTStringIndexExpression.php
@@ -0,0 +1,75 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This node class represents a string index-expression.
+ *
+ *
+ * // ---
+ * $object->foo{2}
+ * // ---
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTStringIndexExpression extends ASTIndexExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitStringIndexExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTSwitchLabel.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTSwitchLabel.php
new file mode 100644
index 0000000..2e70806
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTSwitchLabel.php
@@ -0,0 +1,109 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a switch-label.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTSwitchLabel extends ASTNode
+{
+ /**
+ * Is this switch label the default label?
+ *
+ * @var boolean
+ */
+ protected $default = false;
+
+ /**
+ * Returns true when this node is the default label.
+ *
+ * @return boolean
+ */
+ public function isDefault()
+ {
+ return $this->default;
+ }
+
+ /**
+ * Flags this node instance as the default switch label.
+ *
+ * @return void
+ */
+ public function setDefault()
+ {
+ $this->default = true;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitSwitchLabel($this, $data);
+ }
+
+ /**
+ * The magic sleep method will be called by PHP's runtime environment right
+ * before an instance of this class gets serialized. It should return an
+ * array with those property names that should be serialized for this class.
+ *
+ * @return array(string)
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array_merge(array('default'), parent::__sleep());
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTSwitchStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTSwitchStatement.php
new file mode 100644
index 0000000..2a3a313
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTSwitchStatement.php
@@ -0,0 +1,67 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a switch statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ASTSwitchStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitSwitchStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTThrowStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTThrowStatement.php
new file mode 100644
index 0000000..a9bd9b5
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTThrowStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a throw-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTThrowStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitThrowStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTrait.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTrait.php
new file mode 100644
index 0000000..df311fd
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTrait.php
@@ -0,0 +1,123 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * Representation of a trait.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTTrait extends ASTClass
+{
+ /**
+ * Returns all properties for this class.
+ *
+ * @return \PDepend\Source\AST\ASTProperty[]
+ * @since 1.0.6
+ * @todo Return properties declared by a trait.
+ */
+ public function getProperties()
+ {
+ return array();
+ }
+
+ /**
+ * Returns an array with {@link \PDepend\Source\AST\ASTMethod} objects
+ * that are implemented or imported by this trait.
+ *
+ * @return \PDepend\Source\AST\ASTMethod[]
+ */
+ public function getAllMethods()
+ {
+ $methods = $this->getTraitMethods();
+
+ foreach ($this->getMethods() as $method) {
+ $methods[strtolower($method->getName())] = $method;
+ }
+
+ return $methods;
+ }
+
+ /**
+ * Checks that this user type is a subtype of the given $type instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ * @return boolean
+ * @todo Should we handle trait subtypes?
+ */
+ public function isSubtypeOf(AbstractASTType $type)
+ {
+ return false;
+ }
+
+ /**
+ * ASTVisitor method for node tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @return void
+ */
+ public function accept(ASTVisitor $visitor)
+ {
+ $visitor->visitTrait($this);
+ }
+
+ /**
+ * The magic wakeup method will be called by PHP's runtime environment when
+ * a serialized instance of this class was unserialized. This implementation
+ * of the wakeup method will register this object in the the global class
+ * context.
+ *
+ * @return void
+ */
+ public function __wakeup()
+ {
+ parent::__wakeup();
+
+ $this->context->registerTrait($this);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitAdaptation.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitAdaptation.php
new file mode 100644
index 0000000..6a1026a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitAdaptation.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This node class represents a trait adaptation scope.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTTraitAdaptation extends ASTScope
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitTraitAdaptation($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitAdaptationAlias.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitAdaptationAlias.php
new file mode 100644
index 0000000..b01ffc4
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitAdaptationAlias.php
@@ -0,0 +1,140 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a trait adaptation alias.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTTraitAdaptationAlias extends ASTStatement
+{
+ /**
+ * The new aliased method name.
+ *
+ * @var string
+ */
+ protected $newName;
+
+ /**
+ * The new method modifier for the imported method.
+ *
+ * @var integer
+ */
+ protected $newModifier = -1;
+
+ /**
+ * Sets the new method modifier.
+ *
+ * @param integer $newModifier The new method modifier.
+ *
+ * @return void
+ */
+ public function setNewModifier($newModifier)
+ {
+ $this->newModifier = $newModifier;
+ }
+
+ /**
+ * Returns the new method modifier or -1 when this alias does not
+ * specify a new method modifier.
+ *
+ * @return integer
+ */
+ public function getNewModifier()
+ {
+ return $this->newModifier;
+ }
+
+ /**
+ * Sets the new aliased method name.
+ *
+ * @param string $newName The new aliased method name.
+ *
+ * @return void
+ */
+ public function setNewName($newName)
+ {
+ $this->newName = $newName;
+ }
+
+ /**
+ * Returns the new aliased method name or NULL when this alias does
+ * not specify a new method name.
+ *
+ * @return string
+ */
+ public function getNewName()
+ {
+ return $this->newName;
+ }
+
+ /**
+ * The magic sleep method will be called by PHP's runtime environment right
+ * before an instance of this class gets serialized. It should return an
+ * array with those property names that should be serialized for this class.
+ *
+ * @return array
+ */
+ public function __sleep()
+ {
+ return array_merge(array('newName', 'newModifier'), parent::__sleep());
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitTraitAdaptationAlias($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitAdaptationPrecedence.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitAdaptationPrecedence.php
new file mode 100644
index 0000000..c27bdb1
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitAdaptationPrecedence.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This node class represents a trait adaptation precedence.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTTraitAdaptationPrecedence extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitTraitAdaptationPrecedence($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitMethodCollisionException.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitMethodCollisionException.php
new file mode 100644
index 0000000..d1ffb7b
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitMethodCollisionException.php
@@ -0,0 +1,43 @@
+.
+ * All rights reserved.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This type of exception will be thrown when a trait related method collision
+ * occurred.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTTraitMethodCollisionException extends \RuntimeException
+{
+ /**
+ * Constructs a new exception instance.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ */
+ public function __construct(ASTMethod $method, AbstractASTType $type)
+ {
+ parent::__construct(
+ sprintf(
+ 'Trait method %s has not been applied, because there are ' .
+ 'collisions with other trait methods on %s\%s.',
+ $method->getName(),
+ preg_replace('(\W+)', '\\', $type->getNamespace()->getName()),
+ $type->getName()
+ )
+ );
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitReference.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitReference.php
new file mode 100644
index 0000000..1dcaf16
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitReference.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This is a trait only version of the type reference .
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTTraitReference extends ASTClassOrInterfaceReference
+{
+ /**
+ * Returns the concrete type instance associated with with this placeholder.
+ *
+ * @return \PDepend\Source\AST\AbstractASTType
+ */
+ public function getType()
+ {
+ if ($this->typeInstance === null) {
+ $this->typeInstance = $this->context->getTrait($this->getImage());
+ }
+ return $this->typeInstance;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitTraitReference($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitUseStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitUseStatement.php
new file mode 100644
index 0000000..b94957e
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTraitUseStatement.php
@@ -0,0 +1,212 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\State;
+use PDepend\Source\ASTVisitor\ASTVisitor;
+
+/**
+ * This node class represents a strait use statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTTraitUseStatement extends ASTStatement
+{
+ /**
+ * @var \PDepend\Source\AST\ASTMethod[]
+ */
+ private $allMethods;
+
+ /**
+ * Returns an array with all aliased or directly imported methods.
+ *
+ * @return \PDepend\Source\AST\ASTMethod[]
+ */
+ public function getAllMethods()
+ {
+ if (false === is_array($this->allMethods)) {
+ $this->allMethods = array();
+ foreach ($this->nodes as $node) {
+ if ($node instanceof ASTTraitReference) {
+ $this->collectMethods($node);
+ }
+ }
+ }
+ return $this->allMethods;
+ }
+
+ /**
+ * This method tests if the given {@link \PDepend\Source\AST\ASTMethod} is excluded
+ * by precedence statement in this use statement. It will return true
+ * if the given $method is excluded, otherwise the return value of
+ * this method will be false.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return boolean
+ */
+ public function hasExcludeFor(ASTMethod $method)
+ {
+ $methodName = strtolower($method->getName());
+ $methodParent = $method->getParent();
+
+ $precedences = $this->findChildrenOfType('PDepend\\Source\\AST\\ASTTraitAdaptationPrecedence');
+
+ foreach ($precedences as $precedence) {
+ if (strtolower($precedence->getImage()) !== $methodName) {
+ continue;
+ }
+ $children = $precedence->getChildren();
+ for ($i = 1, $count = count($children); $i < $count; ++$i) {
+ if ($methodParent === $children[$i]->getType()) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Collects all directly defined methods or method aliases for the given
+ * {@link \PDepend\Source\AST\ASTTraitReference}
+ *
+ * @param \PDepend\Source\AST\ASTTraitReference $reference Context trait reference.
+ *
+ * @return void
+ */
+ private function collectMethods(ASTTraitReference $reference)
+ {
+ foreach ($reference->getType()->getAllMethods() as $method) {
+ foreach ($this->getAliasesFor($method) as $alias) {
+ $this->allMethods[] = $alias;
+ }
+ }
+ }
+
+ /**
+ * Returns an array with all aliases for the given method. If no
+ * alias exists for the given method, this method will simply return the
+ * an array with the original method.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return \PDepend\Source\AST\ASTMethod[]
+ */
+ private function getAliasesFor(ASTMethod $method)
+ {
+ $name = strtolower($method->getName());
+
+ $newNames = array();
+ foreach ($this->getAliases() as $alias) {
+ $name2 = strtolower($alias->getImage());
+ if ($name2 !== $name) {
+ continue;
+ }
+
+ $modifier = $method->getModifiers();
+ if (-1 < $alias->getNewModifier()) {
+ $modifier &= ~(
+ State::IS_PUBLIC |
+ State::IS_PROTECTED |
+ State::IS_PRIVATE
+ );
+ $modifier |= $alias->getNewModifier();
+ }
+
+ $newName = $method->getName();
+ if ($alias->getNewName()) {
+ $newName = $alias->getNewName();
+ }
+
+ if (0 === count($alias->getChildren())) {
+ $newMethod = clone $method;
+ $newMethod->setName($newName);
+ $newMethod->setModifiers($modifier);
+
+ $newNames[] = $newMethod;
+ continue;
+ }
+
+ if ($alias->getChild(0)->getType() !== $method->getParent()) {
+ continue;
+ }
+
+ $newMethod = clone $method;
+ $newMethod->setName($newName);
+ $newMethod->setModifiers($modifier);
+
+ $newNames[] = $newMethod;
+ }
+
+ if (count($newNames) > 0) {
+ return $newNames;
+ }
+ return array($method);
+ }
+
+ /**
+ * Returns an array with all alias statements declared in this use
+ * statement.
+ *
+ * @return \PDepend\Source\AST\ASTTraitAdaptationAlias[]
+ */
+ private function getAliases()
+ {
+ return $this->findChildrenOfType('PDepend\\Source\\AST\\ASTTraitAdaptationAlias');
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
+ * @param mixed $data
+ * @return mixed
+ */
+ public function accept(ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitTraitUseStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTryStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTryStatement.php
new file mode 100644
index 0000000..155fea1
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTryStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node class represents a try-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTTryStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitTryStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTType.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTType.php
new file mode 100644
index 0000000..8b43f4a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTType.php
@@ -0,0 +1,90 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * Abstract base class for a type node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTType extends ASTNode
+{
+ /**
+ * This method will return true when the underlying type is an array.
+ *
+ * @return boolean
+ */
+ public function isArray()
+ {
+ return false;
+ }
+
+ /**
+ * This method will return true when the underlying data type is a
+ * php primitive.
+ *
+ * @return boolean
+ */
+ public function isPrimitive()
+ {
+ return false;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitType($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTypeArray.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTypeArray.php
new file mode 100644
index 0000000..04e0f80
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTypeArray.php
@@ -0,0 +1,94 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents an array type node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTTypeArray extends ASTType
+{
+ /**
+ * The visual image for this node type.
+ */
+ const IMAGE = 'array';
+
+ /**
+ * @return string
+ */
+ public function getImage()
+ {
+ return self::IMAGE;
+ }
+
+ /**
+ * This method will return true when the underlying type is an array.
+ * For this concrete type implementation the returned value will be always
+ * true.
+ *
+ * @return boolean
+ */
+ public function isArray()
+ {
+ return true;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitTypeArray($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTypeCallable.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTypeCallable.php
new file mode 100644
index 0000000..80f5a9d
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTTypeCallable.php
@@ -0,0 +1,81 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a callable type node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+class ASTTypeCallable extends ASTType
+{
+ /**
+ * The visual image for this node type.
+ */
+ const IMAGE = 'callable';
+
+ /**
+ * @return string
+ */
+ public function getImage()
+ {
+ return self::IMAGE;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitTypeCallable($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTUnaryExpression.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTUnaryExpression.php
new file mode 100644
index 0000000..44b423a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTUnaryExpression.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.11
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents an unary expression node.
+ *
+ *
+ * // -
+ * -$foo
+ * // -
+ *
+ * // -
+ * +$foo
+ * // -
+ *
+ * // -
+ * &$foo
+ * // -
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.11
+ */
+class ASTUnaryExpression extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitUnaryExpression($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTUnsetStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTUnsetStatement.php
new file mode 100644
index 0000000..df09f0f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTUnsetStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a unset-statement node.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class ASTUnsetStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitUnsetStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTValue.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTValue.php
new file mode 100644
index 0000000..354c91c
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTValue.php
@@ -0,0 +1,107 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.5
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class encapsulates possible default values for functions, methods,
+ * parameters and properties. We use a separate class because otherwise you
+ * cannot differentiate between no default value and a scalar null.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.5
+ */
+class ASTValue
+{
+ /**
+ * Boolean flag that is true when a PHP-value was set.
+ *
+ * @var boolean
+ */
+ private $valueAvailable = false;
+
+ /**
+ * The parsed PHP-value,
+ *
+ * @var mixed
+ */
+ private $value = null;
+
+ /**
+ * This method will return the parsed PHP value.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * This method will set the parsed PHP-value. Please note that this method
+ * acts as a one-way-function, only the first call with set the value all
+ * following calls will be ignored.
+ *
+ * @param mixed $value The parsed PHP-value.
+ *
+ * @return void
+ */
+ public function setValue($value)
+ {
+ if ($this->valueAvailable === false) {
+ $this->value = $value;
+ $this->valueAvailable = true;
+ }
+ }
+
+ /**
+ * This method will return true when the PHP-value is already set.
+ *
+ * @return boolean
+ */
+ public function isValueAvailable()
+ {
+ return $this->valueAvailable;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTVariable.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTVariable.php
new file mode 100644
index 0000000..43c609c
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTVariable.php
@@ -0,0 +1,87 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a variable node.
+ *
+ *
+ * // ----
+ * Foo::$bar();
+ * // ----
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTVariable extends ASTExpression
+{
+ /**
+ * This method will return true when this variable instance represents
+ * the $this scope of a class instance.
+ *
+ * @return boolean
+ * @since 0.10.0
+ */
+ public function isThis()
+ {
+ return ($this->getImage() === '$this');
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitVariable($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTVariableDeclarator.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTVariableDeclarator.php
new file mode 100644
index 0000000..28556d9
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTVariableDeclarator.php
@@ -0,0 +1,114 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This node type represents a variable declarator. A variable declarator always
+ * contains a variable name and it can optionally provide a variable default
+ * value.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTVariableDeclarator extends ASTExpression
+{
+ /**
+ * The initial declaration value for this node or null.
+ *
+ * @var \PDepend\Source\AST\ASTValue
+ */
+ protected $value = null;
+
+ /**
+ * Returns the initial declaration value for this node or null when
+ * no default value exists.
+ *
+ * @return \PDepend\Source\AST\ASTValue
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Sets the declared default value for this variable node.
+ *
+ * @param \PDepend\Source\AST\ASTValue $value
+ *
+ * @return void
+ */
+ public function setValue(ASTValue $value)
+ {
+ $this->value = $value;
+ }
+
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitVariableDeclarator($this, $data);
+ }
+
+ /**
+ * The magic sleep method will be called by PHP's runtime environment right
+ * before an instance of this class gets serialized. It should return an
+ * array with those property names that should be serialized for this class.
+ *
+ * @return array(string)
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array_merge(array('value'), parent::__sleep());
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTVariableVariable.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTVariableVariable.php
new file mode 100644
index 0000000..99f0d71
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTVariableVariable.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a variable variable node.
+ *
+ *
+ * // -
+ * Foo::$$bar();
+ * // -
+ *
+ * // --
+ * Foo::$$$bar();
+ * // --
+ *
+ * // -
+ * Foo::$${BAR}();
+ * // -
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class ASTVariableVariable extends ASTExpression
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitVariableVariable($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTWhileStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTWhileStatement.php
new file mode 100644
index 0000000..48cc22e
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTWhileStatement.php
@@ -0,0 +1,69 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a while-statement.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.8
+ */
+class ASTWhileStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitWhileStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTYieldStatement.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTYieldStatement.php
new file mode 100644
index 0000000..ce7674c
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTYieldStatement.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * This class represents a yield statement node.
+ *
+ *
+ * // -------
+ * yield 24;
+ * // -------
+ *
+ * // ----------
+ * yield $variable;
+ * // ----------
+ *
+ * // ---------------------------------------------
+ * yield $foo => $bar;
+ * // ---------------------------------------------
+ *
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since @TODO
+ */
+class ASTYieldStatement extends ASTStatement
+{
+ /**
+ * Accept method of the visitor design pattern. This method will be called
+ * by a visitor during tree traversal.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor The calling visitor instance.
+ * @param mixed $data
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function accept(\PDepend\Source\ASTVisitor\ASTVisitor $visitor, $data = null)
+ {
+ return $visitor->visitYieldStatement($this, $data);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTArtifact.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTArtifact.php
new file mode 100644
index 0000000..8e16020
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTArtifact.php
@@ -0,0 +1,197 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * Abstract base class for code item.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+abstract class AbstractASTArtifact implements ASTArtifact
+{
+ /**
+ * The name for this item.
+ *
+ * @var string
+ */
+ protected $name = '';
+
+ /**
+ * The unique identifier for this function.
+ *
+ * @var string
+ */
+ protected $id = null;
+
+ /**
+ * The line number where the item declaration starts.
+ *
+ * @var integer
+ */
+ protected $startLine = 0;
+
+ /**
+ * The line number where the item declaration ends.
+ *
+ * @var integer
+ */
+ protected $endLine = 0;
+
+ /**
+ * The source file for this item.
+ *
+ * @var \PDepend\Source\AST\ASTCompilationUnit
+ */
+ protected $compilationUnit = null;
+
+ /**
+ * The comment for this type.
+ *
+ * @var string
+ */
+ protected $docComment = null;
+
+ /**
+ * Constructs a new item for the given $name.
+ *
+ * @param string $name The item name.
+ */
+ public function __construct($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * Returns the item name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets the item name.
+ *
+ * @param string $name The item name.
+ *
+ * @return void
+ * @since 1.0.0
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * Returns a id for this code node.
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ if ($this->id === null) {
+ $this->id = md5(microtime());
+ }
+ return $this->id;
+ }
+
+ /**
+ * Sets the unique identifier for this node instance.
+ *
+ * @param string $id Identifier for this node.
+ * @return void
+ * @since 0.9.12
+ */
+ public function setId($id)
+ {
+ $this->id = $id;
+ }
+
+ /**
+ * Returns the source file for this item.
+ *
+ * @return \PDepend\Source\AST\ASTCompilationUnit
+ */
+ public function getCompilationUnit()
+ {
+ return $this->compilationUnit;
+ }
+
+ /**
+ * Sets the source file for this item.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit
+ * @return void
+ */
+ public function setCompilationUnit(ASTCompilationUnit $compilationUnit)
+ {
+ if ($this->compilationUnit === null || $this->compilationUnit->getName() === null) {
+ $this->compilationUnit = $compilationUnit;
+ }
+ }
+
+ /**
+ * Returns the doc comment for this item or null.
+ *
+ * @return string
+ */
+ public function getDocComment()
+ {
+ return $this->docComment;
+ }
+
+ /**
+ * Sets the doc comment for this item.
+ *
+ * @param string $docComment The doc comment block.
+ *
+ * @return void
+ */
+ public function setDocComment($docComment)
+ {
+ $this->docComment = $docComment;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTCallable.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTCallable.php
new file mode 100644
index 0000000..1fb4fff
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTCallable.php
@@ -0,0 +1,488 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Util\Cache\CacheDriver;
+
+/**
+ * Abstract base class for callable objects.
+ *
+ * Callable objects is a generic parent for methods and functions.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+abstract class AbstractASTCallable extends AbstractASTArtifact
+{
+ /**
+ * The internal used cache instance.
+ *
+ * @var \PDepend\Util\Cache\CacheDriver
+ * @since 0.10.0
+ */
+ protected $cache = null;
+
+ /**
+ * A reference instance for the return value of this callable. By
+ * default and for any scalar type this property is null.
+ *
+ * @var \PDepend\Source\AST\ASTClassOrInterfaceReference
+ * @since 0.9.5
+ */
+ protected $returnClassReference = null;
+
+ /**
+ * List of all exceptions classes referenced by this callable.
+ *
+ * @var \PDepend\Source\AST\ASTClassOrInterfaceReference[]
+ * @since 0.9.5
+ */
+ protected $exceptionClassReferences = array();
+
+ /**
+ * Does this callable return a value by reference?
+ *
+ * @var boolean
+ */
+ protected $returnsReference = false;
+
+ /**
+ * List of all parsed child nodes.
+ *
+ * @var \PDepend\Source\AST\ASTNode[]
+ * @since 0.9.6
+ */
+ protected $nodes = array();
+
+ /**
+ * The start line number of the method or function declaration.
+ *
+ * @var integer
+ * @since 0.9.12
+ */
+ protected $startLine = 0;
+
+ /**
+ * The end line number of the method or function declaration.
+ *
+ * @var integer
+ * @since 0.9.12
+ */
+ protected $endLine = 0;
+
+ /**
+ * List of method/function parameters.
+ *
+ * @var \PDepend\Source\AST\ASTParameter[]
+ */
+ private $parameters = null;
+
+ /**
+ * Setter method for the currently used token cache, where this callable
+ * instance can store the associated tokens.
+ *
+ * @param \PDepend\Util\Cache\CacheDriver $cache
+ * @return \PDepend\Source\AST\AbstractASTCallable
+ * @since 0.10.0
+ */
+ public function setCache(CacheDriver $cache)
+ {
+ $this->cache = $cache;
+ return $this;
+ }
+
+ /**
+ * Adds a parsed child node to this node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node A parsed child node instance.
+ *
+ * @return void
+ * @access private
+ * @since 0.9.6
+ */
+ public function addChild(\PDepend\Source\AST\ASTNode $node)
+ {
+ $this->nodes[] = $node;
+ }
+
+ /**
+ * Returns all child nodes of this method.
+ *
+ * @return \PDepend\Source\AST\ASTNode[]
+ * @since 0.9.8
+ */
+ public function getChildren()
+ {
+ return $this->nodes;
+ }
+
+ /**
+ * This method will search recursive for the first child node that is an
+ * instance of the given $targetType. The returned value will be
+ * null if no child exists for that.
+ *
+ * @param string $targetType Searched class or interface type.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @access private
+ * @since 0.9.6
+ */
+ public function getFirstChildOfType($targetType)
+ {
+ foreach ($this->nodes as $node) {
+ if ($node instanceof $targetType) {
+ return $node;
+ }
+ if (($child = $node->getFirstChildOfType($targetType)) !== null) {
+ return $child;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Will find all children for the given type.
+ *
+ * @param string $targetType The target class or interface type.
+ * @param array &$results The found children.
+ *
+ * @return \PDepend\Source\AST\ASTNode[]
+ * @access private
+ * @since 0.9.6
+ */
+ public function findChildrenOfType($targetType, array &$results = array())
+ {
+ foreach ($this->nodes as $node) {
+ if ($node instanceof $targetType) {
+ $results[] = $node;
+ }
+ $node->findChildrenOfType($targetType, $results);
+ }
+ return $results;
+ }
+
+ /**
+ * Returns the tokens found in the function body.
+ *
+ * @return array(mixed)
+ */
+ public function getTokens()
+ {
+ return (array) $this->cache
+ ->type('tokens')
+ ->restore($this->id);
+ }
+
+ /**
+ * Sets the tokens found in the function body.
+ *
+ * @param \PDepend\Source\Tokenizer\Token[] $tokens The body tokens.
+ *
+ * @return void
+ */
+ public function setTokens(array $tokens)
+ {
+ $this->startLine = reset($tokens)->startLine;
+ $this->endLine = end($tokens)->endLine;
+
+ $this->cache
+ ->type('tokens')
+ ->store($this->id, $tokens);
+ }
+
+ /**
+ * Returns the line number where the callable declaration starts.
+ *
+ * @return integer
+ * @since 0.9.6
+ */
+ public function getStartLine()
+ {
+ return $this->startLine;
+ }
+
+ /**
+ * Returns the line number where the callable declaration ends.
+ *
+ * @return integer
+ * @since 0.9.6
+ */
+ public function getEndLine()
+ {
+ return $this->endLine;
+ }
+
+ /**
+ * Returns all {@link \PDepend\Source\AST\AbstractASTClassOrInterface}
+ * objects this function depends on.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface[]
+ */
+ public function getDependencies()
+ {
+ return new ASTClassOrInterfaceReferenceIterator(
+ $this->findChildrenOfType('PDepend\\Source\\AST\\ASTClassOrInterfaceReference')
+ );
+ }
+
+ /**
+ * This method will return a class or interface instance that represents
+ * the return value of this callable. The returned value will be null
+ * if there is no return value or the return value is scalat.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ * @since 0.9.5
+ */
+ public function getReturnClass()
+ {
+ if ($this->returnClassReference === null) {
+ return null;
+ }
+ return $this->returnClassReference->getType();
+ }
+
+ /**
+ * This method can be used to set a reference instance for the declared
+ * function return type.
+ *
+ * @param \PDepend\Source\AST\ASTClassOrInterfaceReference $classReference Holder
+ * instance for the declared function return type.
+ *
+ * @return void
+ * @since 0.9.5
+ */
+ public function setReturnClassReference(
+ \PDepend\Source\AST\ASTClassOrInterfaceReference $classReference
+ ) {
+ $this->returnClassReference = $classReference;
+ }
+
+ /**
+ * Adds a reference holder for a thrown exception class or interface to
+ * this callable.
+ *
+ * @param \PDepend\Source\AST\ASTClassOrInterfaceReference $classReference A
+ * reference instance for a thrown exception.
+ *
+ * @return void
+ * @since 0.9.5
+ */
+ public function addExceptionClassReference(
+ \PDepend\Source\AST\ASTClassOrInterfaceReference $classReference
+ ) {
+ $this->exceptionClassReferences[] = $classReference;
+ }
+
+ /**
+ * Returns an iterator with thrown exception
+ * {@link \PDepend\Source\AST\AbstractASTClassOrInterface} instances.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface[]
+ */
+ public function getExceptionClasses()
+ {
+ return new ASTClassOrInterfaceReferenceIterator(
+ $this->exceptionClassReferences
+ );
+ }
+
+ /**
+ * Returns an array with all method/function parameters.
+ *
+ * @return \PDepend\Source\AST\ASTParameter[]
+ */
+ public function getParameters()
+ {
+ if ($this->parameters === null) {
+ $this->initParameters();
+ }
+ return $this->parameters;
+ }
+
+ /**
+ * This method will return true when this method returns a value by
+ * reference, otherwise the return value will be false.
+ *
+ * @return boolean
+ * @since 0.9.5
+ */
+ public function returnsReference()
+ {
+ return $this->returnsReference;
+ }
+
+ /**
+ * A call to this method will flag the callable instance with the returns
+ * reference flag, which means that the context function or method returns
+ * a value by reference.
+ *
+ * @return void
+ * @since 0.9.5
+ */
+ public function setReturnsReference()
+ {
+ $this->returnsReference = true;
+ }
+
+ /**
+ * Returns an array with all declared static variables.
+ *
+ * @return array
+ * @since 0.9.6
+ */
+ public function getStaticVariables()
+ {
+ $staticVariables = array();
+
+ $declarations = $this->findChildrenOfType(
+ 'PDepend\\Source\\AST\\ASTStaticVariableDeclaration'
+ );
+ foreach ($declarations as $declaration) {
+ $variables = $declaration->findChildrenOfType(
+ 'PDepend\\Source\\AST\\ASTVariableDeclarator'
+ );
+ foreach ($variables as $variable) {
+ $image = $variable->getImage();
+ $value = $variable->getValue();
+ if ($value !== null) {
+ $value = $value->getValue();
+ }
+
+ $staticVariables[substr($image, 1)] = $value;
+ }
+ }
+ return $staticVariables;
+ }
+
+ /**
+ * This method will return true when this callable instance was
+ * restored from the cache and not currently parsed. Otherwise this method
+ * will return false.
+ *
+ * @return boolean
+ * @since 0.10.0
+ */
+ public function isCached()
+ {
+ return $this->compilationUnit->isCached();
+ }
+
+ /**
+ * This method will initialize the $_parameters property.
+ *
+ * @return void
+ * @since 0.9.6
+ */
+ private function initParameters()
+ {
+ $parameters = array();
+
+ $formalParameters = $this->getFirstChildOfType(
+ 'PDepend\\Source\\AST\\ASTFormalParameters'
+ );
+
+ $formalParameters = $formalParameters->findChildrenOfType(
+ 'PDepend\\Source\\AST\\ASTFormalParameter'
+ );
+
+ foreach ($formalParameters as $formalParameter) {
+ $parameter = new ASTParameter($formalParameter);
+ $parameter->setDeclaringFunction($this);
+ $parameter->setPosition(count($parameters));
+
+ $parameters[] = $parameter;
+ }
+
+ $optional = true;
+ foreach (array_reverse($parameters) as $parameter) {
+ if ($parameter->isDefaultValueAvailable() === false) {
+ $optional = false;
+ }
+ $parameter->setOptional($optional);
+ }
+
+ $this->parameters = $parameters;
+ }
+
+ /**
+ * The magic sleep method will be called by the PHP engine when this class
+ * gets serialized. It returns an array with those properties that should be
+ * cached for all callable instances.
+ *
+ * @return array
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array(
+ 'cache',
+ 'id',
+ 'name',
+ 'nodes',
+ 'startLine',
+ 'endLine',
+ 'docComment',
+ 'returnsReference',
+ 'returnClassReference',
+ 'exceptionClassReferences'
+ );
+ }
+
+ // @codeCoverageIgnoreStart
+
+ /**
+ * This method can be called by the PDepend runtime environment or a
+ * utilizing component to free up memory. This methods are required for
+ * PHP version < 5.3 where cyclic references can not be resolved
+ * automatically by PHP's garbage collector.
+ *
+ * @return void
+ * @since 0.9.12
+ */
+ public function free()
+ {
+ trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
+ }
+
+ // @codeCoverageIgnoreEnd
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTClassOrInterface.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTClassOrInterface.php
new file mode 100644
index 0000000..4d0b37a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTClassOrInterface.php
@@ -0,0 +1,368 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\AST\ASTArtifactList\CollectionArtifactFilter;
+
+/**
+ * Represents an interface or a class type.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+abstract class AbstractASTClassOrInterface extends AbstractASTType
+{
+ /**
+ * The parent for this class node.
+ *
+ * @var \PDepend\Source\AST\ASTClassReference
+ * @since 0.9.5
+ */
+ protected $parentClassReference = null;
+
+ /**
+ * List of all interfaces implemented/extended by the this type.
+ *
+ * @var \PDepend\Source\AST\ASTClassOrInterfaceReference[]
+ */
+ protected $interfaceReferences = array();
+
+ /**
+ * An array with all constants defined in this class or interface.
+ *
+ * @var array(string=>mixed)
+ */
+ protected $constants = null;
+
+ /**
+ * Returns the parent class or null if this class has no parent.
+ *
+ * @return \PDepend\Source\AST\ASTClass
+ * @throws \PDepend\Source\AST\ASTClassOrInterfaceRecursiveInheritanceException
+ */
+ public function getParentClass()
+ {
+ // No parent? Stop here!
+ if ($this->parentClassReference === null) {
+ return null;
+ }
+
+ $parentClass = $this->parentClassReference->getType();
+
+ if ($parentClass === $this) {
+ throw new ASTClassOrInterfaceRecursiveInheritanceException($this);
+ }
+
+ // Check parent against global filter
+ $collection = CollectionArtifactFilter::getInstance();
+ if ($collection->accept($parentClass) === false) {
+ return null;
+ }
+
+ return $parentClass;
+ }
+
+ /**
+ * Returns an array with all parents for the current class.
+ *
+ * The returned array contains class instances for each parent of this class.
+ * They are ordered in the reverse inheritance order. This means that the
+ * direct parent of this class is the first element in the returned array
+ * and parent of this parent the second element and so on.
+ *
+ * @return \PDepend\Source\AST\ASTClass[]
+ * @throws \PDepend\Source\AST\ASTClassOrInterfaceRecursiveInheritanceException
+ * @since 1.0.0
+ */
+ public function getParentClasses()
+ {
+ $parents = array();
+ $parent = $this;
+ while (is_object($parent = $parent->getParentClass())) {
+ if (in_array($parent, $parents, true)) {
+ throw new ASTClassOrInterfaceRecursiveInheritanceException($parent);
+ }
+ $parents[] = $parent;
+ }
+ return $parents;
+ }
+
+ /**
+ * Returns a reference onto the parent class of this class node or null.
+ *
+ * @return \PDepend\Source\AST\ASTClassReference
+ * @since 0.9.5
+ */
+ public function getParentClassReference()
+ {
+ return $this->parentClassReference;
+ }
+
+ /**
+ * Sets a reference onto the parent class of this class node.
+ *
+ * @param \PDepend\Source\AST\ASTClassReference $classReference Reference to the
+ * declared parent class.
+ *
+ * @return void
+ * @since 0.9.5
+ */
+ public function setParentClassReference(ASTClassReference $classReference)
+ {
+ $this->nodes[] = $classReference;
+ $this->parentClassReference = $classReference;
+ }
+
+ /**
+ * Returns a node iterator with all implemented interfaces.
+ *
+ * @return \PDepend\Source\AST\ASTInterface[]
+ * @since 0.9.5
+ */
+ public function getInterfaces()
+ {
+ $stack = $this->getParentClasses();
+ array_unshift($stack, $this);
+
+ $interfaces = array();
+
+ while (($top = array_pop($stack)) !== null) {
+
+ foreach ($top->interfaceReferences as $interfaceReference) {
+ $interface = $interfaceReference->getType();
+ if (in_array($interface, $interfaces, true) === true) {
+ continue;
+ }
+ $interfaces[] = $interface;
+ $stack[] = $interface;
+ }
+ }
+
+ return new ASTArtifactList($interfaces);
+ }
+
+ /**
+ * Returns an array of references onto the interfaces of this class node.
+ *
+ * @return array
+ * @since 0.10.4
+ */
+ public function getInterfaceReferences()
+ {
+ return $this->interfaceReferences;
+ }
+
+ /**
+ * Adds a interface reference node.
+ *
+ * @param \PDepend\Source\AST\ASTClassOrInterfaceReference $interfaceReference
+ * @return void
+ * @since 0.9.5
+ */
+ public function addInterfaceReference(ASTClassOrInterfaceReference $interfaceReference)
+ {
+ $this->nodes[] = $interfaceReference;
+ $this->interfaceReferences[] = $interfaceReference;
+ }
+
+ /**
+ * Returns an array with all constants defined in this class or
+ * interface.
+ *
+ * @return array(string=>mixed)
+ */
+ public function getConstants()
+ {
+ if ($this->constants === null) {
+ $this->initConstants();
+ }
+ return $this->constants;
+ }
+
+ /**
+ * This method returns true when a constant for $name exists,
+ * otherwise it returns false.
+ *
+ * @param string $name Name of the searched constant.
+ *
+ * @return boolean
+ * @since 0.9.6
+ */
+ public function hasConstant($name)
+ {
+ if ($this->constants === null) {
+ $this->initConstants();
+ }
+ return array_key_exists($name, $this->constants);
+ }
+
+ /**
+ * This method will return the value of a constant for $name or it
+ * will return false when no constant for that name exists.
+ *
+ * @param string $name Name of the searched constant.
+ *
+ * @return mixed
+ * @since 0.9.6
+ */
+ public function getConstant($name)
+ {
+ if ($this->hasConstant($name) === true) {
+ return $this->constants[$name];
+ }
+ return false;
+ }
+
+ /**
+ * Returns a list of all methods provided by this type or one of its parents.
+ *
+ * @return \PDepend\Source\AST\ASTMethod[]
+ * @since 0.9.10
+ */
+ public function getAllMethods()
+ {
+ $methods = array();
+ foreach ($this->getInterfaces() as $interface) {
+ foreach ($interface->getAllMethods() as $method) {
+ $methods[strtolower($method->getName())] = $method;
+ }
+ }
+
+ if (is_object($parentClass = $this->getParentClass())) {
+ foreach ($parentClass->getAllMethods() as $methodName => $method) {
+ $methods[$methodName] = $method;
+ }
+ }
+
+ foreach ($this->getTraitMethods() as $method) {
+ $methods[strtolower($method->getName())] = $method;
+ }
+
+ foreach ($this->getMethods() as $method) {
+ $methods[strtolower($method->getName())] = $method;
+ }
+
+ return $methods;
+ }
+
+ /**
+ * Returns all {@link \PDepend\Source\AST\AbstractASTClassOrInterface}
+ * objects this type depends on.
+ *
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface[]
+ */
+ public function getDependencies()
+ {
+ $references = $this->interfaceReferences;
+ if ($this->parentClassReference !== null) {
+ $references[] = $this->parentClassReference;
+ }
+
+ return new ASTClassOrInterfaceReferenceIterator($references);
+ }
+
+ /**
+ * Returns true if this is an abstract class or an interface.
+ *
+ * @return boolean
+ */
+ abstract public function isAbstract();
+
+ /**
+ * Returns the declared modifiers for this type.
+ *
+ * @return integer
+ */
+ abstract public function getModifiers();
+
+ /**
+ * This method initializes the constants defined in this class or interface.
+ *
+ * @return void
+ * @since 0.9.6
+ */
+ private function initConstants()
+ {
+ $this->constants = array();
+ if (($parentClass = $this->getParentClass()) !== null) {
+ $this->constants = $parentClass->getConstants();
+ }
+
+ foreach ($this->getInterfaces() as $interface) {
+ $this->constants = array_merge(
+ $this->constants,
+ $interface->getConstants()
+ );
+ }
+
+ $definitions = $this->findChildrenOfType('PDepend\\Source\\AST\\ASTConstantDefinition');
+
+ foreach ($definitions as $definition) {
+ $declarators = $definition->findChildrenOfType('PDepend\\Source\\AST\\ASTConstantDeclarator');
+
+ foreach ($declarators as $declarator) {
+ $image = $declarator->getImage();
+ $value = $declarator->getValue()->getValue();
+
+ $this->constants[$image] = $value;
+ }
+ }
+ }
+
+ /**
+ * The magic sleep method is called by the PHP runtime environment before an
+ * instance of this class gets serialized. It returns an array with the
+ * names of all those properties that should be cached for this class or
+ * interface instance.
+ *
+ * @return array
+ * @since 0.10.0
+ */
+ public function __sleep()
+ {
+ return array_merge(
+ array('constants', 'interfaceReferences', 'parentClassReference'),
+ parent::__sleep()
+ );
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTType.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTType.php
new file mode 100644
index 0000000..3ac1850
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/AbstractASTType.php
@@ -0,0 +1,504 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+
+namespace PDepend\Source\AST;
+
+use PDepend\Source\Builder\BuilderContext;
+use PDepend\Util\Cache\CacheDriver;
+
+/**
+ * Represents any valid complex php type.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 1.0.0
+ */
+abstract class AbstractASTType extends AbstractASTArtifact
+{
+ /**
+ * The internal used cache instance.
+ *
+ * @var \PDepend\Util\Cache\CacheDriver
+ */
+ protected $cache = null;
+
+ /**
+ * The currently used builder context.
+ *
+ * @var \PDepend\Source\Builder\BuilderContext
+ */
+ protected $context = null;
+
+ /**
+ * The parent namespace for this class.
+ *
+ * @var \PDepend\Source\AST\ASTNamespace
+ */
+ private $namespace = null;
+
+ /**
+ * An array with all constants defined in this class or interface.
+ *
+ * @var array(string=>mixed)
+ */
+ protected $constants = null;
+
+ /**
+ * This property will indicate that the class or interface is user defined.
+ * The parser marks all classes and interfaces as user defined that have a
+ * source file and were part of parsing process.
+ *
+ * @var boolean
+ */
+ protected $userDefined = false;
+
+ /**
+ * List of all parsed child nodes.
+ *
+ * @var \PDepend\Source\AST\ASTNode[]
+ */
+ protected $nodes = array();
+
+ /**
+ * The start line number of the class or interface declaration.
+ *
+ * @var integer
+ */
+ protected $startLine = 0;
+
+ /**
+ * The end line number of the class or interface declaration.
+ *
+ * @var integer
+ */
+ protected $endLine = 0;
+
+ /**
+ * Name of the parent namespace for this class or interface instance. Or
+ * NULL when no namespace was specified.
+ *
+ * @var string
+ */
+ protected $namespaceName = null;
+
+ /**
+ * The modifiers for this class instance.
+ *
+ * @var integer
+ */
+ protected $modifiers = 0;
+
+ /**
+ * Temporary property that only holds methods during the parsing process.
+ *
+ * @var \PDepend\Source\AST\ASTMethod[]
+ * @since 1.0.2
+ */
+ private $methods = array();
+
+
+ /**
+ * Setter method for the currently used token cache, where this class or
+ * interface instance can store the associated tokens.
+ *
+ * @param \PDepend\Util\Cache\CacheDriver $cache
+ * @return \PDepend\Source\AST\AbstractASTType
+ */
+ public function setCache(CacheDriver $cache)
+ {
+ $this->cache = $cache;
+ return $this;
+ }
+
+ /**
+ * Sets the currently active builder context.
+ *
+ * @param \PDepend\Source\Builder\BuilderContext $context
+ * @return \PDepend\Source\AST\AbstractASTType
+ */
+ public function setContext(BuilderContext $context)
+ {
+ $this->context = $context;
+ return $this;
+ }
+
+ /**
+ * Adds a parsed child node to this node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node
+ * @return void
+ * @access private
+ */
+ public function addChild(ASTNode $node)
+ {
+ $this->nodes[] = $node;
+ }
+
+ /**
+ * Returns all child nodes of this class.
+ *
+ * @return \PDepend\Source\AST\ASTNode[]
+ */
+ public function getChildren()
+ {
+ return $this->nodes;
+ }
+
+ /**
+ * This method will search recursive for the first child node that is an
+ * instance of the given $targetType. The returned value will be
+ * null if no child exists for that.
+ *
+ * @param string $targetType Searched class or interface type.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @access private
+ * @todo Refactor $_methods property to getAllMethods() when it exists.
+ */
+ public function getFirstChildOfType($targetType)
+ {
+ foreach ($this->nodes as $node) {
+ if ($node instanceof $targetType) {
+ return $node;
+ }
+ if (($child = $node->getFirstChildOfType($targetType)) !== null) {
+ return $child;
+ }
+ }
+ $methods = $this->getMethods();
+ foreach ($methods as $method) {
+ if (($child = $method->getFirstChildOfType($targetType)) !== null) {
+ return $child;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Will find all children for the given type.
+ *
+ * @param string $targetType The target class or interface type.
+ * @param array &$results The found children.
+ *
+ * @return \PDepend\Source\AST\ASTNode[]
+ * @access private
+ * @todo Refactor $_methods property to getAllMethods() when it exists.
+ */
+ public function findChildrenOfType($targetType, array &$results = array())
+ {
+ foreach ($this->nodes as $node) {
+ if ($node instanceof $targetType) {
+ $results[] = $node;
+ }
+ $node->findChildrenOfType($targetType, $results);
+ }
+
+ foreach ($this->getMethods() as $method) {
+ $method->findChildrenOfType($targetType, $results);
+ }
+
+ return $results;
+ }
+
+ /**
+ * This method will return true when this type has a declaration in
+ * the analyzed source files.
+ *
+ * @return boolean
+ */
+ public function isUserDefined()
+ {
+ return $this->userDefined;
+ }
+
+ /**
+ * This method can be used to mark a type as user defined. User defined
+ * means that the type has a valid declaration in the analyzed source files.
+ *
+ * @return void
+ */
+ public function setUserDefined()
+ {
+ $this->userDefined = true;
+ }
+
+ /**
+ * Returns all {@link \PDepend\Source\AST\ASTMethod} objects in this type.
+ *
+ * @return \PDepend\Source\AST\ASTMethod[]
+ */
+ public function getMethods()
+ {
+ if (is_array($this->methods)) {
+ return new ASTArtifactList($this->methods);
+ }
+
+ $methods = (array) $this->cache
+ ->type('methods')
+ ->restore($this->getId());
+
+ foreach ($methods as $method) {
+ $method->compilationUnit = $this->compilationUnit;
+ $method->setParent($this);
+ }
+
+ return new ASTArtifactList($methods);
+ }
+
+ /**
+ * Adds the given method to this type.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return \PDepend\Source\AST\ASTMethod
+ */
+ public function addMethod(ASTMethod $method)
+ {
+ $method->setParent($this);
+
+ $this->methods[] = $method;
+
+ return $method;
+ }
+
+ /**
+ * Returns an array with {@link \PDepend\Source\AST\ASTMethod} objects
+ * that are imported through traits.
+ *
+ * @return \PDepend\Source\AST\ASTMethod[]
+ * @since 1.0.0
+ */
+ protected function getTraitMethods()
+ {
+ $methods = array();
+
+ $uses = $this->findChildrenOfType(
+ 'PDepend\\Source\\AST\\ASTTraitUseStatement'
+ );
+
+ foreach ($uses as $use) {
+ foreach ($use->getAllMethods() as $method) {
+ foreach ($uses as $use2) {
+ if ($use2->hasExcludeFor($method)) {
+ continue 2;
+ }
+ }
+
+ $name = strtolower($method->getName());
+
+ if (isset($methods[$name])) {
+ throw new ASTTraitMethodCollisionException($method, $this);
+ }
+ $methods[$name] = $method;
+ }
+ }
+ return $methods;
+ }
+
+ /**
+ * Returns an array with all tokens within this type.
+ *
+ * @return \PDepend\Source\Tokenizer\Token[]
+ */
+ public function getTokens()
+ {
+ return (array) $this->cache
+ ->type('tokens')
+ ->restore($this->id);
+ }
+
+ /**
+ * Sets the tokens for this type.
+ *
+ * @param \PDepend\Source\Tokenizer\Token[] $tokens The generated tokens.
+ * @return void
+ */
+ public function setTokens(array $tokens)
+ {
+ $this->startLine = reset($tokens)->startLine;
+ $this->endLine = end($tokens)->endLine;
+
+ $this->cache
+ ->type('tokens')
+ ->store($this->id, $tokens);
+ }
+
+ /**
+ * Returns the line number where the class or interface declaration starts.
+ *
+ * @return integer
+ */
+ public function getStartLine()
+ {
+ return $this->startLine;
+ }
+
+ /**
+ * Returns the line number where the class or interface declaration ends.
+ *
+ * @return integer
+ */
+ public function getEndLine()
+ {
+ return $this->endLine;
+ }
+
+ /**
+ * Returns the name of the parent namespace.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return $this->namespaceName;
+ }
+
+ /**
+ * Returns the parent namespace for this class.
+ *
+ * @return \PDepend\Source\AST\ASTNamespace
+ */
+ public function getNamespace()
+ {
+ return $this->namespace;
+ }
+
+ /**
+ * Sets the parent namespace for this type.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function setNamespace(ASTNamespace $namespace)
+ {
+ $this->namespace = $namespace;
+ $this->namespaceName = $namespace->getName();
+ }
+
+ /**
+ * Resets the associated namespace reference.
+ *
+ * @return void
+ */
+ public function unsetNamespace()
+ {
+ $this->namespace = null;
+ $this->namespaceName = null;
+ }
+
+ /**
+ * This method will return true when this class or interface instance
+ * was restored from the cache and not currently parsed. Otherwise this
+ * method will return false.
+ *
+ * @return boolean
+ */
+ public function isCached()
+ {
+ return $this->compilationUnit->isCached();
+ }
+
+ /**
+ * Returns a list of all methods provided by this type or one of its parents.
+ *
+ * @return \PDepend\Source\AST\ASTMethod[]
+ */
+ abstract public function getAllMethods();
+
+ /**
+ * Checks that this user type is a subtype of the given $type
+ * instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ * @return boolean
+ * @since 1.0.6
+ */
+ abstract public function isSubtypeOf(AbstractASTType $type);
+
+ /**
+ * The magic sleep method is called by the PHP runtime environment before an
+ * instance of this class gets serialized. It returns an array with the
+ * names of all those properties that should be cached for this class or
+ * interface instance.
+ *
+ * @return array
+ */
+ public function __sleep()
+ {
+ if (is_array($this->methods)) {
+ $this->cache
+ ->type('methods')
+ ->store($this->id, $this->methods);
+
+ $this->methods = null;
+ }
+
+ return array(
+ 'cache',
+ 'context',
+ 'docComment',
+ 'endLine',
+ 'modifiers',
+ 'name',
+ 'nodes',
+ 'namespaceName',
+ 'startLine',
+ 'userDefined',
+ 'id'
+ );
+ }
+
+ /**
+ * The magic wakeup method is called by the PHP runtime environment when a
+ * serialized instance of this class gets unserialized and all properties
+ * are restored. This implementation of the __wakeup() method sets
+ * a flag that this object was restored from the cache and it restores the
+ * dependency between this class or interface and it's child methods.
+ *
+ * @return void
+ */
+ public function __wakeup()
+ {
+ $this->methods = null;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/State.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/State.php
new file mode 100644
index 0000000..e02a04d
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/State.php
@@ -0,0 +1,92 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\AST;
+
+/**
+ * Holds constants with internal state constants
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface State
+{
+ /**
+ * Marks a class or interface as implicit abstract.
+ */
+ const IS_IMPLICIT_ABSTRACT = \ReflectionClass::IS_IMPLICIT_ABSTRACT;
+
+ /**
+ * Marks a class or interface as explicit abstract.
+ */
+ const IS_EXPLICIT_ABSTRACT = \ReflectionClass::IS_EXPLICIT_ABSTRACT;
+
+ /**
+ * Marks a node as public.
+ */
+ const IS_PUBLIC = \ReflectionMethod::IS_PUBLIC;
+
+ /**
+ * Marks a node as protected.
+ */
+ const IS_PROTECTED = \ReflectionMethod::IS_PROTECTED;
+
+ /**
+ * Marks a node as private.
+ */
+ const IS_PRIVATE = \ReflectionMethod::IS_PRIVATE;
+
+ /**
+ * Marks a node as abstract.
+ */
+ const IS_ABSTRACT = \ReflectionMethod::IS_ABSTRACT;
+
+ /**
+ * Marks a node as final.
+ */
+ const IS_FINAL = \ReflectionMethod::IS_FINAL;
+
+ /**
+ * Marks a node as static.
+ */
+ const IS_STATIC = \ReflectionMethod::IS_STATIC;
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/ASTVisitListener.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/ASTVisitListener.php
new file mode 100644
index 0000000..dc55c06
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/ASTVisitListener.php
@@ -0,0 +1,208 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\ASTVisitor;
+
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTCompilationUnit;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTNamespace;
+use PDepend\Source\AST\ASTParameter;
+use PDepend\Source\AST\ASTProperty;
+use PDepend\Source\AST\ASTTrait;
+
+/**
+ * Base interface for a visitor listener.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface ASTVisitListener
+{
+ /**
+ * Is called when the visitor starts a new class instance.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class The context class instance.
+ * @return void
+ */
+ public function startVisitClass(ASTClass $class);
+
+ /**
+ * Is called when the visitor ends with a class instance.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class The context class instance.
+ * @return void
+ */
+ public function endVisitClass(ASTClass $class);
+
+ /**
+ * Is called when the visitor starts a new trait instance.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 1.0.0
+ */
+ public function startVisitTrait(ASTTrait $trait);
+
+ /**
+ * Is called when the visitor ends with a trait instance.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 1.0.0
+ */
+ public function endVisitTrait(ASTTrait $trait);
+
+ /**
+ * Is called when the visitor starts a new file instance.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit The context file instance.
+ * @return void
+ */
+ public function startVisitFile(ASTCompilationUnit $compilationUnit);
+
+ /**
+ * Is called when the visitor ends with a file instance.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit The context file instance.
+ * @return void
+ */
+ public function endVisitFile(ASTCompilationUnit $compilationUnit);
+
+ /**
+ * Is called when the visitor starts a new function instance.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function startVisitFunction(ASTFunction $function);
+
+ /**
+ * Is called when the visitor ends with a function instance.
+ *
+ * @param ASTFunction $function
+ * @return void
+ */
+ public function endVisitFunction(ASTFunction $function);
+
+ /**
+ * Is called when the visitor starts a new interface instance.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function startVisitInterface(ASTInterface $interface);
+
+ /**
+ * Is called when the visitor ends with an interface instance.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function endVisitInterface(ASTInterface $interface);
+
+ /**
+ * Is called when the visitor starts a new method instance.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function startVisitMethod(ASTMethod $method);
+
+ /**
+ * Is called when the visitor ends with a method instance.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function endVisitMethod(ASTMethod $method);
+
+ /**
+ * Is called when the visitor starts a new namespace instance.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function startVisitNamespace(ASTNamespace $namespace);
+
+ /**
+ * Is called when the visitor ends with a namespace instance.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function endVisitNamespace(ASTNamespace $namespace);
+
+ /**
+ * Is called when the visitor starts a new parameter instance.
+ *
+ * @param \PDepend\Source\AST\ASTParameter $parameter
+ * @return void
+ */
+ public function startVisitParameter(ASTParameter $parameter);
+
+ /**
+ * Is called when the visitor ends with a parameter instance.
+ *
+ * @param \PDepend\Source\AST\ASTParameter $parameter
+ * @return void
+ */
+ public function endVisitParameter(ASTParameter $parameter);
+
+ /**
+ * Is called when the visitor starts a new property instance.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ public function startVisitProperty(ASTProperty $property);
+
+ /**
+ * Is called when the visitor ends with a property instance.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ public function endVisitProperty(ASTProperty $property);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/ASTVisitor.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/ASTVisitor.php
new file mode 100644
index 0000000..eb62fa1
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/ASTVisitor.php
@@ -0,0 +1,167 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\ASTVisitor;
+
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTCompilationUnit;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTNamespace;
+use PDepend\Source\AST\ASTParameter;
+use PDepend\Source\AST\ASTProperty;
+use PDepend\Source\AST\ASTTrait;
+
+/**
+ * Base interface for visitors that work on the generated node tree.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface ASTVisitor
+{
+ /**
+ * Adds a new listener to this node visitor.
+ * @param \PDepend\Source\ASTVisitor\ASTVisitListener $listener
+ * @return void
+ */
+ public function addVisitListener(ASTVisitListener $listener);
+
+ /**
+ * Visits a class node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class);
+
+ /**
+ * Visits a trait node.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 1.0.0
+ */
+ public function visitTrait(ASTTrait $trait);
+
+ /**
+ * Visits a file node.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit
+ * @return void
+ */
+ public function visitCompilationUnit(ASTCompilationUnit $compilationUnit);
+
+ /**
+ * Visits a function node.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function visitFunction(ASTFunction $function);
+
+ /**
+ * Visits a code interface object.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface);
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method);
+
+ /**
+ * Visits a namespace node.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function visitNamespace(ASTNamespace $namespace);
+
+ /**
+ * Visits a parameter node.
+ *
+ * @param \PDepend\Source\AST\ASTParameter $parameter
+ * @return void
+ */
+ public function visitParameter(ASTParameter $parameter);
+
+ /**
+ * Visits a property node.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ public function visitProperty(ASTProperty $property);
+
+ /**
+ * Magic call method used to provide simplified visitor implementations.
+ * With this method we can call visit${NodeClassName} on each node.
+ *
+ *
+ * $visitor->visitAllocationExpression($alloc);
+ *
+ * $visitor->visitStatement($stmt);
+ *
+ *
+ * All visit methods takes two argument. The first argument is the current
+ * context ast node and the second argument is a data array or object that
+ * is used to collect data.
+ *
+ * The return value of this method is the second input argument, modified
+ * by the concrete visit method.
+ *
+ * @param string $method Name of the called method.
+ * @param array $args Array with method argument.
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function __call($method, $args);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/AbstractASTVisitListener.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/AbstractASTVisitListener.php
new file mode 100644
index 0000000..1d9022f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/AbstractASTVisitListener.php
@@ -0,0 +1,286 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\ASTVisitor;
+
+use PDepend\Source\AST\AbstractASTArtifact;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTCompilationUnit;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTNamespace;
+use PDepend\Source\AST\ASTParameter;
+use PDepend\Source\AST\ASTProperty;
+use PDepend\Source\AST\ASTTrait;
+
+/**
+ * This abstract class provides a default implementation of the node visitor
+ * listener.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+abstract class AbstractASTVisitListener implements ASTVisitListener
+{
+ /**
+ * Is called when the visitor starts a new class instance.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function startVisitClass(ASTClass $class)
+ {
+ $this->startVisitNode($class);
+ }
+
+ /**
+ * Is called when the visitor ends with a class instance.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function endVisitClass(ASTClass $class)
+ {
+ $this->endVisitNode($class);
+ }
+
+ /**
+ * Is called when the visitor starts a new trait instance.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 1.0.0
+ */
+ public function startVisitTrait(ASTTrait $trait)
+ {
+ $this->startVisitNode($trait);
+ }
+
+ /**
+ * Is called when the visitor ends with a trait instance.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 1.0.0
+ */
+ public function endVisitTrait(ASTTrait $trait)
+ {
+ $this->endVisitNode($trait);
+ }
+
+ /**
+ * Is called when the visitor starts a new file instance.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit
+ * @return void
+ */
+ public function startVisitFile(ASTCompilationUnit $compilationUnit)
+ {
+ $this->startVisitNode($compilationUnit);
+ }
+
+ /**
+ * Is called when the visitor ends with a file instance.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit
+ * @return void
+ */
+ public function endVisitFile(ASTCompilationUnit $compilationUnit)
+ {
+ $this->endVisitNode($compilationUnit);
+ }
+
+ /**
+ * Is called when the visitor starts a new function instance.
+ *
+ * @param ASTFunction $function
+ * @return void
+ */
+ public function startVisitFunction(ASTFunction $function)
+ {
+ $this->startVisitNode($function);
+ }
+
+ /**
+ * Is called when the visitor ends with a function instance.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function endVisitFunction(ASTFunction $function)
+ {
+ $this->endVisitNode($function);
+ }
+
+ /**
+ * Is called when the visitor starts a new interface instance.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function startVisitInterface(ASTInterface $interface)
+ {
+ $this->startVisitNode($interface);
+ }
+
+ /**
+ * Is called when the visitor ends with an interface instance.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function endVisitInterface(ASTInterface $interface)
+ {
+ $this->endVisitNode($interface);
+ }
+
+ /**
+ * Is called when the visitor starts a new method instance.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function startVisitMethod(ASTMethod $method)
+ {
+ $this->startVisitNode($method);
+ }
+
+ /**
+ * Is called when the visitor ends with a method instance.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function endVisitMethod(ASTMethod $method)
+ {
+ $this->endVisitNode($method);
+ }
+
+ /**
+ * Is called when the visitor starts a new namespace instance.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function startVisitNamespace(ASTNamespace $namespace)
+ {
+ $this->startVisitNode($namespace);
+ }
+
+ /**
+ * Is called when the visitor ends with a namespace instance.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ public function endVisitNamespace(ASTNamespace $namespace)
+ {
+ $this->endVisitNode($namespace);
+ }
+
+ /**
+ * Is called when the visitor starts a new parameter instance.
+ *
+ * @param \PDepend\Source\AST\ASTParameter $parameter
+ * @return void
+ */
+ public function startVisitParameter(ASTParameter $parameter)
+ {
+ $this->startVisitNode($parameter);
+ }
+
+ /**
+ * Is called when the visitor ends with a parameter instance.
+ *
+ * @param \PDepend\Source\AST\ASTParameter $parameter
+ * @return void
+ */
+ public function endVisitParameter(ASTParameter $parameter)
+ {
+ $this->endVisitNode($parameter);
+ }
+
+ /**
+ * Is called when the visitor starts a new property instance.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ public function startVisitProperty(ASTProperty $property)
+ {
+ $this->startVisitNode($property);
+ }
+
+ /**
+ * Is called when the visitor ends with a property instance.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ public function endVisitProperty(ASTProperty $property)
+ {
+ $this->endVisitNode($property);
+ }
+
+ /**
+ * Generic notification method that is called for every node start.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return void
+ */
+ protected function startVisitNode(AbstractASTArtifact $node)
+ {
+
+ }
+
+ /**
+ * Generic notification method that is called when the node processing ends.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return void
+ */
+ protected function endVisitNode(AbstractASTArtifact $node)
+ {
+
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/AbstractASTVisitor.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/AbstractASTVisitor.php
new file mode 100644
index 0000000..7b30f6a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/ASTVisitor/AbstractASTVisitor.php
@@ -0,0 +1,519 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\ASTVisitor;
+
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTCompilationUnit;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTNamespace;
+use PDepend\Source\AST\ASTParameter;
+use PDepend\Source\AST\ASTProperty;
+use PDepend\Source\AST\ASTTrait;
+
+/**
+ * This abstract visitor implementation provides a default traversal algorithm
+ * that can be used for custom visitors.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+abstract class AbstractASTVisitor implements ASTVisitor
+{
+ /**
+ * List of all registered listeners.
+ *
+ * @var \PDepend\Source\ASTVisitor\ASTVisitListener[]
+ */
+ private $listeners = array();
+
+ /**
+ * Returns an iterator with all registered visit listeners.
+ *
+ * @return Iterator
+ */
+ public function getVisitListeners()
+ {
+ return new \ArrayIterator($this->listeners);
+ }
+
+ /**
+ * Adds a new listener to this node visitor.
+ *
+ * @param \PDepend\Source\ASTVisitor\ASTVisitListener $listener
+ * @return void
+ */
+ public function addVisitListener(ASTVisitListener $listener)
+ {
+ if (in_array($listener, $this->listeners, true) === false) {
+ $this->listeners[] = $listener;
+ }
+ }
+
+ /**
+ * Visits a class node.
+ *
+ * @param ASTClass $class
+ * @return void
+ */
+ public function visitClass(ASTClass $class)
+ {
+ $this->fireStartClass($class);
+
+ $class->getCompilationUnit()->accept($this);
+
+ foreach ($class->getProperties() as $property) {
+ $property->accept($this);
+ }
+ foreach ($class->getMethods() as $method) {
+ $method->accept($this);
+ }
+
+ $this->fireEndClass($class);
+ }
+
+ /**
+ * Visits a trait node.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 1.0.0
+ */
+ public function visitTrait(ASTTrait $trait)
+ {
+ $this->fireStartTrait($trait);
+
+ $trait->getCompilationUnit()->accept($this);
+
+ foreach ($trait->getMethods() as $method) {
+ $method->accept($this);
+ }
+
+ $this->fireEndTrait($trait);
+ }
+
+ /**
+ * Visits a file node.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit
+ * @return void
+ */
+ public function visitCompilationUnit(ASTCompilationUnit $compilationUnit)
+ {
+ $this->fireStartFile($compilationUnit);
+ $this->fireEndFile($compilationUnit);
+ }
+
+ /**
+ * Visits a function node.
+ *
+ * @param ASTFunction $function
+ * @return void
+ */
+ public function visitFunction(ASTFunction $function)
+ {
+ $this->fireStartFunction($function);
+
+ $function->getCompilationUnit()->accept($this);
+
+ foreach ($function->getParameters() as $parameter) {
+ $parameter->accept($this);
+ }
+
+ $this->fireEndFunction($function);
+ }
+
+ /**
+ * Visits a code interface object.
+ *
+ * @param ASTInterface $interface
+ * @return void
+ */
+ public function visitInterface(ASTInterface $interface)
+ {
+ $this->fireStartInterface($interface);
+
+ $interface->getCompilationUnit()->accept($this);
+
+ foreach ($interface->getMethods() as $method) {
+ $method->accept($this);
+ }
+
+ $this->fireEndInterface($interface);
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ public function visitMethod(ASTMethod $method)
+ {
+ $this->fireStartMethod($method);
+
+ foreach ($method->getParameters() as $parameter) {
+ $parameter->accept($this);
+ }
+
+ $this->fireEndMethod($method);
+ }
+
+ /**
+ * Visits a namespace node.
+ *
+ * @param ASTNamespace $namespace
+ * @return void
+ */
+ public function visitNamespace(ASTNamespace $namespace)
+ {
+ $this->fireStartNamespace($namespace);
+
+ foreach ($namespace->getClasses() as $class) {
+ $class->accept($this);
+ }
+ foreach ($namespace->getInterfaces() as $interface) {
+ $interface->accept($this);
+ }
+ foreach ($namespace->getTraits() as $trait) {
+ $trait->accept($this);
+ }
+ foreach ($namespace->getFunctions() as $function) {
+ $function->accept($this);
+ }
+
+ $this->fireEndNamespace($namespace);
+ }
+
+ /**
+ * Visits a parameter node.
+ *
+ * @param \PDepend\Source\AST\ASTParameter $parameter
+ * @return void
+ */
+ public function visitParameter(ASTParameter $parameter)
+ {
+ $this->fireStartParameter($parameter);
+ $this->fireEndParameter($parameter);
+ }
+
+ /**
+ * Visits a property node.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ public function visitProperty(ASTProperty $property)
+ {
+ $this->fireStartProperty($property);
+ $this->fireEndProperty($property);
+ }
+
+
+ /**
+ * Magic call method used to provide simplified visitor implementations.
+ * With this method we can call visit${NodeClassName} on each node.
+ *
+ *
+ * $visitor->visitAllocationExpression($alloc);
+ *
+ * $visitor->visitStatement($stmt);
+ *
+ *
+ * All visit methods takes two argument. The first argument is the current
+ * context ast node and the second argument is a data array or object that
+ * is used to collect data.
+ *
+ * The return value of this method is the second input argument, modified
+ * by the concrete visit method.
+ *
+ * @param string $method Name of the called method.
+ * @param array $args Array with method argument.
+ *
+ * @return mixed
+ * @since 0.9.12
+ */
+ public function __call($method, $args)
+ {
+ $value = $args[1];
+ foreach ($args[0]->getChildren() as $child) {
+ $value = $child->accept($this, $value);
+ }
+ return $value;
+ }
+
+ /**
+ * Sends a start class event.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ protected function fireStartClass(ASTClass $class)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startVisitClass($class);
+ }
+ }
+
+ /**
+ * Sends an end class event.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ protected function fireEndClass(ASTClass $class)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endVisitClass($class);
+ }
+ }
+
+ /**
+ * Sends a start trait event.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ */
+ protected function fireStartTrait(ASTTrait $trait)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startVisitTrait($trait);
+ }
+ }
+
+ /**
+ * Sends an end trait event.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ */
+ protected function fireEndTrait(ASTTrait $trait)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endVisitTrait($trait);
+ }
+ }
+
+ /**
+ * Sends a start file event.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit
+ * @return void
+ */
+ protected function fireStartFile(ASTCompilationUnit $compilationUnit)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startVisitFile($compilationUnit);
+ }
+ }
+
+ /**
+ * Sends an end file event.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit
+ * @return void
+ */
+ protected function fireEndFile(ASTCompilationUnit $compilationUnit)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endVisitFile($compilationUnit);
+ }
+ }
+
+ /**
+ * Sends a start function event.
+ *
+ * @param ASTFunction $function
+ * @return void
+ */
+ protected function fireStartFunction(ASTFunction $function)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startVisitFunction($function);
+ }
+ }
+
+ /**
+ * Sends an end function event.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ protected function fireEndFunction(ASTFunction $function)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endVisitFunction($function);
+ }
+ }
+
+ /**
+ * Sends a start interface event.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ protected function fireStartInterface(ASTInterface $interface)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startVisitInterface($interface);
+ }
+ }
+
+ /**
+ * Sends an end interface event.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ protected function fireEndInterface(ASTInterface $interface)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endVisitInterface($interface);
+ }
+ }
+
+ /**
+ * Sends a start method event.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ protected function fireStartMethod(ASTMethod $method)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startVisitMethod($method);
+ }
+ }
+
+ /**
+ * Sends an end method event.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return void
+ */
+ protected function fireEndMethod(ASTMethod $method)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endVisitMethod($method);
+ }
+ }
+
+ /**
+ * Sends a start namespace event.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ protected function fireStartNamespace(ASTNamespace $namespace)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startVisitNamespace($namespace);
+ }
+ }
+
+ /**
+ * Sends an end namespace event.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace $namespace
+ * @return void
+ */
+ protected function fireEndNamespace(ASTNamespace $namespace)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endVisitNamespace($namespace);
+ }
+ }
+
+ /**
+ * Sends a start parameter event.
+ *
+ * @param \PDepend\Source\AST\ASTParameter $parameter
+ * @return void
+ */
+ protected function fireStartParameter(ASTParameter $parameter)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startVisitParameter($parameter);
+ }
+ }
+
+ /**
+ * Sends a end parameter event.
+ *
+ * @param \PDepend\Source\AST\ASTParameter $parameter
+ * @return void
+ */
+ protected function fireEndParameter(ASTParameter $parameter)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endVisitParameter($parameter);
+ }
+ }
+
+ /**
+ * Sends a start property event.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ protected function fireStartProperty(ASTProperty $property)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->startVisitProperty($property);
+ }
+ }
+
+ /**
+ * Sends an end property event.
+ *
+ * @param \PDepend\Source\AST\ASTProperty $property
+ * @return void
+ */
+ protected function fireEndProperty(ASTProperty $property)
+ {
+ foreach ($this->listeners as $listener) {
+ $listener->endVisitProperty($property);
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Builder/Builder.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Builder/Builder.php
new file mode 100644
index 0000000..8c49022
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Builder/Builder.php
@@ -0,0 +1,1227 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Builder;
+
+use PDepend\Source\AST\AbstractASTClassOrInterface;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTTrait;
+use PDepend\Util\Cache\CacheDriver;
+
+/**
+ * Base interface for all code node builders.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface Builder extends \IteratorAggregate
+{
+ /**
+ * The default package name.
+ */
+ const DEFAULT_NAMESPACE = '+global';
+
+ /**
+ * Setter method for the currently used token cache.
+ *
+ * @param \PDepend\Util\Cache\CacheDriver $cache
+ * @return \PDepend\Source\Builder\Builder
+ * @since 0.10.0
+ */
+ public function setCache(CacheDriver $cache);
+
+ /**
+ * Restores a function within the internal type scope.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ * @since 0.10.0
+ */
+ public function restoreFunction(ASTFunction $function);
+
+ /**
+ * This method will try to find an already existing instance for the given
+ * qualified name. It will create a new {@link \PDepend\Source\AST\ASTClass}
+ * instance when no matching type exists.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ * @since 0.9.5
+ */
+ public function getClassOrInterface($qualifiedName);
+
+ /**
+ * Builds a new code type reference instance.
+ *
+ * @param string $qualifiedName The qualified name of the referenced type.
+ *
+ * @return \PDepend\Source\AST\ASTClassOrInterfaceReference
+ * @since 0.9.5
+ */
+ public function buildAstClassOrInterfaceReference($qualifiedName);
+
+ /**
+ * Builds a new php trait instance.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTTrait
+ * @since 1.0.0
+ */
+ public function buildTrait($qualifiedName);
+
+ /**
+ * Restores an existing trait instance within the context of this builder.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 1.0.0
+ */
+ public function restoreTrait(ASTTrait $trait);
+
+ /**
+ * This method will try to find an already existing instance for the given
+ * qualified name. It will create a new {@link \PDepend\Source\AST\ASTTrait}
+ * instance when no matching type exists.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTTrait
+ * @since 1.0.0
+ */
+ public function getTrait($qualifiedName);
+
+ /**
+ * Builds a new code class instance.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTClass
+ */
+ public function buildClass($qualifiedName);
+
+ /**
+ * This method will try to find an already existing instance for the given
+ * qualified name. It will create a new {@link \PDepend\Source\AST\ASTClass}
+ * instance when no matching type exists.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTClass
+ * @since 0.9.5
+ */
+ public function getClass($qualifiedName);
+
+ /**
+ * Restores an existing class instance within the context of this builder.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ * @since 0.10.0
+ */
+ public function restoreClass(ASTClass $class);
+
+ /**
+ * Builds a new code type reference instance.
+ *
+ * @param string $qualifiedName The qualified name of the referenced type.
+ * @return \PDepend\Source\AST\ASTClassReference
+ * @since 0.9.5
+ */
+ public function buildAstClassReference($qualifiedName);
+
+ /**
+ * Builds a new new interface instance.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTInterface
+ */
+ public function buildInterface($qualifiedName);
+
+ /**
+ * Restores an existing interface instance within the context of this builder.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ * @since 0.10.0
+ */
+ public function restoreInterface(ASTInterface $interface);
+
+ /**
+ * This method will try to find an already existing instance for the given
+ * qualified name. It will create a new {@link \PDepend\Source\AST\ASTInterface}
+ * instance when no matching type exists.
+ *
+ * @param string $qualifiedName The full qualified type identifier.
+ * @return \PDepend\Source\AST\ASTInterface
+ * @since 0.9.5
+ */
+ public function getInterface($qualifiedName);
+
+ /**
+ * Builds a new namespace instance.
+ *
+ * @param string $name
+ * @return \PDepend\Source\AST\ASTNamespace
+ */
+ public function buildNamespace($name);
+
+ /**
+ * Builds a new method instance.
+ *
+ * @param string $name
+ * @return \PDepend\Source\AST\ASTMethod
+ */
+ public function buildMethod($name);
+
+ /**
+ * Builds a new function instance.
+ *
+ * @param string $name
+ * @return \PDepend\Source\AST\ASTFunction
+ */
+ public function buildFunction($name);
+
+ /**
+ * Builds a new self reference instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $type
+ * @return \PDepend\Source\AST\ASTSelfReference
+ * @since 0.9.6
+ */
+ public function buildAstSelfReference(AbstractASTClassOrInterface $type);
+
+ /**
+ * Builds a new parent reference instance.
+ *
+ * @param \PDepend\Source\AST\ASTClassOrInterfaceReference $reference The type
+ * instance that reference the concrete target of parent.
+ *
+ * @return \PDepend\Source\AST\ASTParentReference
+ * @since 0.9.6
+ */
+ public function buildAstParentReference(
+ \PDepend\Source\AST\ASTClassOrInterfaceReference $reference
+ );
+
+ /**
+ * Builds a new static reference instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $owner
+ * @return \PDepend\Source\AST\ASTStaticReference
+ * @since 0.9.6
+ */
+ public function buildAstStaticReference(AbstractASTClassOrInterface $owner);
+
+ /**
+ * Builds a new field declaration node.
+ *
+ * @return \PDepend\Source\AST\ASTFieldDeclaration
+ * @since 0.9.6
+ */
+ public function buildAstFieldDeclaration();
+
+ /**
+ * Builds a new variable declarator node.
+ *
+ * @param string $image The source image for the variable declarator.
+ *
+ * @return \PDepend\Source\AST\ASTVariableDeclarator
+ * @since 0.9.6
+ */
+ public function buildAstVariableDeclarator($image);
+
+ /**
+ * Builds a new constant node.
+ *
+ * @param string $image The source image for the constant.
+ *
+ * @return \PDepend\Source\AST\ASTConstant
+ * @since 0.9.6
+ */
+ public function buildAstConstant($image);
+
+ /**
+ * Builds a new variable node.
+ *
+ * @param string $image The source image for the variable.
+ *
+ * @return \PDepend\Source\AST\ASTVariable
+ * @since 0.9.6
+ */
+ public function buildAstVariable($image);
+
+ /**
+ * Builds a new variable variable node.
+ *
+ * @param string $image The source image for the variable variable.
+ *
+ * @return \PDepend\Source\AST\ASTVariableVariable
+ * @since 0.9.6
+ */
+ public function buildAstVariableVariable($image);
+
+ /**
+ * Builds a new compound variable node.
+ *
+ * @param string $image The source image for the compound variable.
+ *
+ * @return \PDepend\Source\AST\ASTCompoundVariable
+ * @since 0.9.6
+ */
+ public function buildAstCompoundVariable($image);
+
+ /**
+ * Builds a new compound expression node.
+ *
+ * @return \PDepend\Source\AST\ASTCompoundExpression
+ * @since 0.9.6
+ */
+ public function buildAstCompoundExpression();
+
+ /**
+ * Builds a new static variable declaration node.
+ *
+ * @param string $image The source image for the static declaration.
+ *
+ * @return \PDepend\Source\AST\ASTStaticVariableDeclaration
+ * @since 0.9.6
+ */
+ public function buildAstStaticVariableDeclaration($image);
+
+ /**
+ * Builds a new closure node.
+ *
+ * @return \PDepend\Source\AST\ASTClosure
+ * @since 0.9.12
+ */
+ public function buildAstClosure();
+
+ /**
+ * Builds a new formal parameters node.
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameters
+ * @since 0.9.6
+ */
+ public function buildAstFormalParameters();
+
+ /**
+ * Builds a new formal parameter node.
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameter
+ * @since 0.9.6
+ */
+ public function buildAstFormalParameter();
+
+ /**
+ * Builds a new expression node.
+ *
+ * @return \PDepend\Source\AST\ASTExpression
+ * @since 0.9.8
+ */
+ public function buildAstExpression();
+
+ /**
+ * Builds a new assignment expression node.
+ *
+ * @param string $image The assignment operator.
+ *
+ * @return \PDepend\Source\AST\ASTAssignmentExpression
+ * @since 0.9.8
+ */
+ public function buildAstAssignmentExpression($image);
+
+ /**
+ * Builds a new allocation expression node.
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTAllocationExpression
+ * @since 0.9.6
+ */
+ public function buildAstAllocationExpression($image);
+
+ /**
+ * Builds a new eval-expression node.
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTEvalExpression
+ * @since 0.9.12
+ */
+ public function buildAstEvalExpression($image);
+
+ /**
+ * Builds a new exit-expression instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTExitExpression
+ * @since 0.9.12
+ */
+ public function buildAstExitExpression($image);
+
+ /**
+ * Builds a new clone-expression node.
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTCloneExpression
+ * @since 0.9.12
+ */
+ public function buildAstCloneExpression($image);
+
+ /**
+ * Builds a new list-expression node.
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTListExpression
+ * @since 0.9.12
+ */
+ public function buildAstListExpression($image);
+
+ /**
+ * Builds a new include- or include_once-expression.
+ *
+ * @return \PDepend\Source\AST\ASTIncludeExpression
+ * @since 0.9.12
+ */
+ public function buildAstIncludeExpression();
+
+ /**
+ * Builds a new require- or require_once-expression.
+ *
+ * @return \PDepend\Source\AST\ASTRequireExpression
+ * @since 0.9.12
+ */
+ public function buildAstRequireExpression();
+
+ /**
+ * Builds a new array-expression node.
+ *
+ * @return \PDepend\Source\AST\ASTArrayIndexExpression
+ * @since 0.9.12
+ */
+ public function buildAstArrayIndexExpression();
+
+ /**
+ * Builds a new string-expression node.
+ *
+ *
+ * // --------
+ * $string{$index}
+ * // --------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTStringIndexExpression
+ * @since 0.9.12
+ */
+ public function buildAstStringIndexExpression();
+
+ /**
+ * Builds a new instanceof-expression node.
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTInstanceOfExpression
+ * @since 0.9.6
+ */
+ public function buildAstInstanceOfExpression($image);
+
+ /**
+ * Builds a new isset-expression node.
+ *
+ *
+ * // -----------
+ * if (isset($foo)) {
+ * // -----------
+ * }
+ *
+ * // -----------------------
+ * if (isset($foo, $bar, $baz)) {
+ * // -----------------------
+ * }
+ *
+ *
+ * @return \PDepend\Source\AST\ASTIssetExpression
+ * @since 0.9.12
+ */
+ public function buildAstIssetExpression();
+
+ /**
+ * Builds a new boolean conditional-expression.
+ *
+ *
+ * --------------
+ * $bar = ($foo ? 42 : 23);
+ * --------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTConditionalExpression
+ * @since 0.9.8
+ */
+ public function buildAstConditionalExpression();
+
+ /**
+ * Build a new shift left expression.
+ *
+ * @return \PDepend\Source\AST\ASTShiftLeftExpression
+ * @since 1.0.1
+ */
+ public function buildAstShiftLeftExpression();
+
+ /**
+ * Build a new shift right expression.
+ *
+ * @return \PDepend\Source\AST\ASTShiftRightExpression
+ * @since 1.0.1
+ */
+ public function buildAstShiftRightExpression();
+
+ /**
+ * Builds a new boolean and-expression.
+ *
+ * @return \PDepend\Source\AST\ASTBooleanAndExpression
+ * @since 0.9.8
+ */
+ public function buildAstBooleanAndExpression();
+
+ /**
+ * Builds a new boolean or-expression.
+ *
+ * @return \PDepend\Source\AST\ASTBooleanOrExpression
+ * @since 0.9.8
+ */
+ public function buildAstBooleanOrExpression();
+
+ /**
+ * Builds a new logical and-expression.
+ *
+ * @return \PDepend\Source\AST\ASTLogicalAndExpression
+ * @since 0.9.8
+ */
+ public function buildAstLogicalAndExpression();
+
+ /**
+ * Builds a new logical or-expression.
+ *
+ * @return \PDepend\Source\AST\ASTLogicalOrExpression
+ * @since 0.9.8
+ */
+ public function buildAstLogicalOrExpression();
+
+ /**
+ * Builds a new logical xor-expression.
+ *
+ * @return \PDepend\Source\AST\ASTLogicalXorExpression
+ * @since 0.9.8
+ */
+ public function buildAstLogicalXorExpression();
+
+ /**
+ * Builds a new trait use-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTTraitUseStatement
+ * @since 1.0.0
+ */
+ public function buildAstTraitUseStatement();
+
+ /**
+ * Builds a new trait adaptation scope.
+ *
+ * @return \PDepend\Source\AST\ASTTraitAdaptation
+ * @since 1.0.0
+ */
+ public function buildAstTraitAdaptation();
+
+ /**
+ * Builds a new trait adaptation alias statement.
+ *
+ * @param string $image The trait method name.
+ *
+ * @return \PDepend\Source\AST\ASTTraitAdaptationAlias
+ * @since 1.0.0
+ */
+ public function buildAstTraitAdaptationAlias($image);
+
+ /**
+ * Builds a new trait adaptation precedence statement.
+ *
+ * @param string $image The trait method name.
+ *
+ * @return \PDepend\Source\AST\ASTTraitAdaptationPrecedence
+ * @since 1.0.0
+ */
+ public function buildAstTraitAdaptationPrecedence($image);
+
+ /**
+ * Builds a new trait reference node.
+ *
+ * @param string $qualifiedName The full qualified trait name.
+ *
+ * @return \PDepend\Source\AST\ASTTraitReference
+ * @since 1.0.0
+ */
+ public function buildAstTraitReference($qualifiedName);
+
+ /**
+ * Builds a new switch-statement-node.
+ *
+ * @return \PDepend\Source\AST\ASTSwitchStatement
+ * @since 0.9.8
+ */
+ public function buildAstSwitchStatement();
+
+ /**
+ * Builds a new switch-label node.
+ *
+ * @param string $image The source image of this label.
+ *
+ * @return \PDepend\Source\AST\ASTSwitchLabel
+ * @since 0.9.8
+ */
+ public function buildAstSwitchLabel($image);
+
+ /**
+ * Builds a new catch-statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTCatchStatement
+ * @since 0.9.8
+ */
+ public function buildAstCatchStatement($image);
+
+ /**
+ * Builds a new finally-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTFinallyStatement
+ * @since 2.0.0
+ */
+ public function buildAstFinallyStatement();
+
+ /**
+ * Builds a new if statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTIfStatement
+ * @since 0.9.8
+ */
+ public function buildAstIfStatement($image);
+
+ /**
+ * Builds a new elseif-statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTElseIfStatement
+ * @since 0.9.8
+ */
+ public function buildAstElseIfStatement($image);
+
+ /**
+ * Builds a new for-statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTForStatement
+ * @since 0.9.8
+ */
+ public function buildAstForStatement($image);
+
+ /**
+ * Builds a new for-init node.
+ *
+ *
+ * ------------------------
+ * for ($x = 0, $y = 23, $z = 42; $x < $y; ++$x) {}
+ * ------------------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTForInit
+ * @since 0.9.8
+ */
+ public function buildAstForInit();
+
+ /**
+ * Builds a new for-update node.
+ *
+ *
+ * -------------------------------
+ * for ($x = 0, $y = 23, $z = 42; $x < $y; ++$x, $y = $x + 1, $z = $x + 2) {}
+ * -------------------------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTForUpdate
+ * @since 0.9.12
+ */
+ public function buildAstForUpdate();
+
+ /**
+ * Builds a new foreach-statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTForeachStatement
+ * @since 0.9.8
+ */
+ public function buildAstForeachStatement($image);
+
+ /**
+ * Builds a new while-statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTWhileStatement
+ * @since 0.9.8
+ */
+ public function buildAstWhileStatement($image);
+
+ /**
+ * Builds a new do/while-statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTDoWhileStatement
+ * @since 0.9.12
+ */
+ public function buildAstDoWhileStatement($image);
+
+ /**
+ * Builds a new declare-statement node.
+ *
+ *
+ * -------------------------------
+ * declare(encoding='ISO-8859-1');
+ * -------------------------------
+ *
+ * -------------------
+ * declare(ticks=42) {
+ * // ...
+ * }
+ * -
+ *
+ * ------------------
+ * declare(ticks=42):
+ * // ...
+ * enddeclare;
+ * -----------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTDeclareStatement
+ * @since 0.10.0
+ */
+ public function buildAstDeclareStatement();
+
+ /**
+ * Builds a new member primary expression node.
+ *
+ *
+ * //--------
+ * Foo::bar();
+ * //--------
+ *
+ * //---------
+ * Foo::$bar();
+ * //---------
+ *
+ * //---------
+ * $obj->bar();
+ * //---------
+ *
+ * //----------
+ * $obj->$bar();
+ * //----------
+ *
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTMemberPrimaryPrefix
+ * @since 0.9.6
+ */
+ public function buildAstMemberPrimaryPrefix($image);
+
+ /**
+ * Builds a new identifier node.
+ *
+ * @param string $image The image of this identifier.
+ *
+ * @return \PDepend\Source\AST\ASTIdentifier
+ * @since 0.9.6
+ */
+ public function buildAstIdentifier($image);
+
+ /**
+ * Builds a new function postfix expression.
+ *
+ *
+ * //-------
+ * foo($bar);
+ * //-------
+ *
+ * //--------
+ * $foo($bar);
+ * //--------
+ *
+ *
+ * @param string $image The image of this node.
+ *
+ * @return \PDepend\Source\AST\ASTFunctionPostfix
+ * @since 0.9.6
+ */
+ public function buildAstFunctionPostfix($image);
+
+ /**
+ * Builds a new method postfix expression.
+ *
+ *
+ * // ---------
+ * Foo::bar($baz);
+ * // ---------
+ *
+ * // ----------
+ * Foo::$bar($baz);
+ * // ----------
+ *
+ *
+ * @param string $image The image of this node.
+ *
+ * @return \PDepend\Source\AST\ASTMethodPostfix
+ * @since 0.9.6
+ */
+ public function buildAstMethodPostfix($image);
+
+ /**
+ * Builds a new constant postfix expression.
+ *
+ *
+ * // ---
+ * Foo::BAR;
+ * // ---
+ *
+ *
+ * @param string $image The image of this node.
+ *
+ * @return \PDepend\Source\AST\ASTConstantPostfix
+ * @since 0.9.6
+ */
+ public function buildAstConstantPostfix($image);
+
+ /**
+ * Builds a new property postfix expression.
+ *
+ *
+ * // ----
+ * Foo::$bar;
+ * // ----
+ *
+ * // ---
+ * $object->bar;
+ * // ---
+ *
+ *
+ * @param string $image The image of this node.
+ *
+ * @return \PDepend\Source\AST\ASTPropertyPostfix
+ * @since 0.9.6
+ */
+ public function buildAstPropertyPostfix($image);
+
+ /**
+ * Builds a new full qualified class name postfix expression.
+ *
+ *
+ * // -----
+ * Foo::class;
+ * // -----
+ *
+ * // -----
+ * $object::class;
+ * // -----
+ *
+ *
+ * @return \PDepend\Source\AST\ASTClassFqnPostfix
+ * @since 2.0.0
+ */
+ public function buildAstClassFqnPostfix();
+
+ /**
+ * Builds a new arguments list.
+ *
+ *
+ * // ------------
+ * Foo::bar($x, $y, $z);
+ * // ------------
+ *
+ * // ------------
+ * $foo->bar($x, $y, $z);
+ * // ------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTArguments
+ * @since 0.9.6
+ */
+ public function buildAstArguments();
+
+ /**
+ * Builds a new array type node.
+ *
+ * @return \PDepend\Source\AST\ASTTypeArray
+ * @since 0.9.6
+ */
+ public function buildAstTypeArray();
+
+ /**
+ * Builds a new node for the callable type.
+ *
+ * @return \PDepend\Source\AST\ASTTypeCallable
+ * @since 1.0.0
+ */
+ public function buildAstTypeCallable();
+
+ /**
+ * Builds a new primitive type node.
+ *
+ * @param string $image The source image for the primitive type.
+ *
+ * @return \PDepend\Source\AST\ASTPrimitiveType
+ * @since 0.9.6
+ */
+ public function buildAstPrimitiveType($image);
+
+ /**
+ * Builds a new literal node.
+ *
+ * @param string $image The source image for the literal node.
+ *
+ * @return \PDepend\Source\AST\ASTLiteral
+ * @since 0.9.6
+ */
+ public function buildAstLiteral($image);
+
+ /**
+ * Builds a new php string node.
+ *
+ *
+ * $string = "Manuel $Pichler <{$email}>";
+ *
+ * // \PDepend\Source\AST\ASTString
+ * // |-- ASTLiteral - "Manuel ")
+ * // |-- ASTVariable - $Pichler
+ * // |-- ASTLiteral - " <"
+ * // |-- ASTCompoundExpression - {...}
+ * // | |-- ASTVariable - $email
+ * // |-- ASTLiteral - ">"
+ *
+ *
+ * @return \PDepend\Source\AST\ASTString
+ * @since 0.9.10
+ */
+ public function buildAstString();
+
+ /**
+ * Builds a new php array node.
+ *
+ * @return \PDepend\Source\AST\ASTArray
+ * @since 1.0.0
+ */
+ public function buildAstArray();
+
+ /**
+ * Builds a new array element node.
+ *
+ * @return \PDepend\Source\AST\ASTArrayElement
+ * @since 1.0.0
+ */
+ public function buildAstArrayElement();
+
+ /**
+ * Builds a new heredoc node.
+ *
+ * @return \PDepend\Source\AST\ASTHeredoc
+ * @since 0.9.12
+ */
+ public function buildAstHeredoc();
+
+ /**
+ * Builds a new constant definition node.
+ *
+ *
+ * class Foo
+ * {
+ * // ------------------------
+ * const FOO = 42, BAR = 23;
+ * // ------------------------
+ * }
+ *
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTConstantDefinition
+ * @since 0.9.6
+ */
+ public function buildAstConstantDefinition($image);
+
+ /**
+ * Builds a new constant declarator node.
+ *
+ *
+ * class Foo
+ * {
+ * // --------
+ * const BAR = 42;
+ * // --------
+ * }
+ *
+ *
+ * Or in a comma separated constant defintion:
+ *
+ *
+ * class Foo
+ * {
+ * // --------
+ * const BAR = 42,
+ * // --------
+ *
+ * // --------------
+ * const BAZ = 'Foobar',
+ * // --------------
+ *
+ * // ----------
+ * const FOO = 3.14;
+ * // ----------
+ * }
+ *
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTConstantDeclarator
+ * @since 0.9.6
+ */
+ public function buildAstConstantDeclarator($image);
+
+ /**
+ * Builds a new comment node instance.
+ *
+ * @param string $cdata The comment text.
+ *
+ * @return \PDepend\Source\AST\ASTComment
+ * @since 0.9.8
+ */
+ public function buildAstComment($cdata);
+
+ /**
+ * Builds a new unary expression node instance.
+ *
+ * @param string $image The unary expression image/character.
+ *
+ * @return \PDepend\Source\AST\ASTUnaryExpression
+ * @since 0.9.11
+ */
+ public function buildAstUnaryExpression($image);
+
+ /**
+ * Builds a new cast-expression node instance.
+ *
+ * @param string $image The cast-expression image/character.
+ *
+ * @return \PDepend\Source\AST\ASTCastExpression
+ * @since 0.10.0
+ */
+ public function buildAstCastExpression($image);
+
+ /**
+ * Builds a new postfix-expression node instance.
+ *
+ * @param string $image The postfix-expression image/character.
+ *
+ * @return \PDepend\Source\AST\ASTPostfixExpression
+ * @since 0.10.0
+ */
+ public function buildAstPostfixExpression($image);
+
+ /**
+ * Builds a new pre-increment-expression node instance.
+ *
+ * @return \PDepend\Source\AST\ASTPreIncrementExpression
+ * @since 0.10.0
+ */
+ public function buildAstPreIncrementExpression();
+
+ /**
+ * Builds a new pre-decrement-expression node instance.
+ *
+ * @return \PDepend\Source\AST\ASTPreDecrementExpression
+ * @since 0.10.0
+ */
+ public function buildAstPreDecrementExpression();
+
+ /**
+ * Builds a new function/method scope instance.
+ *
+ * @return \PDepend\Source\AST\ASTScope
+ * @since 0.9.12
+ */
+ public function buildAstScope();
+
+ /**
+ * Builds a new statement instance.
+ *
+ * @return \PDepend\Source\AST\ASTStatement
+ * @since 0.9.12
+ */
+ public function buildAstStatement();
+
+ /**
+ * Builds a new return-statement node instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTReturnStatement
+ * @since 0.9.12
+ */
+ public function buildAstReturnStatement($image);
+
+ /**
+ * Builds a new break-statement node instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTBreakStatement
+ * @since 0.9.12
+ */
+ public function buildAstBreakStatement($image);
+
+ /**
+ * Builds a new continue-statement node instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTContinueStatement
+ * @since 0.9.12
+ */
+ public function buildAstContinueStatement($image);
+
+ /**
+ * Builds a new scope-statement instance.
+ *
+ * @return \PDepend\Source\AST\ASTScopeStatement
+ * @since 0.9.12
+ */
+ public function buildAstScopeStatement();
+
+ /**
+ * Builds a new try-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTTryStatement
+ * @since 0.9.12
+ */
+ public function buildAstTryStatement($image);
+
+ /**
+ * Builds a new throw-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTThrowStatement
+ * @since 0.9.12
+ */
+ public function buildAstThrowStatement($image);
+
+ /**
+ * Builds a new goto-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTGotoStatement
+ * @since 0.9.12
+ */
+ public function buildAstGotoStatement($image);
+
+ /**
+ * Builds a new label-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTLabelStatement
+ * @since 0.9.12
+ */
+ public function buildAstLabelStatement($image);
+
+ /**
+ * Builds a new global-statement instance.
+ *
+ * @return \PDepend\Source\AST\ASTGlobalStatement
+ * @since 0.9.12
+ */
+ public function buildAstGlobalStatement();
+
+ /**
+ * Builds a new unset-statement instance.
+ *
+ * @return \PDepend\Source\AST\ASTUnsetStatement
+ * @since 0.9.12
+ */
+ public function buildAstUnsetStatement();
+
+ /**
+ * Builds a new exit-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTEchoStatement
+ * @since 0.9.12
+ */
+ public function buildAstEchoStatement($image);
+
+ /**
+ * Builds a new yield-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTYieldStatement
+ * @since $version$
+ */
+ public function buildAstYieldStatement($image);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Builder/BuilderContext.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Builder/BuilderContext.php
new file mode 100644
index 0000000..31b299e
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Builder/BuilderContext.php
@@ -0,0 +1,121 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Source\Builder;
+
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTTrait;
+
+/**
+ * Base interface for a builder context.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+interface BuilderContext
+{
+ /**
+ * This method can be used to register an existing function in the current
+ * application context.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function registerFunction(ASTFunction $function);
+
+ /**
+ * This method can be used to register an existing trait in the current
+ * class context.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 1.0.0
+ */
+ public function registerTrait(ASTTrait $trait);
+
+ /**
+ * This method can be used to register an existing class in the current
+ * class context.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ */
+ public function registerClass(ASTClass $class);
+
+ /**
+ * This method can be used to register an existing interface in the current
+ * class context.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function registerInterface(ASTInterface $interface);
+
+ /**
+ * Returns the trait instance for the given qualified name.
+ *
+ * @param string $qualifiedName Full qualified trait name.
+ * @return \PDepend\Source\AST\ASTTrait
+ * @since 1.0.0
+ */
+ public function getTrait($qualifiedName);
+
+ /**
+ * Returns the class instance for the given qualified name.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTClass
+ */
+ public function getClass($qualifiedName);
+
+ /**
+ * Returns a class or an interface instance for the given qualified name.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ */
+ public function getClassOrInterface($qualifiedName);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Builder/BuilderContext/GlobalBuilderContext.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Builder/BuilderContext/GlobalBuilderContext.php
new file mode 100644
index 0000000..b0b4022
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Builder/BuilderContext/GlobalBuilderContext.php
@@ -0,0 +1,174 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Source\Builder\BuilderContext;
+
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTTrait;
+use PDepend\Source\Builder\Builder;
+use PDepend\Source\Builder\BuilderContext;
+
+/**
+ * This class provides the default implementation of the builder context.
+ *
+ * This class utilizes the simple static language construct to share the
+ * context instance between all using objects.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+class GlobalBuilderContext implements BuilderContext
+{
+ /**
+ * The currently used ast builder.
+ *
+ * @var \PDepend\Source\Builder\Builder
+ */
+ protected static $builder = null;
+
+ /**
+ * Constructs a new builder context instance.
+ *
+ * @param \PDepend\Source\Builder\Builder $builder The currently used ast builder.
+ */
+ public function __construct(Builder $builder)
+ {
+ self::$builder = $builder;
+ }
+
+ /**
+ * This method can be used to register an existing function in the current
+ * application context.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ */
+ public function registerFunction(ASTFunction $function)
+ {
+ self::$builder->restoreFunction($function);
+ }
+
+ /**
+ * This method can be used to register an existing trait in the current
+ * class context.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 1.0.0
+ */
+ public function registerTrait(ASTTrait $trait)
+ {
+ self::$builder->restoreTrait($trait);
+ }
+
+ /**
+ * This method can be used to register an existing class in the current
+ * class context.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class The class instance.
+ * @return void
+ */
+ public function registerClass(ASTClass $class)
+ {
+ self::$builder->restoreClass($class);
+ }
+
+ /**
+ * This method can be used to register an existing interface in the current
+ * class context.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ */
+ public function registerInterface(ASTInterface $interface)
+ {
+ self::$builder->restoreInterface($interface);
+ }
+
+ /**
+ * Returns the trait instance for the given qualified name.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTTrait
+ * @since 1.0.0
+ */
+ public function getTrait($qualifiedName)
+ {
+ return $this->getBuilder()->getTrait($qualifiedName);
+ }
+
+ /**
+ * Returns the class instance for the given qualified name.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTClass
+ */
+ public function getClass($qualifiedName)
+ {
+ return $this->getBuilder()->getClass($qualifiedName);
+ }
+
+ /**
+ * Returns a class or an interface instance for the given qualified name.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ */
+ public function getClassOrInterface($qualifiedName)
+ {
+ return $this->getBuilder()->getClassOrInterface($qualifiedName);
+ }
+
+ /**
+ * Returns the currently used builder instance.
+ *
+ * @return \PDepend\Source\Builder\Builder
+ */
+ protected function getBuilder()
+ {
+ return self::$builder;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/AbstractPHPParser.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/AbstractPHPParser.php
new file mode 100644
index 0000000..774f114
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/AbstractPHPParser.php
@@ -0,0 +1,6694 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Language\PHP;
+
+use PDepend\Source\AST\AbstractASTCallable;
+use PDepend\Source\AST\AbstractASTClassOrInterface;
+use PDepend\Source\AST\AbstractASTType;
+use PDepend\Source\AST\ASTArray;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTExpression;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTNode;
+use PDepend\Source\AST\ASTStatement;
+use PDepend\Source\AST\ASTSwitchStatement;
+use PDepend\Source\AST\ASTValue;
+use PDepend\Source\AST\State;
+use PDepend\Source\Builder\Builder;
+use PDepend\Source\Parser\InvalidStateException;
+use PDepend\Source\Parser\MissingValueException;
+use PDepend\Source\Parser\TokenStreamEndException;
+use PDepend\Source\Parser\UnexpectedTokenException;
+use PDepend\Source\Tokenizer\Token;
+use PDepend\Source\Tokenizer\Tokenizer;
+use PDepend\Source\Tokenizer\Tokens;
+use PDepend\Util\Cache\CacheDriver;
+use PDepend\Util\Log;
+use PDepend\Util\Type;
+
+/**
+ * The php source parser.
+ *
+ * With the default settings the parser includes annotations, better known as
+ * doc comment tags, in the generated result. This means it extracts the type
+ * information of @var tags for properties, and types in @return + @throws tags
+ * of functions and methods. The current implementation tries to ignore all
+ * scalar types from boolean to void. You should disable this
+ * feature for project that have more or less invalid doc comments, because it
+ * could produce invalid results.
+ *
+ *
+ * $parser->setIgnoreAnnotations();
+ *
+ *
+ * Note: Due to the fact that it is possible to use the same name for
+ * multiple classes and interfaces, and there is no way to determine to which
+ * package it belongs, while the parser handles class, interface or method
+ * signatures, the parser could/will create a code tree that doesn't reflect the
+ * real source structure.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+abstract class AbstractPHPParser
+{
+ /**
+ * Regular expression for inline type definitions in regular comments. This
+ * kind of type is supported by IDEs like Netbeans or eclipse.
+ */
+ const REGEXP_INLINE_TYPE = '(^\s*/\*\s*
+ @var\s+
+ \$[a-zA-Z_\x7f-\xff\\\\][a-zA-Z0-9_\x7f-\xff]*\s+
+ (.*?)
+ \s*\*/\s*$)ix';
+
+ /**
+ * Regular expression for types defined in throws annotations of
+ * method or function doc comments.
+ */
+ const REGEXP_THROWS_TYPE = '(\*\s*
+ @throws\s+
+ ([a-zA-Z_\x7f-\xff\\\\][a-zA-Z0-9_\x7f-\xff\\\\]*)
+ )ix';
+
+ /**
+ * Regular expression for types defined in annotations like return or
+ * var in doc comments of functions and methods.
+ */
+ const REGEXP_RETURN_TYPE = '(\*\s*
+ @return\s+
+ (array\(\s*
+ (\w+\s*=>\s*)?
+ ([a-zA-Z_\x7f-\xff\\\\][a-zA-Z0-9_\x7f-\xff\|\\\\]*)\s*
+ \)
+ |
+ ([a-zA-Z_\x7f-\xff\\\\][a-zA-Z0-9_\x7f-\xff\|\\\\]*))\s+
+ |
+ ([a-zA-Z_\x7f-\xff\\\\][a-zA-Z0-9_\x7f-\xff\|\\\\]*)\[\]
+ )ix';
+
+ /**
+ * Regular expression for types defined in annotations like return or
+ * var in doc comments of functions and methods.
+ */
+ const REGEXP_VAR_TYPE = '(\*\s*
+ @var\s+
+ (array\(\s*
+ (\w+\s*=>\s*)?
+ ([a-zA-Z_\x7f-\xff\\\\][a-zA-Z0-9_\x7f-\xff\|\\\\]*)\s*
+ \)
+ |
+ ([a-zA-Z_\x7f-\xff\\\\][a-zA-Z0-9_\x7f-\xff\|\\\\]*))\s+
+ |
+ ([a-zA-Z_\x7f-\xff\\\\][a-zA-Z0-9_\x7f-\xff\|\\\\]*)\[\]\s+
+ |
+ (array)\(\s*\)\s+
+ )ix';
+
+ /**
+ * Internal state flag, that will be set to true when the parser has
+ * prefixed a qualified name with the actual namespace.
+ *
+ * @var boolean
+ */
+ private $namespacePrefixReplaced = false;
+
+ /**
+ * The name of the last detected namespace.
+ *
+ * @var string
+ */
+ private $namespaceName;
+
+ /**
+ * Last parsed package tag.
+ *
+ * @var string
+ */
+ private $packageName = Builder::DEFAULT_NAMESPACE;
+
+ /**
+ * The package defined in the file level comment.
+ *
+ * @var string
+ */
+ private $globalPackageName = Builder::DEFAULT_NAMESPACE;
+
+ /**
+ * The used data structure builder.
+ *
+ * @var Builder
+ */
+ protected $builder;
+
+ /**
+ * The currently parsed file instance.
+ *
+ * @var \PDepend\Source\AST\ASTCompilationUnit
+ */
+ private $compilationUnit;
+
+ /**
+ * The symbol table used to handle PHP 5.3 use statements.
+ *
+ * @var \PDepend\Source\Parser\SymbolTable
+ */
+ private $useSymbolTable;
+
+ /**
+ * The last parsed doc comment or null.
+ *
+ * @var string
+ */
+ private $docComment;
+
+ /**
+ * Bitfield of last parsed modifiers.
+ *
+ * @var integer
+ */
+ private $modifiers = 0;
+
+ /**
+ * The actually parsed class or interface instance.
+ *
+ * @var \PDepend\Source\AST\AbstractASTClassOrInterface
+ */
+ private $classOrInterface;
+
+ /**
+ * If this property is set to true the parser will ignore all doc
+ * comment annotations.
+ *
+ * @var boolean
+ */
+ private $ignoreAnnotations = false;
+
+ /**
+ * Stack with all active token scopes.
+ *
+ * @var \PDepend\Source\AST\Parser\TokenStack
+ */
+ private $tokenStack;
+
+ /**
+ * Used identifier builder instance.
+ *
+ * @var \PDepend\Util\IdBuilder
+ * @since 0.9.12
+ */
+ private $idBuilder = null;
+
+ /**
+ * The maximum valid nesting level allowed.
+ *
+ * @var integer
+ * @since 0.9.12
+ */
+ private $maxNestingLevel = 1024;
+
+ /**
+ *
+ * @var \PDepend\Util\Cache\CacheDriver
+ * @since 0.10.0
+ */
+ protected $cache;
+
+ /*
+ * The used code tokenizer.
+ *
+ * @var \PDepend\Source\Tokenizer\Tokenizer
+ */
+ protected $tokenizer;
+
+ /**
+ * Constructs a new source parser.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ * @param \PDepend\Source\Builder\Builder $builder
+ * @param \PDepend\Util\Cache\CacheDriver $cache
+ */
+ public function __construct(Tokenizer $tokenizer, Builder $builder, CacheDriver $cache)
+ {
+ $this->tokenizer = $tokenizer;
+ $this->builder = $builder;
+ $this->cache = $cache;
+
+ $this->idBuilder = new \PDepend\Util\IdBuilder();
+ $this->tokenStack = new \PDepend\Source\Parser\TokenStack();
+ $this->useSymbolTable = new \PDepend\Source\Parser\SymbolTable();
+
+ $this->builder->setCache($this->cache);
+ }
+
+ /**
+ * Sets the ignore annotations flag. This means that the parser will ignore
+ * doc comment annotations.
+ *
+ * @return void
+ */
+ public function setIgnoreAnnotations()
+ {
+ $this->ignoreAnnotations = true;
+ }
+
+ /**
+ * Configures the maximum allowed nesting level.
+ *
+ * @param integer $maxNestingLevel The maximum allowed nesting level.
+ *
+ * @return void
+ * @since 0.9.12
+ */
+ public function setMaxNestingLevel($maxNestingLevel)
+ {
+ $this->maxNestingLevel = $maxNestingLevel;
+ }
+
+ /**
+ * Returns the maximum allowed nesting/recursion level.
+ *
+ * @return integer
+ * @since 0.9.12
+ */
+ protected function getMaxNestingLevel()
+ {
+ return $this->maxNestingLevel;
+ }
+
+ /**
+ * Parses the contents of the tokenizer and generates a node tree based on
+ * the found tokens.
+ *
+ * @return void
+ */
+ public function parse()
+ {
+ $this->compilationUnit = $this->tokenizer->getSourceFile();
+ $this->compilationUnit
+ ->setCache($this->cache)
+ ->setId($this->idBuilder->forFile($this->compilationUnit));
+
+ $hash = md5_file($this->compilationUnit->getFileName());
+
+ if ($this->cache->restore($this->compilationUnit->getId(), $hash)) {
+ return;
+ }
+
+ $this->cache->remove($this->compilationUnit->getId());
+
+ $this->setUpEnvironment();
+
+ $this->tokenStack->push();
+
+ Log::debug('Processing file ' . $this->compilationUnit);
+
+ $tokenType = $this->tokenizer->peek();
+ while ($tokenType !== Tokenizer::T_EOF) {
+
+ switch ($tokenType) {
+
+ case Tokens::T_COMMENT:
+ $this->consumeToken(Tokens::T_COMMENT);
+ break;
+
+ case Tokens::T_DOC_COMMENT:
+ $comment = $this->consumeToken(Tokens::T_DOC_COMMENT)->image;
+
+ $this->packageName = $this->parsePackageAnnotation($comment);
+ $this->docComment = $comment;
+ break;
+
+ case Tokens::T_USE:
+ // Parse a use statement. This method has no return value but it
+ // creates a new entry in the symbol map.
+ $this->parseUseDeclarations();
+ break;
+
+ case Tokens::T_NAMESPACE:
+ $this->parseNamespaceDeclaration();
+ break;
+
+ case Tokens::T_NO_PHP:
+ case Tokens::T_OPEN_TAG:
+ case Tokens::T_OPEN_TAG_WITH_ECHO:
+ $this->consumeToken($tokenType);
+ $this->reset();
+ break;
+
+ case Tokens::T_CLOSE_TAG:
+ $this->parseNonePhpCode();
+ $this->reset();
+ break;
+
+ default:
+ if (null === $this->parseOptionalStatement()) {
+ // Consume whatever token
+ $this->consumeToken($tokenType);
+ }
+ break;
+ }
+
+ $tokenType = $this->tokenizer->peek();
+ }
+
+ $this->compilationUnit->setTokens($this->tokenStack->pop());
+ $this->cache->store(
+ $this->compilationUnit->getId(),
+ $this->compilationUnit,
+ $hash
+ );
+
+ $this->tearDownEnvironment();
+ }
+
+ /**
+ * Initializes the parser environment.
+ *
+ * @return void
+ * @since 0.9.12
+ */
+ protected function setUpEnvironment()
+ {
+ ini_set('xdebug.max_nesting_level', $this->getMaxNestingLevel());
+
+ $this->useSymbolTable->createScope();
+
+ $this->reset();
+ }
+
+ /**
+ * Restores the parser environment back.
+ *
+ * @return void
+ * @since 0.9.12
+ */
+ protected function tearDownEnvironment()
+ {
+ ini_restore('xdebug.max_nesting_level');
+
+ $this->useSymbolTable->destroyScope();
+ }
+
+ /**
+ * Resets some object properties.
+ *
+ * @param integer $modifiers Optional default modifiers.
+ *
+ * @return void
+ */
+ protected function reset($modifiers = 0)
+ {
+ $this->packageName = Builder::DEFAULT_NAMESPACE;
+ $this->docComment = null;
+ $this->modifiers = $modifiers;
+ }
+
+ /**
+ * Tests if the given token type is a reserved keyword in the supported PHP
+ * version.
+ *
+ * @param $tokenType
+ * @return boolean
+ * @since 1.1.1
+ */
+ abstract protected function isKeyword($tokenType);
+
+ /**
+ * Will return true if the given $tokenType is a valid class
+ * name part.
+ *
+ * @param integer $tokenType The type of a parsed token.
+ * @return boolean
+ * @since 0.10.6
+ */
+ abstract protected function isClassName($tokenType);
+
+ /**
+ * Parses a valid class or interface name for the currently configured php
+ * version.
+ *
+ * @return string
+ * @since 0.9.20
+ */
+ abstract protected function parseClassName();
+
+ /**
+ * Parses a valid method or function name for the currently configured php
+ * version.
+ *
+ * @return string
+ * @since 0.10.0
+ */
+ abstract protected function parseFunctionName();
+
+ /**
+ * Parses a trait declaration.
+ *
+ * @return \PDepend\Source\AST\ASTTrait
+ * @since 1.0.0
+ */
+ private function parseTraitDeclaration()
+ {
+ $this->tokenStack->push();
+
+ $trait = $this->parseTraitSignature();
+ $trait = $this->parseTypeBody($trait);
+ $trait->setTokens($this->tokenStack->pop());
+
+ $this->reset();
+
+ return $trait;
+ }
+
+ /**
+ * Parses the signature of a trait.
+ *
+ * @return \PDepend\Source\AST\ASTTrait
+ */
+ private function parseTraitSignature()
+ {
+ $this->consumeToken(Tokens::T_TRAIT);
+ $this->consumeComments();
+
+ $qualifiedName = $this->createQualifiedTypeName($this->parseClassName());
+
+ $trait = $this->builder->buildTrait($qualifiedName);
+ $trait->setCompilationUnit($this->compilationUnit);
+ $trait->setDocComment($this->docComment);
+ $trait->setId($this->idBuilder->forClassOrInterface($trait));
+ $trait->setUserDefined();
+
+ return $trait;
+ }
+
+ /**
+ * Parses the dependencies in a interface signature.
+ *
+ * @return \PDepend\Source\AST\ASTInterface
+ */
+ private function parseInterfaceDeclaration()
+ {
+ $this->tokenStack->push();
+
+ $interface = $this->parseInterfaceSignature();
+ $interface = $this->parseTypeBody($interface);
+ $interface->setTokens($this->tokenStack->pop());
+
+ $this->reset();
+
+ return $interface;
+ }
+
+ /**
+ * Parses the signature of an interface and finally returns a configured
+ * interface instance.
+ *
+ * @return \PDepend\Source\AST\ASTInterface
+ * @since 0.10.2
+ */
+ private function parseInterfaceSignature()
+ {
+ $this->consumeToken(Tokens::T_INTERFACE);
+ $this->consumeComments();
+
+ $qualifiedName = $this->createQualifiedTypeName($this->parseClassName());
+
+ $interface = $this->builder->buildInterface($qualifiedName);
+ $interface->setCompilationUnit($this->compilationUnit);
+ $interface->setDocComment($this->docComment);
+ $interface->setId($this->idBuilder->forClassOrInterface($interface));
+ $interface->setUserDefined();
+
+ return $this->parseOptionalExtendsList($interface);
+ }
+
+ /**
+ * Parses an optional interface list of an interface declaration.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return \PDepend\Source\AST\ASTInterface
+ * @since 0.10.2
+ */
+ private function parseOptionalExtendsList(ASTInterface $interface)
+ {
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ if ($tokenType === Tokens::T_EXTENDS) {
+ $this->consumeToken(Tokens::T_EXTENDS);
+ $this->parseInterfaceList($interface);
+ }
+ return $interface;
+ }
+
+ /**
+ * Parses the dependencies in a class signature.
+ *
+ * @return \PDepend\Source\AST\ASTClass
+ */
+ private function parseClassDeclaration()
+ {
+ $this->tokenStack->push();
+
+ $class = $this->parseClassSignature();
+ $class = $this->parseTypeBody($class);
+ $class->setTokens($this->tokenStack->pop());
+
+ $this->reset();
+
+ return $class;
+ }
+
+ /**
+ * Parses the signature of a class.
+ *
+ * The signature of a class consists of optional class modifiers like, final
+ * or abstract, the T_CLASS token, the class name, an optional parent class
+ * and an optional list of implemented interfaces.
+ *
+ * @return \PDepend\Source\AST\ASTClass
+ * @since 1.0.0
+ */
+ private function parseClassSignature()
+ {
+ $this->parseClassModifiers();
+ $this->consumeToken(Tokens::T_CLASS);
+ $this->consumeComments();
+
+ $qualifiedName = $this->createQualifiedTypeName($this->parseClassName());
+
+ $class = $this->builder->buildClass($qualifiedName);
+ $class->setCompilationUnit($this->compilationUnit);
+ $class->setModifiers($this->modifiers);
+ $class->setDocComment($this->docComment);
+ $class->setId($this->idBuilder->forClassOrInterface($class));
+ $class->setUserDefined();
+
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ if ($tokenType === Tokens::T_EXTENDS) {
+ $class = $this->parseClassExtends($class);
+
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+ }
+
+ if ($tokenType === Tokens::T_IMPLEMENTS) {
+ $this->consumeToken(Tokens::T_IMPLEMENTS);
+ $this->parseInterfaceList($class);
+ }
+
+ return $class;
+ }
+
+ /**
+ * This method parses an optional class modifier. Valid class modifiers are
+ * final or abstract.
+ *
+ * @return void
+ */
+ private function parseClassModifiers()
+ {
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ if ($tokenType === Tokens::T_ABSTRACT) {
+ $this->consumeToken(Tokens::T_ABSTRACT);
+ $this->modifiers |= State::IS_EXPLICIT_ABSTRACT;
+ } elseif ($tokenType === Tokens::T_FINAL) {
+ $this->consumeToken(Tokens::T_FINAL);
+ $this->modifiers |= State::IS_FINAL;
+ }
+
+ $this->consumeComments();
+ }
+
+ /**
+ * Parses a parent class declaration for the given $class.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return \PDepend\Source\AST\ASTClass
+ * @since 1.0.0
+ */
+ private function parseClassExtends(ASTClass $class)
+ {
+ $this->consumeToken(Tokens::T_EXTENDS);
+ $this->tokenStack->push();
+
+ $class->setParentClassReference(
+ $this->setNodePositionsAndReturn(
+ $this->builder->buildAstClassReference(
+ $this->parseQualifiedName()
+ )
+ )
+ );
+
+ return $class;
+ }
+
+ /**
+ * This method parses a list of interface names as used in the extends
+ * part of a interface declaration or in the implements part of a
+ * class declaration.
+ *
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $abstractType
+ * @return void
+ */
+ private function parseInterfaceList(AbstractASTClassOrInterface $abstractType)
+ {
+ while (true) {
+
+ $this->tokenStack->push();
+
+ $abstractType->addInterfaceReference(
+ $this->setNodePositionsAndReturn(
+ $this->builder->buildAstClassOrInterfaceReference(
+ $this->parseQualifiedName()
+ )
+ )
+ );
+
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ if ($tokenType === Tokens::T_CURLY_BRACE_OPEN) {
+ break;
+ }
+ $this->consumeToken(Tokens::T_COMMA);
+ }
+ }
+
+ /**
+ * Parses a class/interface/trait body.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ * @return \PDepend\Source\AST\AbstractASTType
+ * @throws \PDepend\Source\Parser\UnexpectedTokenException
+ * @throws \PDepend\Source\Parser\TokenStreamEndException
+ */
+ private function parseTypeBody(AbstractASTType $type)
+ {
+ $this->classOrInterface = $type;
+
+ // Consume comments and read opening curly brace
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
+
+ $defaultModifier = State::IS_PUBLIC;
+ if ($type instanceof ASTInterface) {
+ $defaultModifier |= State::IS_ABSTRACT;
+ }
+ $this->reset();
+
+ $tokenType = $this->tokenizer->peek();
+
+ while ($tokenType !== Tokenizer::T_EOF) {
+
+ switch ($tokenType) {
+
+ case Tokens::T_ABSTRACT:
+ case Tokens::T_PUBLIC:
+ case Tokens::T_PRIVATE:
+ case Tokens::T_PROTECTED:
+ case Tokens::T_STATIC:
+ case Tokens::T_FINAL:
+ case Tokens::T_FUNCTION:
+ case Tokens::T_VARIABLE:
+ case Tokens::T_VAR:
+
+ $methodOrProperty = $this->parseMethodOrFieldDeclaration(
+ $defaultModifier
+ );
+
+ if ($methodOrProperty instanceof \PDepend\Source\AST\ASTNode) {
+ $type->addChild($methodOrProperty);
+ }
+
+ $this->reset();
+ break;
+
+ case Tokens::T_CONST:
+ $type->addChild($this->parseConstantDefinition());
+ $this->reset();
+ break;
+
+ case Tokens::T_CURLY_BRACE_CLOSE:
+ $this->consumeToken(Tokens::T_CURLY_BRACE_CLOSE);
+
+ $this->reset();
+
+ // Reset context class or interface instance
+ $this->classOrInterface = null;
+
+ // Stop processing
+ return $type;
+
+ case Tokens::T_COMMENT:
+ $token = $this->consumeToken(Tokens::T_COMMENT);
+
+ $comment = $this->builder->buildAstComment($token->image);
+ $comment->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ $type->addChild($comment);
+
+ break;
+
+ case Tokens::T_DOC_COMMENT:
+ $token = $this->consumeToken(Tokens::T_DOC_COMMENT);
+
+ $comment = $this->builder->buildAstComment($token->image);
+ $comment->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ $type->addChild($comment);
+
+ $this->docComment = $token->image;
+ break;
+
+ case Tokens::T_USE:
+ $type->addChild($this->parseTraitUseStatement());
+ break;
+
+ default:
+ throw new UnexpectedTokenException(
+ $this->tokenizer->next(),
+ $this->tokenizer->getSourceFile()
+ );
+ }
+
+ $tokenType = $this->tokenizer->peek();
+ }
+
+ throw new TokenStreamEndException($this->tokenizer);
+ }
+
+ /**
+ * This method will parse a list of modifiers and a following property or
+ * method.
+ *
+ * @param integer $modifiers
+ * @return \PDepend\Source\AST\ASTMethod|\PDepend\Source\AST\ASTFieldDeclaration
+ * @since 0.9.6
+ */
+ private function parseMethodOrFieldDeclaration($modifiers = 0)
+ {
+ $this->tokenStack->push();
+
+ $tokenType = $this->tokenizer->peek();
+ while ($tokenType !== Tokenizer::T_EOF) {
+ switch ($tokenType) {
+
+ case Tokens::T_PRIVATE:
+ $modifiers |= State::IS_PRIVATE;
+ $modifiers = $modifiers & ~State::IS_PUBLIC;
+ break;
+
+ case Tokens::T_PROTECTED:
+ $modifiers |= State::IS_PROTECTED;
+ $modifiers = $modifiers & ~State::IS_PUBLIC;
+ break;
+
+ case Tokens::T_VAR:
+ case Tokens::T_PUBLIC:
+ $modifiers |= State::IS_PUBLIC;
+ break;
+
+ case Tokens::T_STATIC:
+ $modifiers |= State::IS_STATIC;
+ break;
+
+ case Tokens::T_ABSTRACT:
+ $modifiers |= State::IS_ABSTRACT;
+ break;
+
+ case Tokens::T_FINAL:
+ $modifiers |= State::IS_FINAL;
+ break;
+
+ case Tokens::T_FUNCTION:
+ $method = $this->parseMethodDeclaration();
+ $method->setModifiers($modifiers);
+ $method->setCompilationUnit($this->compilationUnit);
+ $method->setId($this->idBuilder->forMethod($method));
+ $method->setTokens($this->tokenStack->pop());
+ return $method;
+
+ case Tokens::T_VARIABLE:
+ $declaration = $this->parseFieldDeclaration();
+ $declaration->setModifiers($modifiers);
+
+ return $declaration;
+
+ default:
+ break 2;
+ }
+
+ $this->consumeToken($tokenType);
+ $this->consumeComments();
+
+ $tokenType = $this->tokenizer->peek();
+ }
+ throw new UnexpectedTokenException(
+ $this->tokenizer->next(),
+ $this->tokenizer->getSourceFile()
+ );
+ }
+
+ /**
+ * This method will parse a class field declaration with all it's variables.
+ *
+ *
+ * // Simple field declaration
+ * class Foo {
+ * protected $foo;
+ * }
+ *
+ * // Field declaration with multiple properties
+ * class Foo {
+ * protected $foo = 23
+ * $bar = 42,
+ * $baz = null;
+ * }
+ *
+ *
+ * @return \PDepend\Source\AST\ASTFieldDeclaration
+ * @since 0.9.6
+ */
+ private function parseFieldDeclaration()
+ {
+ $declaration = $this->builder->buildAstFieldDeclaration();
+ $declaration->setComment($this->docComment);
+
+ $type = $this->parseFieldDeclarationType();
+ if ($type !== null) {
+ $declaration->addChild($type);
+ }
+
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ while ($tokenType !== Tokenizer::T_EOF) {
+ $declaration->addChild($this->parseVariableDeclarator());
+
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ if ($tokenType !== Tokens::T_COMMA) {
+ break;
+ }
+ $this->consumeToken(Tokens::T_COMMA);
+
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+ }
+
+ $this->setNodePositionsAndReturn($declaration);
+
+ $this->consumeToken(Tokens::T_SEMICOLON);
+
+ return $declaration;
+ }
+
+ /**
+ * This method parses a simple function or a PHP 5.3 lambda function or
+ * closure.
+ *
+ * @return \PDepend\Source\AST\AbstractASTCallable
+ * @since 0.9.5
+ */
+ private function parseFunctionOrClosureDeclaration()
+ {
+ $this->tokenStack->push();
+
+ $this->consumeToken(Tokens::T_FUNCTION);
+ $this->consumeComments();
+
+ $returnReference = $this->parseOptionalByReference();
+
+ if ($this->isNextTokenFormalParameterList()) {
+ $callable = $this->parseClosureDeclaration();
+ return $this->setNodePositionsAndReturn($callable);
+ } else {
+ $callable = $this->parseFunctionDeclaration();
+ $this->compilationUnit->addChild($callable);
+ }
+
+ $callable->setDocComment($this->docComment);
+ $callable->setTokens($this->tokenStack->pop());
+ $this->prepareCallable($callable);
+
+ if ($returnReference) {
+ $callable->setReturnsReference();
+ }
+
+ $this->reset();
+
+ return $callable;
+ }
+
+ /**
+ * Parses an optional by reference token. The return value will be
+ * true when a reference token was found, otherwise this method will
+ * return false.
+ *
+ * @return boolean
+ * @since 0.9.8
+ */
+ private function parseOptionalByReference()
+ {
+ if ($this->isNextTokenByReference()) {
+ return $this->parseByReference();
+ }
+ return false;
+ }
+
+ /**
+ * Tests that the next available token is the returns by reference token.
+ *
+ * @return boolean
+ * @since 0.9.8
+ */
+ private function isNextTokenByReference()
+ {
+ return ($this->tokenizer->peek() === Tokens::T_BITWISE_AND);
+ }
+
+ /**
+ * This method parses a returns by reference token and returns true.
+ *
+ * @return boolean
+ */
+ private function parseByReference()
+ {
+ $this->consumeToken(Tokens::T_BITWISE_AND);
+ $this->consumeComments();
+
+ return true;
+ }
+
+ /**
+ * Tests that the next available token is an opening parenthesis.
+ *
+ * @return boolean
+ * @since 0.9.10
+ */
+ private function isNextTokenFormalParameterList()
+ {
+ $this->consumeComments();
+ return ($this->tokenizer->peek() === Tokens::T_PARENTHESIS_OPEN);
+ }
+
+ /**
+ * This method parses a function declaration.
+ *
+ * @return \PDepend\Source\AST\ASTFunction
+ * @since 0.9.5
+ */
+ private function parseFunctionDeclaration()
+ {
+ $this->consumeComments();
+
+ // Next token must be the function identifier
+ $functionName = $this->parseFunctionName();
+
+ $function = $this->builder->buildFunction($functionName);
+ $function->setCompilationUnit($this->compilationUnit);
+ $function->setId($this->idBuilder->forFunction($function));
+
+ $this->parseCallableDeclaration($function);
+
+ // First check for an existing namespace
+ if ($this->namespaceName !== null) {
+ $packageName = $this->namespaceName;
+ } elseif ($this->packageName !== Builder::DEFAULT_NAMESPACE) {
+ $packageName = $this->packageName;
+ } else {
+ $packageName = $this->globalPackageName;
+ }
+
+ $this->builder
+ ->buildNamespace($packageName)
+ ->addFunction($function);
+
+ // Store function in source file, because we need them during the file's
+ // __wakeup() phase for function declarations within another function or
+ // method declaration.
+ $this->compilationUnit->addChild($function);
+
+ return $function;
+ }
+
+ /**
+ * This method parses a method declaration.
+ *
+ * @return \PDepend\Source\AST\ASTMethod
+ * @since 0.9.5
+ */
+ private function parseMethodDeclaration()
+ {
+ // Read function keyword
+ $this->consumeToken(Tokens::T_FUNCTION);
+ $this->consumeComments();
+
+ $returnsReference = $this->parseOptionalByReference();
+
+ $methodName = $this->parseFunctionName();
+
+ $method = $this->builder->buildMethod($methodName);
+ $method->setDocComment($this->docComment);
+ $method->setCompilationUnit($this->compilationUnit);
+
+ $this->classOrInterface->addMethod($method);
+
+ $this->parseCallableDeclaration($method);
+ $this->prepareCallable($method);
+
+ if ($returnsReference === true) {
+ $method->setReturnsReference();
+ }
+
+ return $method;
+ }
+
+ /**
+ * This method parses a PHP 5.3 closure or lambda function.
+ *
+ * @return \PDepend\Source\AST\ASTClosure
+ * @since 0.9.5
+ */
+ private function parseClosureDeclaration()
+ {
+ $this->tokenStack->push();
+
+ if (Tokens::T_FUNCTION === $this->tokenizer->peek()) {
+ $this->consumeToken(Tokens::T_FUNCTION);
+ }
+
+ $closure = $this->builder->buildAstClosure();
+ $closure->setReturnsByReference($this->parseOptionalByReference());
+ $closure->addChild($this->parseFormalParameters());
+ $closure = $this->parseOptionalBoundVariables($closure);
+ $closure->addChild($this->parseScope());
+
+ return $this->setNodePositionsAndReturn($closure);
+ }
+
+ /**
+ * Parses a function or a method and adds it to the parent context node.
+ *
+ * @param \PDepend\Source\AST\AbstractASTCallable $callable
+ * @return void
+ */
+ private function parseCallableDeclaration(AbstractASTCallable $callable)
+ {
+ $callable->addChild($this->parseFormalParameters());
+
+ $this->consumeComments();
+ if ($this->tokenizer->peek() == Tokens::T_CURLY_BRACE_OPEN) {
+ $callable->addChild($this->parseScope());
+ } else {
+ $this->consumeToken(Tokens::T_SEMICOLON);
+ }
+ }
+
+ /**
+ * Parses a trait use statement.
+ *
+ * @return \PDepend\Source\AST\ASTTraitUseStatement
+ * @since 1.0.0
+ */
+ private function parseTraitUseStatement()
+ {
+ $this->tokenStack->push();
+ $this->consumeToken(Tokens::T_USE);
+
+ $useStatement = $this->builder->buildAstTraitUseStatement();
+ $useStatement->addChild($this->parseTraitReference());
+
+ $this->consumeComments();
+ while (Tokens::T_COMMA === $this->tokenizer->peek()) {
+ $this->consumeToken(Tokens::T_COMMA);
+ $useStatement->addChild($this->parseTraitReference());
+ }
+
+ return $this->setNodePositionsAndReturn(
+ $this->parseOptionalTraitAdaptation($useStatement)
+ );
+ }
+
+ /**
+ * Parses a trait reference instance.
+ *
+ * @return \PDepend\Source\AST\ASTTraitReference
+ * @since 1.0.0
+ */
+ private function parseTraitReference()
+ {
+ $this->consumeComments();
+ $this->tokenStack->push();
+
+ return $this->setNodePositionsAndReturn(
+ $this->builder->buildAstTraitReference(
+ $this->parseQualifiedName()
+ )
+ );
+ }
+
+ /**
+ * Parses the adaptation list of the given use statement or simply reads
+ * the terminating semicolon, when no adaptation list exists.
+ *
+ * @param \PDepend\Source\AST\ASTTraitUseStatement $useStatement The parent use
+ *
+ * @return \PDepend\Source\AST\ASTTraitUseStatement
+ * @since 1.0.0
+ */
+ private function parseOptionalTraitAdaptation(
+ \PDepend\Source\AST\ASTTraitUseStatement $useStatement
+ ) {
+ $this->consumeComments();
+ if (Tokens::T_CURLY_BRACE_OPEN === $this->tokenizer->peek()) {
+ $useStatement->addChild($this->parseTraitAdaptation());
+ } else {
+ $this->consumeToken(Tokens::T_SEMICOLON);
+ }
+ return $useStatement;
+ }
+
+ /**
+ * Parses the adaptation expression of a trait use statement.
+ *
+ * @return \PDepend\Source\AST\ASTTraitAdaptation
+ * @since 1.0.0
+ */
+ private function parseTraitAdaptation()
+ {
+ $this->tokenStack->push();
+
+ $adaptation = $this->builder->buildAstTraitAdaptation();
+
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
+
+ do {
+ $this->tokenStack->push();
+
+ $reference = $this->parseTraitMethodReference();
+ $this->consumeComments();
+
+ if (Tokens::T_AS === $this->tokenizer->peek()) {
+ $stmt = $this->parseTraitAdaptationAliasStatement($reference);
+ } else {
+ $stmt = $this->parseTraitAdaptationPrecedenceStatement($reference);
+ }
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_SEMICOLON);
+
+ $adaptation->addChild($this->setNodePositionsAndReturn($stmt));
+
+ $this->consumeComments();
+ } while (Tokens::T_CURLY_BRACE_CLOSE !== $this->tokenizer->peek());
+
+ $this->consumeToken(Tokens::T_CURLY_BRACE_CLOSE);
+
+ return $this->setNodePositionsAndReturn($adaptation);
+ }
+
+ /**
+ * Parses a trait method reference and returns the found reference as an
+ * array.
+ *
+ * The returned array with contain only one element, when the referenced
+ * method is specified by the method's name, without the declaring trait.
+ * When the method reference contains the declaring trait the returned
+ * array will contain two elements. The first element is the plain
+ * method name and the second element is an instance of the
+ * {@link \PDepend\Source\AST\ASTTraitReference} class that represents the
+ * declaring trait.
+ *
+ * @return array
+ * @since 1.0.0
+ */
+ private function parseTraitMethodReference()
+ {
+ $this->tokenStack->push();
+
+ $qualifiedName = $this->parseQualifiedName();
+
+ $this->consumeComments();
+ if (Tokens::T_DOUBLE_COLON === $this->tokenizer->peek()) {
+
+ $traitReference = $this->setNodePositionsAndReturn(
+ $this->builder->buildAstTraitReference($qualifiedName)
+ );
+
+ $this->consumeToken(Tokens::T_DOUBLE_COLON);
+ $this->consumeComments();
+
+ return array($this->parseFunctionName(), $traitReference);
+ }
+ $this->tokenStack->pop();
+
+ return array($qualifiedName);
+ }
+
+ /**
+ * Parses a trait adaptation alias statement.
+ *
+ * @param array $reference Parsed method reference array.
+ *
+ * @return \PDepend\Source\AST\ASTTraitAdaptationAlias
+ * @since 1.0.0
+ */
+ private function parseTraitAdaptationAliasStatement(array $reference)
+ {
+ $stmt = $this->builder->buildAstTraitAdaptationAlias($reference[0]);
+
+ if (2 === count($reference)) {
+ $stmt->addChild($reference[1]);
+ }
+
+ $this->consumeToken(Tokens::T_AS);
+ $this->consumeComments();
+
+ switch ($this->tokenizer->peek()) {
+
+ case Tokens::T_PUBLIC:
+ $stmt->setNewModifier(State::IS_PUBLIC);
+ $this->consumeToken(Tokens::T_PUBLIC);
+ $this->consumeComments();
+ break;
+
+ case Tokens::T_PROTECTED:
+ $stmt->setNewModifier(State::IS_PROTECTED);
+ $this->consumeToken(Tokens::T_PROTECTED);
+ $this->consumeComments();
+ break;
+
+ case Tokens::T_PRIVATE:
+ $stmt->setNewModifier(State::IS_PRIVATE);
+ $this->consumeToken(Tokens::T_PRIVATE);
+ $this->consumeComments();
+ break;
+ }
+
+ if (Tokens::T_SEMICOLON !== $this->tokenizer->peek()) {
+ $stmt->setNewName($this->parseFunctionName());
+ }
+ return $stmt;
+ }
+
+ /**
+ * Parses a trait adaptation precedence statement.
+ *
+ * @param array $reference Parsed method reference array.
+ * @return \PDepend\Source\AST\ASTTraitAdaptationPrecedence
+ * @throws \PDepend\Source\Parser\InvalidStateException
+ * @since 1.0.0
+ */
+ private function parseTraitAdaptationPrecedenceStatement(array $reference)
+ {
+ if (count($reference) < 2) {
+ throw new InvalidStateException(
+ $this->tokenizer->next()->startLine,
+ $this->compilationUnit->getFileName(),
+ 'Expecting full qualified trait method name.'
+ );
+ }
+
+ $stmt = $this->builder->buildAstTraitAdaptationPrecedence($reference[0]);
+ $stmt->addChild($reference[1]);
+
+ $this->consumeToken(Tokens::T_INSTEADOF);
+ $this->consumeComments();
+
+ $stmt->addChild($this->parseTraitReference());
+
+ $this->consumeComments();
+ while (Tokens::T_COMMA === $this->tokenizer->peek()) {
+ $this->consumeToken(Tokens::T_COMMA);
+ $stmt->addChild($this->parseTraitReference());
+ $this->consumeComments();
+ }
+
+ return $stmt;
+ }
+
+ /**
+ * Parses an allocation expression.
+ *
+ *
+ * function foo()
+ * {
+ * // -------------
+ * new bar\Baz();
+ * // -------------
+ *
+ * // ---------
+ * new Foo();
+ * // ---------
+ * }
+ *
+ *
+ * @return \PDepend\Source\AST\ASTAllocationExpression
+ * @since 0.9.6
+ */
+ private function parseAllocationExpression()
+ {
+ $this->tokenStack->push();
+
+ $token = $this->consumeToken(Tokens::T_NEW);
+
+ $allocation = $this->builder->buildAstAllocationExpression($token->image);
+ $allocation = $this->parseExpressionTypeReference($allocation, true);
+
+ if ($this->isNextTokenArguments()) {
+ $allocation->addChild($this->parseArguments());
+ }
+ return $this->setNodePositionsAndReturn($allocation);
+ }
+
+ /**
+ * Parses a eval-expression node.
+ *
+ * @return \PDepend\Source\AST\ASTEvalExpression
+ * @since 0.9.12
+ */
+ private function parseEvalExpression()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_EVAL);
+
+ $expr = $this->builder->buildAstEvalExpression($token->image);
+ $expr->addChild($this->parseParenthesisExpression());
+
+ return $this->setNodePositionsAndReturn($expr);
+ }
+
+ /**
+ * This method parses an exit-expression.
+ *
+ * @return \PDepend\Source\AST\ASTExitExpression
+ * @since 0.9.12
+ */
+ private function parseExitExpression()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_EXIT);
+
+ $expr = $this->builder->buildAstExitExpression($token->image);
+
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_PARENTHESIS_OPEN) {
+ $expr->addChild($this->parseParenthesisExpression());
+ }
+ return $this->setNodePositionsAndReturn($expr);
+ }
+
+ /**
+ * Parses a clone-expression node.
+ *
+ * @return \PDepend\Source\AST\ASTCloneExpression
+ * @since 0.9.12
+ */
+ private function parseCloneExpression()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_CLONE);
+
+ $expr = $this->builder->buildAstCloneExpression($token->image);
+ $expr->addChild($this->parseExpression());
+
+ return $this->setNodePositionsAndReturn($expr);
+ }
+
+ /**
+ * This method parses a single list-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTListExpression
+ * @since 0.9.12
+ */
+ private function parseListExpression()
+ {
+ $this->tokenStack->push();
+
+ $token = $this->consumeToken(Tokens::T_LIST);
+ $this->consumeComments();
+
+ $list = $this->builder->buildAstListExpression($token->image);
+
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+ $this->consumeComments();
+
+ while (($tokenType = $this->tokenizer->peek()) !== Tokenizer::T_EOF) {
+
+ // The variable is optional:
+ // list(, , , , $something) = ...;
+ // is valid.
+ switch ($tokenType) {
+
+ case Tokens::T_COMMA:
+ $this->consumeToken(Tokens::T_COMMA);
+ $this->consumeComments();
+ break;
+
+ case Tokens::T_PARENTHESIS_CLOSE:
+ break 2;
+
+ case Tokens::T_LIST:
+ $list->addChild($this->parseListExpression());
+ $this->consumeComments();
+ break;
+
+ default:
+ $list->addChild($this->parseVariableOrConstantOrPrimaryPrefix());
+ $this->consumeComments();
+ break;
+ }
+ }
+
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+
+ return $this->setNodePositionsAndReturn($list);
+ }
+
+ /**
+ * Parses a include-expression node.
+ *
+ * @return \PDepend\Source\AST\ASTIncludeExpression
+ * @since 0.9.12
+ */
+ private function parseIncludeExpression()
+ {
+ $expr = $this->builder->buildAstIncludeExpression();
+
+ return $this->parseRequireOrIncludeExpression($expr, Tokens::T_INCLUDE);
+ }
+
+ /**
+ * Parses a include_once-expression node.
+ *
+ * @return \PDepend\Source\AST\ASTIncludeExpression
+ * @since 0.9.12
+ */
+ private function parseIncludeOnceExpression()
+ {
+ $expr = $this->builder->buildAstIncludeExpression();
+ $expr->setOnce();
+
+ return $this->parseRequireOrIncludeExpression($expr, Tokens::T_INCLUDE_ONCE);
+ }
+
+ /**
+ * Parses a require-expression node.
+ *
+ * @return \PDepend\Source\AST\ASTRequireExpression
+ * @since 0.9.12
+ */
+ private function parseRequireExpression()
+ {
+ $expr = $this->builder->buildAstRequireExpression();
+
+ return $this->parseRequireOrIncludeExpression($expr, Tokens::T_REQUIRE);
+ }
+
+ /**
+ * Parses a require_once-expression node.
+ *
+ * @return \PDepend\Source\AST\ASTRequireExpression
+ * @since 0.9.12
+ */
+ private function parseRequireOnceExpression()
+ {
+ $expr = $this->builder->buildAstRequireExpression();
+ $expr->setOnce();
+
+ return $this->parseRequireOrIncludeExpression($expr, Tokens::T_REQUIRE_ONCE);
+ }
+
+ /**
+ * Parses a require_once-, require-, include_once- or
+ * include-expression node.
+ *
+ * @param \PDepend\Source\AST\ASTExpression $expr
+ * @param integer $type
+ * @return \PDepend\Source\AST\ASTExpression
+ * @since 0.9.12
+ */
+ private function parseRequireOrIncludeExpression(ASTExpression $expr, $type)
+ {
+ $this->tokenStack->push();
+
+ $this->consumeToken($type);
+ $this->consumeComments();
+
+ if ($this->tokenizer->peek() === Tokens::T_PARENTHESIS_OPEN) {
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+ $expr->addChild($this->parseOptionalExpression());
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+ } else {
+ $expr->addChild($this->parseOptionalExpression());
+ }
+
+ return $this->setNodePositionsAndReturn($expr);
+ }
+
+ /**
+ * Parses a cast-expression node.
+ *
+ * @return \PDepend\Source\AST\ASTCaseExpression
+ * @since 0.10.0
+ */
+ private function parseCastExpression()
+ {
+ $token = $this->consumeToken($this->tokenizer->peek());
+
+ $expr = $this->builder->buildAstCastExpression($token->image);
+ $expr->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $expr;
+ }
+
+ /**
+ * This method will parse an increment-expression. Depending on the previous
+ * node this can be a {@link \PDepend\Source\AST\ASTPostIncrementExpression} or
+ * {@link \PDepend\Source\AST\ASTPostfixExpression}.
+ *
+ * @param array &$expressions List of previous parsed expression nodes.
+ * @return \PDepend\Source\AST\ASTExpression
+ * @since 0.10.0
+ */
+ private function parseIncrementExpression(array &$expressions)
+ {
+ if ($this->isReadWriteVariable(end($expressions))) {
+ return $this->parsePostIncrementExpression(array_pop($expressions));
+ }
+ return $this->parsePreIncrementExpression();
+ }
+
+ /**
+ * Parses a post increment-expression and adds the given child to that node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $child The child expression node.
+ *
+ * @return \PDepend\Source\AST\ASTPostfixExpression
+ * @since 0.10.0
+ */
+ private function parsePostIncrementExpression(ASTNode $child)
+ {
+ $token = $this->consumeToken(Tokens::T_INC);
+
+ $expr = $this->builder->buildAstPostfixExpression($token->image);
+ $expr->addChild($child);
+ $expr->configureLinesAndColumns(
+ $child->getStartLine(),
+ $token->endLine,
+ $child->getStartColumn(),
+ $token->endColumn
+ );
+
+ return $expr;
+ }
+
+ /**
+ * Parses a pre increment-expression and adds the given child to that node.
+ *
+ * @return \PDepend\Source\AST\ASTPreIncrementExpression
+ * @since 0.10.0
+ */
+ private function parsePreIncrementExpression()
+ {
+ $token = $this->consumeToken(Tokens::T_INC);
+
+ $expr = $this->builder->buildAstPreIncrementExpression();
+ $expr->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $expr;
+ }
+
+ /**
+ * This method will parse an decrement-expression. Depending on the previous
+ * node this can be a {@link \PDepend\Source\AST\ASTPostDecrementExpression} or
+ * {@link \PDepend\Source\AST\ASTPostfixExpression}.
+ *
+ * @param array &$expressions List of previous parsed expression nodes.
+ *
+ * @return \PDepend\Source\AST\ASTExpression
+ * @since 0.10.0
+ */
+ private function parseDecrementExpression(array &$expressions)
+ {
+ if ($this->isReadWriteVariable(end($expressions))) {
+ return $this->parsePostDecrementExpression(array_pop($expressions));
+ }
+ return $this->parsePreDecrementExpression();
+ }
+
+ /**
+ * Parses a post decrement-expression and adds the given child to that node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $child The child expression node.
+ *
+ * @return \PDepend\Source\AST\ASTPostfixExpression
+ * @since 0.10.0
+ */
+ private function parsePostDecrementExpression(ASTNode $child)
+ {
+ $token = $this->consumeToken(Tokens::T_DEC);
+
+ $expr = $this->builder->buildAstPostfixExpression($token->image);
+ $expr->addChild($child);
+ $expr->configureLinesAndColumns(
+ $child->getStartLine(),
+ $token->endLine,
+ $child->getStartColumn(),
+ $token->endColumn
+ );
+
+ return $expr;
+ }
+
+ /**
+ * Parses a pre decrement-expression and adds the given child to that node.
+ *
+ * @return \PDepend\Source\AST\ASTPreDecrementExpression
+ * @since 0.10.0
+ */
+ private function parsePreDecrementExpression()
+ {
+ $token = $this->consumeToken(Tokens::T_DEC);
+
+ $expr = $this->builder->buildAstPreDecrementExpression();
+ $expr->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $expr;
+ }
+
+ /**
+ * Parses one or more optional php array or string expressions.
+ *
+ *
+ * ---------
+ * $array[0];
+ * ---------
+ *
+ * ----------------
+ * $array[1]['foo'];
+ * ----------------
+ *
+ * ----------------
+ * $string{1}[0]{0};
+ * ----------------
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The parent/context node instance.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 0.9.12
+ */
+ protected function parseOptionalIndexExpression(ASTNode $node)
+ {
+ $this->consumeComments();
+
+ switch ($this->tokenizer->peek()) {
+
+ case Tokens::T_CURLY_BRACE_OPEN:
+ return $this->parseStringIndexExpression($node);
+
+ case Tokens::T_SQUARED_BRACKET_OPEN:
+ return $this->parseArrayIndexExpression($node);
+ }
+
+ return $node;
+ }
+
+ /**
+ * Parses an index expression as it is valid to access elements in a php
+ * string or array.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The context source node.
+ * @param \PDepend\Source\AST\ASTExpression $expr The concrete index expression.
+ * @param integer $open The open token type.
+ * @param integer $close The close token type.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 0.9.12
+ */
+ private function parseIndexExpression(
+ \PDepend\Source\AST\ASTNode $node,
+ \PDepend\Source\AST\ASTExpression $expr,
+ $open,
+ $close
+ ) {
+ $this->consumeToken($open);
+
+ if (($child = $this->parseOptionalExpression()) != null) {
+ $expr->addChild($child);
+ }
+
+ $token = $this->consumeToken($close);
+
+ $expr->configureLinesAndColumns(
+ $node->getStartLine(),
+ $token->endLine,
+ $node->getStartColumn(),
+ $token->endColumn
+ );
+
+ return $this->parseOptionalIndexExpression($expr);
+ }
+
+ /**
+ * Parses a mandatory array index expression.
+ *
+ *
+ * // ---
+ * $array[0];
+ * // ---
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The context source node.
+ *
+ * @return \PDepend\Source\AST\ASTArrayIndexExpression
+ * @since 0.9.12
+ */
+ private function parseArrayIndexExpression(ASTNode $node)
+ {
+ $expr = $this->builder->buildAstArrayIndexExpression();
+ $expr->addChild($node);
+
+ return $this->parseIndexExpression(
+ $node,
+ $expr,
+ Tokens::T_SQUARED_BRACKET_OPEN,
+ Tokens::T_SQUARED_BRACKET_CLOSE
+ );
+ }
+
+ /**
+ * Parses a mandatory array index expression.
+ *
+ *
+ * // ---
+ * $string{0};
+ * // ---
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The context source node.
+ *
+ * @return \PDepend\Source\AST\ASTStringIndexExpression
+ * @since 0.9.12
+ */
+ private function parseStringIndexExpression(ASTNode $node)
+ {
+ $expr = $this->builder->buildAstStringIndexExpression();
+ $expr->addChild($node);
+
+ return $this->parseIndexExpression(
+ $node,
+ $expr,
+ Tokens::T_CURLY_BRACE_OPEN,
+ Tokens::T_CURLY_BRACE_CLOSE
+ );
+ }
+
+ /**
+ * This method checks if the next available token starts an arguments node.
+ *
+ * @return boolean
+ * @since 0.9.8
+ */
+ private function isNextTokenArguments()
+ {
+ $this->consumeComments();
+ return $this->tokenizer->peek() === Tokens::T_PARENTHESIS_OPEN;
+ }
+
+ /**
+ * This method configures the given node with its start and end positions.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The node to prepare.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 0.9.8
+ */
+ private function setNodePositionsAndReturn(ASTNode $node)
+ {
+ $tokens = $this->stripTrailingComments($this->tokenStack->pop());
+
+ $end = $tokens[count($tokens) - 1];
+ $start = $tokens[0];
+
+ $node->configureLinesAndColumns(
+ $start->startLine,
+ $end->endLine,
+ $start->startColumn,
+ $end->endColumn
+ );
+
+ return $node;
+ }
+
+ /**
+ * Strips all trailing comments from the given token stream.
+ *
+ * @param Token[] $tokens Original token stream.
+ * @return Token[]
+ * @since 1.0.0
+ */
+ private function stripTrailingComments(array $tokens)
+ {
+ $comments = array(Tokens::T_COMMENT, Tokens::T_DOC_COMMENT);
+
+ while (count($tokens) > 1 && in_array(end($tokens)->type, $comments)) {
+ array_pop($tokens);
+ }
+ return $tokens;
+ }
+
+ /**
+ * This method parse an instance of expression with its associated class or
+ * interface reference.
+ *
+ *
+ * ----------------
+ * ($object instanceof Clazz);
+ * ----------------
+ *
+ * ------------------------
+ * ($object instanceof Clazz::$clazz);
+ * ------------------------
+ *
+ * -----------------
+ * ($object instanceof $clazz);
+ * -----------------
+ *
+ * -----------------------
+ * ($object instanceof $clazz->type);
+ * -----------------------
+ *
+ * -----------------------------
+ * ($object instanceof static|self|parent);
+ * -----------------------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTInstanceOfExpression
+ * @since 0.9.6
+ */
+ private function parseInstanceOfExpression()
+ {
+ // Consume the "instanceof" keyword and strip comments
+ $token = $this->consumeToken(Tokens::T_INSTANCEOF);
+
+ return $this->parseExpressionTypeReference(
+ $this->builder->buildAstInstanceOfExpression($token->image),
+ false
+ );
+ }
+
+ /**
+ * Parses an isset-expression node.
+ *
+ *
+ * // -----------
+ * if (isset($foo)) {
+ * // -----------
+ * }
+ *
+ * // -----------------------
+ * if (isset($foo, $bar, $baz)) {
+ * // -----------------------
+ * }
+ *
+ *
+ * @return \PDepend\Source\AST\ASTIssetExpression
+ * @since 0.9.12
+ */
+ private function parseIssetExpression()
+ {
+ $startToken = $this->consumeToken(Tokens::T_ISSET);
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+
+ $expr = $this->builder->buildAstIssetExpression();
+ $expr = $this->parseVariableList($expr);
+
+ $stopToken = $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+
+ $expr->configureLinesAndColumns(
+ $startToken->startLine,
+ $stopToken->endLine,
+ $startToken->startColumn,
+ $stopToken->endColumn
+ );
+
+ return $expr;
+ }
+
+ /**
+ * This method parses a type identifier as it is used in expression nodes
+ * like {@link \PDepend\Source\AST\ASTInstanceOfExpression} or an object
+ * allocation node like {@link \PDepend\Source\AST\ASTAllocationExpression}.
+ *
+ * @param \PDepend\Source\AST\ASTNode $expr
+ * @param boolean $classRef
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ */
+ private function parseExpressionTypeReference(ASTNode $expr, $classRef)
+ {
+ // Peek next token and look for a static type identifier
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ switch ($tokenType) {
+
+ case Tokens::T_DOLLAR:
+ case Tokens::T_VARIABLE:
+ // TODO: Parse variable or Member Primary Prefix + Property Postfix
+ $ref = $this->parseVariableOrFunctionPostfixOrMemberPrimaryPrefix();
+ break;
+
+ case Tokens::T_SELF:
+ $ref = $this->parseSelfReference($this->consumeToken(Tokens::T_SELF));
+ break;
+
+ case Tokens::T_PARENT:
+ $ref = $this->parseParentReference($this->consumeToken(Tokens::T_PARENT));
+ break;
+
+ case Tokens::T_STATIC:
+ $ref = $this->parseStaticReference($this->consumeToken(Tokens::T_STATIC));
+ break;
+
+ default:
+ $ref = $this->parseClassOrInterfaceReference($classRef);
+ break;
+ }
+
+ $expr->addChild(
+ $this->parseOptionalMemberPrimaryPrefix(
+ $this->parseOptionalStaticMemberPrimaryPrefix($ref)
+ )
+ );
+
+ return $expr;
+ }
+
+ /**
+ * This method parses a conditional-expression.
+ *
+ *
+ * --------------
+ * $foo = ($bar ? 42 : 23);
+ * --------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTConditionalExpression
+ * @since 0.9.8
+ */
+ private function parseConditionalExpression()
+ {
+ $this->tokenStack->push();
+ $this->consumeToken(Tokens::T_QUESTION_MARK);
+
+ $expr = $this->builder->buildAstConditionalExpression();
+ if (($child = $this->parseOptionalExpression()) != null) {
+ $expr->addChild($child);
+ }
+
+ $this->consumeToken(Tokens::T_COLON);
+
+ $expr->addChild($this->parseExpression());
+
+ return $this->setNodePositionsAndReturn($expr);
+ }
+
+ /**
+ * This method parses a shift left expression node.
+ *
+ * @return \PDepend\Source\AST\ASTShiftLeftExpression
+ * @since 1.0.1
+ */
+ private function parseShiftLeftExpression()
+ {
+ $token = $this->consumeToken(Tokens::T_SL);
+
+ $expr = $this->builder->buildAstShiftLeftExpression();
+ $expr->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+ return $expr;
+ }
+
+ /**
+ * This method parses a shift right expression node.
+ *
+ * @return \PDepend\Source\AST\ASTShiftRightExpression
+ * @since 1.0.1
+ */
+ private function parseShiftRightExpression()
+ {
+ $token = $this->consumeToken(Tokens::T_SR);
+
+ $expr = $this->builder->buildAstShiftRightExpression();
+ $expr->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+ return $expr;
+ }
+
+ /**
+ * This method parses a boolean and-expression.
+ *
+ * @return \PDepend\Source\AST\ASTBooleanAndExpression
+ * @since 0.9.8
+ */
+ private function parseBooleanAndExpression()
+ {
+ $token = $this->consumeToken(Tokens::T_BOOLEAN_AND);
+
+ $expr = $this->builder->buildAstBooleanAndExpression();
+ $expr->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+ return $expr;
+ }
+
+ /**
+ * This method parses a boolean or-expression.
+ *
+ * @return \PDepend\Source\AST\ASTBooleanOrExpression
+ * @since 0.9.8
+ */
+ private function parseBooleanOrExpression()
+ {
+ $token = $this->consumeToken(Tokens::T_BOOLEAN_OR);
+
+ $expr = $this->builder->buildAstBooleanOrExpression();
+ $expr->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+ return $expr;
+ }
+
+ /**
+ * This method parses a logical and-expression.
+ *
+ * @return \PDepend\Source\AST\ASTLogicalAndExpression
+ * @since 0.9.8
+ */
+ private function parseLogicalAndExpression()
+ {
+ $token = $this->consumeToken(Tokens::T_LOGICAL_AND);
+
+ $expr = $this->builder->buildAstLogicalAndExpression();
+ $expr->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+ return $expr;
+ }
+
+ /**
+ * This method parses a logical or-expression.
+ *
+ * @return \PDepend\Source\AST\ASTLogicalOrExpression
+ * @since 0.9.8
+ */
+ private function parseLogicalOrExpression()
+ {
+ $token = $this->consumeToken(Tokens::T_LOGICAL_OR);
+
+ $expr = $this->builder->buildAstLogicalOrExpression();
+ $expr->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+ return $expr;
+ }
+
+ /**
+ * This method parses a logical xor-expression.
+ *
+ * @return \PDepend\Source\AST\ASTLogicalXorExpression
+ * @since 0.9.8
+ */
+ private function parseLogicalXorExpression()
+ {
+ $token = $this->consumeToken(Tokens::T_LOGICAL_XOR);
+
+ $expr = $this->builder->buildAstLogicalXorExpression();
+ $expr->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+ return $expr;
+ }
+
+ /**
+ * Parses a class or interface reference node.
+ *
+ * @param boolean $classReference Force a class reference.
+ *
+ * @return \PDepend\Source\AST\ASTClassOrInterfaceReference
+ * @since 0.9.8
+ */
+ private function parseClassOrInterfaceReference($classReference)
+ {
+ $this->tokenStack->push();
+
+ if ($classReference === true) {
+ return $this->setNodePositionsAndReturn(
+ $this->builder->buildAstClassReference(
+ $this->parseQualifiedName()
+ )
+ );
+ }
+ return $this->setNodePositionsAndReturn(
+ $this->builder->buildAstClassOrInterfaceReference(
+ $this->parseQualifiedName()
+ )
+ );
+ }
+
+ /**
+ * This method parses a brace expression and adds all parsed node instances
+ * to the given {@link \PDepend\Source\AST\ASTNode} object. Finally it returns
+ * the prepared input node.
+ *
+ * A brace expression can be a compound:
+ *
+ *
+ * $this->{$foo ? 'foo' : 'bar'}();
+ *
+ *
+ * or a parameter list:
+ *
+ *
+ * $this->foo($bar, $baz);
+ *
+ *
+ * or an array index:
+ *
+ *
+ * $foo[$bar];
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node
+ * @param \PDepend\Source\Tokenizer\Token $start
+ * @param integer $closeToken
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\TokenStreamEndException
+ * @since 0.9.6
+ */
+ private function parseBraceExpression(
+ ASTNode $node,
+ Token $start,
+ $closeToken
+ ) {
+ if (is_object($expr = $this->parseOptionalExpression())) {
+ $node->addChild($expr);
+ }
+
+ $end = $this->consumeToken($closeToken);
+
+ $node->configureLinesAndColumns(
+ $start->startLine,
+ $end->endLine,
+ $start->startColumn,
+ $end->endColumn
+ );
+ return $node;
+ }
+
+ /**
+ * Parses the body of the given statement instance and adds all parsed nodes
+ * to that statement.
+ *
+ * @param \PDepend\Source\AST\ASTStatement $stmt The owning statement.
+ *
+ * @return \PDepend\Source\AST\ASTStatement
+ * @since 0.9.12
+ */
+ private function parseStatementBody(\PDepend\Source\AST\ASTStatement $stmt)
+ {
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ if ($tokenType === Tokens::T_CURLY_BRACE_OPEN) {
+ $stmt->addChild($this->parseRegularScope());
+ } elseif ($tokenType === Tokens::T_COLON) {
+ $stmt->addChild($this->parseAlternativeScope());
+ } else {
+ $stmt->addChild($this->parseStatement());
+ }
+ return $stmt;
+ }
+
+ /**
+ * Parse a scope enclosed by curly braces.
+ *
+ * @return \PDepend\Source\AST\ASTScope
+ * @since 0.9.12
+ */
+ private function parseRegularScope()
+ {
+ $this->tokenStack->push();
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
+
+ $scope = $this->parseScopeStatements();
+
+ $this->consumeToken(Tokens::T_CURLY_BRACE_CLOSE);
+ return $this->setNodePositionsAndReturn($scope);
+ }
+
+ /**
+ * Parses the scope of a statement that is surrounded with PHP's alternative
+ * syntax for statements.
+ *
+ * @return \PDepend\Source\AST\ASTScopeStatement
+ * @since 0.10.0
+ */
+ private function parseAlternativeScope()
+ {
+ $this->tokenStack->push();
+ $this->consumeToken(Tokens::T_COLON);
+
+ $scope = $this->parseScopeStatements();
+
+ $this->parseOptionalAlternativeScopeTermination();
+ return $this->setNodePositionsAndReturn($scope);
+ }
+
+ /**
+ * Parses all statements that exist in a scope an adds them to a scope
+ * instance.
+ *
+ * @return \PDepend\Source\AST\ASTScopeStatement
+ * @since 0.10.0
+ */
+ private function parseScopeStatements()
+ {
+ $scope = $this->builder->buildAstScopeStatement();
+ while (($child = $this->parseOptionalStatement()) != null) {
+ if ($child instanceof \PDepend\Source\AST\ASTNode) {
+ $scope->addChild($child);
+ }
+ }
+ return $scope;
+ }
+
+ /**
+ * Parses the termination of a scope statement that uses PHP's laternative
+ * syntax format.
+ *
+ * @return void
+ * @since 0.10.0
+ */
+ private function parseOptionalAlternativeScopeTermination()
+ {
+ $tokenType = $this->tokenizer->peek();
+ if ($this->isAlternativeScopeTermination($tokenType)) {
+ $this->parseAlternativeScopeTermination($tokenType);
+ }
+ }
+
+
+ /**
+ * This method returns true when the given token identifier represents
+ * the end token of a alternative scope termination symbol. Otherwise this
+ * method will return false.
+ *
+ * @param integer $tokenType The token type identifier.
+ *
+ * @return boolean
+ * @since 0.10.0
+ */
+ private function isAlternativeScopeTermination($tokenType)
+ {
+ return in_array(
+ $tokenType,
+ array(
+ Tokens::T_ENDDECLARE,
+ Tokens::T_ENDFOR,
+ Tokens::T_ENDFOREACH,
+ Tokens::T_ENDIF,
+ Tokens::T_ENDSWITCH,
+ Tokens::T_ENDWHILE
+ )
+ );
+ }
+
+ /**
+ * Parses a series of tokens that represent an alternative scope termination.
+ *
+ * @param integer $tokenType The token type identifier.
+ *
+ * @return void
+ * @since 0.10.0
+ */
+ private function parseAlternativeScopeTermination($tokenType)
+ {
+ $this->consumeToken($tokenType);
+ $this->consumeComments();
+
+ if ($this->tokenizer->peek() === Tokens::T_SEMICOLON) {
+ $this->consumeToken(Tokens::T_SEMICOLON);
+ } else {
+ $this->parseNonePhpCode();
+ }
+ }
+
+ /**
+ * This method parses multiple expressions and adds them as children to the
+ * given $exprList node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $exprList Parent that accepts multiple expr.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 1.0.0
+ */
+ private function parseExpressionList(\PDepend\Source\AST\ASTNode $exprList)
+ {
+ $this->consumeComments();
+ while ($expr = $this->parseOptionalExpression()) {
+ $exprList->addChild($expr);
+
+ $this->consumeComments();
+ if (Tokens::T_COMMA === $this->tokenizer->peek()) {
+ $this->consumeToken(Tokens::T_COMMA);
+ $this->consumeComments();
+ } else {
+ break;
+ }
+ }
+
+ return $exprList;
+ }
+
+ /**
+ * This method parses an expression node and returns it. When no expression
+ * was found this method will throw an InvalidStateException.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 1.0.1
+ */
+ private function parseExpression()
+ {
+ if (null === ($expr = $this->parseOptionalExpression())) {
+ $token = $this->consumeToken($this->tokenizer->peek());
+
+ throw new InvalidStateException(
+ $token->startLine,
+ $this->compilationUnit->getFileName(),
+ 'Mandatory expression expected.'
+ );
+ }
+ return $expr;
+ }
+
+ /**
+ * This method optionally parses an expression node and returns it. When no
+ * expression was found this method will return null.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ private function parseOptionalExpression()
+ {
+ $expressions = array();
+
+ while (($tokenType = $this->tokenizer->peek()) != Tokenizer::T_EOF) {
+
+ $expr = null;
+
+ switch ($tokenType) {
+
+ case Tokens::T_COMMA:
+ case Tokens::T_AS:
+ case Tokens::T_BREAK:
+ case Tokens::T_CLOSE_TAG:
+ case Tokens::T_COLON:
+ case Tokens::T_CONTINUE:
+ case Tokens::T_CURLY_BRACE_CLOSE:
+ case Tokens::T_DECLARE:
+ case Tokens::T_DO:
+ case Tokens::T_DOUBLE_ARROW:
+ case Tokens::T_ECHO:
+ case Tokens::T_END_HEREDOC:
+ case Tokens::T_ENDFOREACH:
+ case Tokens::T_FOR:
+ case Tokens::T_FOREACH:
+ case Tokens::T_GLOBAL:
+ case Tokens::T_GOTO:
+ case Tokens::T_IF:
+ case Tokens::T_PARENTHESIS_CLOSE:
+ case Tokens::T_RETURN:
+ case Tokens::T_SEMICOLON:
+ case Tokens::T_SQUARED_BRACKET_CLOSE:
+ case Tokens::T_SWITCH:
+ case Tokens::T_THROW:
+ case Tokens::T_TRY:
+ case Tokens::T_UNSET:
+ case Tokens::T_WHILE:
+ break 2;
+
+ case Tokens::T_SELF:
+ case Tokens::T_STRING:
+ case Tokens::T_PARENT:
+ case Tokens::T_STATIC:
+ case Tokens::T_DOLLAR:
+ case Tokens::T_VARIABLE:
+ case Tokens::T_BACKSLASH:
+ case Tokens::T_NAMESPACE:
+ $expressions[] = $this->parseVariableOrConstantOrPrimaryPrefix();
+ break;
+
+ case ($this->isArrayStartDelimiter()):
+ $expressions[] = $this->doParseArray();
+ break;
+
+ case Tokens::T_NULL:
+ case Tokens::T_TRUE:
+ case Tokens::T_FALSE:
+ case Tokens::T_LNUMBER:
+ case Tokens::T_DNUMBER:
+ case Tokens::T_BACKTICK:
+ case Tokens::T_DOUBLE_QUOTE:
+ case Tokens::T_CONSTANT_ENCAPSED_STRING:
+ $expressions[] = $this->parseLiteralOrString();
+ break;
+
+ case Tokens::T_NEW:
+ $expressions[] = $this->parseAllocationExpression();
+ break;
+
+ case Tokens::T_EVAL:
+ $expressions[] = $this->parseEvalExpression();
+ break;
+
+ case Tokens::T_CLONE:
+ $expressions[] = $this->parseCloneExpression();
+ break;
+
+ case Tokens::T_INSTANCEOF:
+ $expressions[] = $this->parseInstanceOfExpression();
+ break;
+
+ case Tokens::T_ISSET:
+ $expressions[] = $this->parseIssetExpression();
+ break;
+
+ case Tokens::T_LIST:
+ $expressions[] = $this->parseListExpression();
+ break;
+
+ case Tokens::T_QUESTION_MARK:
+ $expressions[] = $this->parseConditionalExpression();
+ break;
+
+ case Tokens::T_BOOLEAN_AND:
+ $expressions[] = $this->parseBooleanAndExpression();
+ break;
+
+ case Tokens::T_BOOLEAN_OR:
+ $expressions[] = $this->parseBooleanOrExpression();
+ break;
+
+ case Tokens::T_LOGICAL_AND:
+ $expressions[] = $this->parseLogicalAndExpression();
+ break;
+
+ case Tokens::T_LOGICAL_OR:
+ $expressions[] = $this->parseLogicalOrExpression();
+ break;
+
+ case Tokens::T_LOGICAL_XOR:
+ $expressions[] = $this->parseLogicalXorExpression();
+ break;
+
+ case Tokens::T_FUNCTION:
+ $expressions[] = $this->parseClosureDeclaration();
+ break;
+
+ case Tokens::T_PARENTHESIS_OPEN:
+ $expressions[] = $this->parseParenthesisExpressionOrPrimaryPrefix();
+ break;
+
+ case Tokens::T_EXIT:
+ $expressions[] = $this->parseExitExpression();
+ break;
+
+ case Tokens::T_START_HEREDOC:
+ $expressions[] = $this->parseHeredoc();
+ break;
+
+ case Tokens::T_CURLY_BRACE_OPEN:
+ $expressions[] = $this->parseBraceExpression(
+ $this->builder->buildAstExpression(),
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN),
+ Tokens::T_CURLY_BRACE_CLOSE
+ );
+ break;
+
+ case Tokens::T_INCLUDE:
+ $expressions[] = $this->parseIncludeExpression();
+ break;
+
+ case Tokens::T_INCLUDE_ONCE:
+ $expressions[] = $this->parseIncludeOnceExpression();
+ break;
+
+ case Tokens::T_REQUIRE:
+ $expressions[] = $this->parseRequireExpression();
+ break;
+
+ case Tokens::T_REQUIRE_ONCE:
+ $expressions[] = $this->parseRequireOnceExpression();
+ break;
+
+ case Tokens::T_DEC:
+ $expressions[] = $this->parseDecrementExpression($expressions);
+ break;
+
+ case Tokens::T_INC:
+ $expressions[] = $this->parseIncrementExpression($expressions);
+ break;
+
+ case Tokens::T_SL:
+ $expressions[] = $this->parseShiftLeftExpression();
+ break;
+
+ case Tokens::T_SR:
+ $expressions[] = $this->parseShiftRightExpression();
+ break;
+
+ case Tokens::T_DIR:
+ case Tokens::T_FILE:
+ case Tokens::T_LINE:
+ case Tokens::T_NS_C:
+ case Tokens::T_FUNC_C:
+ case Tokens::T_CLASS_C:
+ case Tokens::T_METHOD_C:
+ $expressions[] = $this->parseConstant();
+ break;
+
+ case Tokens::T_INT_CAST:
+ case Tokens::T_BOOL_CAST:
+ case Tokens::T_ARRAY_CAST:
+ case Tokens::T_UNSET_CAST:
+ case Tokens::T_OBJECT_CAST:
+ case Tokens::T_DOUBLE_CAST:
+ case Tokens::T_STRING_CAST:
+ $expressions[] = $this->parseCastExpression();
+ break;
+
+ case Tokens::T_EQUAL:
+ case Tokens::T_OR_EQUAL:
+ case Tokens::T_SL_EQUAL:
+ case Tokens::T_SR_EQUAL:
+ case Tokens::T_AND_EQUAL:
+ case Tokens::T_DIV_EQUAL:
+ case Tokens::T_MOD_EQUAL:
+ case Tokens::T_MUL_EQUAL:
+ case Tokens::T_XOR_EQUAL:
+ case Tokens::T_PLUS_EQUAL:
+ case Tokens::T_MINUS_EQUAL:
+ case Tokens::T_CONCAT_EQUAL:
+ $expressions[] = $this->parseAssignmentExpression(
+ array_pop($expressions)
+ );
+ break;
+
+ // TODO: Handle comments here
+ case Tokens::T_COMMENT:
+ case Tokens::T_DOC_COMMENT:
+ $this->consumeToken($tokenType);
+ break;
+
+ case Tokens::T_PRINT: // TODO: Implement print expression
+
+ case Tokens::T_STRING_VARNAME: // TODO: Implement this
+
+ case Tokens::T_PLUS: // TODO: Make this a arithmetic expression
+ case Tokens::T_MINUS:
+ case Tokens::T_MUL:
+ case Tokens::T_DIV:
+ case Tokens::T_MOD:
+
+ case Tokens::T_IS_EQUAL: // TODO: Implement compare expressions
+ case Tokens::T_IS_NOT_EQUAL:
+ case Tokens::T_IS_IDENTICAL:
+ case Tokens::T_IS_NOT_IDENTICAL:
+ case Tokens::T_IS_GREATER_OR_EQUAL:
+ case Tokens::T_IS_SMALLER_OR_EQUAL:
+ case Tokens::T_ANGLE_BRACKET_OPEN:
+ case Tokens::T_ANGLE_BRACKET_CLOSE:
+
+ case Tokens::T_EMPTY:
+ case Tokens::T_CONCAT:
+ case Tokens::T_BITWISE_OR:
+ case Tokens::T_BITWISE_AND:
+ case Tokens::T_BITWISE_NOT:
+ case Tokens::T_BITWISE_XOR:
+ $token = $this->consumeToken($tokenType);
+
+ $expr = $this->builder->buildAstExpression();
+ $expr->setImage($token->image);
+ $expr->setStartLine($token->startLine);
+ $expr->setStartColumn($token->startColumn);
+ $expr->setEndLine($token->endLine);
+ $expr->setEndColumn($token->endColumn);
+
+ $expressions[] = $expr;
+ break;
+
+ case Tokens::T_AT:
+ case Tokens::T_EXCLAMATION_MARK:
+ $token = $this->consumeToken($tokenType);
+
+ $expr = $this->builder->buildAstUnaryExpression($token->image);
+ $expr->setStartLine($token->startLine);
+ $expr->setStartColumn($token->startColumn);
+ $expr->setEndLine($token->endLine);
+ $expr->setEndColumn($token->endColumn);
+
+ $expressions[] = $expr;
+ break;
+
+ case Tokens::T_YIELD:
+ $expressions[] = $this->parseYield();
+ break;
+
+ default:
+ throw new UnexpectedTokenException(
+ $this->consumeToken($tokenType),
+ $this->compilationUnit->getFileName()
+ );
+ }
+ }
+
+ $expressions = $this->reduce($expressions);
+
+ $count = count($expressions);
+ if ($count == 0) {
+ return null;
+ } elseif ($count == 1) {
+ return $expressions[0];
+ }
+
+ $expr = $this->builder->buildAstExpression();
+ foreach ($expressions as $node) {
+ $expr->addChild($node);
+ }
+ $expr->configureLinesAndColumns(
+ $expressions[0]->getStartLine(),
+ $expressions[$count - 1]->getEndLine(),
+ $expressions[0]->getStartColumn(),
+ $expressions[$count - 1]->getEndColumn()
+ );
+
+ return $expr;
+ }
+
+ /**
+ * Applies all reduce rules against the given expression list.
+ *
+ * @param \PDepend\Source\AST\ASTExpression[] $expressions Unprepared input
+ * array with parsed expression nodes found in the source tree.
+ *
+ * @return \PDepend\Source\AST\ASTExpression[]
+ * @since 0.10.0
+ */
+ private function reduce(array $expressions)
+ {
+ return $this->reduceUnaryExpression($expressions);
+ }
+
+ /**
+ * Reduces all unary-expressions in the given expression list.
+ *
+ * @param \PDepend\Source\AST\ASTExpression[] $expressions Unprepared input
+ * array with parsed expression nodes found in the source tree.
+ *
+ * @return \PDepend\Source\AST\ASTExpression[]
+ * @since 0.10.0
+ */
+ private function reduceUnaryExpression(array $expressions)
+ {
+ for ($i = count($expressions) - 2; $i >= 0; --$i) {
+ $expr = $expressions[$i];
+ if ($expr instanceof \PDepend\Source\AST\ASTUnaryExpression) {
+ $child = $expressions[$i + 1];
+
+ $expr->addChild($child);
+ $expr->setEndColumn($child->getEndColumn());
+ $expr->setEndLine($child->getEndLine());
+
+ unset($expressions[$i + 1]);
+ }
+ }
+ return array_values($expressions);
+ }
+
+ /**
+ * This method parses a switch statement.
+ *
+ * @return \PDepend\Source\AST\ASTSwitchStatement
+ * @since 0.9.8
+ */
+ private function parseSwitchStatement()
+ {
+ $this->tokenStack->push();
+ $this->consumeToken(Tokens::T_SWITCH);
+
+ $switch = $this->builder->buildAstSwitchStatement();
+ $switch->addChild($this->parseParenthesisExpression());
+ $this->parseSwitchStatementBody($switch);
+
+ return $this->setNodePositionsAndReturn($switch);
+ }
+
+ /**
+ * Parses the body of a switch statement.
+ *
+ * @param \PDepend\Source\AST\ASTSwitchStatement $switch The parent switch stmt.
+ *
+ * @return \PDepend\Source\AST\ASTSwitchStatement
+ * @since 0.9.8
+ */
+ private function parseSwitchStatementBody(ASTSwitchStatement $switch)
+ {
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_CURLY_BRACE_OPEN) {
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
+ } else {
+ $this->consumeToken(Tokens::T_COLON);
+ }
+
+ while (($tokenType = $this->tokenizer->peek()) !== Tokenizer::T_EOF) {
+
+ switch ($tokenType) {
+
+ case Tokens::T_ENDSWITCH:
+ $this->parseAlternativeScopeTermination(Tokens::T_ENDSWITCH);
+ return $switch;
+
+ case Tokens::T_CURLY_BRACE_CLOSE:
+ $this->consumeToken(Tokens::T_CURLY_BRACE_CLOSE);
+ return $switch;
+
+ case Tokens::T_CASE:
+ $switch->addChild($this->parseSwitchLabel());
+ break;
+
+ case Tokens::T_DEFAULT:
+ $switch->addChild($this->parseSwitchLabelDefault());
+ break;
+
+ case Tokens::T_COMMENT:
+ case Tokens::T_DOC_COMMENT:
+ $this->consumeToken($tokenType);
+ break;
+
+ default:
+ break 2;
+ }
+ }
+ throw new UnexpectedTokenException(
+ $this->tokenizer->next(),
+ $this->tokenizer->getSourceFile()
+ );
+ }
+
+ /**
+ * This method parses a case label of a switch statement.
+ *
+ * @return \PDepend\Source\AST\ASTSwitchLabel
+ * @since 0.9.8
+ */
+ private function parseSwitchLabel()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_CASE);
+
+ $label = $this->builder->buildAstSwitchLabel($token->image);
+ $label->addChild($this->parseExpression());
+
+ if ($this->tokenizer->peek() === Tokens::T_COLON) {
+ $this->consumeToken(Tokens::T_COLON);
+ } else {
+ $this->consumeToken(Tokens::T_SEMICOLON);
+ }
+
+ $this->parseSwitchLabelBody($label);
+
+ return $this->setNodePositionsAndReturn($label);
+ }
+
+ /**
+ * This method parses the default label of a switch statement.
+ *
+ * @return \PDepend\Source\AST\ASTSwitchLabel
+ * @since 0.9.8
+ */
+ private function parseSwitchLabelDefault()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_DEFAULT);
+
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_COLON) {
+ $this->consumeToken(Tokens::T_COLON);
+ } else {
+ $this->consumeToken(Tokens::T_SEMICOLON);
+ }
+
+ $label = $this->builder->buildAstSwitchLabel($token->image);
+ $label->setDefault();
+
+ $this->parseSwitchLabelBody($label);
+
+ return $this->setNodePositionsAndReturn($label);
+ }
+
+ /**
+ * Parses the body of an switch label node.
+ *
+ * @param \PDepend\Source\AST\ASTSwitchLabel $label The context switch label.
+ * @return \PDepend\Source\AST\ASTSwitchLabel
+ */
+ private function parseSwitchLabelBody(\PDepend\Source\AST\ASTSwitchLabel $label)
+ {
+ $curlyBraceCount = 0;
+
+ $tokenType = $this->tokenizer->peek();
+ while ($tokenType !== Tokenizer::T_EOF) {
+
+ switch ($tokenType) {
+
+ case Tokens::T_CURLY_BRACE_OPEN:
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
+ ++$curlyBraceCount;
+ break;
+
+ case Tokens::T_CURLY_BRACE_CLOSE:
+ if ($curlyBraceCount === 0) {
+ return $label;
+ }
+ $this->consumeToken(Tokens::T_CURLY_BRACE_CLOSE);
+ --$curlyBraceCount;
+ break;
+
+ case Tokens::T_CASE:
+ case Tokens::T_DEFAULT:
+ case Tokens::T_ENDSWITCH:
+ return $label;
+
+ default:
+ $statement = $this->parseOptionalStatement();
+ if ($statement === null) {
+ $this->consumeToken($tokenType);
+ } elseif ($statement instanceof ASTNode) {
+ $label->addChild($statement);
+ }
+ // TODO: Change the into and when the ast
+ // implementation is finished.
+ break;
+ }
+ $tokenType = $this->tokenizer->peek();
+ }
+ throw new TokenStreamEndException($this->tokenizer);
+ }
+
+ /**
+ * Parses the termination token for a statement. This termination token can
+ * be a semicolon or a closing php tag.
+ *
+ * @return void
+ * @since 0.9.12
+ */
+ private function parseStatementTermination()
+ {
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_SEMICOLON) {
+ $this->consumeToken(Tokens::T_SEMICOLON);
+ } else {
+ $this->parseNonePhpCode();
+ }
+ }
+
+ /**
+ * This method parses a try-statement + associated catch-statements.
+ *
+ * @return \PDepend\Source\AST\ASTTryStatement
+ * @since 0.9.12
+ */
+ private function parseTryStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_TRY);
+
+ $stmt = $this->builder->buildAstTryStatement($token->image);
+ $stmt->addChild($this->parseRegularScope());
+
+ $this->consumeComments();
+
+ if (false === in_array($this->tokenizer->peek(), array(Tokens::T_CATCH, Tokens::T_FINALLY))) {
+ throw new UnexpectedTokenException(
+ $this->tokenizer->next(),
+ $this->tokenizer->getSourceFile()
+ );
+ }
+
+ while ($this->tokenizer->peek() === Tokens::T_CATCH) {
+ $stmt->addChild($this->parseCatchStatement());
+ $this->consumeComments();
+ }
+
+ while ($this->tokenizer->peek() === Tokens::T_FINALLY) {
+ $stmt->addChild($this->parseFinallyStatement());
+ $this->consumeComments();
+ }
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a throw-statement.
+ *
+ * @return \PDepend\Source\AST\ASTThrowStatement
+ * @since 0.9.12
+ */
+ private function parseThrowStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_THROW);
+
+ $stmt = $this->builder->buildAstThrowStatement($token->image);
+ $stmt->addChild($this->parseExpression());
+
+ $this->parseStatementTermination();
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a goto-statement.
+ *
+ * @return \PDepend\Source\AST\ASTGotoStatement
+ * @since 0.9.12
+ */
+ private function parseGotoStatement()
+ {
+ $this->tokenStack->push();
+
+ $this->consumeToken(Tokens::T_GOTO);
+ $this->consumeComments();
+
+ $token = $this->consumeToken(Tokens::T_STRING);
+
+ $this->parseStatementTermination();
+
+ $stmt = $this->builder->buildAstGotoStatement($token->image);
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a label-statement.
+ *
+ * @return \PDepend\Source\AST\ASTLabelStatement
+ * @since 0.9.12
+ */
+ private function parseLabelStatement()
+ {
+ $this->tokenStack->push();
+
+ $token = $this->consumeToken(Tokens::T_STRING);
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_COLON);
+
+ return $this->setNodePositionsAndReturn(
+ $this->builder->buildAstLabelStatement($token->image)
+ );
+ }
+
+ /**
+ * This method parses a global-statement.
+ *
+ * @return \PDepend\Source\AST\ASTGlobalStatement
+ * @since 0.9.12
+ */
+ private function parseGlobalStatement()
+ {
+ $this->tokenStack->push();
+ $this->consumeToken(Tokens::T_GLOBAL);
+
+ $stmt = $this->builder->buildAstGlobalStatement();
+ $stmt = $this->parseVariableList($stmt);
+
+ $this->parseStatementTermination();
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a unset-statement.
+ *
+ * @return \PDepend\Source\AST\ASTUnsetStatement
+ * @since 0.9.12
+ */
+ private function parseUnsetStatement()
+ {
+ $this->tokenStack->push();
+
+ $this->consumeToken(Tokens::T_UNSET);
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+
+ $stmt = $this->builder->buildAstUnsetStatement();
+ $stmt = $this->parseVariableList($stmt);
+
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+
+ $this->parseStatementTermination();
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a catch-statement.
+ *
+ * @return \PDepend\Source\AST\ASTCatchStatement
+ * @since 0.9.8
+ */
+ private function parseCatchStatement()
+ {
+ $this->tokenStack->push();
+ $this->consumeComments();
+
+ $token = $this->consumeToken(Tokens::T_CATCH);
+
+ $catch = $this->builder->buildAstCatchStatement($token->image);
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+
+ $catch->addChild(
+ $this->builder->buildAstClassOrInterfaceReference(
+ $this->parseQualifiedName()
+ )
+ );
+
+ $this->consumeComments();
+ $catch->addChild($this->parseVariable());
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+
+ $catch->addChild($this->parseRegularScope());
+
+ return $this->setNodePositionsAndReturn($catch);
+ }
+
+ /**
+ * This method parses a finally-statement.
+ *
+ * @return \PDepend\Source\AST\ASTFinallyStatement
+ * @since 2.0.0
+ */
+ private function parseFinallyStatement()
+ {
+ $this->tokenStack->push();
+ $this->consumeComments();
+
+ $token = $this->consumeToken(Tokens::T_FINALLY);
+
+ $finally = $this->builder->buildAstFinallyStatement($token->image);
+ $finally->addChild($this->parseRegularScope());
+
+ return $this->setNodePositionsAndReturn($finally);
+ }
+
+ /**
+ * This method parses a single if-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTIfStatement
+ * @since 0.9.8
+ */
+ private function parseIfStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_IF);
+
+ $stmt = $this->builder->buildAstIfStatement($token->image);
+ $stmt->addChild($this->parseParenthesisExpression());
+
+ $this->parseStatementBody($stmt);
+ $this->parseOptionalElseOrElseIfStatement($stmt);
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a single elseif-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTElseIfStatement
+ * @since 0.9.8
+ */
+ private function parseElseIfStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_ELSEIF);
+
+ $stmt = $this->builder->buildAstElseIfStatement($token->image);
+ $stmt->addChild($this->parseParenthesisExpression());
+
+ $this->parseStatementBody($stmt);
+ $this->parseOptionalElseOrElseIfStatement($stmt);
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses an optional else-, else+if- or elseif-statement.
+ *
+ * @param \PDepend\Source\AST\ASTStatement $stmt The owning if/elseif statement.
+ *
+ * @return \PDepend\Source\AST\ASTStatement
+ * @since 0.9.12
+ */
+ private function parseOptionalElseOrElseIfStatement(ASTStatement $stmt)
+ {
+ $this->consumeComments();
+ switch ($this->tokenizer->peek()) {
+
+ case Tokens::T_ELSE:
+ $this->consumeToken(Tokens::T_ELSE);
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_IF) {
+ $stmt->addChild($this->parseIfStatement());
+ } else {
+ $this->parseStatementBody($stmt);
+ }
+ break;
+
+ case Tokens::T_ELSEIF:
+ $stmt->addChild($this->parseElseIfStatement());
+ break;
+ }
+
+ return $stmt;
+ }
+
+ /**
+ * This method parses a single for-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTForStatement
+ * @since 0.9.8
+ */
+ private function parseForStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_FOR);
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+
+ $stmt = $this->builder->buildAstForStatement($token->image);
+
+ if (($init = $this->parseForInit()) !== null) {
+ $stmt->addChild($init);
+ }
+ $this->consumeToken(Tokens::T_SEMICOLON);
+
+ if (($expr = $this->parseForExpression()) !== null) {
+ $stmt->addChild($expr);
+ }
+ $this->consumeToken(Tokens::T_SEMICOLON);
+
+ if (($update = $this->parseForUpdate()) !== null) {
+ $stmt->addChild($update);
+ }
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+
+ return $this->setNodePositionsAndReturn($this->parseStatementBody($stmt));
+ }
+
+ /**
+ * Parses the init part of a for-statement.
+ *
+ *
+ * ------------------------
+ * for ($x = 0, $y = 23, $z = 42; $x < $y; ++$x) {}
+ * ------------------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTForInit
+ * @since 0.9.8
+ */
+ private function parseForInit()
+ {
+ $this->consumeComments();
+ if (Tokens::T_SEMICOLON === $this->tokenizer->peek()) {
+ return null;
+ }
+
+ $this->tokenStack->push();
+
+ $init = $this->builder->buildAstForInit();
+ $this->parseExpressionList($init);
+
+ return $this->setNodePositionsAndReturn($init);
+ }
+
+ /**
+ * Parses the expression part of a for-statement.
+ *
+ * @return \PDepend\Source\AST\ASTExpression
+ * @since 0.9.12
+ */
+ private function parseForExpression()
+ {
+ return $this->parseOptionalExpression();
+ }
+
+ /**
+ * Parses the update part of a for-statement.
+ *
+ *
+ * -------------------------------
+ * for ($x = 0, $y = 23, $z = 42; $x < $y; ++$x, $y = $x + 1, $z = $x + 2) {}
+ * -------------------------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTForUpdate
+ * @since 0.9.12
+ */
+ private function parseForUpdate()
+ {
+ $this->consumeComments();
+ if (Tokens::T_PARENTHESIS_CLOSE === $this->tokenizer->peek()) {
+ return null;
+ }
+
+ $this->tokenStack->push();
+
+ $update = $this->builder->buildAstForUpdate();
+ $this->parseExpressionList($update);
+
+ return $this->setNodePositionsAndReturn($update);
+ }
+
+ /**
+ * This method parses a single foreach-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTForeachStatement
+ * @since 0.9.8
+ */
+ private function parseForeachStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_FOREACH);
+
+ $foreach = $this->builder->buildAstForeachStatement($token->image);
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+
+ $foreach->addChild($this->parseExpression());
+
+ $this->consumeToken(Tokens::T_AS);
+ $this->consumeComments();
+
+ if ($this->tokenizer->peek() === Tokens::T_BITWISE_AND) {
+ $foreach->addChild($this->parseVariableOrMemberByReference());
+ } else {
+ if ($this->tokenizer->peek() == Tokens::T_LIST) {
+ $foreach->addChild($this->parseListExpression());
+ } else {
+ $foreach->addChild($this->parseVariableOrConstantOrPrimaryPrefix());
+
+ if ($this->tokenizer->peek() === Tokens::T_DOUBLE_ARROW) {
+ $this->consumeToken(Tokens::T_DOUBLE_ARROW);
+
+ if ($this->tokenizer->peek() == Tokens::T_LIST) {
+ $foreach->addChild($this->parseListExpression());
+ } else {
+ $foreach->addChild(
+ $this->parseVariableOrMemberOptionalByReference()
+ );
+ }
+ }
+ }
+ }
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+
+ return $this->setNodePositionsAndReturn(
+ $this->parseStatementBody($foreach)
+ );
+ }
+
+ /**
+ * This method parses a single while-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTWhileStatement
+ * @since 0.9.8
+ */
+ private function parseWhileStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_WHILE);
+
+ $stmt = $this->builder->buildAstWhileStatement($token->image);
+ $stmt->addChild($this->parseParenthesisExpression());
+
+ return $this->setNodePositionsAndReturn(
+ $this->parseStatementBody($stmt)
+ );
+ }
+
+ /**
+ * This method parses a do/while-statement.
+ *
+ * @return \PDepend\Source\AST\ASTDoWhileStatement
+ * @sibce 0.9.12
+ */
+ private function parseDoWhileStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_DO);
+
+ $stmt = $this->builder->buildAstDoWhileStatement($token->image);
+ $stmt = $this->parseStatementBody($stmt);
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_WHILE);
+
+ $stmt->addChild($this->parseParenthesisExpression());
+
+ $this->parseStatementTermination();
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a declare-statement.
+ *
+ *
+ * -------------------------------
+ * declare(encoding='ISO-8859-1');
+ * -------------------------------
+ *
+ * -------------------
+ * declare(ticks=42) {
+ * // ...
+ * }
+ * -
+ *
+ * ------------------
+ * declare(ticks=42):
+ * // ...
+ * enddeclare;
+ * -----------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTDeclareStatement
+ * @since 0.10.0
+ */
+ private function parseDeclareStatement()
+ {
+ $this->tokenStack->push();
+ $this->consumeToken(Tokens::T_DECLARE);
+
+ $stmt = $this->builder->buildAstDeclareStatement();
+ $stmt = $this->parseDeclareList($stmt);
+ $stmt = $this->parseStatementBody($stmt);
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a list of declare values. A declare list value always
+ * consists of a string token and a static scalar.
+ *
+ * @param \PDepend\Source\AST\ASTDeclareStatement $stmt The declare statement that
+ * is the owner of this list.
+ *
+ * @return \PDepend\Source\AST\ASTDeclareStatement
+ * @since 0.10.0
+ */
+ private function parseDeclareList(\PDepend\Source\AST\ASTDeclareStatement $stmt)
+ {
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+
+ while (true) {
+ $this->consumeComments();
+ $name = $this->consumeToken(Tokens::T_STRING)->image;
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_EQUAL);
+
+ $this->consumeComments();
+ $value = $this->parseStaticValue();
+
+ $stmt->addValue($name, $value);
+
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_COMMA) {
+ $this->consumeToken(Tokens::T_COMMA);
+ continue;
+ }
+ break;
+ }
+
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+ return $stmt;
+ }
+
+ /**
+ * This method parses a single return-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTReturnStatement
+ * @since 0.9.12
+ */
+ private function parseReturnStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_RETURN);
+
+ $stmt = $this->builder->buildAstReturnStatement($token->image);
+ if (($expr = $this->parseOptionalExpression()) != null) {
+ $stmt->addChild($expr);
+ }
+ $this->parseStatementTermination();
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a break-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTBreakStatement
+ * @since 0.9.12
+ */
+ private function parseBreakStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_BREAK);
+
+ $stmt = $this->builder->buildAstBreakStatement($token->image);
+ if (($expr = $this->parseOptionalExpression()) != null) {
+ $stmt->addChild($expr);
+ }
+ $this->parseStatementTermination();
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a continue-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTContinueStatement
+ * @since 0.9.12
+ */
+ private function parseContinueStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_CONTINUE);
+
+ $stmt = $this->builder->buildAstContinueStatement($token->image);
+ if (($expr = $this->parseOptionalExpression()) != null) {
+ $stmt->addChild($expr);
+ }
+ $this->parseStatementTermination();
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * This method parses a echo-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTEchoStatement
+ * @since 0.9.12
+ */
+ private function parseEchoStatement()
+ {
+ $this->tokenStack->push();
+ $token = $this->consumeToken(Tokens::T_ECHO);
+
+ $stmt = $this->parseExpressionList(
+ $this->builder->buildAstEchoStatement($token->image)
+ );
+
+ $this->parseStatementTermination();
+
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * Parses a simple parenthesis expression or a direct object access, which
+ * was introduced with PHP 5.4.0:
+ *
+ *
+ * (new MyClass())->bar();
+ *
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 1.0.0
+ */
+ private function parseParenthesisExpressionOrPrimaryPrefix()
+ {
+ $expr = $this->parseParenthesisExpression();
+
+ $this->consumeComments();
+ if (Tokens::T_OBJECT_OPERATOR === $this->tokenizer->peek()) {
+ return $this->parseMemberPrimaryPrefix($expr->getChild(0));
+ }
+ return $expr;
+ }
+
+ /**
+ * Parses any expression that is surrounded by an opening and a closing
+ * parenthesis
+ *
+ * @return \PDepend\Source\AST\ASTExpression
+ * @since 0.9.8
+ */
+ private function parseParenthesisExpression()
+ {
+ $this->tokenStack->push();
+ $this->consumeComments();
+
+ $expr = $this->builder->buildAstExpression();
+ $expr = $this->parseBraceExpression(
+ $expr,
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN),
+ Tokens::T_PARENTHESIS_CLOSE
+ );
+
+ return $this->setNodePositionsAndReturn($expr);
+ }
+
+ /**
+ * This method parses a member primary prefix expression or a function
+ * postfix expression node.
+ *
+ * A member primary prefix can be a method call:
+ *
+ *
+ * $object->foo();
+ *
+ * clazz::foo();
+ *
+ *
+ * a property access:
+ *
+ *
+ * $object->foo;
+ *
+ * clazz::$foo;
+ *
+ *
+ * or a class constant access:
+ *
+ *
+ * clazz::FOO;
+ *
+ *
+ * A function postfix represents any kind of function call:
+ *
+ *
+ * $function();
+ *
+ * func();
+ *
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ private function parseMemberPrefixOrFunctionPostfix()
+ {
+ $this->tokenStack->push();
+ $this->tokenStack->push();
+
+ $qName = $this->parseQualifiedName();
+
+ // Remove comments
+ $this->consumeComments();
+
+ // Get next token type
+ $tokenType = $this->tokenizer->peek();
+
+ switch ($tokenType) {
+
+ case Tokens::T_DOUBLE_COLON:
+ $node = $this->builder->buildAstClassOrInterfaceReference($qName);
+ $node = $this->setNodePositionsAndReturn($node);
+ $node = $this->parseStaticMemberPrimaryPrefix($node);
+ break;
+
+ case Tokens::T_PARENTHESIS_OPEN:
+ $node = $this->builder->buildAstIdentifier($qName);
+ $node = $this->setNodePositionsAndReturn($node);
+ $node = $this->parseFunctionPostfix($node);
+ break;
+
+ default:
+ $node = $this->builder->buildAstConstant($qName);
+ $node = $this->setNodePositionsAndReturn($node);
+ break;
+ }
+
+ return $this->setNodePositionsAndReturn($node);
+ }
+
+ /**
+ * This method will parse an optional function postfix.
+ *
+ * If the next available token is an opening parenthesis, this method will
+ * wrap the given $node with a {@link \PDepend\Source\AST\ASTFunctionPostfix}
+ * node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The previously parsed node.
+ *
+ * @return \PDepend\Source\AST\ASTNode The original input node or this node
+ * wrapped with a function postfix instance.
+ * @since 1.0.0
+ */
+ private function parseOptionalFunctionPostfix(ASTNode $node)
+ {
+ $this->consumeComments();
+ if (Tokens::T_PARENTHESIS_OPEN === $this->tokenizer->peek()) {
+ return $this->parseFunctionPostfix($node);
+ }
+ return $node;
+ }
+
+ /**
+ * This method parses a function postfix expression. An object of type
+ * {@link \PDepend\Source\AST\ASTFunctionPostfix} represents any valid php
+ * function call.
+ *
+ * This method will delegate the call to another method that returns a
+ * member primary prefix object when the function postfix expression is
+ * followed by an object operator.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node This node represents the function
+ * identifier. An identifier can be a static string, a variable, a
+ * compound variable or any other valid php function identifier.
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ private function parseFunctionPostfix(ASTNode $node)
+ {
+ $image = $this->extractPostfixImage($node);
+
+ $function = $this->builder->buildAstFunctionPostfix($image);
+ $function->addChild($node);
+ $function->addChild($this->parseArguments());
+
+ return $this->parseOptionalMemberPrimaryPrefix(
+ $this->parseOptionalIndexExpression($function)
+ );
+ }
+
+ /**
+ * This method parses a PHP version specific identifier for method and
+ * property postfix expressions.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 1.0.0
+ */
+ abstract protected function parsePostfixIdentifier();
+
+ /**
+ * This method parses an optional member primary expression. It will parse
+ * the primary expression when an object operator can be found at the actual
+ * token stream position. Otherwise this method simply returns the input
+ * {@link \PDepend\Source\AST\ASTNode} instance.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node This node represents primary prefix
+ * left expression. It will be the first child of the parsed member
+ * primary expression.
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ private function parseOptionalMemberPrimaryPrefix(ASTNode $node)
+ {
+ $this->consumeComments();
+
+ if ($this->tokenizer->peek() === Tokens::T_OBJECT_OPERATOR) {
+ return $this->parseMemberPrimaryPrefix($node);
+ }
+ return $node;
+ }
+
+ /**
+ * This method parses a dynamic or object bound member primary expression.
+ * A member primary prefix can be a method call:
+ *
+ *
+ * $object->foo();
+ *
+ *
+ * or a property access:
+ *
+ *
+ * $object->foo;
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The left node in the parsed member
+ * primary expression.
+ * @return \PDepend\Source\AST\ASTMemberPrimaryPrefix
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ private function parseMemberPrimaryPrefix(ASTNode $node)
+ {
+ // Consume double colon and optional comments
+ $token = $this->consumeToken(Tokens::T_OBJECT_OPERATOR);
+
+ $prefix = $this->builder->buildAstMemberPrimaryPrefix($token->image);
+ $prefix->addChild($node);
+
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ switch ($tokenType) {
+
+ case Tokens::T_STRING:
+ $child = $this->parseIdentifier();
+ $child = $this->parseOptionalIndexExpression($child);
+
+ // TODO: Move this in a separate method
+ if ($child instanceof \PDepend\Source\AST\ASTIndexExpression) {
+ $this->consumeComments();
+ if (Tokens::T_PARENTHESIS_OPEN === $this->tokenizer->peek()) {
+ $prefix->addChild($this->parsePropertyPostfix($child));
+ return $this->parseOptionalFunctionPostfix($prefix);
+ }
+ }
+ break;
+
+ case Tokens::T_CURLY_BRACE_OPEN:
+ $child = $this->parseCompoundExpression();
+ break;
+
+ default:
+ $child = $this->parseCompoundVariableOrVariableVariableOrVariable();
+ break;
+ }
+
+ $prefix->addChild(
+ $this->parseMethodOrPropertyPostfix(
+ $this->parseOptionalIndexExpression($child)
+ )
+ );
+
+ return $this->parseOptionalMemberPrimaryPrefix(
+ $this->parseOptionalIndexExpression($prefix)
+ );
+ }
+
+ /**
+ * This method parses an optional member primary expression. It will parse
+ * the primary expression when a double colon operator can be found at the
+ * actual token stream position. Otherwise this method simply returns the
+ * input {@link \PDepend\Source\AST\ASTNode} instance.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node This node represents primary prefix
+ * left expression. It will be the first child of the parsed member
+ * primary expression.
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 1.0.1
+ */
+ private function parseOptionalStaticMemberPrimaryPrefix(ASTNode $node)
+ {
+ $this->consumeComments();
+
+ if ($this->tokenizer->peek() === Tokens::T_DOUBLE_COLON) {
+ return $this->parseStaticMemberPrimaryPrefix($node);
+ }
+ return $node;
+ }
+
+ /**
+ * This method parses a static member primary expression. The given node
+ * contains the used static class or interface identifier. A static member
+ * primary prefix can represent the following code expressions:
+ *
+ * A static method class:
+ *
+ *
+ * Foo::bar();
+ *
+ *
+ * a static property access:
+ *
+ *
+ * Foo::$bar;
+ *
+ *
+ * or a static constant access:
+ *
+ *
+ * Foo::BAR;
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The left node in the parsed member
+ * primary expression.
+ * @return \PDepend\Source\AST\ASTMemberPrimaryPrefix
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ private function parseStaticMemberPrimaryPrefix(ASTNode $node)
+ {
+ $token = $this->consumeToken(Tokens::T_DOUBLE_COLON);
+
+ $prefix = $this->builder->buildAstMemberPrimaryPrefix($token->image);
+ $prefix->addChild($node);
+
+ $this->consumeComments();
+
+ switch ($this->tokenizer->peek()) {
+
+ case Tokens::T_STRING:
+ $postfix = $this->parseMethodOrConstantPostfix();
+ break;
+
+ case Tokens::T_CLASS_FQN:
+ $postfix = $this->parseFullQualifiedClassNamePostfix();
+ break;
+
+ default:
+ $postfix = $this->parseMethodOrPropertyPostfix(
+ $this->parsePostfixIdentifier()
+ );
+ break;
+ }
+
+ $prefix->addChild($postfix);
+
+ return $this->parseOptionalMemberPrimaryPrefix(
+ $this->parseOptionalIndexExpression($prefix)
+ );
+ }
+
+ /**
+ * This method parses a method- or constant-postfix expression. This expression
+ * will contain an identifier node as nested child.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ private function parseMethodOrConstantPostfix()
+ {
+ $this->tokenStack->push();
+
+ $node = $this->parseIdentifier();
+
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_PARENTHESIS_OPEN) {
+ $postfix = $this->parseMethodPostfix($node);
+ } else {
+ $postfix = $this->builder->buildAstConstantPostfix($node->getImage());
+ $postfix->addChild($node);
+ }
+
+ return $this->setNodePositionsAndReturn($postfix);
+ }
+
+ /**
+ * This method parses a method- or property-postfix expression. This expression
+ * will contain the given node as method or property identifier.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The identifier for the parsed postfix
+ * expression node. This node will be the first child of the returned
+ * postfix node instance.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ private function parseMethodOrPropertyPostfix(ASTNode $node)
+ {
+ // Strip optional comments
+ $this->consumeComments();
+
+ switch ($this->tokenizer->peek()) {
+
+ case Tokens::T_PARENTHESIS_OPEN:
+ $postfix = $this->parseMethodPostfix($node);
+ break;
+
+ default:
+ $postfix = $this->parsePropertyPostfix($node);
+ break;
+ }
+ return $this->parseOptionalMemberPrimaryPrefix($postfix);
+ }
+
+ /**
+ * Parses/Creates a property postfix node instance.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node Node that represents the image of
+ * the property postfix node.
+ *
+ * @return \PDepend\Source\AST\ASTPropertyPostfix
+ * @since 0.10.2
+ */
+ private function parsePropertyPostfix(ASTNode $node)
+ {
+ $image = $this->extractPostfixImage($node);
+
+ $postfix = $this->builder->buildAstPropertyPostfix($image);
+ $postfix->addChild($node);
+
+ $postfix->setEndLine($node->getEndLine());
+ $postfix->setEndColumn($node->getEndColumn());
+ $postfix->setStartLine($node->getStartLine());
+ $postfix->setStartColumn($node->getStartColumn());
+
+ return $postfix;
+ }
+
+ /**
+ * Parses a full qualified class name postfix.
+ *
+ * @return \PDepend\Source\AST\ASTClassFqnPostfix
+ * @since 2.0.0
+ */
+ private function parseFullQualifiedClassNamePostfix()
+ {
+ $this->tokenStack->push();
+
+ $this->consumeToken(Tokens::T_CLASS_FQN);
+
+ return $this->setNodePositionsAndReturn(
+ $this->builder->buildAstClassFqnPostfix()
+ );
+ }
+
+ /**
+ * This method will extract the image/name of the real property/variable
+ * that is wrapped by {@link \PDepend\Source\AST\ASTIndexExpression} nodes. If
+ * the given node is now wrapped by index expressions, this method will
+ * return the image of the entire $node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The context node that may be wrapped
+ * by multiple array or string index expressions.
+ *
+ * @return string
+ * @since 1.0.0
+ */
+ private function extractPostfixImage(ASTNode $node)
+ {
+ while ($node instanceof \PDepend\Source\AST\ASTIndexExpression) {
+ $node = $node->getChild(0);
+ }
+ return $node->getImage();
+ }
+
+ /**
+ * Parses a method postfix node instance.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node Node that represents the image of
+ * the method postfix node.
+ *
+ * @return \PDepend\Source\AST\ASTMethodPostfix
+ * @since 1.0.0
+ */
+ private function parseMethodPostfix(ASTNode $node)
+ {
+ $args = $this->parseArguments();
+ $image = $this->extractPostfixImage($node);
+
+ $postfix = $this->builder->buildAstMethodPostfix($image);
+ $postfix->addChild($node);
+ $postfix->addChild($args);
+
+ $postfix->setEndLine($args->getEndLine());
+ $postfix->setEndColumn($args->getEndColumn());
+ $postfix->setStartLine($node->getStartLine());
+ $postfix->setStartColumn($node->getStartColumn());
+
+ return $this->parseOptionalMemberPrimaryPrefix($postfix);
+ }
+
+ /**
+ * This method parses the arguments passed to a function- or method-call.
+ *
+ * @return \PDepend\Source\AST\ASTArguments
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ private function parseArguments()
+ {
+ $this->consumeComments();
+
+ $this->tokenStack->push();
+
+ $arguments = $this->builder->buildAstArguments();
+
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+ $this->consumeComments();
+
+ if (Tokens::T_PARENTHESIS_CLOSE !== $this->tokenizer->peek()) {
+ $arguments = $this->parseExpressionList($arguments);
+ }
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+
+ return $this->setNodePositionsAndReturn($arguments);
+ }
+
+ /**
+ * This method implements the parsing for various expression types like
+ * variables, object/static method. All these expressions are valid in
+ * several php language constructs like, isset, empty, unset etc.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 0.9.12
+ */
+ private function parseVariableOrConstantOrPrimaryPrefix()
+ {
+ $this->consumeComments();
+ switch ($this->tokenizer->peek()) {
+
+ case Tokens::T_DOLLAR:
+ case Tokens::T_VARIABLE:
+ $node = $this->parseVariableOrFunctionPostfixOrMemberPrimaryPrefix();
+ break;
+
+ case Tokens::T_SELF:
+ $node = $this->parseConstantOrSelfMemberPrimaryPrefix();
+ break;
+
+ case Tokens::T_PARENT:
+ $node = $this->parseConstantOrParentMemberPrimaryPrefix();
+ break;
+
+ case Tokens::T_STATIC:
+ $node = $this->parseStaticVariableDeclarationOrMemberPrimaryPrefix();
+ break;
+
+ case Tokens::T_STRING:
+ case Tokens::T_BACKSLASH:
+ case Tokens::T_NAMESPACE:
+ $node = $this->parseMemberPrefixOrFunctionPostfix();
+ break;
+
+ default:
+ throw new UnexpectedTokenException(
+ $this->tokenizer->next(),
+ $this->compilationUnit->getFileName()
+ );
+ }
+
+ return $node;
+ }
+
+ /**
+ * This method parses any type of variable, function postfix expressions or
+ * any kind of member primary prefix.
+ *
+ * This method expects that the actual token represents any kind of valid
+ * php variable: simple variable, compound variable or variable variable.
+ *
+ * It will parse a function postfix or member primary expression when this
+ * variable is followed by an object operator, double colon or opening
+ * parenthesis.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ private function parseVariableOrFunctionPostfixOrMemberPrimaryPrefix()
+ {
+ $this->tokenStack->push();
+
+ $variable = $this->parseCompoundVariableOrVariableVariableOrVariable();
+ $variable = $this->parseOptionalIndexExpression($variable);
+
+ $this->consumeComments();
+ switch ($this->tokenizer->peek()) {
+
+ case Tokens::T_DOUBLE_COLON:
+ $result = $this->parseStaticMemberPrimaryPrefix($variable);
+ break;
+
+ case Tokens::T_OBJECT_OPERATOR:
+ $result = $this->parseMemberPrimaryPrefix($variable);
+ break;
+
+ case Tokens::T_PARENTHESIS_OPEN:
+ $result = $this->parseFunctionPostfix($variable);
+ break;
+
+ default:
+ $result = $variable;
+ break;
+ }
+ return $this->setNodePositionsAndReturn($result);
+ }
+
+ /**
+ * Parses an assingment expression node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $left The left part of the assignment
+ * expression that will be parsed by this method.
+ *
+ * @return \PDepend\Source\AST\ASTAssignmentExpression
+ * @since 0.9.12
+ */
+ private function parseAssignmentExpression(\PDepend\Source\AST\ASTNode $left)
+ {
+ $token = $this->consumeToken($this->tokenizer->peek());
+
+ $node = $this->builder->buildAstAssignmentExpression($token->image);
+ $node->addChild($left);
+ $node->setStartLine($left->getStartLine());
+ $node->setStartColumn($left->getStartColumn());
+
+ // TODO: Change this into a mandatory expression in later versions
+ if (($expr = $this->parseOptionalExpression()) != null) {
+ $node->addChild($expr);
+ $node->setEndLine($expr->getEndLine());
+ $node->setEndColumn($expr->getEndColumn());
+ } else {
+ $node->setEndLine($left->getEndLine());
+ $node->setEndColumn($left->getEndColumn());
+ }
+ return $node;
+ }
+
+ /**
+ * This method parses a {@link \PDepend\Source\AST\ASTStaticReference} node.
+ *
+ * @param \PDepend\Source\Tokenizer\Token $token The "static" keyword token.
+ * @return \PDepend\Source\AST\ASTStaticReference
+ * @throws \PDepend\Source\Parser\ParserException
+ * @throws \PDepend\Source\Parser\InvalidStateException
+ * @since 0.9.6
+ */
+ private function parseStaticReference(Token $token)
+ {
+ // Strip optional comments
+ $this->consumeComments();
+
+ if ($this->classOrInterface === null) {
+ throw new InvalidStateException(
+ $token->startLine,
+ (string) $this->compilationUnit,
+ 'The keyword "static" was used outside of a class/method scope.'
+ );
+ }
+
+ $ref = $this->builder->buildAstStaticReference($this->classOrInterface);
+ $ref->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $ref;
+ }
+
+ /**
+ * This method parses a {@link \PDepend\Source\AST\ASTSelfReference} node.
+ *
+ * @param \PDepend\Source\Tokenizer\Token $token The "self" keyword token.
+ * @return \PDepend\Source\AST\ASTSelfReference
+ * @throws \PDepend\Source\Parser\ParserException
+ * @throws \PDepend\Source\Parser\InvalidStateException
+ * @since 0.9.6
+ */
+ private function parseSelfReference(Token $token)
+ {
+ if ($this->classOrInterface === null) {
+ throw new InvalidStateException(
+ $token->startLine,
+ (string) $this->compilationUnit,
+ 'The keyword "self" was used outside of a class/method scope.'
+ );
+ }
+
+ $ref = $this->builder->buildAstSelfReference($this->classOrInterface);
+ $ref->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $ref;
+ }
+
+ /**
+ * Parses a simple PHP constant use and returns a corresponding node.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 1.0.0
+ */
+ private function parseConstant()
+ {
+ $this->tokenStack->push();
+
+ switch ($type = $this->tokenizer->peek()) {
+
+ case Tokens::T_STRING:
+ // TODO: Separate node classes for magic constants
+ case Tokens::T_DIR:
+ case Tokens::T_FILE:
+ case Tokens::T_LINE:
+ case Tokens::T_NS_C:
+ case Tokens::T_FUNC_C:
+ case Tokens::T_CLASS_C:
+ case Tokens::T_METHOD_C:
+ $token = $this->consumeToken($type);
+ $const = $this->builder->buildAstConstant($token->image);
+ break;
+ }
+ return $this->setNodePositionsAndReturn($const);
+ }
+
+ /**
+ * This method parses a {@link \PDepend\Source\AST\ASTConstant} node or
+ * an instance of {@link \PDepend\Source\AST\ASTSelfReference} as part of
+ * a {@link \PDepend\Source\AST\ASTMemberPrimaryPrefix} that contains the
+ * self reference as its first child when the self token is followed by a
+ * double colon token.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @throws \PDepend\Source\Parser\InvalidStateException
+ * @since 0.9.6
+ */
+ private function parseConstantOrSelfMemberPrimaryPrefix()
+ {
+ // Read self token and strip optional comments
+ $token = $this->consumeToken(Tokens::T_SELF);
+ $this->consumeComments();
+
+ if ($this->tokenizer->peek() == Tokens::T_DOUBLE_COLON) {
+ return $this->parseStaticMemberPrimaryPrefix(
+ $this->parseSelfReference($token)
+ );
+ }
+ return $this->builder->buildAstConstant($token->image);
+ }
+
+ /**
+ * This method parses a {@link \PDepend\Source\AST\ASTParentReference} node.
+ *
+ * @param \PDepend\Source\Tokenizer\Token $token The "self" keyword token.
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @throws \PDepend\Source\Parser\InvalidStateException
+ * @since 0.9.6
+ */
+ private function parseParentReference(Token $token)
+ {
+ if ($this->classOrInterface === null) {
+ throw new InvalidStateException(
+ $token->startLine,
+ (string) $this->compilationUnit,
+ 'The keyword "parent" was used as type hint but the parameter ' .
+ 'declaration is not in a class scope.'
+ );
+ }
+
+ $classReference = $this->classOrInterface->getParentClassReference();
+ if ($classReference === null) {
+ throw new InvalidStateException(
+ $token->startLine,
+ (string) $this->compilationUnit,
+ sprintf(
+ 'The keyword "parent" was used as type hint but the ' .
+ 'class "%s" does not declare a parent.',
+ $this->classOrInterface->getName()
+ )
+ );
+ }
+
+ $ref = $this->builder->buildAstParentReference($classReference);
+ $ref->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $ref;
+ }
+
+ /**
+ * This method parses a {@link \PDepend\Source\AST\ASTConstant} node or
+ * an instance of {@link \PDepend\Source\AST\ASTParentReference} as part
+ * of a {@link \PDepend\Source\AST\ASTMemberPrimaryPrefix} that contains
+ * the parent reference as its first child when the self token is followed
+ * by a double colon token.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @throws \PDepend\Source\Parser\InvalidStateException
+ * @since 0.9.6
+ */
+ private function parseConstantOrParentMemberPrimaryPrefix()
+ {
+ // Consume parent token and strip optional comments
+ $token = $this->consumeToken(Tokens::T_PARENT);
+ $this->consumeComments();
+
+ if ($this->tokenizer->peek() == Tokens::T_DOUBLE_COLON) {
+ return $this->parseStaticMemberPrimaryPrefix(
+ $this->parseParentReference($token)
+ );
+ }
+ return $this->builder->buildAstConstant($token->image);
+ }
+
+ /**
+ * Parses a variable or any other valid member expression that is optionally
+ * prefixed with PHP's reference operator.
+ *
+ *
+ * // -----------
+ * foreach ( $array as &$this->foo ) {}
+ * // -----------
+ *
+ * // ----------
+ * $foo = &$bar->baz;
+ * // ----------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTUnaryExpression
+ * @since 0.9.18
+ */
+ private function parseVariableOrMemberOptionalByReference()
+ {
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_BITWISE_AND) {
+ return $this->parseVariableOrMemberByReference();
+ }
+ return $this->parseVariableOrConstantOrPrimaryPrefix();
+ }
+
+ /**
+ * Parses a variable or any other valid member expression that is prefixed
+ * with PHP's reference operator.
+ *
+ *
+ * // -----------
+ * foreach ( $array as &$this->foo ) {}
+ * // -----------
+ *
+ * // ----------
+ * $foo = &$bar->baz;
+ * // ----------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTUnaryExpression
+ * @since 0.9.18
+ */
+ private function parseVariableOrMemberByReference()
+ {
+ $this->tokenStack->push();
+
+ $token = $this->consumeToken(Tokens::T_BITWISE_AND);
+ $this->consumeComments();
+
+ $expr = $this->builder->buildAstUnaryExpression($token->image);
+ $expr->addChild($this->parseVariableOrConstantOrPrimaryPrefix());
+
+ return $this->setNodePositionsAndReturn($expr);
+ }
+
+ /**
+ * This method parses a simple PHP variable.
+ *
+ * @return \PDepend\Source\AST\ASTVariable
+ * @throws UnexpectedTokenException
+ * @since 0.9.6
+ */
+ private function parseVariable()
+ {
+ $token = $this->consumeToken(Tokens::T_VARIABLE);
+
+ $variable = $this->builder->buildAstVariable($token->image);
+ $variable->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $variable;
+ }
+
+ /**
+ * This method parses a comma separated list of valid php variables and/or
+ * properties and adds them to the given node instance.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node The context parent node.
+ *
+ * @return \PDepend\Source\AST\ASTNode The prepared entire node.
+ * @since 0.9.12
+ */
+ private function parseVariableList(ASTNode $node)
+ {
+ $this->consumeComments();
+ while ($this->tokenizer->peek() !== Tokenizer::T_EOF) {
+ $node->addChild($this->parseVariableOrConstantOrPrimaryPrefix());
+
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_COMMA) {
+
+ $this->consumeToken(Tokens::T_COMMA);
+ $this->consumeComments();
+ } else {
+ break;
+ }
+ }
+
+ return $node;
+ }
+
+ /**
+ * This method is a decision point between the different variable types
+ * availanle in PHP. It peeks the next token and then decides whether it is
+ * a regular variable or when the next token is of type T_DOLLAR a
+ * compound- or variable-variable.
+ *
+ *
+ * ----
+ * $foo;
+ * ----
+ *
+ * -----
+ * $$foo;
+ * -----
+ *
+ * ------
+ * ${FOO};
+ * ------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @throws UnexpectedTokenException
+ * @since 0.9.6
+ */
+ protected function parseCompoundVariableOrVariableVariableOrVariable()
+ {
+ if ($this->tokenizer->peek() == Tokens::T_DOLLAR) {
+ return $this->parseCompoundVariableOrVariableVariable();
+ }
+ return $this->parseVariable();
+ }
+
+ /**
+ * Parses a PHP compound variable or a simple literal node.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 0.9.19
+ */
+ private function parseCompoundVariableOrLiteral()
+ {
+ $this->tokenStack->push();
+
+ // Read the dollar token
+ $token = $this->consumeToken(Tokens::T_DOLLAR);
+ $this->consumeComments();
+
+ // Get next token type
+ $tokenType = $this->tokenizer->peek();
+
+ switch ($tokenType) {
+
+ case Tokens::T_CURLY_BRACE_OPEN:
+ $variable = $this->builder->buildAstCompoundVariable($token->image);
+ $variable->addChild($this->parseCompoundExpression());
+ break;
+
+ default:
+ $variable = $this->builder->buildAstLiteral($token->image);
+ break;
+ }
+
+ return $this->setNodePositionsAndReturn($variable);
+ }
+
+ /**
+ * This method implements a decision point between compound-variables and
+ * variable-variable. It expects that the next token in the token-stream is
+ * of type T_DOLLAR and removes it from the stream. Then this method
+ * peeks the next available token when it is of type T_CURLY_BRACE_OPEN
+ * this is compound variable, otherwise it can be a variable-variable or a
+ * compound-variable.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\ParserException
+ * @throws UnexpectedTokenException
+ * @since 0.9.6
+ */
+ private function parseCompoundVariableOrVariableVariable()
+ {
+ $this->tokenStack->push();
+
+ // Read the dollar token
+ $token = $this->consumeToken(Tokens::T_DOLLAR);
+ $this->consumeComments();
+
+ // Get next token type
+ $tokenType = $this->tokenizer->peek();
+
+ // T_DOLLAR|T_VARIABLE === Variable variable,
+ // T_CURLY_BRACE_OPEN === Compound variable
+ switch ($tokenType) {
+
+ case Tokens::T_DOLLAR:
+ case Tokens::T_VARIABLE:
+ $variable = $this->builder->buildAstVariableVariable($token->image);
+ $variable->addChild(
+ $this->parseCompoundVariableOrVariableVariableOrVariable()
+ );
+ break;
+
+ default:
+ $variable = $this->parseCompoundVariable($token);
+ break;
+ }
+
+ return $this->setNodePositionsAndReturn($variable);
+ }
+
+ /**
+ * This method parses a compound variable like:
+ *
+ *
+ * // ----------------
+ * return ${'Foo' . 'Bar'};
+ * // ----------------
+ *
+ *
+ * @param \PDepend\Source\Tokenizer\Token $token The dollar token.
+ * @return \PDepend\Source\AST\ASTCompoundVariable
+ * @since 0.10.0
+ */
+ private function parseCompoundVariable(Token $token)
+ {
+ return $this->parseBraceExpression(
+ $this->builder->buildAstCompoundVariable($token->image),
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN),
+ Tokens::T_CURLY_BRACE_CLOSE
+ );
+ }
+
+ /**
+ * This method parses a compound expression like:
+ *
+ *
+ * // ------ ------
+ * $foo = "{$bar}, {$baz}\n";
+ * // ------ ------
+ *
+ *
+ * or a simple literal token:
+ *
+ *
+ * // -
+ * $foo = "{{$bar}, {$baz}\n";
+ * // -
+ *
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 0.9.10
+ */
+ private function parseCompoundExpressionOrLiteral()
+ {
+ $token = $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
+ $this->consumeComments();
+
+ switch ($this->tokenizer->peek()) {
+
+ case Tokens::T_DOLLAR:
+ case Tokens::T_VARIABLE:
+ return $this->parseBraceExpression(
+ $this->builder->buildAstCompoundExpression(),
+ $token,
+ Tokens::T_CURLY_BRACE_CLOSE
+ );
+ }
+
+ $literal = $this->builder->buildAstLiteral($token->image);
+ $literal->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $literal;
+ }
+
+ /**
+ * This method parses a compound expression node.
+ *
+ *
+ * ------------------
+ * {'_' . foo . $bar}
+ * ------------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTCompoundExpression
+ * @throws \PDepend\Source\Parser\ParserException
+ * @throws \PDepend\Source\Parser\ParserException
+ * @since 0.9.6
+ */
+ protected function parseCompoundExpression()
+ {
+ $this->consumeComments();
+
+ return $this->parseBraceExpression(
+ $this->builder->buildAstCompoundExpression(),
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN),
+ Tokens::T_CURLY_BRACE_CLOSE
+ );
+ }
+
+ /**
+ * Parses a static identifier expression, as it is used for method and
+ * function names.
+ *
+ * @return \PDepend\Source\AST\ASTIdentifier
+ * @since 0.9.12
+ */
+ protected function parseIdentifier()
+ {
+ $token = $this->consumeToken(Tokens::T_STRING);
+
+ $node = $this->builder->buildAstIdentifier($token->image);
+ $node->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $node;
+ }
+
+ /**
+ * This method parses a {@link \PDepend\Source\AST\ASTLiteral} node or an
+ * instance of {@link \PDepend\Source\AST\ASTString} that represents a string
+ * in double quotes or surrounded by backticks.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws UnexpectedTokenException
+ */
+ private function parseLiteralOrString()
+ {
+ $tokenType = $this->tokenizer->peek();
+
+ switch ($tokenType) {
+
+ case Tokens::T_NULL:
+ case Tokens::T_TRUE:
+ case Tokens::T_FALSE:
+ case Tokens::T_DNUMBER:
+ case Tokens::T_CONSTANT_ENCAPSED_STRING:
+ $token = $this->consumeToken($tokenType);
+
+ $literal = $this->builder->buildAstLiteral($token->image);
+ $literal->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+ return $literal;
+
+ case Tokens::T_LNUMBER:
+ return $this->parseIntegerNumber();
+
+ default:
+ return $this->parseString($tokenType);
+ }
+ }
+
+ /**
+ * Parses an integer value.
+ *
+ * @return \PDepend\Source\AST\ASTLiteral
+ * @since 1.0.0
+ */
+ abstract protected function parseIntegerNumber();
+
+ /**
+ * Parses an array structure.
+ *
+ * @return \PDepend\Source\AST\ASTArray
+ * @since 1.0.0
+ */
+ private function doParseArray($static = false)
+ {
+ $this->tokenStack->push();
+
+ return $this->setNodePositionsAndReturn(
+ $this->parseArray(
+ $this->builder->buildAstArray(),
+ $static
+ )
+ );
+ }
+
+ /**
+ * Tests if the next token is a valid array start delimiter in the supported
+ * PHP version.
+ *
+ * @return boolean
+ * @since 1.0.0
+ */
+ abstract protected function isArrayStartDelimiter();
+
+ /**
+ * Parses a php array declaration.
+ *
+ * @param \PDepend\Source\AST\ASTArray $array
+ * @param boolean $static
+ *
+ * @return \PDepend\Source\AST\ASTArray
+ * @since 1.0.0
+ */
+ abstract protected function parseArray(ASTArray $array, $static = false);
+
+ /**
+ * Parses all elements in an array.
+ *
+ * @param \PDepend\Source\AST\ASTArray $array
+ * @param integer $endDelimiter
+ * @param boolean $static
+ * @return \PDepend\Source\AST\ASTArray
+ * @since 1.0.0
+ */
+ protected function parseArrayElements(ASTArray $array, $endDelimiter, $static = false)
+ {
+ $this->consumeComments();
+ while ($endDelimiter !== $this->tokenizer->peek()) {
+ $array->addChild($this->parseArrayElement($static));
+
+ $this->consumeComments();
+ if (Tokens::T_COMMA === $this->tokenizer->peek()) {
+ $this->consumeToken(Tokens::T_COMMA);
+ $this->consumeComments();
+ }
+ }
+ return $array;
+ }
+
+ /**
+ * Parses a single array element.
+ *
+ * An array element can have a simple value, a key/value pair, a value by
+ * reference or a key/value pair with a referenced value.
+ *
+ * @param boolean $static
+ * @return \PDepend\Source\AST\ASTArrayElement
+ * @since 1.0.0
+ */
+ protected function parseArrayElement($static = false)
+ {
+ $this->consumeComments();
+
+ $this->tokenStack->push();
+
+ $element = $this->builder->buildAstArrayElement();
+ if ($this->parseOptionalByReference()) {
+
+ if ($static) {
+ $tokens = $this->tokenStack->pop();
+
+ throw new UnexpectedTokenException(
+ end($tokens),
+ $this->compilationUnit->getFileName()
+ );
+ }
+
+ $element->setByReference();
+ }
+
+ $this->consumeComments();
+ if ($this->isKeyword($this->tokenizer->peek())) {
+ throw new UnexpectedTokenException(
+ $this->tokenizer->next(),
+ $this->compilationUnit->getFileName()
+ );
+ }
+
+ $element->addChild($this->parseExpression());
+
+ $this->consumeComments();
+ if (Tokens::T_DOUBLE_ARROW === $this->tokenizer->peek()) {
+ $this->consumeToken(Tokens::T_DOUBLE_ARROW);
+ $this->consumeComments();
+
+ if ($this->parseOptionalByReference()) {
+ $element->setByReference();
+ }
+ $element->addChild($this->parseExpression());
+ }
+
+ return $this->setNodePositionsAndReturn($element);
+ }
+
+ /**
+ * Parses a here- or nowdoc string instance.
+ *
+ * @return \PDepend\Source\AST\ASTHeredoc
+ * @since 0.9.12
+ */
+ protected function parseHeredoc()
+ {
+ $this->tokenStack->push();
+ $this->consumeToken(Tokens::T_START_HEREDOC);
+
+ $heredoc = $this->builder->buildAstHeredoc();
+ $this->parseStringExpressions($heredoc, Tokens::T_END_HEREDOC);
+
+ $token = $this->consumeToken(Tokens::T_END_HEREDOC);
+ $heredoc->setDelimiter($token->image);
+
+ return $this->setNodePositionsAndReturn($heredoc);
+ }
+
+ /**
+ * Parses a simple string sequence between two tokens of the same type.
+ *
+ * @param integer $tokenType The start/stop token type.
+ *
+ * @return string
+ * @since 0.9.10
+ */
+ private function parseStringSequence($tokenType)
+ {
+ $type = $tokenType;
+ $string = '';
+
+ do {
+ $string .= $this->consumeToken($type)->image;
+ $type = $this->tokenizer->peek();
+ } while ($type != $tokenType && $type != Tokenizer::T_EOF);
+
+ return $string . $this->consumeToken($tokenType)->image;
+ }
+
+ /**
+ * This method parses a php string with all possible embedded expressions.
+ *
+ *
+ * $string = "Manuel $Pichler <{$email}>";
+ *
+ * // \PDepend\Source\AST\ASTSTring
+ * // |-- ASTLiteral - "Manuel ")
+ * // |-- ASTVariable - $Pichler
+ * // |-- ASTLiteral - " <"
+ * // |-- ASTCompoundExpression - {...}
+ * // | |-- ASTVariable - $email
+ * // |-- ASTLiteral - ">"
+ *
+ *
+ * @param integer $delimiterType The start/stop token type.
+ *
+ * @return \PDepend\Source\AST\ASTString
+ * @throws \PDepend\Source\Parser\UnexpectedTokenException
+ * @since 0.9.10
+ */
+ private function parseString($delimiterType)
+ {
+ $token = $this->consumeToken($delimiterType);
+
+ $string = $this->builder->buildAstString();
+ $string->setStartLine($token->startLine);
+ $string->setStartColumn($token->startColumn);
+
+ $this->parseStringExpressions($string, $delimiterType);
+
+ $token = $this->consumeToken($delimiterType);
+ $string->setEndLine($token->endLine);
+ $string->setEndColumn($token->endColumn);
+
+ return $string;
+ }
+
+ /**
+ * This method parses the contents of a string or here-/now-doc node. It
+ * will not consume the given stop token, so it is up to the calling method
+ * to consume the stop token. The return value of this method is the prepared
+ * input string node.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node
+ * @param integer $stopToken
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 0.9.12
+ */
+ private function parseStringExpressions(ASTNode $node, $stopToken)
+ {
+ while (($tokenType = $this->tokenizer->peek()) != Tokenizer::T_EOF) {
+
+ switch ($tokenType) {
+
+ case $stopToken:
+ break 2;
+
+ case Tokens::T_BACKSLASH:
+ $node->addChild($this->parseEscapedAstLiteralString());
+ break;
+
+ case Tokens::T_DOLLAR:
+ $node->addChild($this->parseCompoundVariableOrLiteral());
+ break;
+
+ case Tokens::T_VARIABLE:
+ $node->addChild($this->parseVariable());
+ break;
+
+ case Tokens::T_CURLY_BRACE_OPEN:
+ $node->addChild($this->parseCompoundExpressionOrLiteral());
+ break;
+
+ default:
+ $node->addChild($this->parseLiteral());
+ break;
+ }
+ }
+ return $node;
+ }
+
+ /**
+ * This method parses an escaped sequence of literal tokens.
+ *
+ * @return \PDepend\Source\AST\ASTLiteral
+ * @since 0.9.10
+ */
+ private function parseEscapedAstLiteralString()
+ {
+ $this->tokenStack->push();
+
+ $image = $this->consumeToken(Tokens::T_BACKSLASH)->image;
+ $escape = true;
+
+ $tokenType = $this->tokenizer->peek();
+ while ($tokenType != Tokenizer::T_EOF) {
+ if ($tokenType === Tokens::T_BACKSLASH) {
+ $escape != $escape;
+ $image .= $this->consumeToken(Tokens::T_BACKSLASH)->image;
+
+ $tokenType = $this->tokenizer->peek();
+ continue;
+ }
+
+ if ($escape) {
+ $image .= $this->consumeToken($tokenType)->image;
+ break;
+ }
+ }
+ return $this->setNodePositionsAndReturn(
+ $this->builder->buildAstLiteral($image)
+ );
+ }
+
+ /**
+ * This method parses a simple literal and configures the position
+ * properties.
+ *
+ * @return \PDepend\Source\AST\ASTLiteral
+ * @since 0.9.10
+ */
+ protected function parseLiteral()
+ {
+ $token = $this->consumeToken($this->tokenizer->peek());
+
+ $node = $this->builder->buildAstLiteral($token->image);
+ $node->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $node;
+ }
+
+ /**
+ * Extracts all dependencies from a callable signature.
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameters
+ * @since 0.9.5
+ */
+ private function parseFormalParameters()
+ {
+ $this->consumeComments();
+
+ $this->tokenStack->push();
+
+ $formalParameters = $this->builder->buildAstFormalParameters();
+
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+ $this->consumeComments();
+
+ $tokenType = $this->tokenizer->peek();
+
+ // Check for function without parameters
+ if ($tokenType === Tokens::T_PARENTHESIS_CLOSE) {
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+ return $this->setNodePositionsAndReturn($formalParameters);
+ }
+
+ while ($tokenType !== Tokenizer::T_EOF) {
+
+ $formalParameters->addChild(
+ $this->parseFormalParameterOrTypeHintOrByReference()
+ );
+
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ // Check for following parameter
+ if ($tokenType !== Tokens::T_COMMA) {
+ break;
+ }
+ $this->consumeToken(Tokens::T_COMMA);
+ }
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+
+ return $this->setNodePositionsAndReturn($formalParameters);
+ }
+
+ /**
+ * This method parses a formal parameter in all it's variations.
+ *
+ *
+ * // ------------
+ * function traverse(Iterator $it) {}
+ * // ------------
+ *
+ * // ---------
+ * function traverse(array $ar) {}
+ * // ---------
+ *
+ * // ---
+ * function traverse(&$x) {}
+ * // ---
+ *
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameter
+ * @since 0.9.6
+ */
+ private function parseFormalParameterOrTypeHintOrByReference()
+ {
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ $this->tokenStack->push();
+
+ switch ($tokenType) {
+
+ case Tokens::T_ARRAY:
+ $parameter = $this->parseFormalParameterAndArrayTypeHint();
+ break;
+
+ case ($this->isFormalParameterTypeHint($tokenType)):
+ $parameter = $this->parseFormalParameterAndTypeHint();
+ break;
+
+ case Tokens::T_SELF:
+ $parameter = $this->parseFormalParameterAndSelfTypeHint();
+ break;
+
+ case Tokens::T_PARENT:
+ $parameter = $this->parseFormalParameterAndParentTypeHint();
+ break;
+
+ case Tokens::T_BITWISE_AND:
+ $parameter = $this->parseFormalParameterAndByReference();
+ break;
+
+ default:
+ $parameter = $this->parseFormalParameter();
+ break;
+ }
+ return $this->setNodePositionsAndReturn($parameter);
+ }
+
+ /**
+ * This method parses a formal parameter that has an array type hint.
+ *
+ *
+ * // ---------
+ * function traverse(array $ar) {}
+ * // ---------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameter
+ * @since 0.9.6
+ */
+ private function parseFormalParameterAndArrayTypeHint()
+ {
+ $token = $this->consumeToken(Tokens::T_ARRAY);
+
+ $node = $this->builder->buildAstTypeArray();
+ $node->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ $parameter = $this->parseFormalParameterOrByReference();
+ $parameter->prependChild($node);
+
+ return $parameter;
+ }
+
+ /**
+ * This method parses a formal parameter that has a regular class type hint.
+ *
+ *
+ * // ------------
+ * function traverse(Iterator $it) {}
+ * // ------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameter
+ * @since 0.9.6
+ */
+ private function parseFormalParameterAndTypeHint()
+ {
+ $this->tokenStack->push();
+
+ $classReference = $this->setNodePositionsAndReturn(
+ $this->parseFormalParameterTypeHint()
+ );
+
+ $parameter = $this->parseFormalParameterOrByReference();
+ $parameter->addChild($classReference);
+
+ return $parameter;
+ }
+
+ /**
+ * This method will parse a formal parameter that has the keyword parent as
+ * parameter type hint.
+ *
+ *
+ * class Foo extends Bar
+ * {
+ * // ---------
+ * public function test(parent $o) {}
+ * // ---------
+ * }
+ *
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameter
+ * @throws \PDepend\Source\Parser\InvalidStateException
+ * @since 0.9.6
+ */
+ private function parseFormalParameterAndParentTypeHint()
+ {
+ $token = $this->consumeToken(Tokens::T_PARENT);
+
+ $reference = $this->parseParentReference($token);
+ $parameter = $this->parseFormalParameterOrByReference();
+ $parameter->prependChild($reference);
+
+ return $parameter;
+ }
+
+ /**
+ * This method will parse a formal parameter that has the keyword self as
+ * parameter type hint.
+ *
+ *
+ * class Foo
+ * {
+ * // -------
+ * public function test(self $o) {}
+ * // -------
+ * }
+ *
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameter
+ * @since 0.9.6
+ */
+ private function parseFormalParameterAndSelfTypeHint()
+ {
+ $token = $this->consumeToken(Tokens::T_SELF);
+
+ $self = $this->builder->buildAstSelfReference($this->classOrInterface);
+ $self->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ $parameter = $this->parseFormalParameterOrByReference();
+ $parameter->addChild($self);
+
+ return $parameter;
+ }
+
+ /**
+ * This method will parse a formal parameter that can optionally be passed
+ * by reference.
+ *
+ *
+ * // --- -------
+ * function foo(array &$x, $y = 42) {}
+ * // --- -------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameter
+ * @since 0.9.6
+ */
+ protected function parseFormalParameterOrByReference()
+ {
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_BITWISE_AND) {
+ return $this->parseFormalParameterAndByReference();
+ }
+ return $this->parseFormalParameter();
+ }
+
+ /**
+ * This method will parse a formal parameter that is passed by reference.
+ *
+ *
+ * // --- --------
+ * function foo(array &$x, &$y = 42) {}
+ * // --- --------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameter
+ * @since 0.9.6
+ */
+ private function parseFormalParameterAndByReference()
+ {
+ $this->consumeToken(Tokens::T_BITWISE_AND);
+ $this->consumeComments();
+
+ $parameter = $this->parseFormalParameter();
+ $parameter->setPassedByReference();
+
+ return $parameter;
+ }
+
+ /**
+ * This method will parse a formal parameter. A formal parameter is at least
+ * a variable name, but can also contain a default parameter value.
+ *
+ *
+ * // -- -------
+ * function foo(Bar $x, $y = 42) {}
+ * // -- -------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameter
+ * @since 0.9.6
+ */
+ private function parseFormalParameter()
+ {
+ $parameter = $this->builder->buildAstFormalParameter();
+ $parameter->addChild($this->parseVariableDeclarator());
+
+ return $parameter;
+ }
+
+ /**
+ * Tests if the given token type is a valid formal parameter in the supported
+ * PHP version.
+ *
+ * @param integer $tokenType Numerical token identifier.
+ *
+ * @return boolean
+ * @since 1.0.0
+ */
+ abstract protected function isFormalParameterTypeHint($tokenType);
+
+ /**
+ * Parses a formal parameter type hint that is valid in the supported PHP
+ * version.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 1.0.0
+ */
+ abstract protected function parseFormalParameterTypeHint();
+
+ /**
+ * Extracts all dependencies from a callable body.
+ *
+ * @return \PDepend\Source\AST\ASTScope
+ * @since 0.9.12
+ */
+ private function parseScope()
+ {
+ $scope = $this->builder->buildAstScope();
+
+ $this->tokenStack->push();
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
+
+ while (($stmt = $this->parseOptionalStatement()) !== null) {
+ // TODO: Remove if-statement once, we have translated functions and
+ // closures into ast-nodes
+ if ($stmt instanceof \PDepend\Source\AST\ASTNode) {
+ $scope->addChild($stmt);
+ }
+ }
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_CURLY_BRACE_CLOSE);
+
+ return $this->setNodePositionsAndReturn($scope);
+ }
+
+ /**
+ * Parse a statement.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @throws \PDepend\Source\Parser\UnexpectedTokenException
+ * @since 1.0.0
+ */
+ private function parseStatement()
+ {
+ if (null === ($stmt = $this->parseOptionalStatement())) {
+ throw new UnexpectedTokenException(
+ $this->tokenizer->next(),
+ $this->compilationUnit->getFileName()
+ );
+ }
+ return $stmt;
+ }
+
+ /**
+ * Parses an optional statement or returns null.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 0.9.8
+ */
+ private function parseOptionalStatement()
+ {
+ $tokenType = $this->tokenizer->peek();
+
+ switch ($tokenType) {
+
+ case Tokens::T_ECHO:
+ return $this->parseEchoStatement();
+
+ case Tokens::T_SWITCH:
+ return $this->parseSwitchStatement();
+
+ case Tokens::T_TRY:
+ return $this->parseTryStatement();
+
+ case Tokens::T_THROW:
+ return $this->parseThrowStatement();
+
+ case Tokens::T_IF:
+ return $this->parseIfStatement();
+
+ case Tokens::T_FOR:
+ return $this->parseForStatement();
+
+ case Tokens::T_FOREACH:
+ return $this->parseForeachStatement();
+
+ case Tokens::T_DO:
+ return $this->parseDoWhileStatement();
+
+ case Tokens::T_WHILE:
+ return $this->parseWhileStatement();
+
+ case Tokens::T_RETURN:
+ return $this->parseReturnStatement();
+
+ case Tokens::T_BREAK:
+ return $this->parseBreakStatement();
+
+ case Tokens::T_CONTINUE:
+ return $this->parseContinueStatement();
+
+ case Tokens::T_GOTO:
+ return $this->parseGotoStatement();
+
+ case Tokens::T_GLOBAL:
+ return $this->parseGlobalStatement();
+
+ case Tokens::T_UNSET:
+ return $this->parseUnsetStatement();
+
+ case Tokens::T_STRING:
+ if ($this->tokenizer->peekNext() === Tokens::T_COLON) {
+ return $this->parseLabelStatement();
+ }
+ break;
+
+ case Tokens::T_CONST:
+ return $this->parseConstantDefinition();
+
+ case Tokens::T_FUNCTION:
+ return $this->parseFunctionOrClosureDeclaration();
+
+ case Tokens::T_COMMENT:
+ return $this->parseCommentWithOptionalInlineClassOrInterfaceReference();
+
+ case Tokens::T_DOC_COMMENT:
+ return $this->builder->buildAstComment(
+ $this->consumeToken(Tokens::T_DOC_COMMENT)->image
+ );
+
+ case Tokens::T_CURLY_BRACE_OPEN:
+ return $this->parseRegularScope();
+
+ case Tokens::T_DECLARE:
+ return $this->parseDeclareStatement();
+
+ case Tokens::T_ELSE:
+ case Tokens::T_ENDIF:
+ case Tokens::T_ELSEIF:
+ case Tokens::T_ENDFOR:
+ case Tokens::T_ENDWHILE:
+ case Tokens::T_ENDSWITCH:
+ case Tokens::T_ENDDECLARE:
+ case Tokens::T_ENDFOREACH:
+ case Tokens::T_CURLY_BRACE_CLOSE:
+ return null;
+
+ case Tokens::T_DECLARE:
+ return $this->parseDeclareStatement();
+
+ case Tokens::T_CLOSE_TAG:
+ if (($tokenType = $this->parseNonePhpCode()) === Tokenizer::T_EOF) {
+ return null;
+ }
+ return $this->parseOptionalStatement();
+
+ case Tokens::T_TRAIT:
+ $package = $this->getNamespaceOrPackage();
+ $package->addType($trait = $this->parseTraitDeclaration());
+
+ $this->builder->restoreTrait($trait);
+ $this->compilationUnit->addChild($trait);
+ return $trait;
+
+ case Tokens::T_INTERFACE:
+ $package = $this->getNamespaceOrPackage();
+ $package->addType($interface = $this->parseInterfaceDeclaration());
+
+ $this->builder->restoreInterface($interface);
+ $this->compilationUnit->addChild($interface);
+ return $interface;
+
+ case Tokens::T_CLASS:
+ case Tokens::T_FINAL:
+ case Tokens::T_ABSTRACT:
+ $package = $this->getNamespaceOrPackage();
+ $package->addType($class = $this->parseClassDeclaration());
+
+ $this->builder->restoreClass($class);
+ $this->compilationUnit->addChild($class);
+ return $class;
+
+ case Tokens::T_YIELD:
+ return $this->parseYield();
+ }
+
+ $this->tokenStack->push();
+ $stmt = $this->builder->buildAstStatement();
+ if (($expr = $this->parseOptionalExpression()) != null) {
+ $stmt->addChild($expr);
+ }
+ $this->parseStatementTermination();
+ return $this->setNodePositionsAndReturn($stmt);
+ }
+
+ /**
+ * Parses a sequence of none php code tokens and returns the token type of
+ * the next token.
+ *
+ * @return integer
+ * @since 0.9.12
+ */
+ private function parseNonePhpCode()
+ {
+ $this->consumeToken(Tokens::T_CLOSE_TAG);
+
+ $this->tokenStack->push();
+ while (($tokenType = $this->tokenizer->peek()) !== Tokenizer::T_EOF) {
+ switch ($tokenType) {
+
+ case Tokens::T_OPEN_TAG:
+ case Tokens::T_OPEN_TAG_WITH_ECHO:
+ $this->consumeToken($tokenType);
+ $tokenType = $this->tokenizer->peek();
+ break 2;
+
+ default:
+ $this->consumeToken($tokenType);
+ break;
+ }
+ }
+ $this->tokenStack->pop();
+
+ return $tokenType;
+ }
+
+ /**
+ * Parses a comment and optionally an embedded class or interface type
+ * annotation.
+ *
+ * @return \PDepend\Source\AST\ASTComment
+ * @since 0.9.8
+ */
+ private function parseCommentWithOptionalInlineClassOrInterfaceReference()
+ {
+ $token = $this->consumeToken(Tokens::T_COMMENT);
+
+ $comment = $this->builder->buildAstComment($token->image);
+ if (preg_match(self::REGEXP_INLINE_TYPE, $token->image, $match)) {
+ $comment->addChild(
+ $this->builder->buildAstClassOrInterfaceReference($match[1])
+ );
+ }
+
+ $comment->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+ return $comment;
+ }
+
+ /**
+ * Parses an optional set of bound closure variables.
+ *
+ * @param \PDepend\Source\AST\ASTClosure $closure The context closure instance.
+ *
+ * @return \PDepend\Source\AST\ASTClosure
+ * @since 1.0.0
+ */
+ private function parseOptionalBoundVariables(
+ \PDepend\Source\AST\ASTClosure $closure
+ ) {
+ $this->consumeComments();
+ if (Tokens::T_USE === $this->tokenizer->peek()) {
+ return $this->parseBoundVariables($closure);
+ }
+ return $closure;
+ }
+
+ /**
+ * Parses a list of bound closure variables.
+ *
+ * @param \PDepend\Source\AST\ASTClosure $closure The parent closure instance.
+ *
+ * @return \PDepend\Source\AST\ASTClosure
+ * @since 0.9.5
+ */
+ private function parseBoundVariables(\PDepend\Source\AST\ASTClosure $closure)
+ {
+ $this->consumeToken(Tokens::T_USE);
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+
+ while ($this->tokenizer->peek() !== Tokenizer::T_EOF) {
+ $this->consumeComments();
+
+ if ($this->tokenizer->peek() === Tokens::T_BITWISE_AND) {
+ $this->consumeToken(Tokens::T_BITWISE_AND);
+ $this->consumeComments();
+ }
+
+ $this->consumeToken(Tokens::T_VARIABLE);
+ $this->consumeComments();
+
+ if ($this->tokenizer->peek() === Tokens::T_COMMA) {
+ $this->consumeToken(Tokens::T_COMMA);
+ continue;
+ }
+ break;
+ }
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+
+ return $closure;
+ }
+
+ /**
+ * Parses a php class/method name chain.
+ *
+ *
+ * PDepend\Source\Parser::parse();
+ *
+ *
+ * @return string
+ * @link http://php.net/manual/en/language.namespaces.importing.php
+ */
+ protected function parseQualifiedName()
+ {
+ $fragments = $this->parseQualifiedNameRaw();
+
+ // Check for fully qualified name
+ if ($fragments[0] === '\\') {
+ return join('', $fragments);
+ }
+
+ // Search for an use alias
+ $mapsTo = $this->useSymbolTable->lookup($fragments[0]);
+ if ($mapsTo !== null) {
+ // Remove alias and add real namespace
+ array_shift($fragments);
+ array_unshift($fragments, $mapsTo);
+ } elseif ($this->namespaceName !== null
+ && $this->namespacePrefixReplaced === false
+ ) {
+ // Prepend current namespace
+ array_unshift($fragments, $this->namespaceName, '\\');
+ }
+ return join('', $fragments);
+ }
+
+ /**
+ * This method parses a qualified PHP 5.3 class, interface and namespace
+ * identifier and returns the collected tokens as a string array.
+ *
+ * @return array(string)
+ * @since 0.9.5
+ */
+ private function parseQualifiedNameRaw()
+ {
+ // Reset namespace prefix flag
+ $this->namespacePrefixReplaced = false;
+
+ // Consume comments and fetch first token type
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ $qualifiedName = array();
+
+ if ($tokenType === Tokens::T_NAMESPACE) {
+ // Consume namespace keyword
+ $this->consumeToken(Tokens::T_NAMESPACE);
+ $this->consumeComments();
+
+ // Add current namespace as first token
+ $qualifiedName = array((string) $this->namespaceName);
+
+ // Set prefixed flag to true
+ $this->namespacePrefixReplaced = true;
+ } elseif ($this->isClassName($tokenType)) {
+ $qualifiedName[] = $this->parseClassName();
+
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ // Stop here for simple identifier
+ if ($tokenType !== Tokens::T_BACKSLASH) {
+ return $qualifiedName;
+ }
+ }
+
+ do {
+ // Next token must be a namespace separator
+ $this->consumeToken(Tokens::T_BACKSLASH);
+ $this->consumeComments();
+
+ // Append to qualified name
+ $qualifiedName[] = '\\';
+ $qualifiedName[] = $this->parseClassName();
+
+ $this->consumeComments();
+
+ // Get next token type
+ $tokenType = $this->tokenizer->peek();
+ } while ($tokenType === Tokens::T_BACKSLASH);
+
+ return $qualifiedName;
+ }
+
+ /**
+ * This method parses a PHP 5.3 namespace declaration.
+ *
+ * @return void
+ * @since 0.9.5
+ */
+ private function parseNamespaceDeclaration()
+ {
+ // Consume namespace keyword and strip optional comments
+ $this->consumeToken(Tokens::T_NAMESPACE);
+ $this->consumeComments();
+
+ $tokenType = $this->tokenizer->peek();
+
+ // Search for a namespace identifier
+ if ($tokenType === Tokens::T_STRING) {
+ // Reset namespace property
+ $this->namespaceName = null;
+
+ $qualifiedName = $this->parseQualifiedName();
+
+ $this->consumeComments();
+ if ($this->tokenizer->peek() === Tokens::T_CURLY_BRACE_OPEN) {
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
+ } else {
+ $this->consumeToken(Tokens::T_SEMICOLON);
+ }
+
+ // Create a package for this namespace
+ $this->namespaceName = $qualifiedName;
+
+ $this->useSymbolTable->resetScope();
+
+ } elseif ($tokenType === Tokens::T_BACKSLASH) {
+ // Same namespace reference, something like:
+ // new namespace\Foo();
+ // or:
+ // $x = namespace\foo::bar();
+
+ // Now parse a qualified name
+ $this->parseQualifiedNameRaw();
+ } else {
+ // Consume opening curly brace
+ $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
+
+ // Create a package for this namespace
+ $this->namespaceName = '';
+
+ $this->useSymbolTable->resetScope();
+ }
+
+ $this->reset();
+ }
+
+ /**
+ * This method parses a list of PHP 5.3 use declarations and adds a mapping
+ * between short name and full qualified name to the use symbol table.
+ *
+ *
+ * use \foo\bar as fb,
+ * \foobar\Bar;
+ *
+ *
+ * @return void
+ * @since 0.9.5
+ */
+ private function parseUseDeclarations()
+ {
+ // Consume use keyword
+ $this->consumeToken(Tokens::T_USE);
+ $this->consumeComments();
+
+ // Parse all use declarations
+ $this->parseUseDeclaration();
+ $this->consumeComments();
+
+ // Consume closing semicolon
+ $this->consumeToken(Tokens::T_SEMICOLON);
+
+ // Reset any previous state
+ $this->reset();
+ }
+
+ /**
+ * This method parses a single use declaration and adds a mapping between
+ * short name and full qualified name to the use symbol table.
+ *
+ * @return void
+ * @since 0.9.5
+ */
+ private function parseUseDeclaration()
+ {
+ $fragments = $this->parseQualifiedNameRaw();
+ $this->consumeComments();
+
+ // Add leading backslash, because aliases must be full qualified
+ // http://php.net/manual/en/language.namespaces.importing.php
+ if ($fragments[0] !== '\\') {
+ array_unshift($fragments, '\\');
+ }
+
+ if ($this->tokenizer->peek() === Tokens::T_AS) {
+ $this->consumeToken(Tokens::T_AS);
+ $this->consumeComments();
+
+ $image = $this->consumeToken(Tokens::T_STRING)->image;
+ $this->consumeComments();
+ } else {
+ $image = end($fragments);
+ }
+
+ // Add mapping between image and qualified name to symbol table
+ $this->useSymbolTable->add($image, join('', $fragments));
+
+ // Check for a following use declaration
+ if ($this->tokenizer->peek() === Tokens::T_COMMA) {
+ // Consume comma token and comments
+ $this->consumeToken(Tokens::T_COMMA);
+ $this->consumeComments();
+
+ $this->parseUseDeclaration();
+ }
+ }
+
+ /**
+ * Parses a single constant definition with one or more constant declarators.
+ *
+ *
+ * class Foo
+ * {
+ * // ------------------------
+ * const FOO = 42, BAR = 23;
+ * // ------------------------
+ * }
+ *
+ *
+ * @return \PDepend\Source\AST\ASTConstantDefinition
+ * @since 0.9.6
+ */
+ private function parseConstantDefinition()
+ {
+ $this->tokenStack->push();
+
+ $token = $this->consumeToken(Tokens::T_CONST);
+
+ $definition = $this->builder->buildAstConstantDefinition($token->image);
+ $definition->setComment($this->docComment);
+
+ do {
+ $definition->addChild($this->parseConstantDeclarator());
+
+ $this->consumeComments();
+ $tokenType = $this->tokenizer->peek();
+
+ if ($tokenType === Tokens::T_SEMICOLON) {
+ break;
+ }
+ $this->consumeToken(Tokens::T_COMMA);
+ } while ($tokenType !== Tokenizer::T_EOF);
+
+
+ $definition = $this->setNodePositionsAndReturn($definition);
+
+ $this->consumeToken(Tokens::T_SEMICOLON);
+
+ return $definition;
+ }
+
+ /**
+ * Parses a single constant declarator.
+ *
+ *
+ * class Foo
+ * {
+ * // --------
+ * const BAR = 42;
+ * // --------
+ * }
+ *
+ *
+ * Or in a comma separated constant defintion:
+ *
+ *
+ * class Foo
+ * {
+ * // --------
+ * const BAR = 42,
+ * // --------
+ *
+ * // --------------
+ * const BAZ = 'Foobar',
+ * // --------------
+ *
+ * // ----------
+ * const FOO = 3.14;
+ * // ----------
+ * }
+ *
+ *
+ * @return \PDepend\Source\AST\ASTConstantDeclarator
+ * @since 0.9.6
+ */
+ private function parseConstantDeclarator()
+ {
+ // Remove leading comments and create a new token stack
+ $this->consumeComments();
+ $this->tokenStack->push();
+
+ $token = $this->consumeToken(Tokens::T_STRING);
+
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_EQUAL);
+
+ $declarator = $this->builder->buildAstConstantDeclarator($token->image);
+ $declarator->setValue($this->parseStaticValue());
+
+ return $this->setNodePositionsAndReturn($declarator);
+ }
+
+ /**
+ * This method parses a static variable declaration list, a member primary
+ * prefix invoked in the static context of a class or it parses a static
+ * closure declaration.
+ *
+ * Static variable:
+ *
+ * function foo() {
+ * // ------------------------------
+ * static $foo, $bar, $baz = null;
+ * // ------------------------------
+ * }
+ *
+ *
+ * Static method invocation:
+ *
+ * class Foo {
+ * public function baz() {
+ * // ----------------
+ * static::foobar();
+ * // ----------------
+ * }
+ * public function foobar() {}
+ * }
+ *
+ * class Bar extends Foo {
+ * public function foobar() {}
+ * }
+ *
+ *
+ * Static closure declaration:
+ *
+ * $closure = static function($x, $y) {
+ * return ($x * $y);
+ * };
+ *
+ *
+ * @return \PDepend\Source\AST\ASTConstant
+ * @throws \PDepend\Source\Parser\ParserException
+ * @throws \PDepend\Source\Parser\UnexpectedTokenException
+ * @since 0.9.6
+ */
+ private function parseStaticVariableDeclarationOrMemberPrimaryPrefix()
+ {
+ $this->tokenStack->push();
+
+ // Consume static token and strip optional comments
+ $token = $this->consumeToken(Tokens::T_STATIC);
+ $this->consumeComments();
+
+ // Fetch next token type
+ $tokenType = $this->tokenizer->peek();
+
+ if ($tokenType === Tokens::T_PARENTHESIS_OPEN
+ || $tokenType === Tokens::T_DOUBLE_COLON
+ ) {
+ $static = $this->parseStaticReference($token);
+
+ $prefix = $this->parseStaticMemberPrimaryPrefix($static);
+ return $this->setNodePositionsAndReturn($prefix);
+ } elseif ($tokenType === Tokens::T_FUNCTION) {
+ $closure = $this->parseClosureDeclaration();
+ $closure->setStatic(true);
+
+ return $this->setNodePositionsAndReturn($closure);
+ }
+
+ $declaration = $this->parseStaticVariableDeclaration($token);
+ return $this->setNodePositionsAndReturn($declaration);
+
+ }
+
+ /**
+ * This method will parse a static variable declaration.
+ *
+ *
+ * function foo()
+ * {
+ * // First declaration
+ * static $foo;
+ * // Second declaration
+ * static $bar = array();
+ * // Third declaration
+ * static $baz = array(),
+ * $foobar = null,
+ * $barbaz;
+ * }
+ *
+ *
+ * @param \PDepend\Source\Tokenizer\Token $token Token with the "static" keyword.
+ * @return \PDepend\Source\AST\ASTStaticVariableDeclaration
+ * @since 0.9.6
+ */
+ private function parseStaticVariableDeclaration(Token $token)
+ {
+ $staticDeclaration = $this->builder->buildAstStaticVariableDeclaration(
+ $token->image
+ );
+
+ // Strip optional comments
+ $this->consumeComments();
+
+ // Fetch next token type
+ $tokenType = $this->tokenizer->peek();
+
+ while ($tokenType !== Tokenizer::T_EOF) {
+ $staticDeclaration->addChild($this->parseVariableDeclarator());
+
+ $this->consumeComments();
+
+ // Semicolon terminates static declaration
+ $tokenType = $this->tokenizer->peek();
+ if ($tokenType === Tokens::T_SEMICOLON) {
+ break;
+ }
+ // We are here, so there must be a next declarator
+ $this->consumeToken(Tokens::T_COMMA);
+ }
+
+ return $staticDeclaration;
+ }
+
+ /**
+ * This method will parse a variable declarator.
+ *
+ *
+ * // Parameter declarator
+ * function foo($x = 23) {
+ * }
+ * // Property declarator
+ * class Foo{
+ * protected $bar = 42;
+ * }
+ * // Static declarator
+ * function baz() {
+ * static $foo;
+ * }
+ *
+ *
+ * @return \PDepend\Source\AST\ASTVariableDeclarator
+ * @since 0.9.6
+ */
+ private function parseVariableDeclarator()
+ {
+ $this->tokenStack->push();
+
+ $name = $this->consumeToken(Tokens::T_VARIABLE)->image;
+ $this->consumeComments();
+
+ $declarator = $this->builder->buildAstVariableDeclarator($name);
+
+ if ($this->tokenizer->peek() === Tokens::T_EQUAL) {
+ $this->consumeToken(Tokens::T_EQUAL);
+ $declarator->setValue($this->parseStaticValueOrStaticArray());
+ }
+ return $this->setNodePositionsAndReturn($declarator);
+ }
+
+ /**
+ * This method will parse a static value or a static array as it is
+ * used as default value for a parameter or property declaration.
+ *
+ * @return \PDepend\Source\AST\ASTValue
+ * @since 0.9.6
+ */
+ private function parseStaticValueOrStaticArray()
+ {
+ $this->consumeComments();
+ if ($this->isArrayStartDelimiter()) {
+ // TODO: Use default value as value!
+ $defaultValue = $this->doParseArray(true);
+
+ $value = new ASTValue();
+ $value->setValue(array());
+
+ return $value;
+ }
+ return $this->parseStaticValue();
+ }
+
+ /**
+ * This method will parse a static default value as it is used for a
+ * parameter, property or constant declaration.
+ *
+ * @return \PDepend\Source\AST\ASTValue
+ * @since 0.9.5
+ */
+ private function parseStaticValue()
+ {
+ $defaultValue = new ASTValue();
+
+ $this->consumeComments();
+
+ // By default all parameters positive signed
+ $signed = 1;
+
+ $tokenType = $this->tokenizer->peek();
+ while ($tokenType !== Tokenizer::T_EOF) {
+
+ switch ($tokenType) {
+
+ case Tokens::T_COMMA:
+ case Tokens::T_SEMICOLON:
+ case Tokens::T_PARENTHESIS_CLOSE:
+ if ($defaultValue->isValueAvailable() === true) {
+ return $defaultValue;
+ }
+ throw new MissingValueException($this->tokenizer);
+
+ case Tokens::T_NULL:
+ $this->consumeToken(Tokens::T_NULL);
+ $defaultValue->setValue(null);
+ break;
+
+ case Tokens::T_TRUE:
+ $this->consumeToken(Tokens::T_TRUE);
+ $defaultValue->setValue(true);
+ break;
+
+ case Tokens::T_FALSE:
+ $this->consumeToken(Tokens::T_FALSE);
+ $defaultValue->setValue(false);
+ break;
+
+ case Tokens::T_LNUMBER:
+ $token = $this->consumeToken(Tokens::T_LNUMBER);
+ $defaultValue->setValue($signed * (int) $token->image);
+ break;
+
+ case Tokens::T_DNUMBER:
+ $token = $this->consumeToken(Tokens::T_DNUMBER);
+ $defaultValue->setValue($signed * (double) $token->image);
+ break;
+
+ case Tokens::T_CONSTANT_ENCAPSED_STRING:
+ $token = $this->consumeToken(Tokens::T_CONSTANT_ENCAPSED_STRING);
+ $defaultValue->setValue(substr($token->image, 1, -1));
+ break;
+
+ case Tokens::T_DOUBLE_COLON:
+ $this->consumeToken(Tokens::T_DOUBLE_COLON);
+ break;
+
+ case Tokens::T_CLASS_FQN:
+ $this->consumeToken(Tokens::T_CLASS_FQN);
+ break;
+
+ case Tokens::T_PLUS:
+ $this->consumeToken(Tokens::T_PLUS);
+ break;
+
+ case Tokens::T_MINUS:
+ $this->consumeToken(Tokens::T_MINUS);
+ $signed *= -1;
+ break;
+
+ case Tokens::T_DOUBLE_QUOTE:
+ $defaultValue->setValue($this->parseStringSequence($tokenType));
+ break;
+
+ case Tokens::T_DIR:
+ case Tokens::T_FILE:
+ case Tokens::T_LINE:
+ case Tokens::T_SELF:
+ case Tokens::T_NS_C:
+ case Tokens::T_FUNC_C:
+ case Tokens::T_PARENT:
+ case Tokens::T_STRING:
+ case Tokens::T_STATIC:
+ case Tokens::T_CLASS_C:
+ case Tokens::T_METHOD_C:
+ case Tokens::T_BACKSLASH:
+ case Tokens::T_SQUARED_BRACKET_OPEN:
+ case Tokens::T_SQUARED_BRACKET_CLOSE:
+ // There is a default value but we don't handle it at the moment.
+ $defaultValue->setValue(null);
+ $this->consumeToken($tokenType);
+ break;
+
+ case Tokens::T_START_HEREDOC:
+ $defaultValue->setValue(
+ $this->parseHeredoc()->getChild(0)->getImage()
+ );
+ break;
+
+
+ default:
+ throw new UnexpectedTokenException(
+ $this->tokenizer->next(),
+ $this->tokenizer->getSourceFile()
+ );
+ }
+
+ $this->consumeComments();
+
+ $tokenType = $this->tokenizer->peek();
+ }
+
+ // We should never reach this, so throw an exception
+ throw new TokenStreamEndException($this->tokenizer);
+ }
+
+ /**
+ * Checks if the given expression is a read/write variable as defined in
+ * the PHP zend_language_parser.y definition.
+ *
+ *
+ * @param \PDepend\Source\AST\ASTNode $expr The context node instance.
+ *
+ * @return boolean
+ * @since 0.10.0
+ */
+ private function isReadWriteVariable($expr)
+ {
+ return ($expr instanceof \PDepend\Source\AST\ASTVariable
+ || $expr instanceof \PDepend\Source\AST\ASTFunctionPostfix
+ || $expr instanceof \PDepend\Source\AST\ASTVariableVariable
+ || $expr instanceof \PDepend\Source\AST\ASTCompoundVariable
+ || $expr instanceof \PDepend\Source\AST\ASTMemberPrimaryPrefix);
+ }
+
+ /**
+ * This method creates a qualified class or interface name based on the
+ * current parser state. By default method uses the current namespace scope
+ * as prefix for the given local name. And it will fallback to a previously
+ * parsed package annotation, when no namespace declaration was parsed.
+ *
+ * @param string $localName The local class or interface name.
+ *
+ * @return string
+ */
+ private function createQualifiedTypeName($localName)
+ {
+ return ltrim($this->getNamespaceOrPackageName() . '\\' . $localName, '\\');
+ }
+
+ /**
+ * Returns the name of a declared names. When the parsed code is not namespaced
+ * this method will return the name from the @package annotation.
+ *
+ * @return string
+ * @since 0.9.8
+ */
+ private function getNamespaceOrPackageName()
+ {
+ if ($this->namespaceName === null) {
+ return $this->packageName;
+ }
+ return $this->namespaceName;
+ }
+
+ /**
+ * Returns the currently active package or namespace.
+ *
+ * @return \PDepend\Source\AST\ASTNamespace
+ * @since 1.0.0
+ */
+ private function getNamespaceOrPackage()
+ {
+ return $this->builder->buildNamespace($this->getNamespaceOrPackageName());
+ }
+
+ /**
+ * Extracts the @package information from the given comment.
+ *
+ * @param string $comment A doc comment block.
+ *
+ * @return string
+ */
+ private function parsePackageAnnotation($comment)
+ {
+ $package = Builder::DEFAULT_NAMESPACE;
+ if (preg_match('#\*\s*@package\s+(\S+)#', $comment, $match)) {
+ $package = trim($match[1]);
+ if (preg_match('#\*\s*@subpackage\s+(\S+)#', $comment, $match)) {
+ $package .= '\\' . trim($match[1]);
+ }
+ }
+
+ // Check for doc level comment
+ if ($this->globalPackageName === Builder::DEFAULT_NAMESPACE
+ && $this->isFileComment() === true
+ ) {
+ $this->globalPackageName = $package;
+
+ $this->compilationUnit->setDocComment($comment);
+ }
+ return $package;
+ }
+
+ /**
+ * Checks that the current token could be used as file comment.
+ *
+ * This method checks that the previous token is an open tag and the following
+ * token is not a class, a interface, final, abstract or a function.
+ *
+ * @return boolean
+ */
+ protected function isFileComment()
+ {
+ if ($this->tokenizer->prev() !== Tokens::T_OPEN_TAG) {
+ return false;
+ }
+
+ $notExpectedTags = array(
+ Tokens::T_CLASS,
+ Tokens::T_FINAL,
+ Tokens::T_TRAIT,
+ Tokens::T_ABSTRACT,
+ Tokens::T_FUNCTION,
+ Tokens::T_INTERFACE
+ );
+
+ return !in_array($this->tokenizer->peek(), $notExpectedTags, true);
+ }
+
+ /**
+ * Returns the class names of all throws annotations with in the
+ * given comment block.
+ *
+ * @param string $comment The context doc comment block.
+ *
+ * @return array
+ */
+ private function parseThrowsAnnotations($comment)
+ {
+ $throws = array();
+ if (preg_match_all(self::REGEXP_THROWS_TYPE, $comment, $matches) > 0) {
+ foreach ($matches[1] as $match) {
+ $throws[] = $match;
+ }
+ }
+ return $throws;
+ }
+
+ /**
+ * This method parses the given doc comment text for a return annotation and
+ * it returns the found return type.
+ *
+ * @param string $comment A doc comment text.
+ *
+ * @return string
+ */
+ private function parseReturnAnnotation($comment)
+ {
+ if (preg_match(self::REGEXP_RETURN_TYPE, $comment, $match) > 0) {
+ foreach (explode('|', end($match)) as $type) {
+ if (Type::isScalarType($type) === false) {
+ return $type;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * This method parses the given doc comment text for a var annotation and
+ * it returns the found property types.
+ *
+ * @param string $comment A doc comment text.
+ * @return array(string)
+ */
+ private function parseVarAnnotation($comment)
+ {
+ if (preg_match(self::REGEXP_VAR_TYPE, $comment, $match) > 0) {
+ return array_map('trim', explode('|', end($match)));
+ }
+ return array();
+ }
+
+ /**
+ * This method will extract the type information of a property from it's
+ * doc comment information. The returned value will be null when no
+ * type information exists.
+ *
+ * @return \PDepend\Source\AST\ASTType
+ * @since 0.9.6
+ */
+ private function parseFieldDeclarationType()
+ {
+ // Skip, if ignore annotations is set
+ if ($this->ignoreAnnotations === true) {
+ return null;
+ }
+
+ $reference = $this->parseFieldDeclarationClassOrInterfaceReference();
+ if ($reference !== null) {
+ return $reference;
+ }
+
+ $annotations = $this->parseVarAnnotation($this->docComment);
+ foreach ($annotations as $annotation) {
+ if (Type::isPrimitiveType($annotation) === true) {
+ return $this->builder->buildAstPrimitiveType(
+ Type::getPrimitiveType($annotation)
+ );
+ } elseif (Type::isArrayType($annotation) === true) {
+ return $this->builder->buildAstTypeArray();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Extracts non scalar types from a field doc comment and creates a
+ * matching type instance.
+ *
+ * @return \PDepend\Source\AST\ASTClassOrInterfaceReference
+ * @since 0.9.6
+ */
+ private function parseFieldDeclarationClassOrInterfaceReference()
+ {
+ $annotations = $this->parseVarAnnotation($this->docComment);
+ foreach ($annotations as $annotation) {
+ if (Type::isScalarType($annotation) === false) {
+ return $this->builder->buildAstClassOrInterfaceReference(
+ $annotation
+ );
+ }
+ }
+ return null;
+ }
+
+ /**
+ * This method parses a yield-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTYieldStatmenet
+ */
+ private function parseYield()
+ {
+ $this->tokenStack->push();
+
+ $token = $this->consumeToken(Tokens::T_YIELD);
+ $this->consumeComments();
+
+ $yield = $this->builder->buildAstYieldStatement($token->image);
+
+ $yield->addChild($this->parseOptionalExpression());
+
+ if ($this->tokenizer->peek() === Tokens::T_DOUBLE_ARROW) {
+ $this->consumeToken(Tokens::T_DOUBLE_ARROW);
+
+ $yield->addChild($this->parseOptionalExpression());
+ }
+
+ $this->consumeComments();
+ if (Tokens::T_PARENTHESIS_CLOSE === $this->tokenizer->peek()) {
+ return $this->setNodePositionsAndReturn($yield);
+ }
+
+ $this->parseStatementTermination();
+ return $this->setNodePositionsAndReturn($yield);
+ }
+
+ /**
+ * Extracts documented throws and return types and sets them
+ * to the given $callable instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTCallable $callable
+ * @return void
+ */
+ private function prepareCallable(AbstractASTCallable $callable)
+ {
+ // Skip, if ignore annotations is set
+ if ($this->ignoreAnnotations === true) {
+ return;
+ }
+
+ // Get all @throws Types
+ $throws = $this->parseThrowsAnnotations($callable->getDocComment());
+ foreach ($throws as $qualifiedName) {
+ $callable->addExceptionClassReference(
+ $this->builder->buildAstClassOrInterfaceReference($qualifiedName)
+ );
+ }
+
+ // Get return annotation
+ $qualifiedName = $this->parseReturnAnnotation($callable->getDocComment());
+ if ($qualifiedName !== null) {
+ $callable->setReturnClassReference(
+ $this->builder->buildAstClassOrInterfaceReference($qualifiedName)
+ );
+ }
+ }
+
+ /**
+ * This method will consume the next token in the token stream. It will
+ * throw an exception if the type of this token is not identical with
+ * $tokenType.
+ *
+ * @param integer $tokenType The next expected token type.
+ * @return \PDepend\Source\Tokenizer\Token
+ * @throws \PDepend\Source\Parser\TokenStreamEndException
+ * @throws \PDepend\Source\Parser\UnexpectedTokenException
+ */
+ protected function consumeToken($tokenType)
+ {
+ $token = $this->tokenizer->next();
+ if ($token === Tokenizer::T_EOF) {
+ throw new TokenStreamEndException($this->tokenizer);
+ } elseif ($token->type == $tokenType) {
+ return $this->tokenStack->add($token);
+ }
+
+ throw new UnexpectedTokenException(
+ $token,
+ $this->tokenizer->getSourceFile()
+ );
+ }
+
+ /**
+ * This method will consume all comment tokens from the token stream.
+ *
+ * @return void
+ */
+ protected function consumeComments()
+ {
+ $type = $this->tokenizer->peek();
+ while ($type == Tokens::T_COMMENT || $type == Tokens::T_DOC_COMMENT) {
+
+ $token = $this->consumeToken($type);
+ $type = $this->tokenizer->peek();
+
+ if (Tokens::T_COMMENT === $token->type) {
+ continue;
+ }
+
+ $this->docComment = $token->image;
+ if (preg_match('(\s+@package\s+[^\s]+\s+)', $token->image)) {
+ $this->packageName = $this->parsePackageAnnotation($token->image);
+ }
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPBuilder.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPBuilder.php
new file mode 100644
index 0000000..39aab5f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPBuilder.php
@@ -0,0 +1,2336 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Language\PHP;
+
+use PDepend\Source\AST\AbstractASTClassOrInterface;
+use PDepend\Source\AST\ASTArtifactList;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTClassOrInterfaceReference;
+use PDepend\Source\AST\ASTCompilationUnit;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTNamespace;
+use PDepend\Source\AST\ASTParentReference;
+use PDepend\Source\AST\ASTTrait;
+use PDepend\Source\Builder\Builder;
+use PDepend\Source\Builder\BuilderContext\GlobalBuilderContext;
+use PDepend\Util\Cache\CacheDriver;
+use PDepend\Util\Log;
+use PDepend\Util\Type;
+
+/**
+ * Default code tree builder implementation.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class PHPBuilder implements Builder
+{
+ /**
+ * The internal used cache instance.
+ *
+ * @var \PDepend\Util\Cache\CacheDriver
+ * @since 0.10.0
+ */
+ protected $cache = null;
+
+ /**
+ * The ast builder context.
+ *
+ * @var \PDepend\Source\Builder\BuilderContext
+ * @since 0.10.0
+ */
+ protected $context = null;
+
+ /**
+ * This property holds all packages found during the parsing phase.
+ *
+ * @param \PDepend\Source\AST\ASTNamespace[]
+ * @since 0.9.12
+ */
+ private $preparedNamespaces = null;
+
+ /**
+ * Default package which contains all functions and classes with an unknown
+ * scope.
+ *
+ * @var \PDepend\Source\AST\ASTNamespace
+ */
+ protected $defaultPackage = null;
+
+ /**
+ * Default source file that acts as a dummy.
+ *
+ * @var ASTCompilationUnit
+ */
+ protected $defaultCompilationUnit = null;
+
+ /**
+ * All generated {@link \PDepend\Source\AST\ASTTrait} objects
+ *
+ * @var array
+ */
+ private $traits = array();
+
+ /**
+ * All generated {@link \PDepend\Source\AST\ASTClass} objects
+ *
+ * @var \PDepend\Source\AST\ASTClass[]
+ */
+ private $classes = array();
+
+ /**
+ * All generated {@link \PDepend\Source\AST\ASTInterface} instances.
+ *
+ * @var \PDepend\Source\AST\ASTInterface[]
+ */
+ private $interfaces = array();
+
+ /**
+ * All generated {@link \PDepend\Source\AST\ASTNamespace} objects
+ *
+ * @var \PDepend\Source\AST\ASTNamespace[]
+ */
+ private $namespaces = array();
+
+ /**
+ * Internal status flag used to check that a build request is internal.
+ *
+ * @var boolean
+ */
+ private $internal = false;
+
+ /**
+ * Internal used flag that marks the parsing process as frozen.
+ *
+ * @var boolean
+ */
+ private $frozen = false;
+
+ /**
+ * Cache of all traits created during the regular parsing process.
+ *
+ * @var array
+ */
+ private $frozenTraits = array();
+
+ /**
+ * Cache of all classes created during the regular parsing process.
+ *
+ * @var \PDepend\Source\AST\ASTClass[]
+ */
+ private $frozenClasses = array();
+
+ /**
+ * Cache of all interfaces created during the regular parsing process.
+ *
+ * @var \PDepend\Source\AST\ASTInterface[]
+ */
+ private $frozenInterfaces = array();
+
+ /**
+ * Constructs a new builder instance.
+ */
+ public function __construct()
+ {
+ $this->defaultPackage = new ASTNamespace(self::DEFAULT_NAMESPACE);
+ $this->defaultCompilationUnit = new ASTCompilationUnit(null);
+
+ $this->namespaces[self::DEFAULT_NAMESPACE] = $this->defaultPackage;
+
+ $this->context = new GlobalBuilderContext($this);
+ }
+
+ /**
+ * Setter method for the currently used token cache.
+ *
+ * @param \PDepend\Util\Cache\CacheDriver $cache
+ * @return \PDepend\Source\Language\PHP\PHPBuilder
+ * @since 0.10.0
+ */
+ public function setCache(CacheDriver $cache)
+ {
+ $this->cache = $cache;
+ return $this;
+ }
+
+ /**
+ * Builds a new code type reference instance.
+ *
+ * @param string $qualifiedName The qualified name of the referenced type.
+ *
+ * @return ASTClassOrInterfaceReference
+ * @since 0.9.5
+ */
+ public function buildAstClassOrInterfaceReference($qualifiedName)
+ {
+ $this->checkBuilderState();
+
+ // Debug method creation
+ Log::debug(
+ 'Creating: \PDepend\Source\AST\ASTClassOrInterfaceReference(' .
+ $qualifiedName .
+ ')'
+ );
+
+ return new ASTClassOrInterfaceReference($this->context, $qualifiedName);
+ }
+
+ /**
+ * This method will try to find an already existing instance for the given
+ * qualified name. It will create a new {@link \PDepend\Source\AST\ASTClass}
+ * instance when no matching type exists.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\AbstractASTClassOrInterface
+ * @since 0.9.5
+ */
+ public function getClassOrInterface($qualifiedName)
+ {
+ $classOrInterface = $this->findClass($qualifiedName);
+ if ($classOrInterface !== null) {
+ return $classOrInterface;
+ }
+
+ $classOrInterface = $this->findInterface($qualifiedName);
+ if ($classOrInterface !== null) {
+ return $classOrInterface;
+ }
+ return $this->buildClassInternal($qualifiedName);
+ }
+
+ /**
+ * Builds a new php trait instance.
+ *
+ * @param string $qualifiedName The full qualified trait name.
+ *
+ * @return \PDepend\Source\AST\ASTTrait
+ * @since 1.0.0
+ */
+ public function buildTrait($qualifiedName)
+ {
+ $this->checkBuilderState();
+
+ $trait = new ASTTrait($this->extractTypeName($qualifiedName));
+ $trait->setCache($this->cache)
+ ->setContext($this->context)
+ ->setCompilationUnit($this->defaultCompilationUnit);
+
+ return $trait;
+ }
+
+ /**
+ * This method will try to find an already existing instance for the given
+ * qualified name. It will create a new {@link \PDepend\Source\AST\ASTTrait}
+ * instance when no matching type exists.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTTrait
+ * @since 1.0.0
+ */
+ public function getTrait($qualifiedName)
+ {
+ $trait = $this->findTrait($qualifiedName);
+ if ($trait === null) {
+ $trait = $this->buildTraitInternal($qualifiedName);
+ }
+ return $trait;
+ }
+
+ /**
+ * Builds a new trait reference node.
+ *
+ * @param string $qualifiedName The full qualified trait name.
+ *
+ * @return \PDepend\Source\AST\ASTTraitReference
+ * @since 1.0.0
+ */
+ public function buildAstTraitReference($qualifiedName)
+ {
+ $this->checkBuilderState();
+
+ Log::debug(
+ 'Creating: \PDepend\Source\AST\ASTTraitReference(' . $qualifiedName . ')'
+ );
+
+ return new \PDepend\Source\AST\ASTTraitReference($this->context, $qualifiedName);
+ }
+
+ /**
+ * Builds a new class instance or reuses a previous created class.
+ *
+ * Where possible you should give a qualified class name, that is prefixed
+ * with the package identifier.
+ *
+ *
+ * $builder->buildClass('php::depend::Parser');
+ *
+ *
+ * To determine the correct class, this method implements the following
+ * algorithm.
+ *
+ *
+ *
Check for an exactly matching instance and reuse it.
+ *
Check for a class instance that belongs to the default package. If
+ * such an instance exists, reuse it and replace the default package with
+ * the newly given package information.
+ *
Check that the requested class is in the default package, if this
+ * is true, reuse the first class instance and ignore the default package.
+ *
+ *
Create a new instance for the specified package.
+ *
+ *
+ * @param string $name The class name.
+ *
+ * @return \PDepend\Source\AST\ASTClass The created class object.
+ */
+ public function buildClass($name)
+ {
+ $this->checkBuilderState();
+
+ $class = new ASTClass($this->extractTypeName($name));
+ $class->setCache($this->cache)
+ ->setContext($this->context)
+ ->setCompilationUnit($this->defaultCompilationUnit);
+
+ return $class;
+ }
+
+ /**
+ * This method will try to find an already existing instance for the given
+ * qualified name. It will create a new {@link \PDepend\Source\AST\ASTClass}
+ * instance when no matching type exists.
+ *
+ * @param string $qualifiedName The full qualified type identifier.
+ *
+ * @return \PDepend\Source\AST\ASTClass
+ * @since 0.9.5
+ */
+ public function getClass($qualifiedName)
+ {
+ $class = $this->findClass($qualifiedName);
+ if ($class === null) {
+ $class = $this->buildClassInternal($qualifiedName);
+ }
+ return $class;
+ }
+
+ /**
+ * Builds a new code type reference instance.
+ *
+ * @param string $qualifiedName The qualified name of the referenced type.
+ *
+ * @return \PDepend\Source\AST\ASTClassReference
+ * @since 0.9.5
+ */
+ public function buildAstClassReference($qualifiedName)
+ {
+ $this->checkBuilderState();
+
+ // Debug method creation
+ Log::debug(
+ 'Creating: \PDepend\Source\AST\ASTClassReference(' . $qualifiedName . ')'
+ );
+
+ return new \PDepend\Source\AST\ASTClassReference($this->context, $qualifiedName);
+ }
+
+ /**
+ * Builds a new new interface instance.
+ *
+ * If there is an existing class instance for the given name, this method
+ * checks if this class is part of the default namespace. If this is the
+ * case this method will update all references to the new interface and it
+ * removes the class instance. Otherwise it creates new interface instance.
+ *
+ * Where possible you should give a qualified interface name, that is
+ * prefixed with the package identifier.
+ *
+ *
+ * $builder->buildInterface('php::depend::Parser');
+ *
+ *
+ * To determine the correct interface, this method implements the following
+ * algorithm.
+ *
+ *
+ *
Check for an exactly matching instance and reuse it.
+ *
Check for a interface instance that belongs to the default package.
+ * If such an instance exists, reuse it and replace the default package
+ * with the newly given package information.
+ *
Check that the requested interface is in the default package, if
+ * this is true, reuse the first interface instance and ignore the default
+ * package.
+ *
+ *
Create a new instance for the specified package.
+ *
+ *
+ * @param string $name The interface name.
+ * @return \PDepend\Source\AST\ASTInterface
+ */
+ public function buildInterface($name)
+ {
+ $this->checkBuilderState();
+
+ $interface = new ASTInterface($this->extractTypeName($name));
+ $interface->setCache($this->cache)
+ ->setContext($this->context)
+ ->setCompilationUnit($this->defaultCompilationUnit);
+
+ return $interface;
+ }
+
+ /**
+ * This method will try to find an already existing instance for the given
+ * qualified name. It will create a new {@link \PDepend\Source\AST\ASTInterface}
+ * instance when no matching type exists.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTInterface
+ * @since 0.9.5
+ */
+ public function getInterface($qualifiedName)
+ {
+ $interface = $this->findInterface($qualifiedName);
+ if ($interface === null) {
+ $interface = $this->buildInterfaceInternal($qualifiedName);
+ }
+ return $interface;
+ }
+
+ /**
+ * Builds a new method instance.
+ *
+ * @param string $name
+ * @return \PDepend\Source\AST\ASTMethod
+ */
+ public function buildMethod($name)
+ {
+ $this->checkBuilderState();
+
+ // Debug method creation
+ Log::debug("Creating: \\PDepend\\Source\\AST\\ASTMethod({$name})");
+
+ // Create a new method instance
+ $method = new ASTMethod($name);
+ $method->setCache($this->cache);
+
+ return $method;
+ }
+
+ /**
+ * Builds a new package instance.
+ *
+ * @param string $name The package name.
+ * @return \PDepend\Source\AST\ASTNamespace
+ */
+ public function buildNamespace($name)
+ {
+ if (!isset($this->namespaces[$name])) {
+ // Debug package creation
+ Log::debug(
+ 'Creating: \\PDepend\\Source\\AST\\ASTNamespace(' . $name . ')'
+ );
+
+ $this->namespaces[$name] = new ASTNamespace($name);
+ }
+ return $this->namespaces[$name];
+ }
+
+ /**
+ * Builds a new function instance.
+ *
+ * @param string $name The function name.
+ * @return ASTFunction
+ */
+ public function buildFunction($name)
+ {
+ $this->checkBuilderState();
+
+ // Debug function creation
+ Log::debug("Creating: \\PDepend\\Source\\AST\\ASTFunction({$name})");
+
+ // Create new function
+ $function = new ASTFunction($name);
+ $function->setCache($this->cache)
+ ->setContext($this->context)
+ ->setCompilationUnit($this->defaultCompilationUnit);
+
+ return $function;
+ }
+
+ /**
+ * Builds a new self reference instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $type
+ * @return \PDepend\Source\AST\ASTSelfReference
+ * @since 0.9.6
+ */
+ public function buildAstSelfReference(AbstractASTClassOrInterface $type)
+ {
+ Log::debug(
+ 'Creating: \PDepend\Source\AST\ASTSelfReference(' . $type->getName() . ')'
+ );
+
+ return new \PDepend\Source\AST\ASTSelfReference($this->context, $type);
+ }
+
+ /**
+ * Builds a new parent reference instance.
+ *
+ * @param ASTClassOrInterfaceReference $reference The type
+ * instance that reference the concrete target of parent.
+ *
+ * @return ASTParentReference
+ * @since 0.9.6
+ */
+ public function buildAstParentReference(ASTClassOrInterfaceReference $reference)
+ {
+ Log::debug('Creating: \PDepend\Source\AST\ASTParentReference()');
+
+ return new ASTParentReference($reference);
+ }
+
+ /**
+ * Builds a new static reference instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $owner
+ * @return \PDepend\Source\AST\ASTStaticReference
+ * @since 0.9.6
+ */
+ public function buildAstStaticReference(AbstractASTClassOrInterface $owner)
+ {
+ Log::debug('Creating: \PDepend\Source\AST\ASTStaticReference()');
+
+ return new \PDepend\Source\AST\ASTStaticReference($this->context, $owner);
+ }
+
+ /**
+ * Builds a new field declaration node.
+ *
+ * @return \PDepend\Source\AST\ASTFieldDeclaration
+ * @since 0.9.6
+ */
+ public function buildAstFieldDeclaration()
+ {
+ return $this->buildAstNodeInstance('ASTFieldDeclaration');
+ }
+
+ /**
+ * Builds a new variable declarator node.
+ *
+ * @param string $image The source image for the variable declarator.
+ *
+ * @return \PDepend\Source\AST\ASTVariableDeclarator
+ * @since 0.9.6
+ */
+ public function buildAstVariableDeclarator($image)
+ {
+ return $this->buildAstNodeInstance('ASTVariableDeclarator', $image);
+ }
+
+ /**
+ * Builds a new static variable declaration node.
+ *
+ * @param string $image The source image for the statuc declaration.
+ *
+ * @return \PDepend\Source\AST\ASTStaticVariableDeclaration
+ * @since 0.9.6
+ */
+ public function buildAstStaticVariableDeclaration($image)
+ {
+ return $this->buildAstNodeInstance('ASTStaticVariableDeclaration', $image);
+ }
+
+ /**
+ * Builds a new constant node.
+ *
+ * @param string $image The source image for the constant.
+ *
+ * @return \PDepend\Source\AST\ASTConstant
+ * @since 0.9.6
+ */
+ public function buildAstConstant($image)
+ {
+ return $this->buildAstNodeInstance('ASTConstant', $image);
+ }
+
+ /**
+ * Builds a new variable node.
+ *
+ * @param string $image The source image for the variable.
+ *
+ * @return \PDepend\Source\AST\ASTVariable
+ * @since 0.9.6
+ */
+ public function buildAstVariable($image)
+ {
+ return $this->buildAstNodeInstance('ASTVariable', $image);
+ }
+
+ /**
+ * Builds a new variable variable node.
+ *
+ * @param string $image The source image for the variable variable.
+ *
+ * @return \PDepend\Source\AST\ASTVariableVariable
+ * @since 0.9.6
+ */
+ public function buildAstVariableVariable($image)
+ {
+ return $this->buildAstNodeInstance('ASTVariableVariable', $image);
+ }
+
+ /**
+ * Builds a new compound variable node.
+ *
+ * @param string $image The source image for the compound variable.
+ *
+ * @return \PDepend\Source\AST\ASTCompoundVariable
+ * @since 0.9.6
+ */
+ public function buildAstCompoundVariable($image)
+ {
+ return $this->buildAstNodeInstance('ASTCompoundVariable', $image);
+ }
+
+ /**
+ * Builds a new compound expression node.
+ *
+ * @return \PDepend\Source\AST\ASTCompoundExpression
+ * @since 0.9.6
+ */
+ public function buildAstCompoundExpression()
+ {
+ return $this->buildAstNodeInstance('ASTCompoundExpression');
+ }
+
+ /**
+ * Builds a new closure node.
+ *
+ * @return \PDepend\Source\AST\ASTClosure
+ * @since 0.9.12
+ */
+ public function buildAstClosure()
+ {
+ return $this->buildAstNodeInstance('ASTClosure');
+ }
+
+ /**
+ * Builds a new formal parameters node.
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameters
+ * @since 0.9.6
+ */
+ public function buildAstFormalParameters()
+ {
+ return $this->buildAstNodeInstance('ASTFormalParameters');
+ }
+
+ /**
+ * Builds a new formal parameter node.
+ *
+ * @return \PDepend\Source\AST\ASTFormalParameter
+ * @since 0.9.6
+ */
+ public function buildAstFormalParameter()
+ {
+ return $this->buildAstNodeInstance('ASTFormalParameter');
+ }
+
+ /**
+ * Builds a new expression node.
+ *
+ * @return \PDepend\Source\AST\ASTExpression
+ * @since 0.9.8
+ */
+ public function buildAstExpression()
+ {
+ return $this->buildAstNodeInstance('ASTExpression');
+ }
+
+ /**
+ * Builds a new assignment expression node.
+ *
+ * @param string $image The assignment operator.
+ *
+ * @return \PDepend\Source\AST\ASTAssignmentExpression
+ * @since 0.9.8
+ */
+ public function buildAstAssignmentExpression($image)
+ {
+ return $this->buildAstNodeInstance('ASTAssignmentExpression', $image);
+ }
+
+ /**
+ * Builds a new allocation expression node.
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTAllocationExpression
+ * @since 0.9.6
+ */
+ public function buildAstAllocationExpression($image)
+ {
+ return $this->buildAstNodeInstance('ASTAllocationExpression', $image);
+ }
+
+ /**
+ * Builds a new eval-expression node.
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTEvalExpression
+ * @since 0.9.12
+ */
+ public function buildAstEvalExpression($image)
+ {
+ return $this->buildAstNodeInstance('ASTEvalExpression', $image);
+ }
+
+ /**
+ * Builds a new exit-expression instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTExitExpression
+ * @since 0.9.12
+ */
+ public function buildAstExitExpression($image)
+ {
+ return $this->buildAstNodeInstance('ASTExitExpression', $image);
+ }
+
+ /**
+ * Builds a new clone-expression node.
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTCloneExpression
+ * @since 0.9.12
+ */
+ public function buildAstCloneExpression($image)
+ {
+ return $this->buildAstNodeInstance('ASTCloneExpression', $image);
+ }
+
+ /**
+ * Builds a new list-expression node.
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTListExpression
+ * @since 0.9.12
+ */
+ public function buildAstListExpression($image)
+ {
+ return $this->buildAstNodeInstance('ASTListExpression', $image);
+ }
+
+ /**
+ * Builds a new include- or include_once-expression.
+ *
+ * @return \PDepend\Source\AST\ASTIncludeExpression
+ * @since 0.9.12
+ */
+ public function buildAstIncludeExpression()
+ {
+ return $this->buildAstNodeInstance('ASTIncludeExpression');
+ }
+
+ /**
+ * Builds a new require- or require_once-expression.
+ *
+ * @return \PDepend\Source\AST\ASTRequireExpression
+ * @since 0.9.12
+ */
+ public function buildAstRequireExpression()
+ {
+ return $this->buildAstNodeInstance('ASTRequireExpression');
+ }
+
+ /**
+ * Builds a new array-expression node.
+ *
+ * @return \PDepend\Source\AST\ASTArrayIndexExpression
+ * @since 0.9.12
+ */
+ public function buildAstArrayIndexExpression()
+ {
+ return $this->buildAstNodeInstance('ASTArrayIndexExpression');
+ }
+
+ /**
+ * Builds a new string-expression node.
+ *
+ *
+ * // --------
+ * $string{$index}
+ * // --------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTStringIndexExpression
+ * @since 0.9.12
+ */
+ public function buildAstStringIndexExpression()
+ {
+ return $this->buildAstNodeInstance('ASTStringIndexExpression');
+ }
+
+ /**
+ * Builds a new php array node.
+ *
+ * @return \PDepend\Source\AST\ASTArray
+ * @since 1.0.0
+ */
+ public function buildAstArray()
+ {
+ return $this->buildAstNodeInstance('ASTArray');
+ }
+
+ /**
+ * Builds a new array element node.
+ *
+ * @return \PDepend\Source\AST\ASTArrayElement
+ * @since 1.0.0
+ */
+ public function buildAstArrayElement()
+ {
+ return $this->buildAstNodeInstance('ASTArrayElement');
+ }
+
+
+ /**
+ * Builds a new instanceof expression node.
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTInstanceOfExpression
+ * @since 0.9.6
+ */
+ public function buildAstInstanceOfExpression($image)
+ {
+ return $this->buildAstNodeInstance('ASTInstanceOfExpression', $image);
+ }
+
+ /**
+ * Builds a new isset-expression node.
+ *
+ *
+ * // -----------
+ * if (isset($foo)) {
+ * // -----------
+ * }
+ *
+ * // -----------------------
+ * if (isset($foo, $bar, $baz)) {
+ * // -----------------------
+ * }
+ *
+ *
+ * @return \PDepend\Source\AST\ASTIssetExpression
+ * @since 0.9.12
+ */
+ public function buildAstIssetExpression()
+ {
+ return $this->buildAstNodeInstance('ASTIssetExpression');
+ }
+
+ /**
+ * Builds a new boolean conditional-expression.
+ *
+ *
+ * --------------
+ * $bar = ($foo ? 42 : 23);
+ * --------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTConditionalExpression
+ * @since 0.9.8
+ */
+ public function buildAstConditionalExpression()
+ {
+ return $this->buildAstNodeInstance('ASTConditionalExpression', '?');
+ }
+
+ /**
+ * Build a new shift left expression.
+ *
+ * @return \PDepend\Source\AST\ASTShiftLeftExpression
+ * @since 1.0.1
+ */
+ public function buildAstShiftLeftExpression()
+ {
+ return $this->buildAstNodeInstance('ASTShiftLeftExpression');
+ }
+
+ /**
+ * Build a new shift right expression.
+ *
+ * @return \PDepend\Source\AST\ASTShiftRightExpression
+ * @since 1.0.1
+ */
+ public function buildAstShiftRightExpression()
+ {
+ return $this->buildAstNodeInstance('ASTShiftRightExpression');
+ }
+
+ /**
+ * Builds a new boolean and-expression.
+ *
+ * @return \PDepend\Source\AST\ASTBooleanAndExpression
+ * @since 0.9.8
+ */
+ public function buildAstBooleanAndExpression()
+ {
+ return $this->buildAstNodeInstance('ASTBooleanAndExpression', '&&');
+ }
+
+ /**
+ * Builds a new boolean or-expression.
+ *
+ * @return \PDepend\Source\AST\ASTBooleanOrExpression
+ * @since 0.9.8
+ */
+ public function buildAstBooleanOrExpression()
+ {
+ return $this->buildAstNodeInstance('ASTBooleanOrExpression', '||');
+ }
+
+ /**
+ * Builds a new logical and-expression.
+ *
+ * @return \PDepend\Source\AST\ASTLogicalAndExpression
+ * @since 0.9.8
+ */
+ public function buildAstLogicalAndExpression()
+ {
+ return $this->buildAstNodeInstance('ASTLogicalAndExpression', 'and');
+ }
+
+ /**
+ * Builds a new logical or-expression.
+ *
+ * @return \PDepend\Source\AST\ASTLogicalOrExpression
+ * @since 0.9.8
+ */
+ public function buildAstLogicalOrExpression()
+ {
+ return $this->buildAstNodeInstance('ASTLogicalOrExpression', 'or');
+ }
+
+ /**
+ * Builds a new logical xor-expression.
+ *
+ * @return \PDepend\Source\AST\ASTLogicalXorExpression
+ * @since 0.9.8
+ */
+ public function buildAstLogicalXorExpression()
+ {
+ return $this->buildAstNodeInstance('ASTLogicalXorExpression', 'xor');
+ }
+
+ /**
+ * Builds a new trait use-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTTraitUseStatement
+ * @since 1.0.0
+ */
+ public function buildAstTraitUseStatement()
+ {
+ return $this->buildAstNodeInstance('ASTTraitUseStatement');
+ }
+
+ /**
+ * Builds a new trait adaptation scope
+ *
+ * @return \PDepend\Source\AST\ASTTraitAdaptation
+ * @since 1.0.0
+ */
+ public function buildAstTraitAdaptation()
+ {
+ return $this->buildAstNodeInstance('ASTTraitAdaptation');
+ }
+
+ /**
+ * Builds a new trait adaptation alias statement.
+ *
+ * @param string $image The trait method name.
+ *
+ * @return \PDepend\Source\AST\ASTTraitAdaptationAlias
+ * @since 1.0.0
+ */
+ public function buildAstTraitAdaptationAlias($image)
+ {
+ return $this->buildAstNodeInstance('ASTTraitAdaptationAlias', $image);
+ }
+
+ /**
+ * Builds a new trait adaptation precedence statement.
+ *
+ * @param string $image The trait method name.
+ *
+ * @return \PDepend\Source\AST\ASTTraitAdaptationPrecedence
+ * @since 1.0.0
+ */
+ public function buildAstTraitAdaptationPrecedence($image)
+ {
+ return $this->buildAstNodeInstance('ASTTraitAdaptationPrecedence', $image);
+ }
+
+ /**
+ * Builds a new switch-statement-node.
+ *
+ * @return \PDepend\Source\AST\ASTSwitchStatement
+ * @since 0.9.8
+ */
+ public function buildAstSwitchStatement()
+ {
+ return $this->buildAstNodeInstance('ASTSwitchStatement');
+ }
+
+ /**
+ * Builds a new switch-label node.
+ *
+ * @param string $image The source image of this label.
+ *
+ * @return \PDepend\Source\AST\ASTSwitchLabel
+ * @since 0.9.8
+ */
+ public function buildAstSwitchLabel($image)
+ {
+ return $this->buildAstNodeInstance('ASTSwitchLabel', $image);
+ }
+
+ /**
+ * Builds a new global-statement instance.
+ *
+ * @return \PDepend\Source\AST\ASTGlobalStatement
+ * @since 0.9.12
+ */
+ public function buildAstGlobalStatement()
+ {
+ return $this->buildAstNodeInstance('ASTGlobalStatement');
+ }
+
+ /**
+ * Builds a new unset-statement instance.
+ *
+ * @return \PDepend\Source\AST\ASTUnsetStatement
+ * @since 0.9.12
+ */
+ public function buildAstUnsetStatement()
+ {
+ return $this->buildAstNodeInstance('ASTUnsetStatement');
+ }
+
+ /**
+ * Builds a new catch-statement node.
+ *
+ * @param string $image
+ * @return \PDepend\Source\AST\ASTCatchStatement
+ * @since 0.9.8
+ */
+ public function buildAstCatchStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTCatchStatement', $image);
+ }
+
+ /**
+ * Builds a new finally-statement node.
+ *
+ * @return \PDepend\Source\AST\ASTFinallyStatement
+ * @since 2.0.0
+ */
+ public function buildAstFinallyStatement()
+ {
+ return $this->buildAstNodeInstance('ASTFinallyStatement', 'finally');
+ }
+
+ /**
+ * Builds a new if statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTIfStatement
+ * @since 0.9.8
+ */
+ public function buildAstIfStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTIfStatement', $image);
+ }
+
+ /**
+ * Builds a new elseif statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTElseIfStatement
+ * @since 0.9.8
+ */
+ public function buildAstElseIfStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTElseIfStatement', $image);
+ }
+
+ /**
+ * Builds a new for statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTForStatement
+ * @since 0.9.8
+ */
+ public function buildAstForStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTForStatement', $image);
+ }
+
+ /**
+ * Builds a new for-init node.
+ *
+ *
+ * ------------------------
+ * for ($x = 0, $y = 23, $z = 42; $x < $y; ++$x) {}
+ * ------------------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTForInit
+ * @since 0.9.8
+ */
+ public function buildAstForInit()
+ {
+ return $this->buildAstNodeInstance('ASTForInit');
+ }
+
+ /**
+ * Builds a new for-update node.
+ *
+ *
+ * -------------------------------
+ * for ($x = 0, $y = 23, $z = 42; $x < $y; ++$x, $y = $x + 1, $z = $x + 2) {}
+ * -------------------------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTForUpdate
+ * @since 0.9.12
+ */
+ public function buildAstForUpdate()
+ {
+ return $this->buildAstNodeInstance('ASTForUpdate');
+ }
+
+ /**
+ * Builds a new foreach-statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTForeachStatement
+ * @since 0.9.8
+ */
+ public function buildAstForeachStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTForeachStatement', $image);
+ }
+
+ /**
+ * Builds a new while-statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTWhileStatement
+ * @since 0.9.8
+ */
+ public function buildAstWhileStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTWhileStatement', $image);
+ }
+
+ /**
+ * Builds a new do/while-statement node.
+ *
+ * @param string $image The source image of this statement.
+ *
+ * @return \PDepend\Source\AST\ASTDoWhileStatement
+ * @since 0.9.12
+ */
+ public function buildAstDoWhileStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTDoWhileStatement', $image);
+ }
+
+ /**
+ * Builds a new declare-statement node.
+ *
+ *
+ * -------------------------------
+ * declare(encoding='ISO-8859-1');
+ * -------------------------------
+ *
+ * -------------------
+ * declare(ticks=42) {
+ * // ...
+ * }
+ * -
+ *
+ * ------------------
+ * declare(ticks=42):
+ * // ...
+ * enddeclare;
+ * -----------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTDeclareStatement
+ * @since 0.10.0
+ */
+ public function buildAstDeclareStatement()
+ {
+ return $this->buildAstNodeInstance('ASTDeclareStatement');
+ }
+
+ /**
+ * Builds a new member primary expression node.
+ *
+ *
+ * //--------
+ * Foo::bar();
+ * //--------
+ *
+ * //---------
+ * Foo::$bar();
+ * //---------
+ *
+ * //---------
+ * $obj->bar();
+ * //---------
+ *
+ * //----------
+ * $obj->$bar();
+ * //----------
+ *
+ *
+ * @param string $image The source image of this expression.
+ *
+ * @return \PDepend\Source\AST\ASTMemberPrimaryPrefix
+ * @since 0.9.6
+ */
+ public function buildAstMemberPrimaryPrefix($image)
+ {
+ return $this->buildAstNodeInstance('ASTMemberPrimaryPrefix', $image);
+ }
+
+ /**
+ * Builds a new identifier node.
+ *
+ * @param string $image The image of this identifier.
+ *
+ * @return \PDepend\Source\AST\ASTIdentifier
+ * @since 0.9.6
+ */
+ public function buildAstIdentifier($image)
+ {
+ return $this->buildAstNodeInstance('ASTIdentifier', $image);
+ }
+
+ /**
+ * Builds a new function postfix expression.
+ *
+ *
+ * //-------
+ * foo($bar);
+ * //-------
+ *
+ * //--------
+ * $foo($bar);
+ * //--------
+ *
+ *
+ * @param string $image The image of this node.
+ *
+ * @return \PDepend\Source\AST\ASTFunctionPostfix
+ * @since 0.9.6
+ */
+ public function buildAstFunctionPostfix($image)
+ {
+ return $this->buildAstNodeInstance('ASTFunctionPostfix', $image);
+ }
+
+ /**
+ * Builds a new method postfix expression.
+ *
+ *
+ * // ---------
+ * Foo::bar($baz);
+ * // ---------
+ *
+ * // ----------
+ * Foo::$bar($baz);
+ * // ----------
+ *
+ *
+ * @param string $image The image of this node.
+ *
+ * @return \PDepend\Source\AST\ASTMethodPostfix
+ * @since 0.9.6
+ */
+ public function buildAstMethodPostfix($image)
+ {
+ return $this->buildAstNodeInstance('ASTMethodPostfix', $image);
+ }
+
+ /**
+ * Builds a new constant postfix expression.
+ *
+ *
+ * // ---
+ * Foo::BAR;
+ * // ---
+ *
+ *
+ * @param string $image The image of this node.
+ *
+ * @return \PDepend\Source\AST\ASTConstantPostfix
+ * @since 0.9.6
+ */
+ public function buildAstConstantPostfix($image)
+ {
+ return $this->buildAstNodeInstance('ASTConstantPostfix', $image);
+ }
+
+ /**
+ * Builds a new property postfix expression.
+ *
+ *
+ * // ----
+ * Foo::$bar;
+ * // ----
+ *
+ * // ---
+ * $object->bar;
+ * // ---
+ *
+ *
+ * @param string $image The image of this node.
+ *
+ * @return \PDepend\Source\AST\ASTPropertyPostfix
+ * @since 0.9.6
+ */
+ public function buildAstPropertyPostfix($image)
+ {
+ return $this->buildAstNodeInstance('ASTPropertyPostfix', $image);
+ }
+
+ /**
+ * Builds a new full qualified class name postfix expression.
+ *
+ *
+ * // -----
+ * Foo::class;
+ * // -----
+ *
+ * // -----
+ * $object::class;
+ * // -----
+ *
+ *
+ * @return \PDepend\Source\AST\ASTClassFqnPostfix
+ * @since 2.0.0
+ */
+ public function buildAstClassFqnPostfix()
+ {
+ return $this->buildAstNodeInstance('ASTClassFqnPostfix', 'class');
+ }
+
+ /**
+ * Builds a new arguments list.
+ *
+ *
+ * // ------------
+ * Foo::bar($x, $y, $z);
+ * // ------------
+ *
+ * // ------------
+ * $foo->bar($x, $y, $z);
+ * // ------------
+ *
+ *
+ * @return \PDepend\Source\AST\ASTArguments
+ * @since 0.9.6
+ */
+ public function buildAstArguments()
+ {
+ return $this->buildAstNodeInstance('ASTArguments');
+ }
+
+ /**
+ * Builds a new array type node.
+ *
+ * @return \PDepend\Source\AST\ASTTypeArray
+ * @since 0.9.6
+ */
+ public function buildAstTypeArray()
+ {
+ return $this->buildAstNodeInstance('ASTTypeArray');
+ }
+
+ /**
+ * Builds a new node for the callable type.
+ *
+ * @return \PDepend\Source\AST\ASTTypeCallable
+ * @since 1.0.0
+ */
+ public function buildAstTypeCallable()
+ {
+ return $this->buildAstNodeInstance('ASTTypeCallable');
+ }
+
+ /**
+ * Builds a new primitive type node.
+ *
+ * @param string $image The source image for the primitive type.
+ *
+ * @return \PDepend\Source\AST\ASTPrimitiveType
+ * @since 0.9.6
+ */
+ public function buildAstPrimitiveType($image)
+ {
+ return $this->buildAstNodeInstance('ASTPrimitiveType', $image);
+ }
+
+ /**
+ * Builds a new literal node.
+ *
+ * @param string $image The source image for the literal node.
+ *
+ * @return \PDepend\Source\AST\ASTLiteral
+ * @since 0.9.6
+ */
+ public function buildAstLiteral($image)
+ {
+ return $this->buildAstNodeInstance('ASTLiteral', $image);
+ }
+
+ /**
+ * Builds a new php string node.
+ *
+ *
+ * $string = "Manuel $Pichler <{$email}>";
+ *
+ * // \PDepend\Source\AST\ASTString
+ * // |-- ASTLiteral - "Manuel ")
+ * // |-- ASTVariable - $Pichler
+ * // |-- ASTLiteral - " <"
+ * // |-- ASTCompoundExpression - {...}
+ * // | |-- ASTVariable - $email
+ * // |-- ASTLiteral - ">"
+ *
+ *
+ * @return \PDepend\Source\AST\ASTString
+ * @since 0.9.10
+ */
+ public function buildAstString()
+ {
+ return $this->buildAstNodeInstance('ASTString');
+ }
+
+ /**
+ * Builds a new heredoc node.
+ *
+ * @return \PDepend\Source\AST\ASTHeredoc
+ * @since 0.9.12
+ */
+ public function buildAstHeredoc()
+ {
+ return $this->buildAstNodeInstance('ASTHeredoc');
+ }
+
+ /**
+ * Builds a new constant definition node.
+ *
+ *
+ * class Foo
+ * {
+ * // ------------------------
+ * const FOO = 42, BAR = 23;
+ * // ------------------------
+ * }
+ *
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTConstantDefinition
+ * @since 0.9.6
+ */
+ public function buildAstConstantDefinition($image)
+ {
+ return $this->buildAstNodeInstance('ASTConstantDefinition', $image);
+ }
+
+ /**
+ * Builds a new constant declarator node.
+ *
+ *
+ * class Foo
+ * {
+ * // --------
+ * const BAR = 42;
+ * // --------
+ * }
+ *
+ *
+ * Or in a comma separated constant defintion:
+ *
+ *
+ * class Foo
+ * {
+ * // --------
+ * const BAR = 42,
+ * // --------
+ *
+ * // --------------
+ * const BAZ = 'Foobar',
+ * // --------------
+ *
+ * // ----------
+ * const FOO = 3.14;
+ * // ----------
+ * }
+ *
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTConstantDeclarator
+ * @since 0.9.6
+ */
+ public function buildAstConstantDeclarator($image)
+ {
+ return $this->buildAstNodeInstance('ASTConstantDeclarator', $image);
+ }
+
+ /**
+ * Builds a new comment node instance.
+ *
+ * @param string $cdata The comment text.
+ *
+ * @return \PDepend\Source\AST\ASTComment
+ * @since 0.9.8
+ */
+ public function buildAstComment($cdata)
+ {
+ return $this->buildAstNodeInstance('ASTComment', $cdata);
+ }
+
+ /**
+ * Builds a new unary expression node instance.
+ *
+ * @param string $image The unary expression image/character.
+ *
+ * @return \PDepend\Source\AST\ASTUnaryExpression
+ * @since 0.9.11
+ */
+ public function buildAstUnaryExpression($image)
+ {
+ return $this->buildAstNodeInstance('ASTUnaryExpression', $image);
+ }
+
+ /**
+ * Builds a new cast-expression node instance.
+ *
+ * @param string $image The cast-expression image/character.
+ *
+ * @return \PDepend\Source\AST\ASTCastExpression
+ * @since 0.10.0
+ */
+ public function buildAstCastExpression($image)
+ {
+ return $this->buildAstNodeInstance('ASTCastExpression', $image);
+ }
+
+ /**
+ * Builds a new postfix-expression node instance.
+ *
+ * @param string $image The postfix-expression image/character.
+ *
+ * @return \PDepend\Source\AST\ASTPostfixExpression
+ * @since 0.10.0
+ */
+ public function buildAstPostfixExpression($image)
+ {
+ return $this->buildAstNodeInstance('ASTPostfixExpression', $image);
+ }
+
+ /**
+ * Builds a new pre-increment-expression node instance.
+ *
+ * @return \PDepend\Source\AST\ASTPreIncrementExpression
+ * @since 0.10.0
+ */
+ public function buildAstPreIncrementExpression()
+ {
+ return $this->buildAstNodeInstance('ASTPreIncrementExpression');
+ }
+
+ /**
+ * Builds a new pre-decrement-expression node instance.
+ *
+ * @return \PDepend\Source\AST\ASTPreDecrementExpression
+ * @since 0.10.0
+ */
+ public function buildAstPreDecrementExpression()
+ {
+ return $this->buildAstNodeInstance('ASTPreDecrementExpression');
+ }
+
+ /**
+ * Builds a new function/method scope instance.
+ *
+ * @return \PDepend\Source\AST\ASTScope
+ * @since 0.9.12
+ */
+ public function buildAstScope()
+ {
+ return $this->buildAstNodeInstance('ASTScope');
+ }
+
+ /**
+ * Builds a new statement instance.
+ *
+ * @return \PDepend\Source\AST\ASTStatement
+ * @since 0.9.12
+ */
+ public function buildAstStatement()
+ {
+ return $this->buildAstNodeInstance('ASTStatement');
+ }
+
+ /**
+ * Builds a new return statement node instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTReturnStatement
+ * @since 0.9.12
+ */
+ public function buildAstReturnStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTReturnStatement', $image);
+ }
+
+ /**
+ * Builds a new break-statement node instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTBreakStatement
+ * @since 0.9.12
+ */
+ public function buildAstBreakStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTBreakStatement', $image);
+ }
+
+ /**
+ * Builds a new continue-statement node instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTContinueStatement
+ * @since 0.9.12
+ */
+ public function buildAstContinueStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTContinueStatement', $image);
+ }
+
+ /**
+ * Builds a new scope-statement instance.
+ *
+ * @return \PDepend\Source\AST\ASTScopeStatement
+ * @since 0.9.12
+ */
+ public function buildAstScopeStatement()
+ {
+ return $this->buildAstNodeInstance('ASTScopeStatement');
+ }
+
+ /**
+ * Builds a new try-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTTryStatement
+ * @since 0.9.12
+ */
+ public function buildAstTryStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTTryStatement', $image);
+ }
+
+ /**
+ * Builds a new throw-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTThrowStatement
+ * @since 0.9.12
+ */
+ public function buildAstThrowStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTThrowStatement', $image);
+ }
+
+ /**
+ * Builds a new goto-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTGotoStatement
+ * @since 0.9.12
+ */
+ public function buildAstGotoStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTGotoStatement', $image);
+ }
+
+ /**
+ * Builds a new label-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTLabelStatement
+ * @since 0.9.12
+ */
+ public function buildAstLabelStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTLabelStatement', $image);
+ }
+
+ /**
+ * Builds a new exit-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTEchoStatement
+ * @since 0.9.12
+ */
+ public function buildAstEchoStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTEchoStatement', $image);
+ }
+
+ /**
+ * Builds a new yield-statement instance.
+ *
+ * @param string $image The source code image for this node.
+ *
+ * @return \PDepend\Source\AST\ASTYieldStatement
+ * @since $version$
+ */
+ public function buildAstYieldStatement($image)
+ {
+ return $this->buildAstNodeInstance('ASTYieldStatement', $image);
+ }
+
+ /**
+ * Returns an iterator with all generated {@link \PDepend\Source\AST\ASTNamespace}
+ * objects.
+ *
+ * @return \PDepend\Source\AST\ASTArtifactList
+ */
+ public function getIterator()
+ {
+ return $this->getNamespaces();
+ }
+
+ /**
+ * Returns an iterator with all generated {@link \PDepend\Source\AST\ASTNamespace}
+ * objects.
+ *
+ * @return \PDepend\Source\AST\ASTNamespace[]
+ */
+ public function getNamespaces()
+ {
+ if ($this->preparedNamespaces === null) {
+ $this->preparedNamespaces = $this->getPreparedNamespaces();
+ }
+ return new ASTArtifactList($this->preparedNamespaces);
+ }
+
+ /**
+ * Returns an iterator with all generated {@link \PDepend\Source\AST\ASTNamespace}
+ * objects.
+ *
+ * @return \PDepend\Source\AST\ASTArtifactList
+ * @since 0.9.12
+ */
+ private function getPreparedNamespaces()
+ {
+ // Create a package array copy
+ $namespaces = $this->namespaces;
+
+ // Remove default package if empty
+ if ($this->defaultPackage->getTypes()->count() === 0
+ && $this->defaultPackage->getFunctions()->count() === 0
+ ) {
+ unset($namespaces[self::DEFAULT_NAMESPACE]);
+ }
+ return $namespaces;
+ }
+
+ /**
+ * Builds a new trait instance or reuses a previous created trait.
+ *
+ * Where possible you should give a qualified trait name, that is prefixed
+ * with the package identifier.
+ *
+ *
+ * $builder->buildTrait('php::depend::Parser');
+ *
+ *
+ * To determine the correct trait, this method implements the following
+ * algorithm.
+ *
+ *
+ *
Check for an exactly matching instance and reuse it.
+ *
Check for a class instance that belongs to the default package. If
+ * such an instance exists, reuse it and replace the default package with
+ * the newly given package information.
+ *
Check that the requested trait is in the default package, if this
+ * is true, reuse the first trait instance and ignore the default package.
+ *
+ *
Create a new instance for the specified package.
+ *
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTTrait
+ * @since 0.9.5
+ */
+ protected function buildTraitInternal($qualifiedName)
+ {
+ $this->internal = true;
+
+ $trait = $this->buildTrait($qualifiedName);
+ $trait->setNamespace(
+ $this->buildNamespace($this->extractNamespaceName($qualifiedName))
+ );
+
+ $this->restoreTrait($trait);
+
+ return $trait;
+ }
+
+ /**
+ * This method tries to find a trait instance matching for the given
+ * qualified name in all scopes already processed. It will return the best
+ * matching instance or null if no match exists.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTTrait
+ * @since 0.9.5
+ */
+ protected function findTrait($qualifiedName)
+ {
+ $this->freeze();
+
+ $trait = $this->findType(
+ $this->frozenTraits,
+ $qualifiedName
+ );
+
+ if ($trait === null) {
+ $trait = $this->findType($this->traits, $qualifiedName);
+ }
+ return $trait;
+ }
+
+ /**
+ * Builds a new new interface instance.
+ *
+ * If there is an existing interface instance for the given name, this method
+ * checks if this interface is part of the default namespace. If this is the
+ * case this method will update all references to the new interface and it
+ * removes the class instance. Otherwise it creates new interface instance.
+ *
+ * Where possible you should give a qualified interface name, that is
+ * prefixed with the package identifier.
+ *
+ *
+ * $builder->buildInterface('php::depend::Parser');
+ *
+ *
+ * To determine the correct interface, this method implements the following
+ * algorithm.
+ *
+ *
+ *
Check for an exactly matching instance and reuse it.
+ *
Check for a interface instance that belongs to the default package.
+ * If such an instance exists, reuse it and replace the default package
+ * with the newly given package information.
+ *
Check that the requested interface is in the default package, if
+ * this is true, reuse the first interface instance and ignore the default
+ * package.
+ *
+ *
Create a new instance for the specified package.
+ *
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTInterface
+ * @since 0.9.5
+ */
+ protected function buildInterfaceInternal($qualifiedName)
+ {
+ $this->internal = true;
+
+ $interface = $this->buildInterface($qualifiedName);
+ $interface->setNamespace(
+ $this->buildNamespace($this->extractNamespaceName($qualifiedName))
+ );
+
+ $this->restoreInterface($interface);
+
+ return $interface;
+ }
+
+ /**
+ * This method tries to find an interface instance matching for the given
+ * qualified name in all scopes already processed. It will return the best
+ * matching instance or null if no match exists.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTInterface
+ * @since 0.9.5
+ */
+ protected function findInterface($qualifiedName)
+ {
+ $this->freeze();
+
+ $interface = $this->findType(
+ $this->frozenInterfaces,
+ $qualifiedName
+ );
+
+ if ($interface === null) {
+ $interface = $this->findType(
+ $this->interfaces,
+ $qualifiedName
+ );
+ }
+ return $interface;
+ }
+
+ /**
+ * Builds a new class instance or reuses a previous created class.
+ *
+ * Where possible you should give a qualified class name, that is prefixed
+ * with the package identifier.
+ *
+ *
+ * $builder->buildClass('php::depend::Parser');
+ *
+ *
+ * To determine the correct class, this method implements the following
+ * algorithm.
+ *
+ *
+ *
Check for an exactly matching instance and reuse it.
+ *
Check for a class instance that belongs to the default package. If
+ * such an instance exists, reuse it and replace the default package with
+ * the newly given package information.
+ *
Check that the requested class is in the default package, if this
+ * is true, reuse the first class instance and ignore the default package.
+ *
+ *
Create a new instance for the specified package.
+ *
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTClass
+ * @since 0.9.5
+ */
+ protected function buildClassInternal($qualifiedName)
+ {
+ $this->internal = true;
+
+ $class = $this->buildClass($qualifiedName);
+ $class->setNamespace(
+ $this->buildNamespace($this->extractNamespaceName($qualifiedName))
+ );
+
+ $this->restoreClass($class);
+
+ return $class;
+ }
+
+ /**
+ * This method tries to find a class instance matching for the given
+ * qualified name in all scopes already processed. It will return the best
+ * matching instance or null if no match exists.
+ *
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\ASTClass
+ * @since 0.9.5
+ */
+ protected function findClass($qualifiedName)
+ {
+ $this->freeze();
+
+ $class = $this->findType(
+ $this->frozenClasses,
+ $qualifiedName
+ );
+
+ if ($class === null) {
+ $class = $this->findType($this->classes, $qualifiedName);
+ }
+ return $class;
+ }
+
+ /**
+ * This method tries to find an interface or class instance matching for the
+ * given qualified name in all scopes already processed. It will return the
+ * best matching instance or null if no match exists.
+ *
+ * @param array $instances
+ * @param string $qualifiedName
+ * @return \PDepend\Source\AST\AbstractASTType
+ * @since 0.9.5
+ */
+ protected function findType(array $instances, $qualifiedName)
+ {
+ $classOrInterfaceName = $this->extractTypeName($qualifiedName);
+ $namespaceName = $this->extractNamespaceName($qualifiedName);
+
+ $caseInsensitiveName = strtolower($classOrInterfaceName);
+
+ if (!isset($instances[$caseInsensitiveName])) {
+ return null;
+ }
+
+ // Check for exact match and return first matching instance
+ if (isset($instances[$caseInsensitiveName][$namespaceName])) {
+ return reset($instances[$caseInsensitiveName][$namespaceName]);
+ }
+
+ if (!$this->isDefault($namespaceName)) {
+ return null;
+ }
+
+ $classesOrInterfaces = reset($instances[$caseInsensitiveName]);
+ return reset($classesOrInterfaces);
+ }
+
+ /**
+ * This method will freeze the actual builder state and create a second
+ * runtime scope.
+ *
+ * @return void
+ * @since 0.9.5
+ */
+ protected function freeze()
+ {
+ if ($this->frozen === true) {
+ return;
+ }
+
+ $this->frozen = true;
+
+ $this->frozenTraits = $this->copyTypesWithPackage($this->traits);
+ $this->frozenClasses = $this->copyTypesWithPackage($this->classes);
+ $this->frozenInterfaces = $this->copyTypesWithPackage($this->interfaces);
+
+ $this->traits = array();
+ $this->classes = array();
+ $this->interfaces = array();
+ }
+
+ /**
+ * Creates a copy of the given input array, but skips all types that do not
+ * contain a parent package.
+ *
+ * @param array $originalTypes The original types created during the parsing
+ * process.
+ *
+ * @return array
+ */
+ private function copyTypesWithPackage(array $originalTypes)
+ {
+ $copiedTypes = array();
+ foreach ($originalTypes as $typeName => $namespaces) {
+ foreach ($namespaces as $namespaceName => $types) {
+ foreach ($types as $index => $type) {
+ if (is_object($type->getNamespace())) {
+ $copiedTypes[$typeName][$namespaceName][$index] = $type;
+ }
+ }
+ }
+ }
+ return $copiedTypes;
+ }
+
+ /**
+ * Restores a function within the internal type scope.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return void
+ * @since 0.10.0
+ */
+ public function restoreFunction(ASTFunction $function)
+ {
+ $this->buildNamespace($function->getNamespaceName())
+ ->addFunction($function);
+ }
+
+ /**
+ * Restores a trait within the internal type scope.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @since 0.10.0
+ */
+ public function restoreTrait(ASTTrait $trait)
+ {
+ $this->storeTrait(
+ $trait->getName(),
+ $trait->getNamespaceName(),
+ $trait
+ );
+ }
+
+ /**
+ * Restores a class within the internal type scope.
+ *
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ * @since 0.10.0
+ */
+ public function restoreClass(ASTClass $class)
+ {
+ $this->storeClass(
+ $class->getName(),
+ $class->getNamespaceName(),
+ $class
+ );
+ }
+
+ /**
+ * Restores an interface within the internal type scope.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ * @since 0.10.0
+ */
+ public function restoreInterface(ASTInterface $interface)
+ {
+ $this->storeInterface(
+ $interface->getName(),
+ $interface->getNamespaceName(),
+ $interface
+ );
+ }
+
+ /**
+ * This method will persist a trait instance for later reuse.
+ *
+ * @param string $traitName
+ * @param string $namespaceName
+ * @param \PDepend\Source\AST\ASTTrait $trait
+ * @return void
+ * @@since 1.0.0
+ */
+ protected function storeTrait($traitName, $namespaceName, ASTTrait $trait)
+ {
+ $traitName = strtolower($traitName);
+ if (!isset($this->traits[$traitName][$namespaceName])) {
+ $this->traits[$traitName][$namespaceName] = array();
+ }
+ $this->traits[$traitName][$namespaceName][$trait->getId()] = $trait;
+
+ $namespace = $this->buildNamespace($namespaceName);
+ $namespace->addType($trait);
+ }
+
+ /**
+ * This method will persist a class instance for later reuse.
+ *
+ * @param string $className
+ * @param string $namespaceName
+ * @param \PDepend\Source\AST\ASTClass $class
+ * @return void
+ * @@since 0.9.5
+ */
+ protected function storeClass($className, $namespaceName, ASTClass $class)
+ {
+ $className = strtolower($className);
+ if (!isset($this->classes[$className][$namespaceName])) {
+ $this->classes[$className][$namespaceName] = array();
+ }
+ $this->classes[$className][$namespaceName][$class->getId()] = $class;
+
+ $namespace = $this->buildNamespace($namespaceName);
+ $namespace->addType($class);
+ }
+
+ /**
+ * This method will persist an interface instance for later reuse.
+ *
+ * @param string $interfaceName
+ * @param string $namespaceName
+ * @param \PDepend\Source\AST\ASTInterface $interface
+ * @return void
+ * @@since 0.9.5
+ */
+ protected function storeInterface($interfaceName, $namespaceName, ASTInterface $interface)
+ {
+ $interfaceName = strtolower($interfaceName);
+ if (!isset($this->interfaces[$interfaceName][$namespaceName])) {
+ $this->interfaces[$interfaceName][$namespaceName] = array();
+ }
+ $this->interfaces[$interfaceName][$namespaceName][$interface->getId()]
+ = $interface;
+
+ $namespace = $this->buildNamespace($namespaceName);
+ $namespace->addType($interface);
+ }
+
+ /**
+ * Checks that the parser is not frozen or a request is flagged as internal.
+ *
+ * @param boolean $internal The new internal flag value.
+ * @return void
+ * @throws \BadMethodCallException
+ * @since 0.9.5
+ */
+ protected function checkBuilderState($internal = false)
+ {
+ if ($this->frozen === true && $this->internal === false) {
+ throw new \BadMethodCallException(
+ 'Cannot create new nodes, when internal state is frozen.'
+ );
+ }
+ $this->internal = $internal;
+ }
+
+
+ /**
+ * Returns true if the given package is the default package.
+ *
+ * @param string $namespaceName The package name.
+ * @return boolean
+ */
+ protected function isDefault($namespaceName)
+ {
+ return ($namespaceName === self::DEFAULT_NAMESPACE);
+ }
+
+ /**
+ * Extracts the type name of a qualified PHP 5.3 type identifier.
+ *
+ *
+ * $typeName = $this->extractTypeName('foo\bar\foobar');
+ * var_dump($typeName);
+ * // Results in:
+ * // string(6) "foobar"
+ *
+ *
+ * @param string $qualifiedName The qualified PHP 5.3 type identifier.
+ *
+ * @return string
+ */
+ protected function extractTypeName($qualifiedName)
+ {
+ if (($pos = strrpos($qualifiedName, '\\')) !== false) {
+ return substr($qualifiedName, $pos + 1);
+ }
+ return $qualifiedName;
+ }
+
+ /**
+ * Extracts the package name of a qualified PHP 5.3 class identifier.
+ *
+ * If the class name doesn't contain a package identifier this method will
+ * return the default identifier.
+ *
+ *
+ * $namespaceName = $this->extractPackageName('foo\bar\foobar');
+ * var_dump($namespaceName);
+ * // Results in:
+ * // string(8) "foo\bar"
+ *
+ * $namespaceName = $this->extractPackageName('foobar');
+ * var_dump($namespaceName);
+ * // Results in:
+ * // string(6) "+global"
+ *
+ *
+ * @param string $qualifiedName The qualified PHP 5.3 class identifier.
+ *
+ * @return string
+ */
+ protected function extractNamespaceName($qualifiedName)
+ {
+ if (($pos = strrpos($qualifiedName, '\\')) !== false) {
+ return ltrim(substr($qualifiedName, 0, $pos), '\\');
+ } elseif (Type::isInternalType($qualifiedName)) {
+ return Type::getTypePackage($qualifiedName);
+ }
+ return self::DEFAULT_NAMESPACE;
+ }
+
+ /**
+ * Creates a {@link \PDepend\Source\AST\ASTNode} instance.
+ *
+ * @param string $className Local name of the ast node class.
+ * @param string $image Optional image for the created ast node.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 0.9.12
+ */
+ private function buildAstNodeInstance($className, $image = null)
+ {
+ $className = "\\PDepend\\Source\\AST\\{$className}";
+
+ Log::debug("Creating: {$className}({$image})");
+
+ return new $className($image);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPParserGeneric.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPParserGeneric.php
new file mode 100644
index 0000000..bff1baa
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPParserGeneric.php
@@ -0,0 +1,349 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.20
+ */
+
+namespace PDepend\Source\Language\PHP;
+
+use PDepend\Source\Parser\TokenStreamEndException;
+use PDepend\Source\Parser\UnexpectedTokenException;
+use PDepend\Source\Tokenizer\Tokenizer;
+use PDepend\Source\Tokenizer\Tokens;
+
+/**
+ * Concrete parser implementation that is very tolerant and accepts language
+ * constructs and keywords that are reserved in newer php versions, but not in
+ * older versions.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.20
+ */
+class PHPParserGeneric extends AbstractPHPParser
+{
+ /**
+ * Tests if the given token type is a reserved keyword in the supported PHP
+ * version.
+ *
+ * @param $tokenType
+ * @return boolean
+ * @since 1.1.1
+ */
+ protected function isKeyword($tokenType)
+ {
+ switch ($tokenType) {
+ case Tokens::T_CLASS:
+ case Tokens::T_INTERFACE:
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Will return true if the given $tokenType is a valid class
+ * name part.
+ *
+ * @param integer $tokenType The type of a parsed token.
+ *
+ * @return boolean
+ * @since 0.10.6
+ */
+ protected function isClassName($tokenType)
+ {
+ switch ($tokenType) {
+ case Tokens::T_DIR:
+ case Tokens::T_USE:
+ case Tokens::T_GOTO:
+ case Tokens::T_NULL:
+ case Tokens::T_NS_C:
+ case Tokens::T_TRUE:
+ case Tokens::T_CLONE:
+ case Tokens::T_FALSE:
+ case Tokens::T_TRAIT:
+ case Tokens::T_STRING:
+ case Tokens::T_TRAIT_C:
+ case Tokens::T_INSTEADOF:
+ case Tokens::T_NAMESPACE:
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Parses a valid class or interface name and returns the image of the parsed
+ * token.
+ *
+ * @return string
+ * @throws \PDepend\Source\Parser\TokenStreamEndException
+ * @throws \PDepend\Source\Parser\UnexpectedTokenException
+ */
+ protected function parseClassName()
+ {
+ $type = $this->tokenizer->peek();
+
+ if ($this->isClassName($type)) {
+ return $this->consumeToken($type)->image;
+ } elseif ($type === Tokenizer::T_EOF) {
+ throw new TokenStreamEndException($this->tokenizer);
+ }
+
+ throw new UnexpectedTokenException(
+ $this->tokenizer->next(),
+ $this->tokenizer->getSourceFile()
+ );
+ }
+
+ /**
+ * Parses a function name from the given tokenizer and returns the string
+ * literal representing the function name. If no valid token exists in the
+ * token stream, this method will throw an exception.
+ *
+ * @return string
+ * @throws \PDepend\Source\Parser\UnexpectedTokenException
+ * @throws \PDepend\Source\Parser\TokenStreamEndException
+ */
+ public function parseFunctionName()
+ {
+ $type = $this->tokenizer->peek();
+ switch ($type) {
+ case Tokens::T_CLONE:
+ case Tokens::T_STRING:
+ case Tokens::T_USE:
+ case Tokens::T_GOTO:
+ case Tokens::T_NULL:
+ case Tokens::T_SELF:
+ case Tokens::T_TRUE:
+ case Tokens::T_FALSE:
+ case Tokens::T_TRAIT:
+ case Tokens::T_INSTEADOF:
+ case Tokens::T_NAMESPACE:
+ case Tokens::T_DIR:
+ case Tokens::T_NS_C:
+ case Tokens::T_PARENT:
+ case Tokens::T_TRAIT_C:
+ return $this->consumeToken($type)->image;
+ case Tokenizer::T_EOF:
+ throw new TokenStreamEndException($this->tokenizer);
+ }
+ throw new UnexpectedTokenException(
+ $this->tokenizer->next(),
+ $this->tokenizer->getSourceFile()
+ );
+ }
+
+ /**
+ * Tests if the given token type is a valid formal parameter in the supported
+ * PHP version.
+ *
+ * @param integer $tokenType Numerical token identifier.
+ *
+ * @return boolean
+ * @since 1.0.0
+ */
+ protected function isFormalParameterTypeHint($tokenType)
+ {
+ switch ($tokenType) {
+ case Tokens::T_STRING:
+ case Tokens::T_CALLABLE:
+ case Tokens::T_BACKSLASH:
+ case Tokens::T_NAMESPACE:
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Parses a formal parameter type hint that is valid in the supported PHP
+ * version.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 1.0.0
+ */
+ protected function parseFormalParameterTypeHint()
+ {
+ switch ($this->tokenizer->peek()) {
+ case Tokens::T_CALLABLE:
+ $this->consumeToken(Tokens::T_CALLABLE);
+ $type = $this->builder->buildAstTypeCallable();
+ break;
+ case Tokens::T_STRING:
+ case Tokens::T_BACKSLASH:
+ case Tokens::T_NAMESPACE:
+ $name = $this->parseQualifiedName();
+
+ if (0 === strcasecmp('callable', $name)) {
+ $type = $this->builder->buildAstTypeCallable();
+ } else {
+ $type = $this->builder->buildAstClassOrInterfaceReference($name);
+ }
+ break;
+ }
+ return $type;
+ }
+
+ /**
+ * Parses an integer value.
+ *
+ * @return \PDepend\Source\AST\ASTLiteral
+ * @throws \PDepend\Source\Parser\UnexpectedTokenException
+ * @since 1.0.0
+ */
+ protected function parseIntegerNumber()
+ {
+ $token = $this->consumeToken(Tokens::T_LNUMBER);
+
+ if ('0' === $token->image) {
+ if (Tokens::T_STRING === $this->tokenizer->peek()) {
+ $token1 = $this->consumeToken(Tokens::T_STRING);
+ if (preg_match('(^b[01]+$)', $token1->image)) {
+ $token->image = $token->image . $token1->image;
+ $token->endLine = $token1->endLine;
+ $token->endColumn = $token1->endColumn;
+ } else {
+ throw new UnexpectedTokenException(
+ $token1,
+ $this->tokenizer->getSourceFile()
+ );
+ }
+ }
+ }
+
+ $literal = $this->builder->buildAstLiteral($token->image);
+ $literal->configureLinesAndColumns(
+ $token->startLine,
+ $token->endLine,
+ $token->startColumn,
+ $token->endColumn
+ );
+
+ return $literal;
+ }
+
+ /**
+ * This method parses a PHP version specific identifier for method and
+ * property postfix expressions.
+ *
+ * @return \PDepend\Source\AST\ASTNode
+ * @since 1.0.0
+ */
+ protected function parsePostfixIdentifier()
+ {
+ switch ($this->tokenizer->peek()) {
+ case Tokens::T_STRING:
+ $node = $this->parseLiteral();
+ break;
+ case Tokens::T_CURLY_BRACE_OPEN:
+ $node = $this->parseCompoundExpression();
+ break;
+ default:
+ $node = $this->parseCompoundVariableOrVariableVariableOrVariable();
+ break;
+ }
+ return $this->parseOptionalIndexExpression($node);
+ }
+
+ /**
+ * Implements some quirks and hacks to support php here- and now-doc for
+ * PHP 5.2.x versions :/
+ *
+ * @return \PDepend\Source\AST\ASTHeredoc
+ * @since 1.0.0
+ */
+ protected function parseHeredoc()
+ {
+ $heredoc = parent::parseHeredoc();
+ if (version_compare(phpversion(), "5.3.0alpha") >= 0) {
+ return $heredoc;
+ }
+
+ // Consume dangling semicolon
+ $this->tokenizer->next();
+
+ $token = $this->tokenizer->next();
+ preg_match('(/\*(\'|")\*/)', $token->image, $match);
+
+ return $heredoc;
+ }
+
+ /**
+ * Tests if the next token is a valid array start delimiter in the supported
+ * PHP version.
+ *
+ * @return boolean
+ * @since 1.0.0
+ */
+ protected function isArrayStartDelimiter()
+ {
+ switch ($this->tokenizer->peek()) {
+ case Tokens::T_ARRAY:
+ case Tokens::T_SQUARED_BRACKET_OPEN:
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Parses a php array declaration.
+ *
+ * @param \PDepend\Source\AST\ASTArray $array
+ * @param boolean $static
+ * @return \PDepend\Source\AST\ASTArray
+ * @since 1.0.0
+ */
+ protected function parseArray(\PDepend\Source\AST\ASTArray $array, $static = false)
+ {
+ switch ($this->tokenizer->peek()) {
+ case Tokens::T_ARRAY:
+ $this->consumeToken(Tokens::T_ARRAY);
+ $this->consumeComments();
+ $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
+ $this->parseArrayElements($array, Tokens::T_PARENTHESIS_CLOSE, $static);
+ $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
+ break;
+ default:
+ $this->consumeToken(Tokens::T_SQUARED_BRACKET_OPEN);
+ $this->parseArrayElements($array, Tokens::T_SQUARED_BRACKET_CLOSE, $static);
+ $this->consumeToken(Tokens::T_SQUARED_BRACKET_CLOSE);
+ break;
+ }
+ return $array;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPTokenizerHelperVersion52.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPTokenizerHelperVersion52.php
new file mode 100644
index 0000000..51ccd0f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPTokenizerHelperVersion52.php
@@ -0,0 +1,128 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Language\PHP;
+
+use PDepend\Source\Parser\TokenException;
+
+/**
+ * Utility class that can be used to handle PHP's namespace separator in all
+ * PHP environments lower than 5.3alpha3
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+final class PHPTokenizerHelperVersion52
+{
+ /**
+ * This method implements a workaround for all PHP versions lower 5.3alpha3
+ * that do not handle the namespace separator char.
+ *
+ * @param string $source The raw source code.
+ *
+ * @return array The tokens.
+ */
+ public static function tokenize($source)
+ {
+ // Replace backslash with valid token
+ $source = preg_replace(
+ array(
+ '#\\\\([^"\'`\\\\])#i',
+ '(<<<(\s*)([\w\d]+)(.*[\r\n])\2;(\r\n|\n|\r))sU',
+ '(<<<(\s*)([\w\d]+)(.*[\r\n])\2(\r\n|\n|\r))sU',
+ '(<<<(\s*)(["\'])([\w\d]+)\2(.*[\r\n])\3;(\r\n|\n|\r))sU',
+ '(<<<(\s*)(["\'])([\w\d]+)\2(.*[\r\n])\3(\s*),(\s*))sU',
+ '(<<<(\s*)(["\'])([\w\d]+)\2(.*[\r\n])\3(\s*)\)(\s*))sU'
+ ),
+ array(
+ ':::\\1',
+ "<<<\\1\\2\\3\\2;\\4/*\"*/;",
+ "<<<\\1\\2\\3\\2;\\4/*\"*/",
+ "<<<\\1\\3\\4\\3;\\5/*\\2*/;",
+ "<<<\\1\\3\\4\\3;\\5/*\\2*/,\\6",
+ "<<<\\1\\3\\4\\3;\\5/*\\2*/)\\6"
+ ),
+ $source
+ );
+
+ $tokens = self::doTokenize($source);
+
+ $result = array();
+ for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
+ if (is_string($tokens[$i])) {
+ $result[] = str_replace(':::', '\\', $tokens[$i]);
+ } elseif ($tokens[$i][0] !== T_DOUBLE_COLON) {
+ $tokens[$i][1] = str_replace(':::', '\\', $tokens[$i][1]);
+ $result[] = $tokens[$i];
+ } elseif (!isset($tokens[$i + 1]) || $tokens[$i + 1] !== ':') {
+ $tokens[$i][1] = str_replace(':::', '\\', $tokens[$i][1]);
+ $result[] = $tokens[$i];
+ } else {
+ $result[] = '\\';
+ ++$i;
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Executes the internal tokenizer function and decorates it with some
+ * exception handling.
+ *
+ * @param string $source The raw php source code.
+ * @return array
+ * @throws \PDepend\Source\Parser\TokenException
+ * @todo Exception should be moved into a general namespace.
+ */
+ private static function doTokenize($source)
+ {
+ ini_set('track_errors', 'on');
+ $php_errormsg = null;
+
+ $tokens = @token_get_all($source);
+
+ if ($php_errormsg === null) {
+ return $tokens;
+ }
+ throw new TokenException($php_errormsg);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPTokenizerInternal.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPTokenizerInternal.php
new file mode 100644
index 0000000..05aaf45
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Language/PHP/PHPTokenizerInternal.php
@@ -0,0 +1,704 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Language\PHP;
+
+use PDepend\Source\AST\ASTCompilationUnit;
+use PDepend\Source\Tokenizer\Token;
+use PDepend\Source\Tokenizer\Tokenizer;
+use PDepend\Source\Tokenizer\Tokens;
+
+/**
+ * This tokenizer uses the internal {@link token_get_all()} function as token stream
+ * generator.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ *
+ */
+class PHPTokenizerInternal implements Tokenizer
+{
+ /**
+ * Mapping between php internal tokens and php depend tokens.
+ *
+ * @var array(integer=>integer)
+ */
+ protected static $tokenMap = array(
+ T_AS => Tokens::T_AS,
+ T_DO => Tokens::T_DO,
+ T_IF => Tokens::T_IF,
+ T_SL => Tokens::T_SL,
+ T_SR => Tokens::T_SR,
+ T_DEC => Tokens::T_DEC,
+ T_FOR => Tokens::T_FOR,
+ T_INC => Tokens::T_INC,
+ T_NEW => Tokens::T_NEW,
+ T_TRY => Tokens::T_TRY,
+ T_USE => Tokens::T_USE,
+ T_VAR => Tokens::T_VAR,
+ T_CASE => Tokens::T_CASE,
+ T_ECHO => Tokens::T_ECHO,
+ T_ELSE => Tokens::T_ELSE,
+ T_EVAL => Tokens::T_EVAL,
+ T_EXIT => Tokens::T_EXIT,
+ T_FILE => Tokens::T_FILE,
+ T_GOTO => Tokens::T_GOTO,
+ T_LINE => Tokens::T_LINE,
+ T_LIST => Tokens::T_LIST,
+ T_NS_C => Tokens::T_NS_C,
+ T_ARRAY => Tokens::T_ARRAY,
+ T_BREAK => Tokens::T_BREAK,
+ T_CLASS => Tokens::T_CLASS,
+ T_CATCH => Tokens::T_CATCH,
+ T_CLONE => Tokens::T_CLONE,
+ T_CONST => Tokens::T_CONST,
+ T_EMPTY => Tokens::T_EMPTY,
+ T_ENDIF => Tokens::T_ENDIF,
+ T_FINAL => Tokens::T_FINAL,
+ T_ISSET => Tokens::T_ISSET,
+ T_PRINT => Tokens::T_PRINT,
+ T_THROW => Tokens::T_THROW,
+ T_TRAIT => Tokens::T_TRAIT,
+ T_UNSET => Tokens::T_UNSET,
+ T_WHILE => Tokens::T_WHILE,
+ T_ENDFOR => Tokens::T_ENDFOR,
+ T_ELSEIF => Tokens::T_ELSEIF,
+ T_FUNC_C => Tokens::T_FUNC_C,
+ T_GLOBAL => Tokens::T_GLOBAL,
+ T_PUBLIC => Tokens::T_PUBLIC,
+ T_RETURN => Tokens::T_RETURN,
+ T_STATIC => Tokens::T_STATIC,
+ T_STRING => Tokens::T_STRING,
+ T_SWITCH => Tokens::T_SWITCH,
+ T_CLASS_C => Tokens::T_CLASS_C,
+ T_COMMENT => Tokens::T_COMMENT,
+ T_DECLARE => Tokens::T_DECLARE,
+ T_DEFAULT => Tokens::T_DEFAULT,
+ T_DNUMBER => Tokens::T_DNUMBER,
+ T_EXTENDS => Tokens::T_EXTENDS,
+ T_FOREACH => Tokens::T_FOREACH,
+ T_INCLUDE => Tokens::T_INCLUDE,
+ T_LNUMBER => Tokens::T_LNUMBER,
+ T_PRIVATE => Tokens::T_PRIVATE,
+ T_REQUIRE => Tokens::T_REQUIRE,
+ T_TRAIT_C => Tokens::T_TRAIT_C,
+ T_ABSTRACT => Tokens::T_ABSTRACT,
+ T_CALLABLE => Tokens::T_CALLABLE,
+ T_ENDWHILE => Tokens::T_ENDWHILE,
+ T_FUNCTION => Tokens::T_FUNCTION,
+ T_INT_CAST => Tokens::T_INT_CAST,
+ T_IS_EQUAL => Tokens::T_IS_EQUAL,
+ T_OR_EQUAL => Tokens::T_OR_EQUAL,
+ T_CONTINUE => Tokens::T_CONTINUE,
+ T_METHOD_C => Tokens::T_METHOD_C,
+ T_OPEN_TAG => Tokens::T_OPEN_TAG,
+ T_SL_EQUAL => Tokens::T_SL_EQUAL,
+ T_SR_EQUAL => Tokens::T_SR_EQUAL,
+ T_VARIABLE => Tokens::T_VARIABLE,
+ T_ENDSWITCH => Tokens::T_ENDSWITCH,
+ T_DIV_EQUAL => Tokens::T_DIV_EQUAL,
+ T_AND_EQUAL => Tokens::T_AND_EQUAL,
+ T_MOD_EQUAL => Tokens::T_MOD_EQUAL,
+ T_MUL_EQUAL => Tokens::T_MUL_EQUAL,
+ T_NAMESPACE => Tokens::T_NAMESPACE,
+ T_XOR_EQUAL => Tokens::T_XOR_EQUAL,
+ T_INTERFACE => Tokens::T_INTERFACE,
+ T_BOOL_CAST => Tokens::T_BOOL_CAST,
+ T_CHARACTER => Tokens::T_CHARACTER,
+ T_CLOSE_TAG => Tokens::T_CLOSE_TAG,
+ T_INSTEADOF => Tokens::T_INSTEADOF,
+ T_PROTECTED => Tokens::T_PROTECTED,
+ T_CURLY_OPEN => Tokens::T_CURLY_BRACE_OPEN,
+ T_ENDFOREACH => Tokens::T_ENDFOREACH,
+ T_ENDDECLARE => Tokens::T_ENDDECLARE,
+ T_IMPLEMENTS => Tokens::T_IMPLEMENTS,
+ T_NUM_STRING => Tokens::T_NUM_STRING,
+ T_PLUS_EQUAL => Tokens::T_PLUS_EQUAL,
+ T_ARRAY_CAST => Tokens::T_ARRAY_CAST,
+ T_BOOLEAN_OR => Tokens::T_BOOLEAN_OR,
+ T_INSTANCEOF => Tokens::T_INSTANCEOF,
+ T_LOGICAL_OR => Tokens::T_LOGICAL_OR,
+ T_UNSET_CAST => Tokens::T_UNSET_CAST,
+ T_DOC_COMMENT => Tokens::T_DOC_COMMENT,
+ T_END_HEREDOC => Tokens::T_END_HEREDOC,
+ T_MINUS_EQUAL => Tokens::T_MINUS_EQUAL,
+ T_BOOLEAN_AND => Tokens::T_BOOLEAN_AND,
+ T_DOUBLE_CAST => Tokens::T_DOUBLE_CAST,
+ T_INLINE_HTML => Tokens::T_INLINE_HTML,
+ T_LOGICAL_AND => Tokens::T_LOGICAL_AND,
+ T_LOGICAL_XOR => Tokens::T_LOGICAL_XOR,
+ T_OBJECT_CAST => Tokens::T_OBJECT_CAST,
+ T_STRING_CAST => Tokens::T_STRING_CAST,
+ T_DOUBLE_ARROW => Tokens::T_DOUBLE_ARROW,
+ T_INCLUDE_ONCE => Tokens::T_INCLUDE_ONCE,
+ T_IS_IDENTICAL => Tokens::T_IS_IDENTICAL,
+ T_DOUBLE_COLON => Tokens::T_DOUBLE_COLON,
+ T_CONCAT_EQUAL => Tokens::T_CONCAT_EQUAL,
+ T_IS_NOT_EQUAL => Tokens::T_IS_NOT_EQUAL,
+ T_REQUIRE_ONCE => Tokens::T_REQUIRE_ONCE,
+ T_BAD_CHARACTER => Tokens::T_BAD_CHARACTER,
+ T_HALT_COMPILER => Tokens::T_HALT_COMPILER,
+ T_START_HEREDOC => Tokens::T_START_HEREDOC,
+ T_STRING_VARNAME => Tokens::T_STRING_VARNAME,
+ T_OBJECT_OPERATOR => Tokens::T_OBJECT_OPERATOR,
+ T_IS_NOT_IDENTICAL => Tokens::T_IS_NOT_IDENTICAL,
+ T_OPEN_TAG_WITH_ECHO => Tokens::T_OPEN_TAG_WITH_ECHO,
+ T_IS_GREATER_OR_EQUAL => Tokens::T_IS_GREATER_OR_EQUAL,
+ T_IS_SMALLER_OR_EQUAL => Tokens::T_IS_SMALLER_OR_EQUAL,
+ T_PAAMAYIM_NEKUDOTAYIM => Tokens::T_DOUBLE_COLON,
+ T_ENCAPSED_AND_WHITESPACE => Tokens::T_ENCAPSED_AND_WHITESPACE,
+ T_CONSTANT_ENCAPSED_STRING => Tokens::T_CONSTANT_ENCAPSED_STRING,
+ T_YIELD => Tokens::T_YIELD,
+ T_FINALLY => Tokens::T_FINALLY,
+ //T_DOLLAR_OPEN_CURLY_BRACES => Tokens::T_CURLY_BRACE_OPEN,
+ );
+
+ /**
+ * Mapping between php internal text tokens an php depend numeric tokens.
+ *
+ * @var array(string=>integer)
+ */
+ protected static $literalMap = array(
+ '@' => Tokens::T_AT,
+ '/' => Tokens::T_DIV,
+ '%' => Tokens::T_MOD,
+ '*' => Tokens::T_MUL,
+ '+' => Tokens::T_PLUS,
+ ':' => Tokens::T_COLON,
+ ',' => Tokens::T_COMMA,
+ '=' => Tokens::T_EQUAL,
+ '-' => Tokens::T_MINUS,
+ '.' => Tokens::T_CONCAT,
+ '$' => Tokens::T_DOLLAR,
+ '`' => Tokens::T_BACKTICK,
+ '\\' => Tokens::T_BACKSLASH,
+ ';' => Tokens::T_SEMICOLON,
+ '|' => Tokens::T_BITWISE_OR,
+ '&' => Tokens::T_BITWISE_AND,
+ '~' => Tokens::T_BITWISE_NOT,
+ '^' => Tokens::T_BITWISE_XOR,
+ '"' => Tokens::T_DOUBLE_QUOTE,
+ '?' => Tokens::T_QUESTION_MARK,
+ '!' => Tokens::T_EXCLAMATION_MARK,
+ '{' => Tokens::T_CURLY_BRACE_OPEN,
+ '}' => Tokens::T_CURLY_BRACE_CLOSE,
+ '(' => Tokens::T_PARENTHESIS_OPEN,
+ ')' => Tokens::T_PARENTHESIS_CLOSE,
+ '<' => Tokens::T_ANGLE_BRACKET_OPEN,
+ '>' => Tokens::T_ANGLE_BRACKET_CLOSE,
+ '[' => Tokens::T_SQUARED_BRACKET_OPEN,
+ ']' => Tokens::T_SQUARED_BRACKET_CLOSE,
+ 'use' => Tokens::T_USE,
+ 'goto' => Tokens::T_GOTO,
+ 'null' => Tokens::T_NULL,
+ 'self' => Tokens::T_SELF,
+ 'true' => Tokens::T_TRUE,
+ 'array' => Tokens::T_ARRAY,
+ 'false' => Tokens::T_FALSE,
+ 'trait' => Tokens::T_TRAIT,
+ 'yield' => Tokens::T_YIELD,
+ 'parent' => Tokens::T_PARENT,
+ 'finally' => Tokens::T_FINALLY,
+ 'insteadof' => Tokens::T_INSTEADOF,
+ 'namespace' => Tokens::T_NAMESPACE,
+ '__dir__' => Tokens::T_DIR,
+ '__trait__' => Tokens::T_TRAIT_C,
+ '__namespace__' => Tokens::T_NS_C,
+ );
+
+ /**
+ *
+ * @var array(mixed=>array)
+ */
+ protected static $substituteTokens = array(
+ T_DOLLAR_OPEN_CURLY_BRACES => array('$', '{'),
+ );
+
+ /**
+ * BuilderContext sensitive alternative mappings.
+ *
+ * @var array(integer=>array)
+ */
+ protected static $alternativeMap = array(
+ Tokens::T_USE => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_GOTO => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_NULL => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_SELF => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_TRUE => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_ARRAY => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ ),
+ Tokens::T_FALSE => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_PARENT => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_NAMESPACE => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_DIR => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_NS_C => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_PARENT => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_TRAIT_C=> array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_TRAIT => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_INSTEADOF => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_FINALLY => array(
+ Tokens::T_OBJECT_OPERATOR => Tokens::T_STRING,
+ Tokens::T_DOUBLE_COLON => Tokens::T_STRING,
+ Tokens::T_CONST => Tokens::T_STRING,
+ Tokens::T_FUNCTION => Tokens::T_STRING,
+ ),
+ Tokens::T_CLASS => array(
+ Tokens::T_DOUBLE_COLON => Tokens::T_CLASS_FQN,
+ ),
+ );
+
+ /**
+ * The source file instance.
+ *
+ * @var \PDepend\Source\AST\ASTCompilationUnit
+ */
+ protected $sourceFile = '';
+
+ /**
+ * Count of all tokens.
+ *
+ * @var integer
+ */
+ protected $count = 0;
+
+ /**
+ * Internal stream pointer index.
+ *
+ * @var integer
+ */
+ protected $index = 0;
+
+ /**
+ * Prepared token list.
+ *
+ * @var Token[]
+ */
+ protected $tokens = null;
+
+ /**
+ * The next free identifier for unknown string tokens.
+ *
+ * @var integer
+ */
+ private $unknownTokenID = 1000;
+
+ /**
+ * Returns the name of the source file.
+ *
+ * @return \PDepend\Source\AST\ASTCompilationUnit
+ */
+ public function getSourceFile()
+ {
+ return $this->sourceFile;
+ }
+
+ /**
+ * Sets a new php source file.
+ *
+ * @param string $sourceFile A php source file.
+ *
+ * @return void
+ */
+ public function setSourceFile($sourceFile)
+ {
+ $this->tokens = null;
+ $this->sourceFile = new ASTCompilationUnit($sourceFile);
+ }
+
+ /**
+ * Returns the next token or {@link \PDepend\Source\Tokenizer\Tokenizer::T_EOF} if
+ * there is no next token.
+ *
+ * @return Token|integer
+ */
+ public function next()
+ {
+ $this->tokenize();
+
+ if ($this->index < $this->count) {
+ return $this->tokens[$this->index++];
+ }
+ return self::T_EOF;
+ }
+
+ /**
+ * Returns the next token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_EOF} if
+ * there is no next token.
+ *
+ * @return integer
+ */
+ public function peek()
+ {
+ $this->tokenize();
+
+ if (isset($this->tokens[$this->index])) {
+ return $this->tokens[$this->index]->type;
+ }
+ return self::T_EOF;
+ }
+
+ /**
+ * Returns the type of next token, after the current token. This method
+ * ignores all comments between the current and the next token.
+ *
+ * @return integer
+ * @since 0.9.12
+ */
+ public function peekNext()
+ {
+ $this->tokenize();
+
+ $offset = 0;
+ do {
+ $type = $this->tokens[$this->index + ++$offset]->type;
+ } while ($type == Tokens::T_COMMENT || $type == Tokens::T_DOC_COMMENT);
+ return $type;
+ }
+
+ /**
+ * Returns the previous token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_BOF}
+ * if there is no previous token.
+ *
+ * @return integer
+ */
+ public function prev()
+ {
+ $this->tokenize();
+
+ if ($this->index > 1) {
+ return $this->tokens[$this->index - 2]->type;
+ }
+ return self::T_BOF;
+ }
+
+ /**
+ * This method takes an array of tokens returned by token_get_all()
+ * and substitutes some of the tokens with those required by PDepend's
+ * parser implementation.
+ *
+ * @param array(array) $tokens Unprepared array of php tokens.
+ *
+ * @return array(array)
+ */
+ private function substituteTokens(array $tokens)
+ {
+ $result = array();
+ foreach ($tokens as $token) {
+ $temp = (array) $token;
+ $temp = $temp[0];
+ if (isset(self::$substituteTokens[$temp])) {
+ foreach (self::$substituteTokens[$temp] as $token) {
+ $result[] = $token;
+ }
+ } else {
+ $result[] = $token;
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Tokenizes the content of the source file with {@link token_get_all()} and
+ * filters this token stream.
+ *
+ * @return void
+ */
+ private function tokenize()
+ {
+ if ($this->tokens) {
+ return;
+ }
+
+ $this->tokens = array();
+ $this->index = 0;
+ $this->count = 0;
+
+ // Replace short open tags, short open tags will produce invalid results
+ // in all environments with disabled short open tags.
+ $source = $this->sourceFile->getSource();
+ $source = preg_replace(
+ array('(<\?=)', '(<\?(\s))'),
+ array('substituteTokens($tokens);
+
+ // Is the current token between an opening and a closing php tag?
+ $inTag = false;
+
+ // The current line number
+ $startLine = 1;
+
+ $startColumn = 1;
+ $endColumn = 1;
+
+ $literalMap = self::$literalMap;
+ $tokenMap = self::$tokenMap;
+
+ // Previous found type
+ $previousType = null;
+
+ while ($token = current($tokens)) {
+ $type = null;
+ $image = null;
+
+ if (is_string($token)) {
+ $token = array(null, $token);
+ }
+
+ if ($token[0] === T_OPEN_TAG) {
+ $type = $tokenMap[$token[0]];
+ $image = $token[1];
+ $inTag = true;
+ } elseif ($token[0] === T_CLOSE_TAG) {
+ $type = $tokenMap[$token[0]];
+ $image = $token[1];
+ $inTag = false;
+ } elseif ($inTag === false) {
+ $type = Tokens::T_NO_PHP;
+ $image = $this->consumeNonePhpTokens($tokens);
+ } elseif ($token[0] === T_WHITESPACE) {
+ // Count newlines in token
+ $lines = substr_count($token[1], "\n");
+ if ($lines === 0) {
+ $startColumn += strlen($token[1]);
+ } else {
+ $startColumn = strlen(
+ substr($token[1], strrpos($token[1], "\n") + 1)
+ ) + 1;
+ }
+
+ $startLine += $lines;
+ } else {
+ $value = strtolower($token[1]);
+ if (isset($literalMap[$value])) {
+ // Fetch literal type
+ $type = $literalMap[$value];
+
+ // Check for a context sensitive alternative
+ if (isset(self::$alternativeMap[$type][$previousType])) {
+ $type = self::$alternativeMap[$type][$previousType];
+ }
+ $image = $token[1];
+ } elseif (isset($tokenMap[$token[0]])) {
+ $type = $tokenMap[$token[0]];
+ // Check for a context sensitive alternative
+ if (isset(self::$alternativeMap[$type][$previousType])) {
+ $type = self::$alternativeMap[$type][$previousType];
+ }
+
+ $image = $token[1];
+ } else {
+ // This should never happen
+ // @codeCoverageIgnoreStart
+ list($type, $image) = $this->generateUnknownToken($token[1]);
+ // @codeCoverageIgnoreEnd
+ }
+ }
+
+ if ($type) {
+ $rtrim = rtrim($image);
+ $lines = substr_count($rtrim, "\n");
+ if ($lines === 0) {
+ $endColumn = $startColumn + strlen($rtrim) - 1;
+ } else {
+ $endColumn = strlen(
+ substr($rtrim, strrpos($rtrim, "\n") + 1)
+ );
+ }
+
+ $endLine = $startLine + $lines;
+
+ $token = new Token($type, $rtrim, $startLine, $endLine, $startColumn, $endColumn);
+
+ // Store token in internal list
+ $this->tokens[] = $token;
+
+ // Count newlines in token
+ $lines = substr_count($image, "\n");
+ if ($lines === 0) {
+ $startColumn += strlen($image);
+ } else {
+ $startColumn = strlen(
+ substr($image, strrpos($image, "\n") + 1)
+ ) + 1;
+ }
+
+ $startLine += $lines;
+
+ // Store current type
+ if ($type !== Tokens::T_COMMENT && $type !== Tokens::T_DOC_COMMENT) {
+ $previousType = $type;
+ }
+ }
+
+ next($tokens);
+ }
+
+ $this->count = count($this->tokens);
+ }
+
+ /**
+ * This method fetches all tokens until an opening php tag was found and it
+ * returns the collected content. The returned value will be null if there
+ * was no none php token.
+ *
+ * @param array &$tokens Reference to the current token stream.
+ *
+ * @return string
+ */
+ private function consumeNonePhpTokens(array &$tokens)
+ {
+ // The collected token content
+ $content = null;
+
+ // Fetch current token
+ $token = (array) current($tokens);
+
+ // Skipp all non open tags
+ while ($token[0] !== T_OPEN_TAG_WITH_ECHO &&
+ $token[0] !== T_OPEN_TAG &&
+ $token[0] !== false) {
+
+ $content .= (isset($token[1]) ? $token[1] : $token[0]);
+
+ $token = (array) next($tokens);
+ }
+
+ // Set internal pointer one back when there was at least one none php token
+ if ($token[0] !== false) {
+ prev($tokens);
+ }
+
+ return $content;
+ }
+
+ /**
+ * Generates a dummy/temp token for unknown string literals.
+ *
+ * @param string $token The unknown string token.
+ *
+ * @return array(integer => mixed)
+ */
+ private function generateUnknownToken($token)
+ {
+ return array($this->unknownTokenID++, $token);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/InvalidStateException.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/InvalidStateException.php
new file mode 100644
index 0000000..84b27d6
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/InvalidStateException.php
@@ -0,0 +1,73 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Parser;
+
+/**
+ * This type of exception is thrown when the parser reaches an invalid state
+ * and the parsed source does not fill the expected structure.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class InvalidStateException extends ParserException
+{
+ /**
+ * Constructs a new invalid state exception.
+ *
+ * @param integer $lineNumber Line number where the parser has stopped.
+ * @param string $fileName The source file where this exception occured.
+ * @param string $reason Short description what has happend.
+ */
+ public function __construct($lineNumber, $fileName, $reason)
+ {
+ parent::__construct(
+ sprintf(
+ 'The parser has reached an invalid state near line "%d" in file ' .
+ '"%s". Please check the following conditions: %s',
+ $lineNumber,
+ $fileName,
+ $reason
+ )
+ );
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/MissingValueException.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/MissingValueException.php
new file mode 100644
index 0000000..6445add
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/MissingValueException.php
@@ -0,0 +1,78 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Parser;
+
+use PDepend\Source\Tokenizer\Token;
+use PDepend\Source\Tokenizer\Tokenizer;
+
+/**
+ * This type of exception is thrown when a parameter or property declaration
+ * should contain a default value, but this value was not defined.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class MissingValueException extends ParserException
+{
+ /**
+ * Constructs a new missing value exception.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ */
+ public function __construct(Tokenizer $tokenizer)
+ {
+ // Get wrong token
+ $token = $tokenizer->next();
+ // The parser must take care for this
+ assert($token instanceof Token);
+
+ $message = sprintf(
+ 'Missing default value on line: %d, col: %d, file: %s.',
+ $token->startLine,
+ $token->startColumn,
+ $tokenizer->getSourceFile()
+ );
+
+ parent::__construct($message);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/ParserException.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/ParserException.php
new file mode 100644
index 0000000..fdb008e
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/ParserException.php
@@ -0,0 +1,53 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Parser;
+
+/**
+ * Base class for exceptions that can occurred during the parsing process.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ParserException extends \RuntimeException
+{
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/SymbolTable.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/SymbolTable.php
new file mode 100644
index 0000000..2aa1397
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/SymbolTable.php
@@ -0,0 +1,140 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Parser;
+
+/**
+ * This class provides a simple hashmap for name mappings done by the parser.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class SymbolTable
+{
+ /**
+ * Stack with all active scopes.
+ *
+ * @var array(array)
+ */
+ private $scopeStack = array();
+
+ /**
+ * The currently active scope.
+ *
+ * @var array(string=>string)
+ */
+ private $scope = array();
+
+ /**
+ * This method creates a new scope.
+ *
+ * @return void
+ */
+ public function createScope()
+ {
+ // Add copy of last scope as new scope
+ array_push($this->scopeStack, $this->scope);
+ }
+
+ /**
+ * This method destorys the top most scope.
+ *
+ * @return void
+ */
+ public function destroyScope()
+ {
+ // Remove scope from stack
+ array_pop($this->scopeStack);
+
+ // Update current scope to latest in stack
+ $this->scope = end($this->scopeStack);
+ }
+
+ /**
+ * Adds a new value to the top most scope.
+ *
+ * @param string $key The key of this scope value.
+ * @param mixed $value A new scope value.
+ * @return void
+ */
+ public function add($key, $value)
+ {
+ if (is_array($this->scope) === false) {
+ throw new UnderflowException('No active scope.');
+ }
+ $this->scope[strtolower($key)] = $value;
+ }
+
+ /**
+ * Resets the current scope
+ *
+ * @return void
+ */
+ public function resetScope()
+ {
+ if (is_array($this->scope) === false) {
+ throw new UnderflowException('No active scope.');
+ }
+ $this->scope = array();
+ }
+
+ /**
+ * This method will return the registered value for the given key, when it
+ * exists in the current scope. The returned value will null if no
+ * value exists for the given key.
+ *
+ * @param string $key The key for a searched scope value.
+ * @return mixed
+ */
+ public function lookup($key)
+ {
+ if (is_array($this->scope) === false) {
+ throw new UnderflowException('No active scope.');
+ }
+
+ $key = strtolower($key);
+ if (isset($this->scope[$key])) {
+ return $this->scope[$key];
+ }
+ return null;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/TokenException.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/TokenException.php
new file mode 100644
index 0000000..0b279b6
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/TokenException.php
@@ -0,0 +1,56 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.10
+ */
+
+namespace PDepend\Source\Parser;
+
+/**
+ * Base class for token/token stream related exceptions.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.10
+ */
+class TokenException extends ParserException
+{
+
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/TokenStack.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/TokenStack.php
new file mode 100644
index 0000000..5ec0273
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/TokenStack.php
@@ -0,0 +1,120 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+
+namespace PDepend\Source\Parser;
+
+use PDepend\Source\Tokenizer\Token;
+
+/**
+ * This class provides a scoped collection for {@link \PDepend\Source\Tokenizer\Token}
+ * objects.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.6
+ */
+class TokenStack
+{
+ /**
+ * The actual token scope.
+ *
+ * @var \PDepend\Source\Tokenizer\Token[]
+ */
+ private $tokens = array();
+
+ /**
+ * Stack with token scopes.
+ *
+ * @var \PDepend\Source\Tokenizer\Token[][]
+ */
+ private $stack = array();
+
+ /**
+ * The current stack offset.
+ *
+ * @var integer
+ */
+ private $offset = 0;
+
+ /**
+ * This method will push a new token scope onto the stack,
+ *
+ * @return void
+ */
+ public function push()
+ {
+ $this->stack[$this->offset++] = $this->tokens;
+ $this->tokens = array();
+ }
+
+ /**
+ * This method will pop the top token scope from the stack and return an
+ * array with all collected tokens. Additionally this method will add all
+ * tokens of the removed scope onto the next token scope.
+ *
+ * @return \PDepend\Source\Tokenizer\Token[]
+ */
+ public function pop()
+ {
+ $tokens = $this->tokens;
+ $this->tokens = $this->stack[--$this->offset];
+
+ unset($this->stack[$this->offset]);
+
+ foreach ($tokens as $token) {
+ $this->tokens[] = $token;
+ }
+ return $tokens;
+ }
+
+ /**
+ * This method will add a new token to the currently active token scope.
+ *
+ * @param \PDepend\Source\Tokenizer\Token $token The token to add.
+ * @return \PDepend\Source\Tokenizer\Token
+ */
+ public function add(Token $token)
+ {
+ return ($this->tokens[] = $token);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/TokenStreamEndException.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/TokenStreamEndException.php
new file mode 100644
index 0000000..4975f1f
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/TokenStreamEndException.php
@@ -0,0 +1,70 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Parser;
+
+use PDepend\Source\Tokenizer\Tokenizer;
+
+/**
+ * This type of exception is thrown when the parser reaches the end of the token
+ * stream, but expects further tokens.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class TokenStreamEndException extends TokenException
+{
+ /**
+ * Constructs a new end of token stream exception.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ */
+ public function __construct(Tokenizer $tokenizer)
+ {
+ parent::__construct(
+ sprintf(
+ 'Unexpected end of token stream in file: %s.',
+ $tokenizer->getSourceFile()
+ )
+ );
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/UnexpectedTokenException.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/UnexpectedTokenException.php
new file mode 100644
index 0000000..021e34a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Parser/UnexpectedTokenException.php
@@ -0,0 +1,73 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Parser;
+
+use PDepend\Source\Tokenizer\Token;
+
+/**
+ * This type of exception is thrown when the parser detects an unexpected token.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class UnexpectedTokenException extends TokenException
+{
+ /**
+ * Constructs a new unexpected token exception.
+ *
+ * @param Token $token The last parsed token instance.
+ * @param string $fileName The file where the exception occured.
+ */
+ public function __construct(Token $token, $fileName)
+ {
+ $message = sprintf(
+ 'Unexpected token: %s, line: %d, col: %d, file: %s.',
+ $token->image,
+ $token->startLine,
+ $token->startColumn,
+ $fileName
+ );
+
+ parent::__construct($message);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Tokenizer/Token.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Tokenizer/Token.php
new file mode 100644
index 0000000..2eb8c81
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Tokenizer/Token.php
@@ -0,0 +1,114 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Tokenizer;
+
+/**
+ * This struct represents a code token.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Token
+{
+ /**
+ * The token type identifier.
+ *
+ * @var integer
+ */
+ public $type = null;
+
+ /**
+ * The token image/textual representation.
+ *
+ * @var string
+ */
+ public $image = null;
+
+ /**
+ * The start line number for this token.
+ *
+ * @var integer
+ */
+ public $startLine = null;
+
+ /**
+ * The end line number for this token.
+ *
+ * @var integer
+ */
+ public $endLine = null;
+
+ /**
+ * The start column number for this token.
+ *
+ * @var integer
+ */
+ public $startColumn = null;
+
+ /**
+ * The end column number for this token.
+ *
+ * @var integer
+ */
+ public $endColumn = null;
+
+ /**
+ * Constructs a new source token.
+ *
+ * @param integer $type The token type identifier.
+ * @param string $image The token image/textual representation.
+ * @param integer $startLine The start line number for this token.
+ * @param integer $endLine The end line number for this token.
+ * @param integer $startColumn The start column number for this token.
+ * @param integer $endColumn The end column number for this token.
+ */
+ public function __construct($type, $image, $startLine, $endLine, $startColumn, $endColumn)
+ {
+ $this->type = $type;
+ $this->image = $image;
+ $this->startLine = $startLine;
+ $this->endLine = $endLine;
+ $this->startColumn = $startColumn;
+ $this->endColumn = $endColumn;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Tokenizer/Tokenizer.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Tokenizer/Tokenizer.php
new file mode 100644
index 0000000..0bb2818
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Tokenizer/Tokenizer.php
@@ -0,0 +1,188 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Tokenizer;
+
+/**
+ * Define PHP 5.4 __TRAIT__ token constant.
+ */
+if (!defined('T_TRAIT_C')) {
+ define('T_TRAIT_C', 42000);
+}
+
+/**
+ * Define PHP 5.4 'trait' token constant.
+ */
+if (!defined('T_TRAIT')) {
+ define('T_TRAIT', 42001);
+}
+
+/**
+ * Define PHP 5.4 'insteadof' token constant.
+ */
+if (!defined('T_INSTEADOF')) {
+ define('T_INSTEADOF', 42002);
+}
+
+/**
+ * Define PHP 5.3 __NAMESPACE__ token constant.
+ */
+if (!defined('T_NS_C')) {
+ define('T_NS_C', 42003);
+}
+
+/**
+ * Define PHP 5.3 'use' token constant
+ */
+if (!defined('T_USE')) {
+ define('T_USE', 42004);
+}
+
+/**
+ * Define PHP 5.3 'namespace' token constant.
+ */
+if (!defined('T_NAMESPACE')) {
+ define('T_NAMESPACE', 42005);
+}
+
+/**
+ * Define PHP 5.3's '__DIR__' token constant.
+ */
+if (!defined('T_DIR')) {
+ define('T_DIR', 42006);
+}
+
+/**
+ * Define PHP 5.3's 'T_GOTO' token constant.
+ */
+if (!defined('T_GOTO')) {
+ define('T_GOTO', 42007);
+}
+
+/**
+ * Define PHP 5.4's 'T_CALLABLE' token constant
+ */
+if (!defined('T_CALLABLE')) {
+ define('T_CALLABLE', 42008);
+}
+
+/**
+ * Define PHP 5.5's 'T_YIELD' token constant
+ */
+if (!defined('T_YIELD')) {
+ define('T_YIELD', 42009);
+}
+
+/**
+ * Define PHP 5,5's 'T_FINALLY' token constant
+ */
+if (!defined('T_FINALLY')) {
+ define('T_FINALLY', 42010);
+}
+
+/**
+ * Base interface for all php code tokenizers.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface Tokenizer
+{
+ /**
+ * Marks the end of the token stream.
+ */
+ const T_EOF = -1;
+
+ /**
+ * Marks the beginning of the token stream.
+ */
+ const T_BOF = -2;
+
+ /**
+ * Returns the name of the source file.
+ *
+ * @return string
+ */
+ public function getSourceFile();
+
+ /**
+ * Sets a new php source file.
+ *
+ * @param string $sourceFile A php source file.
+ *
+ * @return void
+ */
+ public function setSourceFile($sourceFile);
+
+ /**
+ * Returns the next token or {@link \PDepend\Source\Tokenizer\Tokenizer::T_EOF} if
+ * there is no next token.
+ *
+ * @return \PDepend\Source\Tokenizer\Token
+ */
+ public function next();
+
+ /**
+ * Returns the next token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_EOF} if
+ * there is no next token.
+ *
+ * @return integer
+ */
+ public function peek();
+
+ /**
+ * Returns the type of next token, after the current token. This method
+ * ignores all comments between the current and the next token.
+ *
+ * @return integer
+ * @since 0.9.12
+ */
+ public function peekNext();
+
+ /**
+ * Returns the previous token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_BOF}
+ * if there is no previous token.
+ *
+ * @return integer
+ */
+ public function prev();
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Tokenizer/Tokens.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Tokenizer/Tokens.php
new file mode 100644
index 0000000..af379e8
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Source/Tokenizer/Tokens.php
@@ -0,0 +1,857 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Source\Tokenizer;
+
+/**
+ * This interface holds the different tokenizer, builder and parser constants.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface Tokens
+{
+ /**
+ * Marks a class token.
+ */
+ const T_CLASS = 1;
+
+ /**
+ * Marks an interface token.
+ */
+ const T_INTERFACE = 2;
+
+ /**
+ * Marks an abstract token.
+ */
+ const T_ABSTRACT = 3;
+
+ /**
+ * Marks a curly brace open.
+ */
+ const T_CURLY_BRACE_OPEN = 4;
+
+ /**
+ * Marks a curly brace close.
+ */
+ const T_CURLY_BRACE_CLOSE = 5;
+
+ /**
+ * Marks a parenthesis open.
+ */
+ const T_PARENTHESIS_OPEN = 6;
+
+ /**
+ * Marks a parenthesis close.
+ */
+ const T_PARENTHESIS_CLOSE = 7;
+
+ /**
+ * Marks a new token.
+ */
+ const T_NEW = 8;
+
+ /**
+ * Marks a function.
+ */
+ const T_FUNCTION = 9;
+
+ /**
+ * Marks a double colon.
+ */
+ const T_DOUBLE_COLON = 10;
+
+ /**
+ * Marks a string token.
+ */
+ const T_STRING = 11;
+
+ /**
+ * Marks a doc comment.
+ */
+ const T_DOC_COMMENT = 12;
+
+ /**
+ * Marks a semicolon.
+ */
+ const T_SEMICOLON = 13;
+
+ /**
+ * Marks a null token.
+ */
+ const T_NULL = 14;
+
+ /**
+ * Marks a true token.
+ */
+ const T_TRUE = 15;
+
+ /**
+ * Marks a false token.
+ */
+ const T_FALSE = 16;
+
+ /**
+ * Marks a array token.
+ */
+ const T_ARRAY = 17;
+
+ /**
+ * Marks a 'parent' token.
+ */
+ const T_PARENT = 18;
+
+ /**
+ * Marks a '=' token.
+ */
+ const T_EQUAL = 19;
+
+ /**
+ * Marks a '&=' token.
+ */
+ const T_AND_EQUAL = 20;
+
+ /**
+ * Marks a '.=' token.
+ */
+ const T_CONCAT_EQUAL = 21;
+
+ /**
+ * Marks a '/=' token.
+ */
+ const T_DIV_EQUAL = 22;
+
+ /**
+ * Marks a '==' token.
+ */
+ const T_IS_EQUAL = 23;
+
+ /**
+ * Marks a '>=' token.
+ */
+ const T_IS_GREATER_OR_EQUAL = 24;
+
+ /**
+ * Marks a '===' token.
+ */
+ const T_IS_IDENTICAL = 25;
+
+ /**
+ * Marks a '!=' or '<>' token.
+ */
+ const T_IS_NOT_EQUAL = 26;
+
+ /**
+ * Marks a '!==' token.
+ */
+ const T_IS_NOT_IDENTICAL = 27;
+
+ /**
+ * Marks a '<=' token.
+ */
+ const T_IS_SMALLER_OR_EQUAL = 28;
+
+ /**
+ * Marks a '-=' token.
+ */
+ const T_MINUS_EQUAL = 29;
+
+ /**
+ * Marks a '%=' token.
+ */
+ const T_MOD_EQUAL = 30;
+
+ /**
+ * Marks a '*=' token.
+ */
+ const T_MUL_EQUAL = 31;
+
+ /**
+ * Marks a '|=' token.
+ */
+ const T_OR_EQUAL = 32;
+
+ /**
+ * Marks a '+=' token.
+ */
+ const T_PLUS_EQUAL = 33;
+
+ /**
+ * Marks a '^=' token.
+ */
+ const T_XOR_EQUAL = 34;
+
+ /**
+ * Marks a '.' token.
+ */
+ const T_CONCAT = 35;
+
+ /**
+ * Marks a 'as' token.
+ */
+ const T_AS = 36;
+
+ /**
+ * Marks a '(array)' cast token.
+ */
+ const T_ARRAY_CAST = 37;
+
+ /**
+ * Marks a '&&' token.
+ */
+ const T_BOOLEAN_AND = 38;
+
+ /**
+ * Marks a '||' token.
+ */
+ const T_BOOLEAN_OR = 39;
+
+ /**
+ * Marks a '(bool)' or '(boolean)' cast token.
+ */
+ const T_BOOL_CAST = 40;
+
+ /**
+ * Marks a 'break' token.
+ */
+ const T_BREAK = 41;
+
+ /**
+ * Marks a 'case' token.
+ */
+ const T_CASE = 42;
+
+ /**
+ * Marks a 'catch' token.
+ */
+ const T_CATCH = 43;
+
+ /**
+ * Marks a '__CLASS__' token.
+ */
+ const T_CLASS_C = 44;
+
+ /**
+ * Marks a 'clone' token.
+ */
+ const T_CLONE = 45;
+
+ /**
+ * Marks a '?>' token.
+ */
+ const T_CLOSE_TAG = 46;
+
+ /**
+ * Marks a 'const' token.
+ */
+ const T_CONST = 47;
+
+ /**
+ * Marks a constant string like 'foo' or "foo".
+ */
+ const T_CONSTANT_ENCAPSED_STRING = 48;
+
+ /**
+ * Marks a 'continue' token.
+ */
+ const T_CONTINUE = 49;
+
+ /**
+ * Marks a '--' token.
+ */
+ const T_DEC = 50;
+
+ /**
+ * Marks a 'declare' token.
+ */
+ const T_DECLARE = 51;
+
+ /**
+ * Marks a 'default' token.
+ */
+ const T_DEFAULT = 52;
+
+ /**
+ * Marks a floating point number.
+ */
+ const T_DNUMBER = 53;
+
+ /**
+ * Marks a 'do' token.
+ */
+ const T_DO = 54;
+
+ /**
+ * Marks a '=>' token.
+ */
+ const T_DOUBLE_ARROW = 55;
+
+ /**
+ * Marks a '(real)', '(float)' or '(double)' cast token.
+ */
+ const T_DOUBLE_CAST = 56;
+
+ /**
+ * Marks a 'echo' token.
+ */
+ const T_ECHO = 57;
+
+ /**
+ * Marks a 'else' token.
+ */
+ const T_ELSE = 58;
+
+ /**
+ * Marks a 'elseif' token.
+ */
+ const T_ELSEIF = 59;
+
+ /**
+ * Marks a 'empty' token.
+ */
+ const T_EMPTY = 60;
+
+ /**
+ * Marks the end of a heredoc block.
+ */
+ const T_END_HEREDOC = 61;
+
+ /**
+ * Marks a 'evil' token.
+ */
+ const T_EVAL = 62;
+
+ /**
+ * Marks a 'exit' or 'die' token.
+ */
+ const T_EXIT = 63;
+
+ /**
+ * Marks a 'extends' token.
+ */
+ const T_EXTENDS = 64;
+
+ /**
+ * Marks a '__FILE__' token.
+ */
+ const T_FILE = 65;
+
+ /**
+ * Marks a 'final' token.
+ */
+ const T_FINAL = 66;
+
+ /**
+ * Marks a 'for' token.
+ */
+ const T_FOR = 67;
+
+ /**
+ * Marks a 'foreach' token.
+ */
+ const T_FOREACH = 68;
+
+ /**
+ * Marks a '__FUNCTION__' token.
+ */
+ const T_FUNC_C = 69;
+
+ /**
+ * Marks a 'global' token.
+ */
+ const T_GLOBAL = 70;
+
+ /**
+ * Marks a '__halt_compiler()' token.
+ */
+ const T_HALT_COMPILER = 71;
+
+ /**
+ * Marks a 'if' token.
+ */
+ const T_IF = 72;
+
+ /**
+ * Marks a 'implements' token.
+ */
+ const T_IMPLEMENTS = 73;
+
+ /**
+ * Marks a '++' token.
+ */
+ const T_INC = 74;
+
+ /**
+ * Marks a 'include' token.
+ */
+ const T_INCLUDE = 75;
+
+ /**
+ * Marks a 'include_once' token.
+ */
+ const T_INCLUDE_ONCE = 76;
+
+ /**
+ * Marks inline html???
+ */
+ const T_INLINE_HTML = 77;
+
+ /**
+ * Marks a 'instanceof' token.
+ */
+ const T_INSTANCEOF = 78;
+
+ /**
+ * Marks a '(int)' or '(integer)' cast token.
+ */
+ const T_INT_CAST = 79;
+
+ /**
+ * Marks a 'isset' token.
+ */
+ const T_ISSET = 80;
+
+ /**
+ * Marks a '__LINE__' token.
+ */
+ const T_LINE = 81;
+
+ /**
+ * Marks a 'list' token.
+ */
+ const T_LIST = 82;
+
+ /**
+ * Marks a integer number token.
+ */
+ const T_LNUMBER = 83;
+
+ /**
+ * Marks a 'and' token.
+ */
+ const T_LOGICAL_AND = 84;
+
+ /**
+ * Marks a 'or' token.
+ */
+ const T_LOGICAL_OR = 85;
+
+ /**
+ * Marks a 'xor' token.
+ */
+ const T_LOGICAL_XOR = 86;
+
+ /**
+ * Marks a '__METHOD__' token.
+ */
+ const T_METHOD_C = 87;
+
+ /**
+ * Marks a '__NAMESPACE__' token.
+ */
+ const T_NS_C = 88;
+
+ /**
+ * A number string token???
+ */
+ const T_NUM_STRING = 89;
+
+ /**
+ * Marks a '(object)' cast token.
+ */
+ const T_OBJECT_CAST = 90;
+
+ /**
+ * Marks a '->' object access token.
+ */
+ const T_OBJECT_OPERATOR = 91;
+
+ /**
+ * Marks a php open token.
+ */
+ const T_OPEN_TAG = 92;
+
+ /**
+ * Marks a php open token.
+ */
+ const T_OPEN_TAG_WITH_ECHO = 93;
+
+ /**
+ * Marks a 'print' token.
+ */
+ const T_PRINT = 94;
+
+ /**
+ * Marks a 'private' token.
+ */
+ const T_PRIVATE = 95;
+
+ /**
+ * Marks a 'public' token.
+ */
+ const T_PUBLIC = 96;
+
+ /**
+ * Marks a 'protected' token.
+ */
+ const T_PROTECTED = 97;
+
+ /**
+ * Marks a 'require' token.
+ */
+ const T_REQUIRE = 98;
+
+ /**
+ * Marks a 'require_once' token.
+ */
+ const T_REQUIRE_ONCE = 99;
+
+ /**
+ * Marks a 'return' token.
+ */
+ const T_RETURN = 100;
+
+ /**
+ * Marks a '<<' token.
+ */
+ const T_SL = 101;
+
+ /**
+ * Marks a '<<=' token.
+ */
+ const T_SL_EQUAL = 102;
+
+ /**
+ * Marks a '>>' token.
+ */
+ const T_SR = 103;
+
+ /**
+ * Marks a '>>=' token.
+ */
+ const T_SR_EQUAL = 104;
+
+ /**
+ * Marks the beginning of a here doc block.
+ */
+ const T_START_HEREDOC = 105;
+
+ /**
+ * Marks a 'static' token.
+ */
+ const T_STATIC = 106;
+
+ /**
+ * Marks a '(string)' cast token.
+ */
+ const T_STRING_CAST = 107;
+
+ /**
+ * Marks a string var name???
+ */
+ const T_STRING_VARNAME = 108;
+
+ /**
+ * Marks a 'switch' token.
+ */
+ const T_SWITCH = 109;
+
+ /**
+ * Marks a 'throw' token.
+ */
+ const T_THROW = 110;
+
+ /**
+ * Marks a 'try' token.
+ */
+ const T_TRY = 111;
+
+ /**
+ * Marks a 'unset' token.
+ */
+ const T_UNSET = 112;
+
+ /**
+ * Marks a '(unset)' cast token.
+ */
+ const T_UNSET_CAST = 113;
+
+ /**
+ * Marks a 'use' token.
+ */
+ const T_USE = 114;
+
+ /**
+ * Marks a 'var' token.
+ */
+ const T_VAR = 115;
+
+ /**
+ * Marks a variable token.
+ */
+ const T_VARIABLE = 116;
+
+ /**
+ * Marks a 'while' token.
+ */
+ const T_WHILE = 117;
+
+ /**
+ * Marks a ',' token.
+ */
+ const T_COMMA = 118;
+
+ /**
+ * Marks a '*' token.
+ */
+ const T_MUL = 119;
+
+ /**
+ * Marks a '[' token.
+ */
+ const T_SQUARED_BRACKET_OPEN = 120;
+
+ /**
+ * Marks a ']' token.
+ */
+ const T_SQUARED_BRACKET_CLOSE = 121;
+
+ /**
+ * Marks a '<' token.
+ */
+ const T_ANGLE_BRACKET_OPEN = 122;
+
+ /**
+ * Marks a '>' token.
+ */
+ const T_ANGLE_BRACKET_CLOSE = 123;
+
+ /**
+ * Marks a '"' token.
+ */
+ const T_DOUBLE_QUOTE = 124;
+
+ /**
+ * Marks a ':' token.
+ */
+ const T_COLON = 125;
+
+ /**
+ * Marks a '@' token.
+ */
+ const T_AT = 126;
+
+ /**
+ * Marks a '+' token.
+ */
+ const T_PLUS = 127;
+
+ /**
+ * Marks a '-' token.
+ */
+ const T_MINUS = 128;
+
+ /**
+ * Marks a '!' token.
+ */
+ const T_EXCLAMATION_MARK = 129;
+
+ /**
+ * Marks a '?' token.
+ */
+ const T_QUESTION_MARK = 130;
+
+ /**
+ * Marks a '&' token.
+ */
+ const T_BITWISE_AND = 131;
+
+ /**
+ * Marks a '|' token.
+ */
+ const T_BITWISE_OR = 132;
+
+ /**
+ * Marks a '~' token.
+ */
+ const T_BITWISE_NOT = 133;
+
+ /**
+ * Marks a '^' token.
+ */
+ const T_BITWISE_XOR = 134;
+
+ /**
+ * Marks a '/' token.
+ */
+ const T_DIV = 135;
+
+ /**
+ * Marks a '%' token.
+ */
+ const T_MOD = 136;
+
+ /**
+ * Marks a comment token.
+ */
+ const T_COMMENT = 137;
+
+ /**
+ * Marks a 'namespace' token.
+ */
+ const T_NAMESPACE = 138;
+
+ /**
+ * Marks an escape token.
+ */
+ const T_ENCAPSED_AND_WHITESPACE = 139;
+
+ /**
+ * Marks a '$' string token.
+ */
+ const T_DOLLAR = 140;
+
+ /**
+ * Marks any character token.
+ */
+ const T_CHARACTER = 141;
+
+ /**
+ * Marks any bad character token.
+ */
+ const T_BAD_CHARACTER = 142;
+
+ /**
+ * Marks a 'self' token.
+ */
+ const T_SELF = 143;
+
+ /**
+ * Marks a '`' backtick token.
+ */
+ const T_BACKTICK = 144;
+
+ /**
+ * Marks a '\' backslash token.
+ */
+ const T_BACKSLASH = 145;
+
+ /**
+ * Marks a '__DIR__' token.
+ */
+ const T_DIR = 146;
+
+ /**
+ * Marks a 'goto' token.
+ */
+ const T_GOTO = 147;
+
+ /**
+ * Alternative end token for an if-statement.
+ */
+ const T_ENDIF = 148;
+
+ /**
+ * Alternative end token for a for-statement.
+ */
+ const T_ENDFOR = 149;
+
+ /**
+ * Alternative end token for a foreach-statement.
+ */
+ const T_ENDFOREACH = 150;
+
+ /**
+ * Alternative end token for a switch-statement.
+ */
+ const T_ENDSWITCH = 151;
+
+ /**
+ * Alternative end token for a while-statement.
+ */
+ const T_ENDWHILE = 152;
+
+ /**
+ * Alternative end token for a declare-statement.
+ */
+ const T_ENDDECLARE = 153;
+
+ /**
+ * Marks a 'trait' keyword token.
+ */
+ const T_TRAIT = 154;
+
+ /**
+ * Marks a '__TRAIT__' magic constant token.
+ */
+ const T_TRAIT_C = 155;
+
+ /**
+ * Token that represents the new Callable type hint.
+ */
+ const T_CALLABLE = 156;
+
+ /**
+ * Token that represents the new 'insteadof' keyword.
+ */
+ const T_INSTEADOF = 157;
+
+ /**
+ * Token that represents the stdClass::class and $class::class constant.
+ */
+ const T_CLASS_FQN = 158;
+
+ /**
+ * Token that represents the new 'yield' keyword.
+ */
+ const T_YIELD = 159;
+
+ /**
+ * Token that represents the 'finally' keyword.
+ */
+ const T_FINALLY = 160;
+
+ /**
+ * Marks any content not between php tags.
+ */
+ const T_NO_PHP = 255;
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/TextUI/Command.php b/vendor/pdepend/pdepend/src/main/php/PDepend/TextUI/Command.php
new file mode 100644
index 0000000..38f4a5c
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/TextUI/Command.php
@@ -0,0 +1,626 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\TextUI;
+
+use PDepend\Util\ConfigurationInstance;
+use PDepend\Util\Log;
+use PDepend\Util\Workarounds;
+use PDepend\Application;
+
+/**
+ * Handles the command line stuff and starts the text ui runner.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Command
+{
+ /**
+ * Marks a cli error exit.
+ */
+ const CLI_ERROR = 1742;
+
+ /**
+ * Marks an input error exit.
+ */
+ const INPUT_ERROR = 1743;
+
+ /**
+ * The recieved cli options
+ *
+ * @var array(string=>mixed)
+ */
+ private $options = array();
+
+ /**
+ * The directories/files to be analyzed
+ *
+ * @var string
+ */
+ private $source;
+
+ /**
+ * The used text ui runner.
+ *
+ * @var \PDepend\TextUI\Runner
+ */
+ private $runner = null;
+
+ /**
+ * @var \PDepend\Application
+ */
+ private $application;
+
+ /**
+ * Performs the main cli process and returns the exit code.
+ *
+ * @return integer
+ */
+ public function run()
+ {
+ $this->application = new Application();
+
+ try {
+ if ($this->parseArguments() === false) {
+ $this->printHelp();
+ return self::CLI_ERROR;
+ }
+ } catch (\Exception $e) {
+ echo $e->getMessage(), PHP_EOL, PHP_EOL;
+
+ $this->printHelp();
+ return self::CLI_ERROR;
+ }
+
+ if (isset($this->options['--help'])) {
+ $this->printHelp();
+ return Runner::SUCCESS_EXIT;
+ }
+ if (isset($this->options['--usage'])) {
+ $this->printUsage();
+ return Runner::SUCCESS_EXIT;
+ }
+ if (isset($this->options['--version'])) {
+ $this->printVersion();
+ return Runner::SUCCESS_EXIT;
+ }
+
+ $configurationFile = false;
+
+ if (isset($this->options['--configuration'])) {
+ $configurationFile = $this->options['--configuration'];
+
+ if (false === file_exists($configurationFile)) {
+ $configurationFile = getcwd() . '/' . $configurationFile;
+ }
+ if (false === file_exists($configurationFile)) {
+ $configurationFile = $this->options['--configuration'];
+ }
+
+ unset($this->options['--configuration']);
+ } elseif (file_exists(getcwd() . '/pdepend.xml')) {
+ $configurationFile = getcwd() . '/pdepend.xml';
+ } elseif (file_exists(getcwd() . '/pdepend.xml.dist')) {
+ $configurationFile = getcwd() . '/pdepend.xml.dist';
+ }
+
+ if ($configurationFile) {
+ try {
+ $this->application->setConfigurationFile($configurationFile);
+ } catch (\Exception $e) {
+ echo $e->getMessage(), PHP_EOL, PHP_EOL;
+
+ $this->printHelp();
+ return self::CLI_ERROR;
+ }
+ }
+
+ // Create a new text ui runner
+ $this->runner = $this->application->getRunner();
+
+ $this->assignArguments();
+
+ // Get a copy of all options
+ $options = $this->options;
+
+ // Get an array with all available log options
+ $logOptions = $this->application->getAvailableLoggerOptions();
+
+ // Get an array with all available analyzer options
+ $analyzerOptions = $this->application->getAvailableAnalyzerOptions();
+
+ foreach ($options as $option => $value) {
+ if (isset($logOptions[$option])) {
+ // Reduce recieved option list
+ unset($options[$option]);
+ // Register logger
+ $this->runner->addReportGenerator(substr($option, 2), $value);
+ } elseif (isset($analyzerOptions[$option])) {
+ // Reduce recieved option list
+ unset($options[$option]);
+
+ if (isset($analyzerOptions[$option]['value']) && is_bool($value)) {
+ echo 'Option ', $option, ' requires a value.', PHP_EOL;
+ return self::INPUT_ERROR;
+ } elseif ($analyzerOptions[$option]['value'] === 'file'
+ && file_exists($value) === false
+ ) {
+ echo 'Specified file ', $option, '=', $value,
+ ' not exists.', PHP_EOL;
+
+ return self::INPUT_ERROR;
+ } elseif ($analyzerOptions[$option]['value'] === '*[,...]') {
+ $value = array_map('trim', explode(',', $value));
+ }
+ $this->runner->addOption(substr($option, 2), $value);
+ }
+ }
+
+ if (isset($options['--without-annotations'])) {
+ // Disable annotation parsing
+ $this->runner->setWithoutAnnotations();
+ // Remove option
+ unset($options['--without-annotations']);
+ }
+
+ if (isset($options['--optimization'])) {
+ // This option is deprecated.
+ echo 'Option --optimization is ambiguous.', PHP_EOL;
+ // Remove option
+ unset($options['--optimization']);
+ }
+
+ if (isset($options['--notify-me'])) {
+ $this->runner->addProcessListener(
+ new \PDepend\DbusUI\ResultPrinter()
+ );
+ unset($options['--notify-me']);
+ }
+
+ if (count($options) > 0) {
+ $this->printHelp();
+ echo "Unknown option '", key($options), "' given.", PHP_EOL;
+ return self::CLI_ERROR;
+ }
+
+ try {
+ // Output current pdepend version and author
+ $this->printVersion();
+ $this->printWorkarounds();
+
+ $startTime = time();
+
+ $result = $this->runner->run();
+
+ if ($this->runner->hasParseErrors() === true) {
+ $errors = $this->runner->getParseErrors();
+
+ printf(
+ '%sThe following error%s occured:%s',
+ PHP_EOL,
+ count($errors) > 1 ? 's' : '',
+ PHP_EOL
+ );
+
+ foreach ($errors as $error) {
+ echo $error, PHP_EOL;
+ }
+ echo PHP_EOL;
+ }
+
+ echo PHP_EOL, 'Time: ', date('i:s', time() - $startTime);
+ if (function_exists('memory_get_peak_usage')) {
+ $memory = (memory_get_peak_usage(true) / (1024 * 1024));
+ printf('; Memory: %4.2fMb', $memory);
+ }
+ echo PHP_EOL;
+
+ return $result;
+ } catch (\RuntimeException $e) {
+
+ echo PHP_EOL, PHP_EOL,
+ 'Critical error: ', PHP_EOL,
+ '=============== ', PHP_EOL,
+ $e->getMessage(), PHP_EOL;
+
+ Log::debug($e->getTraceAsString());
+
+ return $e->getCode();
+ }
+ }
+
+ /**
+ * Parses the cli arguments.
+ *
+ * @return boolean
+ */
+ protected function parseArguments()
+ {
+ if (!isset($_SERVER['argv'])) {
+ if (false === (boolean) ini_get('register_argc_argv')) {
+ // @codeCoverageIgnoreStart
+ echo 'Please enable register_argc_argv in your php.ini.';
+ } else {
+ // @codeCoverageIgnoreEnd
+ echo 'Unknown error, no $argv array available.';
+ }
+ echo PHP_EOL, PHP_EOL;
+ return false;
+ }
+
+ $argv = $_SERVER['argv'];
+
+ // Remove the pdepend command line file
+ array_shift($argv);
+
+ if (count($argv) === 0) {
+ return false;
+ }
+
+ // Last argument must be a list of source directories
+ if (strpos(end($argv), '--') !== 0) {
+ $this->source = explode(',', array_pop($argv));
+ }
+
+ for ($i = 0, $c = count($argv); $i < $c; ++$i) {
+
+ // Is it an ini_set option?
+ if ($argv[$i] === '-d' && isset($argv[$i + 1])) {
+ if (strpos($argv[++$i], '=') === false) {
+ ini_set($argv[$i], 'on');
+ } else {
+ list($key, $value) = explode('=', $argv[$i]);
+
+ ini_set($key, $value);
+ }
+ } elseif (strpos($argv[$i], '=') === false) {
+ $this->options[$argv[$i]] = true;
+ } else {
+ list($key, $value) = explode('=', $argv[$i]);
+
+ $this->options[$key] = $value;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Assign CLI arguments to current runner instance
+ *
+ * @return bool
+ */
+ protected function assignArguments()
+ {
+ if ($this->source) {
+ $this->runner->setSourceArguments($this->source);
+ }
+
+ // Check for suffix option
+ if (isset($this->options['--suffix'])) {
+ // Get file extensions
+ $extensions = explode(',', $this->options['--suffix']);
+ // Set allowed file extensions
+ $this->runner->setFileExtensions($extensions);
+
+ unset($this->options['--suffix']);
+ }
+
+ // Check for ignore option
+ if (isset($this->options['--ignore'])) {
+ // Get exclude directories
+ $directories = explode(',', $this->options['--ignore']);
+ // Set exclude directories
+ $this->runner->setExcludeDirectories($directories);
+
+ unset($this->options['--ignore']);
+ }
+
+ // Check for exclude namespace option
+ if (isset($this->options['--exclude'])) {
+ // Get exclude directories
+ $namespaces = explode(',', $this->options['--exclude']);
+ // Set exclude namespace
+ $this->runner->setExcludeNamespaces($namespaces);
+
+ unset($this->options['--exclude']);
+ }
+
+ // Check for the bad documentation option
+ if (isset($this->options['--bad-documentation'])) {
+ echo "Option --bad-documentation is ambiguous.", PHP_EOL;
+
+ unset($this->options['--bad-documentation']);
+ }
+
+ $configuration = $this->application->getConfiguration();
+
+ // Store in config registry
+ ConfigurationInstance::set($configuration);
+
+ if (isset($this->options['--debug'])) {
+ unset($this->options['--debug']);
+
+ Log::setSeverity(Log::DEBUG);
+ }
+ }
+
+ /**
+ * Outputs the current PDepend version.
+ *
+ * @return void
+ */
+ protected function printVersion()
+ {
+ $build = __DIR__ . '/../../../../../build.properties';
+
+ if (file_exists($build)) {
+ $data = @parse_ini_file($build);
+ $version = $data['project.version'];
+ } else {
+ $version = '@package_version@';
+ }
+
+ echo 'PDepend ', $version, PHP_EOL, PHP_EOL;
+ }
+
+ /**
+ * If the current PHP installation requires some workarounds or limitations,
+ * this method will output a message on STDOUT.
+ *
+ * @return void
+ */
+ protected function printWorkarounds()
+ {
+ $workarounds = new Workarounds();
+
+ if ($workarounds->isNotRequired()) {
+ return;
+ }
+
+ echo 'Your PHP version requires some workaround:', PHP_EOL;
+ foreach ($workarounds->getRequiredWorkarounds() as $workaround) {
+ echo '- ', $workaround, PHP_EOL;
+ }
+ echo PHP_EOL;
+ }
+
+ /**
+ * Outputs the base usage of PDepend.
+ *
+ * @return void
+ */
+ protected function printUsage()
+ {
+ $this->printVersion();
+ echo 'Usage: pdepend [options] [logger] ', PHP_EOL, PHP_EOL;
+ }
+
+ /**
+ * Outputs the main help of PDepend.
+ *
+ * @return void
+ */
+ protected function printHelp()
+ {
+ $this->printUsage();
+
+ $length = $this->printLogOptions();
+ $length = $this->printAnalyzerOptions($length);
+
+ $this->printOption(
+ '--configuration=',
+ 'Optional PDepend configuration file.',
+ $length
+ );
+ echo PHP_EOL;
+
+ $this->printOption(
+ '--suffix=',
+ 'List of valid PHP file extensions.',
+ $length
+ );
+ $this->printOption(
+ '--ignore=',
+ 'List of exclude directories.',
+ $length
+ );
+ $this->printOption(
+ '--exclude=',
+ 'List of exclude namespaces.',
+ $length
+ );
+ echo PHP_EOL;
+
+ $this->printOption(
+ '--without-annotations',
+ 'Do not parse doc comment annotations.',
+ $length
+ );
+ echo PHP_EOL;
+
+ $this->printOption('--debug', 'Prints debugging information.', $length);
+ $this->printOption('--help', 'Print this help text.', $length);
+ $this->printOption('--version', 'Print the current version.', $length);
+
+ $this->printDbusOption($length);
+
+ $this->printOption('-d key[=value]', 'Sets a php.ini value.', $length);
+ echo PHP_EOL;
+ }
+
+ /**
+ * Prints all available log options and returns the length of the longest
+ * option.
+ *
+ * @return integer
+ */
+ protected function printLogOptions()
+ {
+ $maxLength = 0;
+ $options = array();
+ $logOptions = $this->application->getAvailableLoggerOptions();
+ foreach ($logOptions as $option => $info) {
+ // Build log option identifier
+ $identifier = sprintf('%s=<%s>', $option, $info['value']);
+ // Store in options array
+ $options[$identifier] = $info['message'];
+
+ $length = strlen($identifier);
+ if ($length > $maxLength) {
+ $maxLength = $length;
+ }
+ }
+
+ ksort($options);
+
+ $last = null;
+ foreach ($options as $option => $message) {
+
+ $current = substr($option, 0, strrpos($option, '-'));
+ if ($last !== null && $last !== $current) {
+ echo PHP_EOL;
+ }
+ $last = $current;
+
+ $this->printOption($option, $message, $maxLength);
+ }
+ echo PHP_EOL;
+
+ return $maxLength;
+ }
+
+ /**
+ * Prints the analyzer options.
+ *
+ * @param integer $length Length of the longest option.
+ *
+ * @return integer
+ */
+ protected function printAnalyzerOptions($length)
+ {
+ $options = $this->application->getAvailableAnalyzerOptions();
+
+ if (count($options) === 0) {
+ return $length;
+ }
+
+ ksort($options);
+
+ foreach ($options as $option => $info) {
+
+ if (isset($info['value'])) {
+ $option .= '=<' . $info['value'] . '>';
+ } else {
+ $option .= '=';
+ }
+
+ $this->printOption($option, $info['message'], $length);
+ }
+ echo PHP_EOL;
+
+ return $length;
+ }
+
+ /**
+ * Prints a single option.
+ *
+ * @param string $option The option identifier.
+ * @param string $message The option help message.
+ * @param integer $length The length of the longest option.
+ *
+ * @return void
+ */
+ private function printOption($option, $message, $length)
+ {
+ // Ignore the phpunit xml option
+ if (0 === strpos($option, '--phpunit-xml=')) {
+ return;
+ }
+
+ // Calculate the max message length
+ $mlength = 77 - $length;
+
+ $option = str_pad($option, $length, ' ', STR_PAD_RIGHT);
+ echo ' ', $option, ' ';
+
+ $lines = explode(PHP_EOL, wordwrap($message, $mlength, PHP_EOL));
+ echo array_shift($lines);
+
+ while (($line = array_shift($lines)) !== null) {
+ echo PHP_EOL, str_repeat(' ', $length + 3), $line;
+ }
+ echo PHP_EOL;
+ }
+
+ /**
+ * Optionally outputs the dbus option when the required extension
+ * is loaded.
+ *
+ * @param integer $length Padding length for the option.
+ *
+ * @return void
+ */
+ private function printDbusOption($length)
+ {
+ if (extension_loaded("dbus") === false) {
+ return;
+ }
+
+ $option = '--notify-me';
+ $message = 'Show a notification after analysis.';
+
+ $this->printOption($option, $message, $length);
+ }
+
+ /**
+ * Main method that starts the command line runner.
+ *
+ * @return integer The exit code.
+ */
+ public static function main()
+ {
+ $command = new Command();
+ return $command->run();
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/TextUI/ResultPrinter.php b/vendor/pdepend/pdepend/src/main/php/PDepend/TextUI/ResultPrinter.php
new file mode 100644
index 0000000..c147338
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/TextUI/ResultPrinter.php
@@ -0,0 +1,232 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\TextUI;
+
+use PDepend\Metrics\Analyzer;
+use PDepend\ProcessListener;
+use PDepend\Source\AST\AbstractASTArtifact;
+use PDepend\Source\Builder\Builder;
+use PDepend\Source\Tokenizer\Tokenizer;
+use PDepend\Source\ASTVisitor\AbstractASTVisitListener;
+
+/**
+ * Prints current the PDepend status information.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ResultPrinter extends AbstractASTVisitListener implements ProcessListener
+{
+ /**
+ * The step size.
+ */
+ const STEP_SIZE = 20;
+
+ /**
+ * Number of processed items.
+ *
+ * @var integer
+ */
+ private $count = 0;
+
+ /**
+ * Is called when PDepend starts the file parsing process.
+ *
+ * @param \PDepend\Source\Builder\Builder $builder
+ * @return void
+ */
+ public function startParseProcess(Builder $builder)
+ {
+ $this->count = 0;
+
+ echo "Parsing source files:\n";
+ }
+
+ /**
+ * Is called when PDepend has finished the file parsing process.
+ *
+ * @param \PDepend\Source\Builder\Builder $builder
+ * @return void
+ */
+ public function endParseProcess(Builder $builder)
+ {
+ $this->finish();
+ }
+
+ /**
+ * Is called when PDepend starts parsing of a new file.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ * @return void
+ */
+ public function startFileParsing(Tokenizer $tokenizer)
+ {
+ $this->step();
+ }
+
+ /**
+ * Is called when PDepend has finished a file.
+ *
+ * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
+ * @return void
+ */
+ public function endFileParsing(Tokenizer $tokenizer)
+ {
+
+ }
+
+ /**
+ * Is called when PDepend starts the analyzing process.
+ *
+ * @return void
+ */
+ public function startAnalyzeProcess()
+ {
+ }
+
+ /**
+ * Is called when PDepend has finished the analyzing process.
+ *
+ * @return void
+ */
+ public function endAnalyzeProcess()
+ {
+ }
+
+ /**
+ * Is called when PDepend starts the logging process.
+ *
+ * @return void
+ */
+ public function startLogProcess()
+ {
+ echo "Generating pdepend log files, this may take a moment.\n";
+ }
+
+ /**
+ * Is called when PDepend has finished the logging process.
+ *
+ * @return void
+ */
+ public function endLogProcess()
+ {
+ }
+
+ /**
+ * Is called when PDepend starts a new analyzer.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer
+ * @return void
+ */
+ public function startAnalyzer(Analyzer $analyzer)
+ {
+ $this->count = 0;
+
+ $parts = explode('\\', get_class($analyzer));
+
+ $name = preg_replace('(Analyzer$)', '', end($parts));
+ $name = preg_replace('/([a-zA-Z])([a-z])(?=[A-Z])/', '$1$2 ', $name);
+
+ echo "Calculating {$name} metrics:\n";
+ }
+
+ /**
+ * Is called when PDepend has finished one analyzing process.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer
+ * @return void
+ */
+ public function endAnalyzer(Analyzer $analyzer)
+ {
+ $this->finish(self::STEP_SIZE);
+ }
+
+ /**
+ * Generic notification method that is called for every node start.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $node
+ * @return void
+ */
+ public function startVisitNode(AbstractASTArtifact $node)
+ {
+ $this->step(self::STEP_SIZE);
+ }
+
+ /**
+ * Prints a single dot for the current step.
+ *
+ * @param integer $size
+ * @return void
+ */
+ protected function step($size = 1)
+ {
+ if ($this->count > 0 && $this->count % $size === 0) {
+ echo '.';
+ }
+ if ($this->count > 0 && $this->count % ($size * 60) === 0) {
+ printf("% 6s\n", $this->count);
+ }
+ ++$this->count;
+ }
+
+ /**
+ * Closes the current dot line.
+ *
+ * @param integer $size
+ * @return void
+ */
+ protected function finish($size = 1)
+ {
+ $diff = ($this->count % ($size * 60));
+
+ if ($diff === 0) {
+ printf(".% 6s\n\n", $this->count);
+ } elseif ($size === 1) {
+ $indent = 66 - ceil($diff / $size);
+ printf(".% {$indent}s\n\n", $this->count);
+ } else {
+ $indent = 66 - ceil($diff / $size) + 1;
+ printf("% {$indent}s\n\n", $this->count);
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/TextUI/Runner.php b/vendor/pdepend/pdepend/src/main/php/PDepend/TextUI/Runner.php
new file mode 100644
index 0000000..73c3043
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/TextUI/Runner.php
@@ -0,0 +1,347 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\TextUI;
+
+use PDepend\Engine;
+use PDepend\Input\ExcludePathFilter;
+use PDepend\Input\ExtensionFilter;
+use PDepend\ProcessListener;
+use PDepend\Report\ReportGeneratorFactory;
+use PDepend\Source\AST\ASTArtifactList\PackageArtifactFilter;
+
+/**
+ * The command line runner starts a PDepend process.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Runner
+{
+ /**
+ * Marks the default success exit.
+ */
+ const SUCCESS_EXIT = 0;
+
+ /**
+ * Marks an internal exception exit.
+ */
+ const EXCEPTION_EXIT = 2;
+
+ /**
+ * List of allowed file extensions. Default file extensions are php
+ * and
php5.
+ *
+ * @var array(string)
+ */
+ private $extensions = array('php', 'php5');
+
+ /**
+ * List of exclude directories. Default exclude dirs are .svn and
+ * CVS.
+ *
+ * @var array(string)
+ */
+ private $excludeDirectories = array('.git', '.svn', 'CVS');
+
+ /**
+ * List of exclude namespaces.
+ *
+ * @var array(string)
+ */
+ private $excludeNamespaces = array();
+
+ /**
+ * List of source code directories and files.
+ *
+ * @var array(string)
+ */
+ private $sourceArguments = array();
+
+ /**
+ * Should the parse ignore doc comment annotations?
+ *
+ * @var boolean
+ */
+ private $withoutAnnotations = false;
+
+ /**
+ * List of log identifiers and log files.
+ *
+ * @var array(string=>string)
+ */
+ private $loggerMap = array();
+
+ /**
+ * List of cli options for loggers or analyzers.
+ *
+ * @var array(string=>mixed)
+ */
+ private $options = array();
+
+ /**
+ * This of process listeners that will be hooked into PDepend's analyzing
+ * process.
+ *
+ * @var ProcessListener[]
+ */
+ private $processListeners = array();
+
+ /**
+ * List of error messages for all parsing errors.
+ *
+ * @var array(string)
+ */
+ private $parseErrors = array();
+
+ /**
+ * @var PDepend\Report\ReportGeneratorFactory
+ */
+ private $reportGeneratorFactory;
+
+ /**
+ * @var PDepend\Engine
+ */
+ private $engine;
+
+ public function __construct(ReportGeneratorFactory $reportGeneratorFactory, Engine $engine)
+ {
+ $this->reportGeneratorFactory = $reportGeneratorFactory;
+ $this->engine = $engine;
+ }
+
+ /**
+ * Sets a list of allowed file extensions.
+ *
+ * NOTE: If you call this method, it will replace the default file extensions.
+ *
+ * @param array(string) $extensions List of file extensions.
+ * @return void
+ */
+ public function setFileExtensions(array $extensions)
+ {
+ $this->extensions = $extensions;
+ }
+
+ /**
+ * Sets a list of exclude directories.
+ *
+ * NOTE: If this method is called, it will overwrite the default settings.
+ *
+ * @param array(string) $excludeDirectories All exclude directories.
+ * @return void
+ */
+ public function setExcludeDirectories(array $excludeDirectories)
+ {
+ $this->excludeDirectories = $excludeDirectories;
+ }
+
+ /**
+ * Sets a list of exclude packages.
+ *
+ * @param array(string) $excludePackages Exclude packages.
+ * @return void
+ */
+ public function setExcludeNamespaces(array $excludePackages)
+ {
+ $this->excludeNamespaces = $excludePackages;
+ }
+
+ /**
+ * Sets a list of source directories and files.
+ *
+ * @param array(string) $sourceArguments The source directories.
+ * @return void
+ */
+ public function setSourceArguments(array $sourceArguments)
+ {
+ $this->sourceArguments = $sourceArguments;
+ }
+
+ /**
+ * Should the parser ignore doc comment annotations?
+ *
+ * @return void
+ */
+ public function setWithoutAnnotations()
+ {
+ $this->withoutAnnotations = true;
+ }
+
+ /**
+ * Adds a logger to this runner.
+ *
+ * @param string $generatorId The logger identifier.
+ * @param string $reportFile The log file name.
+ * @return void
+ */
+ public function addReportGenerator($generatorId, $reportFile)
+ {
+ $this->loggerMap[$generatorId] = $reportFile;
+ }
+
+ /**
+ * Adds a logger or analyzer option.
+ *
+ * @param string $identifier The option identifier.
+ * @param string|array $value The option value.
+ * @return void
+ */
+ public function addOption($identifier, $value)
+ {
+ $this->options[$identifier] = $value;
+ }
+
+ /**
+ * Adds a process listener instance that will be hooked into PDepend's
+ * analyzing process.
+ *
+ * @param ProcessListener $processListener A process listener.
+ * @return void
+ */
+ public function addProcessListener(ProcessListener $processListener)
+ {
+ $this->processListeners[] = $processListener;
+ }
+
+ /**
+ * Starts the main PDepend process and returns true after a successful
+ * execution.
+ *
+ * @return boolean
+ * @throws \RuntimeException An exception with a readable error message and
+ * an exit code.
+ */
+ public function run()
+ {
+ $engine = $this->engine;
+ $engine->setOptions($this->options);
+
+ if (count($this->extensions) > 0) {
+ $filter = new ExtensionFilter($this->extensions);
+ $engine->addFileFilter($filter);
+ }
+
+ if (count($this->excludeDirectories) > 0) {
+ $exclude = $this->excludeDirectories;
+ $filter = new ExcludePathFilter($exclude);
+ $engine->addFileFilter($filter);
+ }
+
+ if (count($this->excludeNamespaces) > 0) {
+ $exclude = $this->excludeNamespaces;
+ $filter = new PackageArtifactFilter($exclude);
+ $engine->setCodeFilter($filter);
+ }
+
+ if ($this->withoutAnnotations === true) {
+ $engine->setWithoutAnnotations();
+ }
+
+ // Try to set all source directories.
+ try {
+ foreach ($this->sourceArguments as $sourceArgument) {
+ if (is_file($sourceArgument)) {
+ $engine->addFile($sourceArgument);
+ } else {
+ $engine->addDirectory($sourceArgument);
+ }
+ }
+ } catch (\Exception $e) {
+ throw new \RuntimeException($e->getMessage(), self::EXCEPTION_EXIT);
+ }
+
+ if (count($this->loggerMap) === 0) {
+ throw new \RuntimeException('No output specified.', self::EXCEPTION_EXIT);
+ }
+
+ // To append all registered loggers.
+ try {
+ foreach ($this->loggerMap as $generatorId => $reportFile) {
+ // Create a new logger
+ $generator = $this->reportGeneratorFactory->createGenerator($generatorId, $reportFile);
+
+ $engine->addReportGenerator($generator);
+ }
+ } catch (\Exception $e) {
+ throw new \RuntimeException($e->getMessage(), self::EXCEPTION_EXIT);
+ }
+
+ foreach ($this->processListeners as $processListener) {
+ $engine->addProcessListener($processListener);
+ }
+
+ try {
+ $engine->analyze();
+
+ foreach ($engine->getExceptions() as $exception) {
+ $this->parseErrors[] = $exception->getMessage();
+ }
+ } catch (\Exception $e) {
+ throw new \RuntimeException($e->getMessage(), self::EXCEPTION_EXIT);
+ }
+
+ return self::SUCCESS_EXIT;
+ }
+
+ /**
+ * This method will return true when there were errors during the
+ * parse process.
+ *
+ * @return boolean
+ */
+ public function hasParseErrors()
+ {
+ return (count($this->parseErrors) > 0);
+ }
+
+ /**
+ * This method will return an array with error messages for all
+ * failures that happened during the parsing process.
+ *
+ * @return array(string)
+ */
+ public function getParseErrors()
+ {
+ return $this->parseErrors;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/CacheDriver.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/CacheDriver.php
new file mode 100644
index 0000000..5f10a87
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/CacheDriver.php
@@ -0,0 +1,110 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Util\Cache;
+
+/**
+ * Base interface for a concrete cache driver.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+interface CacheDriver
+{
+ /**
+ * The current cache version.
+ */
+ const VERSION = '@version:985259cebe923b2fb3bde769caa77546:@';
+
+ /**
+ * Sets the type for the next store() or restore() method
+ * call. A type is something like a namespace or group for cache entries.
+ *
+ * Note that the cache type will be reset after each storage method call, so
+ * you must invoke right before every call to restore() or
+ * store().
+ *
+ * @param string $type
+ * @return \PDepend\Util\Cache\CacheDriver
+ */
+ public function type($type);
+
+ /**
+ * This method will store the given $data under $key. This
+ * method can be called with a third parameter that will be used as a
+ * verification token, when the a cache entry gets restored. If the stored
+ * hash and the supplied hash are not identical, that cache entry will be
+ * removed and not returned.
+ *
+ * @param string $key The cache key for the given data.
+ * @param mixed $data Any data that should be cached.
+ * @param string $hash Optional hash that will be used for verification.
+ * @return void
+ */
+ public function store($key, $data, $hash = null);
+
+ /**
+ * This method tries to restore an existing cache entry for the given
+ * $key. If a matching entry exists, this method verifies that the
+ * given $hash and the the value stored with cache entry are equal.
+ * Then it returns the cached entry. Otherwise this method will return
+ * NULL.
+ *
+ * @param string $key The cache key for the given data.
+ * @param string $hash Optional hash that will be used for verification.
+ * @return mixed
+ */
+ public function restore($key, $hash = null);
+
+ /**
+ * This method will remove an existing cache entry for the given identifier.
+ * It will delete all cache entries where the cache key start with the given
+ * $pattern. If no matching entry exists, this method simply does
+ * nothing.
+ *
+ * @param string $pattern The cache key pattern.
+ * @return void
+ */
+ public function remove($pattern);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/CacheFactory.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/CacheFactory.php
new file mode 100644
index 0000000..32b9160
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/CacheFactory.php
@@ -0,0 +1,143 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Util\Cache;
+
+use PDepend\Util\Cache\Driver\FileCacheDriver;
+use PDepend\Util\Cache\Driver\MemoryCacheDriver;
+use PDepend\Util\Configuration;
+
+/**
+ * Factory that encapsulates the creation of a concrete cache instance.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+class CacheFactory
+{
+ /**
+ * The system configuration.
+ *
+ * @var \PDepend\Util\Configuration
+ */
+ protected $configuration = null;
+
+ /**
+ * Singleton property that holds existing cache instances.
+ *
+ * @var \PDepend\Util\Cache\CacheDriver[]
+ */
+ protected $caches = array();
+
+ /**
+ * Constructs a new cache factory instance for the given configuration.
+ *
+ * @param \PDepend\Util\Configuration $configuration The system configuration.
+ */
+ public function __construct(Configuration $configuration)
+ {
+ $this->configuration = $configuration;
+ }
+
+ /**
+ * Creates a new instance or returns an existing cache for the given cache
+ * identifier.
+ *
+ * @param string $cacheKey The name/identifier for the cache instance.
+ *
+ * @return \PDepend\Util\Cache\CacheDriver
+ */
+ public function create($cacheKey = null)
+ {
+ if (false === isset($this->caches[$cacheKey])) {
+ $this->caches[$cacheKey] = $this->createCache($cacheKey);
+ }
+ return $this->caches[$cacheKey];
+ }
+
+ /**
+ * Creates a cache instance based on the supplied configuration.
+ *
+ * @param string $cacheKey The name/identifier for the cache instance.
+ * @return \PDepend\Util\Cache\CacheDriver
+ * @throws \InvalidArgumentException If the configured cache driver is unknown.
+ */
+ protected function createCache($cacheKey)
+ {
+ switch ($this->configuration->cache->driver) {
+ case 'file':
+ return $this->createFileCache(
+ $this->configuration->cache->location,
+ $cacheKey
+ );
+ case 'memory':
+ return $this->createMemoryCache();
+ }
+ throw new \InvalidArgumentException(
+ "Unknown cache driver '{$this->configuration->cache->driver}' given."
+ );
+ }
+
+ /**
+ * Creates a new file system based cache instance.
+ *
+ * @param string $location Cache root directory.
+ * @param string $cacheKey The name/identifier for the cache instance.
+ * @return \PDepend\Util\Cache\Driver\FileCacheDriver
+ */
+ protected function createFileCache($location, $cacheKey)
+ {
+ return new FileCacheDriver($location, $cacheKey);
+ }
+
+ /**
+ * Creates an in memory cache instance.
+ *
+ * @return \PDepend\Util\Cache\Driver\MemoryCacheDriver
+ */
+ protected function createMemoryCache()
+ {
+ return new MemoryCacheDriver();
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/Driver/File/FileCacheDirectory.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/Driver/File/FileCacheDirectory.php
new file mode 100644
index 0000000..6f8f254
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/Driver/File/FileCacheDirectory.php
@@ -0,0 +1,226 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Util\Cache\Driver\File;
+
+use PDepend\Util\Cache\CacheDriver;
+
+/**
+ * Directory helper for the file system based cache implementation.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+class FileCacheDirectory
+{
+ /**
+ * The current cache version/hash number.
+ */
+ const VERSION = CacheDriver::VERSION;
+
+ /**
+ * The cache root directory.
+ *
+ * @var string
+ */
+ protected $cacheDir = null;
+
+ /**
+ * Constructs a new cache directory helper instance.
+ *
+ * @param string $cacheDir The cache root directory.
+ */
+ public function __construct($cacheDir)
+ {
+ $this->cacheDir = $this->ensureExists($cacheDir);
+
+ if (false === $this->isValidVersion()) {
+ $this->flush();
+ }
+ }
+
+ /**
+ * Creates a cache directory for the given cache entry key and returns the
+ * full qualified path for that cache directory.
+ *
+ * @param string $key The cache for an entry.
+ * @return string
+ */
+ public function createCacheDirectory($key)
+ {
+ return $this->createOrReturnCacheDirectory($key);
+ }
+
+ /**
+ * Returns the full qualified path for an existing cache directory or
+ * creates a new cache directory for the given cache entry key and returns
+ * the full qualified path for that cache directory.
+ *
+ * @param string $key The cache for an entry.
+ * @return string
+ */
+ protected function createOrReturnCacheDirectory($key)
+ {
+ $path = $this->getCacheDir() . '/' . substr($key, 0, 2);
+ if (false === file_exists($path)) {
+ mkdir($path, 0775, true);
+ }
+ return $path;
+ }
+
+ /**
+ * Ensures that the given $cacheDir really exists.
+ *
+ * @param string $cacheDir The cache root directory.
+ * @return string
+ */
+ protected function ensureExists($cacheDir)
+ {
+ if (false === file_exists($cacheDir)) {
+ mkdir($cacheDir, 0775, true);
+ }
+ return $cacheDir;
+ }
+
+ /**
+ * Tests if the current software cache version is similar to the stored
+ * file system cache version.
+ *
+ * @return boolean
+ */
+ protected function isValidVersion()
+ {
+ return (self::VERSION === $this->readVersion());
+ }
+
+ /**
+ * Reads the stored cache version number from the cache root directory.
+ *
+ * @return string
+ */
+ protected function readVersion()
+ {
+ if (file_exists($this->getVersionFile())) {
+ return trim(file_get_contents($this->getVersionFile()));
+ }
+ return null;
+ }
+
+ /**
+ * Writes the current software cache version into a file in the cache root
+ * directory.
+ *
+ * @return void
+ */
+ protected function writeVersion()
+ {
+ file_put_contents($this->getVersionFile(), self::VERSION);
+ }
+
+ /**
+ * Returns the file name for the used version file.
+ *
+ * @return string
+ */
+ protected function getVersionFile()
+ {
+ return $this->getCacheDir() . '/_version';
+ }
+
+ /**
+ * Returns the cache root directory.
+ *
+ * @return string
+ */
+ protected function getCacheDir()
+ {
+ return $this->cacheDir;
+ }
+
+ /**
+ * Flushes all contents below the configured cache root directory and writes
+ * a version file with the current software version.
+ *
+ * @return void
+ */
+ protected function flush()
+ {
+ $this->flushDirectory($this->getCacheDir());
+ $this->writeVersion();
+ }
+
+ /**
+ * Deletes all files and directories below the given $cacheDir.
+ *
+ * @param string $cacheDir A cache directory.
+ *
+ * @return void
+ */
+ protected function flushDirectory($cacheDir)
+ {
+ foreach (new \DirectoryIterator($cacheDir) as $child) {
+ $this->flushEntry($child);
+ }
+ }
+
+ /**
+ * Flushes the cache record for the given file info instance, independent if
+ * it is a file, directory or symlink.
+ *
+ * @param \SplFileInfo $file
+ * @return void
+ */
+ protected function flushEntry(\SplFileInfo $file)
+ {
+ $path = $file->getRealPath();
+ if ($file->isDot()) {
+ return;
+ } elseif ($file->isFile()) {
+ unlink($path);
+ } else {
+ $this->flushDirectory($path);
+ rmdir($path);
+ }
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/Driver/FileCacheDriver.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/Driver/FileCacheDriver.php
new file mode 100644
index 0000000..93fb435
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/Driver/FileCacheDriver.php
@@ -0,0 +1,273 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Util\Cache\Driver;
+
+use PDepend\Util\Cache\CacheDriver;
+use PDepend\Util\Cache\Driver\File\FileCacheDirectory;
+
+/**
+ * A file system based cache implementation.
+ *
+ * This class implements the {@link \PDepend\Util\Cache\CacheDriver} interface
+ * based on the local file system. It creates a special directory structure and
+ * stores all cache entries in files under this directory structure.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+class FileCacheDriver implements CacheDriver
+{
+ /**
+ * Default cache entry type.
+ */
+ const ENTRY_TYPE = 'cache';
+
+ /**
+ * The cache directory handler
+ *
+ * @var FileCacheDirectory
+ */
+ protected $directory;
+
+ /**
+ * The current cache entry type.
+ *
+ * @var string
+ */
+ protected $type = self::ENTRY_TYPE;
+
+ /**
+ * Major and minor version of the currently used PHP.
+ *
+ * @var string
+ */
+ protected $version;
+
+ /**
+ * Unique key for this cache instance.
+ *
+ * @var string
+ * @since 1.0.0
+ */
+ private $cacheKey;
+
+ /**
+ * This method constructs a new file cache instance for the given root
+ * directory.
+ *
+ * @param string $root The cache root directory.
+ * @param string $cacheKey Unique key for this cache instance.
+ */
+ public function __construct($root, $cacheKey = null)
+ {
+ $this->directory = new FileCacheDirectory($root);
+ $this->version = preg_replace('(^(\d+\.\d+).*)', '\\1', phpversion());
+
+ $this->cacheKey = $cacheKey;
+ }
+
+ /**
+ * Sets the type for the next store() or restore() method
+ * call. A type is something like a namespace or group for cache entries.
+ *
+ * Note that the cache type will be reset after each storage method call, so
+ * you must invoke right before every call to restore() or
+ * store().
+ *
+ * @param string $type The name or object type for the next storage method call.
+ * @return \PDepend\Util\Cache\CacheDriver
+ */
+ public function type($type)
+ {
+ $this->type = $type;
+ return $this;
+ }
+
+ /**
+ * This method will store the given $data under $key. This
+ * method can be called with a third parameter that will be used as a
+ * verification token, when the a cache entry gets restored. If the stored
+ * hash and the supplied hash are not identical, that cache entry will be
+ * removed and not returned.
+ *
+ * @param string $key The cache key for the given data.
+ * @param mixed $data Any data that should be cached.
+ * @param string $hash Optional hash that will be used for verification.
+ * @return void
+ */
+ public function store($key, $data, $hash = null)
+ {
+ $file = $this->getCacheFile($key);
+ $this->write($file, serialize(array('hash' => $hash, 'data' => $data)));
+ }
+
+ /**
+ * This method writes the given $data into $file.
+ *
+ * @param string $file The cache file name.
+ * @param string $data Serialized cache data.
+ * @return void
+ */
+ protected function write($file, $data)
+ {
+ $handle = fopen($file, 'wb');
+ flock($handle, LOCK_EX);
+ fwrite($handle, $data);
+ flock($handle, LOCK_UN);
+ fclose($handle);
+ }
+
+ /**
+ * This method tries to restore an existing cache entry for the given
+ * $key. If a matching entry exists, this method verifies that the
+ * given $hash and the the value stored with cache entry are equal.
+ * Then it returns the cached entry. Otherwise this method will return
+ * NULL.
+ *
+ * @param string $key The cache key for the given data.
+ * @param string $hash Optional hash that will be used for verification.
+ * @return mixed
+ */
+ public function restore($key, $hash = null)
+ {
+ $file = $this->getCacheFile($key);
+ if (file_exists($file)) {
+ return $this->restoreFile($file, $hash);
+ }
+ return null;
+ }
+
+ /**
+ * This method restores a cache entry, when the given $hash is equal
+ * to stored hash value. If both hashes are equal this method returns the
+ * cached entry. Otherwise this method returns NULL.
+ *
+ * @param string $file The cache file name.
+ * @param string $hash The verification hash.
+ * @return mixed
+ */
+ protected function restoreFile($file, $hash)
+ {
+ $data = unserialize($this->read($file));
+ if ($data['hash'] === $hash) {
+ return $data['data'];
+ }
+ return null;
+ }
+
+ /**
+ * This method reads the raw data from the given $file.
+ *
+ * @param string $file The cache file name.
+ * @return string
+ */
+ protected function read($file)
+ {
+ $handle = fopen($file, 'rb');
+ flock($handle, LOCK_EX);
+
+ $data = fread($handle, filesize($file));
+
+ flock($handle, LOCK_UN);
+ fclose($handle);
+
+ return $data;
+ }
+
+ /**
+ * This method will remove an existing cache entry for the given identifier.
+ * It will delete all cache entries where the cache key start with the given
+ * $pattern. If no matching entry exists, this method simply does
+ * nothing.
+ *
+ * @param string $pattern The cache key pattern.
+ * @return void
+ */
+ public function remove($pattern)
+ {
+ $file = $this->getCacheFileWithoutExtension($pattern);
+ foreach (glob("{$file}*.*") as $f) {
+ unlink($f);
+ }
+ }
+
+ /**
+ * This method creates the full qualified file name for a cache entry. This
+ * file name is a combination of the given $key, the cache root
+ * directory and the current entry type.
+ *
+ * @param string $key The cache key for the given data.
+ * @return string
+ */
+ protected function getCacheFile($key)
+ {
+ $cacheFile = $this->getCacheFileWithoutExtension($key) .
+ '.' . $this->version .
+ '.' . $this->type;
+
+ $this->type = self::ENTRY_TYPE;
+
+ return $cacheFile;
+ }
+
+ /**
+ * This method creates the full qualified file name for a cache entry. This
+ * file name is a combination of the given $key, the cache root
+ * directory and the current entry type, but without the used cache file
+ * extension.
+ *
+ * @param string $key The cache key for the given data.
+ * @return string
+ */
+ protected function getCacheFileWithoutExtension($key)
+ {
+ if (is_string($this->cacheKey)) {
+ $key = md5($key . $this->cacheKey);
+ }
+
+ $path = $this->directory->createCacheDirectory($key);
+ return "{$path}/{$key}";
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/Driver/MemoryCacheDriver.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/Driver/MemoryCacheDriver.php
new file mode 100644
index 0000000..6e141f3
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/Driver/MemoryCacheDriver.php
@@ -0,0 +1,213 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+
+namespace PDepend\Util\Cache\Driver;
+
+use PDepend\Util\Cache\CacheDriver;
+
+/**
+ * A memory based cache implementation.
+ *
+ * This class implements the {@link \PDepend\Util\Cache\CacheDriver} interface based
+ * on an in memory data structure. This means that all cached entries will get
+ * lost when the php process exits.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.10.0
+ */
+class MemoryCacheDriver implements CacheDriver
+{
+ /**
+ * Default cache entry type.
+ */
+ const ENTRY_TYPE = 'cache';
+
+ /**
+ * The in memory cache.
+ *
+ * @var array(string=>array)
+ */
+ protected $cache = array();
+
+ /**
+ * Current cache entry type.
+ *
+ * @var string
+ */
+ protected $type = self::ENTRY_TYPE;
+
+ /**
+ * Unique identifier within the same cache instance.
+ *
+ * @var string
+ */
+ protected $staticId = null;
+
+ /**
+ * Global stack, mainly used during testing.
+ *
+ * @var array
+ */
+ protected static $staticCache = array();
+
+ /**
+ * Instantiates a new in memory cache instance.
+ */
+ public function __construct()
+ {
+ $this->staticId = sha1(uniqid(rand(0, PHP_INT_MAX)));
+ }
+
+ /**
+ * Sets the type for the next store() or restore() method
+ * call. A type is something like a namespace or group for cache entries.
+ *
+ * Note that the cache type will be reset after each storage method call, so
+ * you must invoke right before every call to restore() or
+ * store().
+ *
+ * @param string $type The name or object type for the next storage method call.
+ * @return \PDepend\Util\Cache\CacheDriver
+ */
+ public function type($type)
+ {
+ $this->type = $type;
+ return $this;
+ }
+
+ /**
+ * This method will store the given $data under $key. This
+ * method can be called with a third parameter that will be used as a
+ * verification token, when the a cache entry gets restored. If the stored
+ * hash and the supplied hash are not identical, that cache entry will be
+ * removed and not returned.
+ *
+ * @param string $key The cache key for the given data.
+ * @param mixed $data Any data that should be cached.
+ * @param string $hash Optional hash that will be used for verification.
+ * @return void
+ */
+ public function store($key, $data, $hash = null)
+ {
+ $this->cache[$this->getCacheKey($key)] = array($hash, $data);
+ }
+
+ /**
+ * This method tries to restore an existing cache entry for the given
+ * $key. If a matching entry exists, this method verifies that the
+ * given $hash and the the value stored with cache entry are equal.
+ * Then it returns the cached entry. Otherwise this method will return
+ * NULL.
+ *
+ * @param string $key The cache key for the given data.
+ * @param string $hash Optional hash that will be used for verification.
+ * @return mixed
+ */
+ public function restore($key, $hash = null)
+ {
+ $cacheKey = $this->getCacheKey($key);
+ if (isset($this->cache[$cacheKey]) && $this->cache[$cacheKey][0] === $hash) {
+ return $this->cache[$cacheKey][1];
+ }
+ return null;
+ }
+
+ /**
+ * This method will remove an existing cache entry for the given identifier.
+ * It will delete all cache entries where the cache key start with the given
+ * $pattern. If no matching entry exists, this method simply does
+ * nothing.
+ *
+ * @param string $pattern The cache key pattern.
+ * @return void
+ */
+ public function remove($pattern)
+ {
+ foreach (array_keys($this->cache) as $key) {
+ if (0 === strpos($key, $pattern)) {
+ unset($this->cache[$key]);
+ }
+ }
+ }
+
+ /**
+ * Creates a prepared cache entry identifier, based on the given $key
+ * and the $type property. Note that this method resets the cache
+ * type, so that it is only valid for a single call.
+ *
+ * @param string $key The concrete object key.
+ * @return string
+ */
+ protected function getCacheKey($key)
+ {
+ $type = $this->type;
+ $this->type = self::ENTRY_TYPE;
+
+ return "{$key}.{$type}";
+ }
+
+ /**
+ * PHP's magic serialize sleep method.
+ *
+ * @return array
+ * @since 1.0.2
+ */
+ public function __sleep()
+ {
+ self::$staticCache[$this->staticId] = $this->cache;
+
+ return array('staticId');
+ }
+
+ /**
+ * PHP's magic serialize wakeup method.
+ *
+ * @return void
+ * @since 1.0.2
+ */
+ public function __wakeup()
+ {
+ $this->cache = self::$staticCache[$this->staticId];
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Configuration.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Configuration.php
new file mode 100644
index 0000000..3721614
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Configuration.php
@@ -0,0 +1,128 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util;
+
+/**
+ * Simple container class that holds settings for PDepend and all its sub
+ * systems.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Configuration
+{
+ /**
+ * Simple object tree holding the concrete configuration values.
+ *
+ * @var \stdClass
+ * @since 0.10.0
+ */
+ protected $settings = null;
+
+ /**
+ * Constructs a new configuration instance with the given settings tree.
+ *
+ * @param \stdClass $settings The concrete configuration values.
+ * @since 0.10.0
+ */
+ public function __construct(\stdClass $settings)
+ {
+ $this->settings = $settings;
+ }
+
+ /**
+ * Magic get method that is called by PHP's runtime engine whenever an
+ * undeclared object property is accessed through a read operation. This
+ * implementation of the magic get method checks if a configuration value
+ * for the given $name exists and returns the configuration value if
+ * a matching entry exists. Otherwise this method will throw an exception.
+ *
+ * @param string $name Name of the requested configuration value.
+ * @return mixed
+ * @throws \OutOfRangeException If no matching configuration value exists.
+ * @since 0.10.0
+ */
+ public function __get($name)
+ {
+ if (isset($this->settings->{$name})) {
+ return $this->settings->{$name};
+ }
+ throw new \OutOfRangeException(
+ sprintf("A configuration option '%s' not exists.", $name)
+ );
+ }
+
+ /**
+ * Magic setter method that will be called by PHP's runtime engine when a
+ * write operation is performed on an undeclared object property. This
+ * implementation of the magic set method always throws an exception, because
+ * configuration settings are immutable.
+ *
+ * @param string $name Name of the write property.
+ * @param mixed $value The new property value.
+ * @return void
+ * @throws \OutOfRangeException Whenever this method is called.
+ * @since 0.10.0
+ */
+ public function __set($name, $value)
+ {
+ throw new \OutOfRangeException(
+ sprintf("A configuration option '%s' not exists.", $name)
+ );
+ }
+
+ /**
+ * Magic isset method that will be called by PHP's runtime engine when the
+ * isset() operator is called on an undefined object property. This
+ * implementation of the magic isset method tests if a configuration value
+ * for the given $name exists.
+ *
+ * @param string $name Name of the requested property.
+ * @return boolean
+ * @since 0.10.0
+ */
+ public function __isset($name)
+ {
+ return isset($this->settings->{$name});
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/ConfigurationInstance.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/ConfigurationInstance.php
new file mode 100644
index 0000000..9201481
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/ConfigurationInstance.php
@@ -0,0 +1,80 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util;
+
+/**
+ * Registry class for the PDepend configuration class.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ConfigurationInstance
+{
+ /**
+ * The unique configuration instance.
+ *
+ * @var \PDepend\Util\Configuration
+ */
+ private static $configuration = null;
+
+ /**
+ * Returns a configured config instance or null.
+ *
+ * @return \PDepend\Util\Configuration
+ */
+ public static function get()
+ {
+ return self::$configuration;
+ }
+
+ /**
+ * Sets the configuration instance.
+ *
+ * @param \PDepend\Util\Configuration $configuration The config instance.
+ * @return void
+ */
+ public static function set(Configuration $configuration = null)
+ {
+ self::$configuration = $configuration;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Coverage/CloverReport.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Coverage/CloverReport.php
new file mode 100644
index 0000000..2b8096d
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Coverage/CloverReport.php
@@ -0,0 +1,151 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util\Coverage;
+
+use PDepend\Source\AST\AbstractASTArtifact;
+
+/**
+ * Coverage report implementation for clover formatted xml files.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class CloverReport implements Report
+{
+ /**
+ * Holds the line coverage for all files found in the coverage report.
+ *
+ * @var array(string=>array)
+ */
+ private $fileLineCoverage = array();
+
+ /**
+ * Constructs a new clover report instance.
+ *
+ * @param \SimpleXMLElement $sxml The context simple xml element.
+ */
+ public function __construct(\SimpleXMLElement $sxml)
+ {
+ $this->readProjectCoverage($sxml->project);
+ }
+
+ /**
+ * Reads the coverage information for a project.
+ *
+ * @param \SimpleXMLElement $sxml Element representing the clover project tag.
+ * @return void
+ */
+ private function readProjectCoverage(\SimpleXMLElement $sxml)
+ {
+ $this->readFileCoverage($sxml);
+ foreach ($sxml->package as $package) {
+ $this->readFileCoverage($package);
+ }
+ }
+
+ /**
+ * Reads the coverage information for all file elements under the given
+ * parent.
+ *
+ * @param \SimpleXMLElement $sxml Element representing a file parent element.
+ * @return void
+ */
+ private function readFileCoverage(\SimpleXMLElement $sxml)
+ {
+ foreach ($sxml->file as $file) {
+ $lines = array();
+ foreach ($file->line as $line) {
+ $lines[(int) $line['num']] = (0 < (int) $line['count']);
+ }
+ $this->fileLineCoverage[(string) $file['name']] = $lines;
+ }
+ }
+
+ /**
+ * Returns the percentage code coverage for the given item instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $artifact
+ * @return float
+ */
+ public function getCoverage(AbstractASTArtifact $artifact)
+ {
+ $lines = $this->getLines($artifact->getCompilationUnit()->getFileName());
+
+ $startLine = $artifact->getStartLine();
+ $endLine = $artifact->getEndLine();
+
+ $executable = 0;
+ $executed = 0;
+ for ($i = $startLine; $i <= $endLine; ++$i) {
+ if (!isset($lines[$i])) {
+ continue;
+ }
+ ++$executable;
+ if ($lines[$i]) {
+ ++$executed;
+ }
+ }
+
+ if (0 === $executed && 1 === $executable && 0 < ($endLine - $startLine)) {
+ return 100;
+ }
+ if ($executed === 0) {
+ return 0;
+ }
+ return (($executed / $executable) * 100);
+ }
+
+ /**
+ * Returns the lines of the covered file.
+ *
+ * @param string $fileName The source file name.
+ * @return array(boolean)
+ */
+ private function getLines($fileName)
+ {
+ if (isset($this->fileLineCoverage[$fileName])) {
+ return $this->fileLineCoverage[$fileName];
+ }
+ return array();
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Coverage/Factory.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Coverage/Factory.php
new file mode 100644
index 0000000..5c1cdff
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Coverage/Factory.php
@@ -0,0 +1,92 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util\Coverage;
+
+/**
+ * Factory used to abstract concrete coverage report formats from the pdepend
+ * application.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Factory
+{
+ /**
+ * Factory method that tries to create coverage report instance for a given
+ * path name.
+ *
+ * @param string $pathName Qualified path name of a coverage report file.
+ * @return \PDepend\Util\Coverage\CloverReport
+ * @throws \RuntimeException When the given path name does not point to a
+ * valid coverage file or onto an unsupported coverage format.
+ */
+ public function create($pathName)
+ {
+ $sxml = $this->loadXml($pathName);
+ if ($sxml->project) {
+ return new CloverReport($sxml);
+ }
+ throw new \RuntimeException('Unsupported coverage report format.');
+ }
+
+ /**
+ * Creates a simple xml instance for the xml contents that are located under
+ * the given path name.
+ *
+ * @param string $pathName Qualified path name of a coverage report file.
+ * @return \SimpleXMLElement
+ * @throws \RuntimeException When the given path name does not point to a
+ * valid xml file.
+ */
+ private function loadXml($pathName)
+ {
+ $mode = libxml_use_internal_errors(true);
+ $sxml = simplexml_load_file($pathName);
+ libxml_use_internal_errors($mode);
+
+ if ($sxml === false) {
+ throw new \RuntimeException(trim(libxml_get_last_error()->message));
+ }
+ return $sxml;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Coverage/Report.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Coverage/Report.php
new file mode 100644
index 0000000..d7e16f2
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Coverage/Report.php
@@ -0,0 +1,62 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util\Coverage;
+
+use PDepend\Source\AST\AbstractASTArtifact;
+
+/**
+ * Base interface representing a coverage report.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+interface Report
+{
+ /**
+ * Returns the percentage code coverage for the given item instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $artifact
+ * @return float
+ */
+ public function getCoverage(AbstractASTArtifact $artifact);
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/FileUtil.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/FileUtil.php
new file mode 100644
index 0000000..d11a510
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/FileUtil.php
@@ -0,0 +1,92 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util;
+
+/**
+ * This is a utility class for some file operations.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+final class FileUtil
+{
+ /**
+ * Returns the home directory of the current user if it exists. Otherwise
+ * this method will return the system temp directory.
+ *
+ * @return string
+ * @since 0.10.0
+ */
+ public static function getUserHomeDirOrSysTempDir()
+ {
+ $home = self::getUserHomeDir();
+ if (file_exists($home) && is_writable($home)) {
+ return $home;
+ }
+ return self::getSysTempDir();
+ }
+
+ /**
+ * Returns the system temp directory.
+ *
+ * @return string
+ */
+ public static function getSysTempDir()
+ {
+ return sys_get_temp_dir();
+ }
+
+ /**
+ * Returns the home directory of the current user.
+ *
+ * @return string
+ * @since 0.10.0
+ */
+ public static function getUserHomeDir()
+ {
+ if (false === stripos(PHP_OS, 'win')) {
+ return getenv('HOME');
+ }
+ return getenv('HOMEDRIVE') . getenv('HOMEPATH');
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/IdBuilder.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/IdBuilder.php
new file mode 100644
index 0000000..fa3cc52
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/IdBuilder.php
@@ -0,0 +1,162 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+
+namespace PDepend\Util;
+
+use PDepend\Source\AST\AbstractASTArtifact;
+use PDepend\Source\AST\AbstractASTType;
+use PDepend\Source\AST\ASTCompilationUnit;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTMethod;
+
+/**
+ * This class provides methods to generate unique, but reproducable identifiers
+ * for nodes generated during the parsing process.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since 0.9.12
+ */
+class IdBuilder
+{
+ /**
+ * Generates an identifier for the given file instance.
+ *
+ * @param \PDepend\Source\AST\ASTCompilationUnit $compilationUnit
+ * @return string
+ */
+ public function forFile(ASTCompilationUnit $compilationUnit)
+ {
+ return $this->hash($compilationUnit->getFileName());
+ }
+
+ /**
+ * Generates an identifier for the given function instance.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $function
+ * @return string
+ */
+ public function forFunction(ASTFunction $function)
+ {
+ return $this->forOffsetItem($function, 'function');
+ }
+
+ /**
+ * Generates an identifier for the given class, interface or trait instance.
+ *
+ * @param \PDepend\Source\AST\AbstractASTType $type
+ * @return string
+ */
+ public function forClassOrInterface(AbstractASTType $type)
+ {
+
+ return $this->forOffsetItem(
+ $type,
+ ltrim(strrchr(strtolower(get_class($type)), '_'), '_')
+ );
+ }
+
+ /**
+ * Generates an identifier for the given source item.
+ *
+ * @param \PDepend\Source\AST\AbstractASTArtifact $artifact
+ * @param string $prefix The item type identifier.
+ * @return string
+ */
+ protected function forOffsetItem(AbstractASTArtifact $artifact, $prefix)
+ {
+ $fileHash = $artifact->getCompilationUnit()->getId();
+ $itemHash = $this->hash($prefix . ':' . strtolower($artifact->getName()));
+
+ $offset = $this->getOffsetInFile($fileHash, $itemHash);
+
+ return sprintf('%s-%s-%s', $fileHash, $itemHash, $offset);
+ }
+
+ /**
+ * Generates an identifier for the given method instance.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $method
+ * @return string
+ */
+ public function forMethod(ASTMethod $method)
+ {
+ return sprintf(
+ '%s-%s',
+ $method->getParent()->getId(),
+ $this->hash(strtolower($method->getName()))
+ );
+ }
+
+ /**
+ * Creates a base 36 hash for the given string.
+ *
+ * @param string $string The raw input identifier/string.
+ * @return string
+ */
+ protected function hash($string)
+ {
+ return substr(base_convert(md5($string), 16, 36), 0, 11);
+ }
+
+ /**
+ * Returns the node offset/occurence of the given $string within a
+ * file.
+ *
+ * @param string $file The file identifier.
+ * @param string $string The node identifier.
+ * @return string
+ */
+ protected function getOffsetInFile($file, $string)
+ {
+ if (isset($this->offsetInFile[$file][$string])) {
+ $this->offsetInFile[$file][$string]++;
+ } else {
+ $this->offsetInFile[$file][$string] = 0;
+ }
+ return sprintf(
+ '%02s',
+ base_convert($this->offsetInFile[$file][$string], 10, 36)
+ );
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/ImageConvert.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/ImageConvert.php
new file mode 100644
index 0000000..e980b5a
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/ImageConvert.php
@@ -0,0 +1,181 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util;
+
+/**
+ * Simple utility class that is used to create different image formats. This
+ * class can use the ImageMagick cli tool convert and the pecl extension
+ * pecl/imagick.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class ImageConvert
+{
+ /**
+ * Tries to converts the $input image into the $output format.
+ *
+ * @param string $input The input file.
+ * @param string $output The output file.
+ * @return void
+ */
+ public static function convert($input, $output)
+ {
+ $inputType = strtolower(pathinfo($input, PATHINFO_EXTENSION));
+ $outputType = strtolower(pathinfo($output, PATHINFO_EXTENSION));
+
+ // Check for output file without extension and reuse input type
+ if ($outputType === '') {
+ $outputType = $inputType;
+ $output .= ".{$outputType}";
+ }
+
+ if ($inputType === 'svg') {
+ self::prepareSvg($input);
+ }
+
+ if ($inputType === $outputType) {
+ file_put_contents($output, file_get_contents($input));
+ } elseif (extension_loaded('imagick') === true) {
+ $imagick = new \Imagick($input);
+ $imagick->setImageFormat($outputType);
+ $imagick->writeImage($output);
+
+ // The following code is not testable when imagick is installed
+ // @codeCoverageIgnoreStart
+ } elseif (self::hasImagickConvert() === true) {
+ $input = escapeshellarg($input);
+ $output = escapeshellarg($output);
+
+ system("convert {$input} {$output}");
+ } else {
+
+ $fallback = substr($output, 0, -strlen($outputType)) . $inputType;
+
+ echo "WARNING: Cannot generate image of type '{$outputType}'. This",
+ " feature needs either the\n pecl/imagick extension or",
+ " the ImageMagick cli tool 'convert'.\n\n",
+ "Writing alternative image:\n{$fallback}\n\n";
+
+ file_put_contents($fallback, file_get_contents($input));
+ }
+ // @codeCoverageIgnoreEnd
+ }
+
+ /**
+ * Tests that the ImageMagick CLI tool convert exists.
+ *
+ * @return boolean
+ */
+ protected static function hasImagickConvert()
+ {
+ // @codeCoverageIgnoreStart
+ $desc = array(
+ 0 => array('pipe', 'r'),
+ 1 => array('pipe', 'w'),
+ 2 => array('pipe', 'a'),
+ );
+
+ $proc = proc_open('convert', $desc, $pipes);
+ if (is_resource($proc)) {
+ fwrite($pipes[0], '-version');
+ fclose($pipes[0]);
+
+ return (0 === proc_close($proc));
+ }
+ return false;
+ // @codeCoverageIgnoreEnd
+ }
+
+ /**
+ * Utility method for svg input files.
+ *
+ * If the input file has the mime type svg and a configuration file with
+ * imageConvert options exists, this method will prepare the input image
+ * file.
+ *
+ * @param string $input The input svg file.
+ * @return void
+ */
+ protected static function prepareSvg($input)
+ {
+ // Check for a configuration instance
+ if (($config = ConfigurationInstance::get()) === null) {
+ return;
+ }
+
+ $svg = file_get_contents($input);
+
+ // Check for font family
+ if (isset($config->imageConvert->fontFamily)) {
+ // Get font family
+ $fontFamily = (string) $config->imageConvert->fontFamily;
+ // Replace CSS separators
+ $fontReplace = 'font-family:' . strtr($fontFamily, ';:', ' ');
+ $fontPattern = '/font-family:\s*Arial/';
+
+ $svg = preg_replace($fontPattern, $fontReplace, $svg);
+ }
+
+ // Check for font size
+ if (isset($config->imageConvert->fontSize)) {
+ // Get font size
+ $fontSize = abs((float) $config->imageConvert->fontSize);
+
+ // Fetch all font-size expressions
+ preg_match_all('/font-size:\s*(\d+)/', $svg, $fontSizes);
+ $fontSizes = array_unique($fontSizes[1]);
+
+ $resize = ($fontSize - max($fontSizes));
+ foreach ($fontSizes as $fontSize) {
+ // Calculate resize value
+ $fontReplace = 'font-size:' . ($fontSize + $resize);
+ $fontPattern = "/font-size:\s*{$fontSize}/";
+
+ $svg = preg_replace($fontPattern, $fontReplace, $svg);
+ }
+ }
+
+ file_put_contents($input, $svg);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Log.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Log.php
new file mode 100644
index 0000000..9aa5916
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Log.php
@@ -0,0 +1,110 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util;
+
+/**
+ * Simple logging class for debug messages and extended information.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+final class Log
+{
+ /**
+ * Log debug messages.
+ */
+ const DEBUG = 1;
+
+ /**
+ * The log output stream, defaults for the moment to stderr.
+ *
+ * @var resource
+ */
+ private static $stream = STDERR;
+
+ /**
+ * Are debugging messages activated?
+ *
+ * @var boolean
+ */
+ private static $debug = false;
+
+ /**
+ * Sets the log severity levels, this can be an OR combined list of valid
+ * severities.
+ *
+ * @param integer $severity The log severity levels.
+ *
+ * @return void
+ */
+ public static function setSeverity($severity)
+ {
+ self::$debug = ((self::DEBUG & $severity) === $severity);
+ }
+
+ /**
+ * Logs the given message with debug severity.
+ *
+ * @param string $message The debug log message.
+ *
+ * @return void
+ */
+ public static function debug($message)
+ {
+ if (self::$debug) {
+ self::log($message);
+ }
+ }
+
+ /**
+ * Generic log method for all severities.
+ *
+ * @param string $message The log message.
+ *
+ * @return void
+ */
+ public static function log($message)
+ {
+ fwrite(self::$stream, PHP_EOL . $message);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/MathUtil.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/MathUtil.php
new file mode 100644
index 0000000..d87508e
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/MathUtil.php
@@ -0,0 +1,87 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util;
+
+/**
+ * This is a simply utility class that will perform mathematical operations with
+ * bcmath when the extension exists, otherwise it will use default math operations.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+final class MathUtil
+{
+ /**
+ * This method will multiply the two given operands with the bcmath extension
+ * when available, otherwise it will use the default mathematical operations.
+ *
+ * @param string $left The left arithmetic operand.
+ * @param string $right The right arithmetic operand.
+ *
+ * @return string
+ */
+ public static function mul($left, $right)
+ {
+ if (function_exists('bcmul')) {
+ return bcmul($left, $right);
+ }
+ return (string) ((int) $left * (int) $right);
+ }
+
+ /**
+ * This method will add the two given operands with the bcmath extension
+ * when available, otherwise it will use the default mathematical operations.
+ *
+ * @param string $left The left arithmetic operand.
+ * @param string $right The right arithmetic operand.
+ *
+ * @return string
+ */
+ public static function add($left, $right)
+ {
+ if (function_exists('bcadd')) {
+ return bcadd($left, $right);
+ }
+ return (string) ((int) $left + (int) $right);
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Type.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Type.php
new file mode 100644
index 0000000..1f01303
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Type.php
@@ -0,0 +1,407 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util;
+
+/**
+ * Utility class that can be used to detect simpl scalars or internal types.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+final class Type
+{
+ /**
+ * Constants for valid php data types.
+ */
+ const PHP_TYPE_ARRAY = 'array',
+ PHP_TYPE_BOOLEAN = 'boolean',
+ PHP_TYPE_FLOAT = 'float',
+ PHP_TYPE_INTEGER = 'integer',
+ PHP_TYPE_STRING = 'string';
+ /**
+ * Constants with valid php data type identifiers.
+ */
+ const IMAGE_ARRAY = 'array',
+ IMAGE_BOOL = 'bool',
+ IMAGE_BOOLEAN = 'boolean',
+ IMAGE_DOUBLE = 'double',
+ IMAGE_FLOAT = 'float',
+ IMAGE_INT = 'int',
+ IMAGE_INTEGER = 'integer',
+ IMAGE_MIXED = 'mixed',
+ IMAGE_REAL = 'real',
+ IMAGE_RESOURCE = 'resource',
+ IMAGE_OBJECT = 'object',
+ IMAGE_STRING = 'string',
+ IMAGE_STDCLASS = 'stdclass',
+ IMAGE_VOID = 'void';
+
+ /**
+ * Constants with the metaphone representation of multiple php data types.
+ */
+ const IMAGE_METAPHONE_ARRAY = 'AR',
+ IMAGE_METAPHONE_BOOL = 'BL',
+ IMAGE_METAPHONE_BOOLEAN = 'BLN',
+ IMAGE_METAPHONE_DOUBLE = 'TBL',
+ IMAGE_METAPHONE_FLOAT = 'FLT',
+ IMAGE_METAPHONE_INT = 'INT',
+ IMAGE_METAPHONE_INTEGER = 'INTJR',
+ IMAGE_METAPHONE_MIXED = 'MKST',
+ IMAGE_METAPHONE_REAL = 'RL',
+ IMAGE_METAPHONE_RESOURCE = 'RSRS',
+ IMAGE_METAPHONE_OBJECT = 'OBJKT',
+ IMAGE_METAPHONE_STRING = 'STRNK',
+ IMAGE_METAPHONE_STDCLASS = 'STTKLS',
+ IMAGE_METAPHONE_UNKNOWN = 'UNKNN',
+ IMAGE_METAPHONE_UNKNOWN_TYPE = 'UNKNNTP';
+
+ /**
+ * Constants with the soundex representation of multiple php data types.
+ */
+ const IMAGE_SOUNDEX_ARRAY = 'A600',
+ IMAGE_SOUNDEX_BOOL = 'B450',
+ IMAGE_SOUNDEX_BOOLEAN = 'B400',
+ IMAGE_SOUNDEX_DOUBLE = 'D140',
+ IMAGE_SOUNDEX_FLOAT = 'F430',
+ IMAGE_SOUNDEX_INT = 'I530',
+ IMAGE_SOUNDEX_INTEGER = 'I532',
+ IMAGE_SOUNDEX_MIXED = 'M230',
+ IMAGE_SOUNDEX_REAL = 'R400',
+ IMAGE_SOUNDEX_RESOURCE = 'R262',
+ IMAGE_SOUNDEX_OBJECT = 'O122',
+ IMAGE_SOUNDEX_STRING = 'S365',
+ IMAGE_SOUNDEX_STDCLASS = 'S324',
+ IMAGE_SOUNDEX_UNKNOWN = 'U525';
+
+ /**
+ * Constants for other types/keywords frequently used.
+ */
+ const IMAGE_OTHER_NULL = 'null',
+ IMAGE_OTHER_FALSE = 'false',
+ IMAGE_OTHER_TRUE = 'true',
+ IMAGE_OTHER_UNKNOWN = 'unknown',
+ IMAGE_OTHER_UNKNOWN_TYPE = 'unknown_type';
+
+ /**
+ * This property contains a mapping between a unified lower case type name
+ * and the corresponding PHP extension that declares this type.
+ *
+ * @var array(string=>string)
+ */
+ private static $typeNameToExtension = null;
+
+ /**
+ * Hash with all internal namespaces/extensions. Key and value are identical
+ * and contain the name of the extension.
+ *
+ * @var array(string=>string)
+ * @since 0.9.10
+ */
+ private static $internalNamespaces = null;
+
+ /**
+ * List of scalar php types.
+ *
+ * @var array(string)
+ */
+ private static $scalarTypes = array(
+ self::IMAGE_ARRAY => true,
+ self::IMAGE_BOOL => true,
+ self::IMAGE_BOOLEAN => true,
+ self::IMAGE_DOUBLE => true,
+ self::IMAGE_FLOAT => true,
+ self::IMAGE_INT => true,
+ self::IMAGE_INTEGER => true,
+ self::IMAGE_MIXED => true,
+ self::IMAGE_REAL => true,
+ self::IMAGE_RESOURCE => true,
+ self::IMAGE_OBJECT => true,
+ self::IMAGE_STRING => true,
+ self::IMAGE_STDCLASS => true,
+ self::IMAGE_VOID => true,
+ self::IMAGE_OTHER_NULL => true,
+ self::IMAGE_OTHER_FALSE => true,
+ self::IMAGE_OTHER_TRUE => true,
+ self::IMAGE_OTHER_UNKNOWN => true,
+ self::IMAGE_OTHER_UNKNOWN_TYPE => true,
+ self::IMAGE_METAPHONE_ARRAY => true,
+ self::IMAGE_METAPHONE_BOOL => true,
+ self::IMAGE_METAPHONE_BOOLEAN => true,
+ self::IMAGE_METAPHONE_DOUBLE => true,
+ self::IMAGE_METAPHONE_FLOAT => true,
+ self::IMAGE_METAPHONE_INT => true,
+ self::IMAGE_METAPHONE_INTEGER => true,
+ self::IMAGE_METAPHONE_MIXED => true,
+ self::IMAGE_METAPHONE_OBJECT => true,
+ self::IMAGE_METAPHONE_REAL => true,
+ self::IMAGE_METAPHONE_RESOURCE => true,
+ self::IMAGE_METAPHONE_STRING => true,
+ self::IMAGE_METAPHONE_STDCLASS => true,
+ self::IMAGE_METAPHONE_UNKNOWN => true,
+ self::IMAGE_METAPHONE_UNKNOWN_TYPE => true,
+ self::IMAGE_SOUNDEX_ARRAY => true,
+ self::IMAGE_SOUNDEX_BOOL => true,
+ self::IMAGE_SOUNDEX_BOOLEAN => true,
+ self::IMAGE_SOUNDEX_DOUBLE => true,
+ self::IMAGE_SOUNDEX_FLOAT => true,
+ self::IMAGE_SOUNDEX_INT => true,
+ self::IMAGE_SOUNDEX_INTEGER => true,
+ self::IMAGE_SOUNDEX_MIXED => true,
+ self::IMAGE_SOUNDEX_REAL => true,
+ self::IMAGE_SOUNDEX_RESOURCE => true,
+ self::IMAGE_SOUNDEX_OBJECT => true,
+ self::IMAGE_SOUNDEX_STRING => true,
+ self::IMAGE_SOUNDEX_STDCLASS => true,
+ self::IMAGE_SOUNDEX_UNKNOWN => true,
+ );
+
+ /**
+ * List of primitive php types.
+ *
+ * @var array(string=>string)
+ */
+ private static $primitiveTypes = array(
+ self::IMAGE_BOOL => self::PHP_TYPE_BOOLEAN,
+ self::IMAGE_BOOLEAN => self::PHP_TYPE_BOOLEAN,
+ self::IMAGE_SOUNDEX_BOOL => self::PHP_TYPE_BOOLEAN,
+ self::IMAGE_SOUNDEX_BOOLEAN => self::PHP_TYPE_BOOLEAN,
+ self::IMAGE_OTHER_FALSE => self::PHP_TYPE_BOOLEAN,
+ self::IMAGE_OTHER_TRUE => self::PHP_TYPE_BOOLEAN,
+ self::IMAGE_METAPHONE_BOOL => self::PHP_TYPE_BOOLEAN,
+ self::IMAGE_METAPHONE_BOOLEAN => self::PHP_TYPE_BOOLEAN,
+ self::IMAGE_REAL => self::PHP_TYPE_FLOAT,
+ self::IMAGE_FLOAT => self::PHP_TYPE_FLOAT,
+ self::IMAGE_DOUBLE => self::PHP_TYPE_FLOAT,
+ self::IMAGE_METAPHONE_REAL => self::PHP_TYPE_FLOAT,
+ self::IMAGE_METAPHONE_FLOAT => self::PHP_TYPE_FLOAT,
+ self::IMAGE_METAPHONE_DOUBLE => self::PHP_TYPE_FLOAT,
+ self::IMAGE_SOUNDEX_DOUBLE => self::PHP_TYPE_FLOAT,
+ self::IMAGE_SOUNDEX_FLOAT => self::PHP_TYPE_FLOAT,
+ self::IMAGE_SOUNDEX_REAL => self::PHP_TYPE_FLOAT,
+ self::IMAGE_INT => self::PHP_TYPE_INTEGER,
+ self::IMAGE_INTEGER => self::PHP_TYPE_INTEGER,
+ self::IMAGE_METAPHONE_INT => self::PHP_TYPE_INTEGER,
+ self::IMAGE_METAPHONE_INTEGER => self::PHP_TYPE_INTEGER,
+ self::IMAGE_SOUNDEX_INT => self::PHP_TYPE_INTEGER,
+ self::IMAGE_SOUNDEX_INTEGER => self::PHP_TYPE_INTEGER,
+ self::IMAGE_STRING => self::PHP_TYPE_STRING,
+ self::IMAGE_METAPHONE_STRING => self::PHP_TYPE_STRING,
+ self::IMAGE_SOUNDEX_STRING => self::PHP_TYPE_STRING,
+ );
+
+ /**
+ * Returns true if the given type is internal or part of an
+ * extension.
+ *
+ * @param string $typeName The type name.
+ *
+ * @return boolean
+ */
+ public static function isInternalType($typeName)
+ {
+ self::initTypeToExtension();
+
+ $normalizedName = ltrim($typeName, '\\');
+ $normalizedName = strtolower($normalizedName);
+
+ return isset(self::$typeNameToExtension[$normalizedName]);
+ }
+
+ /**
+ * Returns the package/extension for the given type name. If no package
+ * exists, this method will return null.
+ *
+ * @param string $typeName The type name.
+ *
+ * @return string
+ */
+ public static function getTypePackage($typeName)
+ {
+ self::initTypeToExtension();
+
+ $normalizedName = ltrim($typeName, '\\');
+ $normalizedName = strtolower($normalizedName);
+ if (isset(self::$typeNameToExtension[$normalizedName])) {
+ return self::$typeNameToExtension[$normalizedName];
+ }
+ return null;
+ }
+
+ /**
+ * Returns an array with all package/extension names.
+ *
+ * @return array(string)
+ */
+ public static function getInternalNamespaces()
+ {
+ if (self::$internalNamespaces === null) {
+ $extensions = array_values(self::initTypeToExtension());
+ $extensions = array_unique($extensions);
+
+ self::$internalNamespaces = array_combine($extensions, $extensions);
+ }
+ return self::$internalNamespaces;
+ }
+
+ /**
+ * This method will return true when the given package represents a
+ * php extension.
+ *
+ * @param string $packageName Name of a package.
+ *
+ * @return boolean
+ */
+ public static function isInternalPackage($packageName)
+ {
+ $packageNames = self::getInternalNamespaces();
+ return isset($packageNames[strtolower($packageName)]);
+ }
+
+ /**
+ * This method will return true when the given type identifier is in
+ * the list of scalar/none-object types.
+ *
+ * @param string $image The type identifier.
+ *
+ * @return boolean
+ */
+ public static function isScalarType($image)
+ {
+ $image = strtolower($image);
+ if (isset(self::$scalarTypes[$image]) === true) {
+ return true;
+ }
+ $image = metaphone($image);
+ if (isset(self::$scalarTypes[$image]) === true) {
+ return true;
+ }
+ return isset(self::$scalarTypes[soundex($image)]);
+ }
+
+ /**
+ * This method will return true when the given type identifier is in
+ * the list of primitive types.
+ *
+ * @param string $image The type image.
+ *
+ * @return boolean
+ * @since 0.9.6
+ */
+ public static function isPrimitiveType($image)
+ {
+ return (self::getPrimitiveType($image) !== null);
+ }
+
+ /**
+ * This method will return a unified type image for a detected source type
+ * image.
+ *
+ * @param string $image The found primitive type image.
+ *
+ * @return string
+ * @since 0.9.6
+ */
+ public static function getPrimitiveType($image)
+ {
+ $image = strtolower($image);
+ if (isset(self::$primitiveTypes[$image]) === true) {
+ return self::$primitiveTypes[$image];
+ }
+ $image = metaphone($image);
+ if (isset(self::$primitiveTypes[$image]) === true) {
+ return self::$primitiveTypes[$image];
+ }
+ $image = soundex($image);
+ if (isset(self::$primitiveTypes[$image]) === true) {
+ return self::$primitiveTypes[$image];
+ }
+ return null;
+ }
+
+ /**
+ * This method will return true when the given image describes a
+ * php array type.
+ *
+ * @param string $image The found type image.
+ *
+ * @return boolean
+ * @since 0.9.6
+ */
+ public static function isArrayType($image)
+ {
+ return (strtolower($image) === 'array');
+ }
+
+ /**
+ * This method reads all available classes and interfaces and checks whether
+ * this type belongs to an extension or is internal. All internal and extension
+ * classes are collected in an internal data structure.
+ *
+ * @return array(string=>string)
+ */
+ private static function initTypeToExtension()
+ {
+ // Skip when already done.
+ if (self::$typeNameToExtension !== null) {
+ return self::$typeNameToExtension;
+ }
+
+ self::$typeNameToExtension = array('iterator' => '+standard');
+
+ $extensionNames = get_loaded_extensions();
+ $extensionNames = array_map('strtolower', $extensionNames);
+
+ foreach ($extensionNames as $extensionName) {
+ $extension = new \ReflectionExtension($extensionName);
+
+ $classNames = $extension->getClassNames();
+ $classNames = array_map('strtolower', $classNames);
+
+ foreach ($classNames as $className) {
+ self::$typeNameToExtension[$className] = '+' . $extensionName;
+ }
+ }
+
+ return self::$typeNameToExtension;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Workarounds.php b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Workarounds.php
new file mode 100644
index 0000000..4d75853
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Workarounds.php
@@ -0,0 +1,90 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+
+namespace PDepend\Util;
+
+/**
+ * Utility class used to test for required php version workarounds.
+ *
+ * @copyright 2008-2013 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ */
+class Workarounds
+{
+ /**
+ * Tests if the used PHP version has the known unserialize issue with object
+ * references.
+ *
+ * @return boolean
+ * @see https://bugs.php.net/bug.php?id=62373
+ */
+ public function hasSerializeReferenceIssue()
+ {
+ return (version_compare(phpversion(), "5.4.0") > 0 && version_compare("5.4.5", phpversion()) > 0);
+ }
+
+ /**
+ * Tests if the current environment has no known issues and does not
+ * require any workaround.
+ *
+ * @return boolean
+ */
+ public function isNotRequired()
+ {
+ return !$this->hasSerializeReferenceIssue();
+ }
+
+ /**
+ * Returns an array with error messages related to the required workarounds.
+ *
+ * @return array
+ */
+ public function getRequiredWorkarounds()
+ {
+ $issues = array();
+ if ($this->hasSerializeReferenceIssue()) {
+ $issues[] = 'File cache deactivated due to known serialize() issues in PHP ' . phpversion();
+ }
+
+ return $issues;
+ }
+}
diff --git a/vendor/pdepend/pdepend/src/main/resources/schema/configuration.xsd b/vendor/pdepend/pdepend/src/main/resources/schema/configuration.xsd
new file mode 100644
index 0000000..95b0fb6
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/resources/schema/configuration.xsd
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/pdepend/pdepend/src/main/resources/services.xml b/vendor/pdepend/pdepend/src/main/resources/services.xml
new file mode 100644
index 0000000..1b998b2
--- /dev/null
+++ b/vendor/pdepend/pdepend/src/main/resources/services.xml
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/phpmd/phpmd/.gitignore b/vendor/phpmd/phpmd/.gitignore
new file mode 100644
index 0000000..ea94bf8
--- /dev/null
+++ b/vendor/phpmd/phpmd/.gitignore
@@ -0,0 +1,5 @@
+.abc
+.idea
+.sonar
+composer.phar
+vendor
diff --git a/vendor/phpmd/phpmd/.gitmodules b/vendor/phpmd/phpmd/.gitmodules
new file mode 100644
index 0000000..d5023a9
--- /dev/null
+++ b/vendor/phpmd/phpmd/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "setup"]
+ path = setup
+ url = git://github.com/Qafoo/build-commons.git
diff --git a/vendor/phpmd/phpmd/.travis.yml b/vendor/phpmd/phpmd/.travis.yml
new file mode 100644
index 0000000..310f9c4
--- /dev/null
+++ b/vendor/phpmd/phpmd/.travis.yml
@@ -0,0 +1,23 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+ - 5.5
+ - 5.6
+ - hhvm
+
+matrix:
+ allow_failures:
+ - php: hhvm
+
+env:
+ - TEST_CONFIG="phpunit.xml.dist"
+
+before_script:
+ - composer install
+
+script: phpunit --configuration $TEST_CONFIG
+
+notifications:
+ irc: "irc.freenode.org#phpmd"
diff --git a/vendor/phpmd/phpmd/AUTHORS.rst b/vendor/phpmd/phpmd/AUTHORS.rst
new file mode 100644
index 0000000..98afd17
--- /dev/null
+++ b/vendor/phpmd/phpmd/AUTHORS.rst
@@ -0,0 +1,38 @@
+================
+Authors of PHPMD
+================
+
+Main Authors/Maintainers
+------------------------
+
+- Manuel Pichler (Since 2009)
+
+Contributors
+------------
+
+- Volker Dusch (Since 2010) / https://github.com/edorian
+- timmartin (Since 2010) / https://github.com/timmartin
+- Sebastian Bergmann (Since 2011) / https://github.com/sebastianbergmann
+- Zsolt Takacs (Since 2011) / https://github.com/zstakacs
+- Che Hodgins (Since 2011) / https://github.com/chehodgins
+- Gennadiy Litvinyuk (Since 2011) / https://github.com/gennadiylitvinyuk
+- Francis Besset (Since 2011) / https://github.com/francisbesset
+- zerkalica (Since 2012) / https://github.com/zerkalica
+- palbertini (Since 2012) / https://github.com/palbertini
+- bahulneel (Since 2012) / https://github.com/bahulneel
+- Willem Stuursma (Since 2012) / https://github.com/willemstuursma
+- Nimlhug (Since 2012) / https://github.com/Nimlhug
+- A. Martin Llano (Since 2012) / https://github.com/amllano
+- Juan Basso (Since 2012) / https://github.com/jrbasso
+- Brian Ridley (Since 2013) / https://github.com/ptlis
+- Radosław Mejer (Since 2014) / https://github.com/radmen
+- Tobias Nyholm (Since 2014) / https://github.com/Nyholm
+- Gasillo (Since 2014) / https://github.com/Gasillo
+- Marc Würth (Since 2014) / https://github.com/ravage84
+
+..
+ Local Variables:
+ mode: rst
+ fill-column: 79
+ End:
+ vim: et syn=rst tw=79
diff --git a/vendor/phpmd/phpmd/CHANGELOG b/vendor/phpmd/phpmd/CHANGELOG
new file mode 100644
index 0000000..23843c3
--- /dev/null
+++ b/vendor/phpmd/phpmd/CHANGELOG
@@ -0,0 +1,137 @@
+phpmd-1.2.0 (2011/09/27)
+========================
+
+- Implemented: PHPMD needs a *strict* mode.
+
+phpmd-1.1.1 (2011/06/30)
+========================
+
+- Fixed: Bug in PHPMD's package manifest file.
+
+phpmd-1.1.0 (2011/03/20)
+========================
+
+- Implemented #10474873: Add rule for PHP's goto statement. Implemented
+ with commit #2745a20.
+- Implemented #10474987: Implement rule for CBO metric. Implemented with
+ commit #14277b4.
+- Implemented #11012465: Replace deprecated PHPUnit features in test suite.
+ Implemented with commit #4adb88d.
+- Fixed #10096717: LongVariable rule should not apply on private
+ properties. Fixed with commit #f063bc9.
+
+phpmd-1.0.1 (2011/02/12)
+========================
+
+- Fixed #9930643: The include_path does not match with PHP_Depend's new
+ directory layout. Fixed with commit #531be78.
+- Fixed #9626017: Clear temporary resources after a test has finished.
+ Fixed with commit #b385f15.
+
+phpmd-1.0.0 (2011/02/05)
+========================
+
+- Fixed #9626017: Clear temporary resources after a test has finished. Fixed
+ with commit #b385f15.
+- New source layout that follows maven's conventions for the directory
+ structure of a product.
+- Switched to PHPUnit 3.5.x as testing framework
+
+phpmd-0.2.8 (2010/11/25)
+========================
+
+- Improved help text for the PHPMD command line. Thanks to Volker
+ Dusch for this contribution. https://github.com/edorian/phpmd
+- PHPMD is now compatible with next PHP_Depend release 0.10.0
+
+phpmd-0.2.7 (2010/09/01)
+========================
+
+- Fixed #36: @SupressWarnings annotation does not work for
+ UnusedPrivateMethod rule. Fixed in svn revision #284.
+- Fixed #35: Stream Writer closes STDOUT. Fixed in svn revision #286.
+- Fixed #33: PEAR package.xml does not @php_bin@ and @bin_dir@ on
+ phpmd.bat. Fixed in svn revision #264.
+
+phpmd-0.2.6 (2010/07/03)
+========================
+
+- Implemented #24: Implement Depth Of Inheritance Rule. Implemented in
+ svn revision #253.
+- Implemented #25: Implement Number of Children Rule. Implemented in svn
+ revision #252.
+- Implemented #26: Implement Rule that detects the usage of PHP's eval()
+ function. Implemented in svn revision #251.
+- Implemented #27: Implement Rule that detects the usage of PHP's exit()
+ expression. Implemented in svn revision #250.
+- Fixed #28: Unused local variable and unused parameter rule produces
+ false positives. Fixed in svn revision #245.
+- Implemented #30: New option --version added to PHPMD's command line
+ interface. Implemented in svn revision #246.
+- Names of several command line options unified with PHPUnit and PHPCPD.
+ The --ignore option is now --exclude and --extensions is now --suffixes.
+
+phpmd-0.2.5 (2010/04/03)
+========================
+
+- Implemented #12: Add rule for the Weighted Methods Per Class Metric.
+ Implemented in svn revision #228.
+- Fixed #16: Alternative syntax for properties in rule set files
+ implemented. Fixed in svn revision #220
+- Fixed #17: Do not return success exit code when PHPMD detects rule
+ violations in analyzed source code. Fixed in svn revision #226.
+- Fixed #19: Super globals were detected as unused variables.Fixed in
+ svn revision #218
+- Fixed #20: Local static variables were treated as unused variables.
+ Fixed in svn revision #219.
+
+phpmd-0.2.4 (2010/03/08)
+========================
+
+- E_NOTICE bug fix in naming rule.
+
+phpmd-0.2.3 (2010/03/04)
+========================
+
+- Fixed #6: PHP Tokenizer required but no error when installing.
+- Fixed #7: UnusedLocalVariable ruleset incorrectly flags variables
+ as unused when used inside double quoted string. Fixed in svn
+ revision #187.
+- Implemented #9: Add support for "Suppress warnings" annotations.
+ Implemented in svn revision #200.
+- Implemented #10: Support for exclude element in rule-set files added.
+ Implemented in svn revision #189.
+- Implemented #13: Implement naming rules, e.g. short variables, parameter
+ etc.
+- Fixed #14: ExcessivePublicCount rule should utilize PHP_Depend's cis
+ metric. Fixed in svn revision #203.
+- Fixed #15: ExcessivePublicCount rule is never used. Fixed in svn
+ revision #202.
+
+phpmd-0.2.2 (2010/01/20)
+========================
+
+- Small change to the command line interface, which did not return an
+ exit code != 0 when an exception occured.
+
+phpmd-0.2.1 (2010/01/05)
+========================
+
+- Implemented #5: Allow multiple input files/directories. Implemented in svn
+ revision #158.
+- Tested: Additional unit tests for multiple components added.
+
+phpmd-0.2.0 (2009/12/30)
+========================
+
+- Implemented #2: Support for unused code fules completed, implemented in svn
+ revision #134.
+- Implemented #3: Text renderer implemented.
+- Implemented #4: Implement a html renderer, implemented in svn revision #139.
+- Several performance improvements.
+
+
+phpmd-0.1.0 (2009/12/20)
+========================
+
+- Initial release
diff --git a/vendor/phpmd/phpmd/LICENSE b/vendor/phpmd/phpmd/LICENSE
new file mode 100644
index 0000000..f2d3360
--- /dev/null
+++ b/vendor/phpmd/phpmd/LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 2008-2014, Manuel Pichler .
+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 Manuel Pichler nor the names of his
+ 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.
diff --git a/vendor/phpmd/phpmd/README.rst b/vendor/phpmd/phpmd/README.rst
new file mode 100644
index 0000000..5f3f7b5
--- /dev/null
+++ b/vendor/phpmd/phpmd/README.rst
@@ -0,0 +1,116 @@
+==================
+Command line usage
+==================
+
+Type phpmd [filename|directory] [report format] [ruleset file], i.e: ::
+
+ mapi@arwen ~ $ phpmd PHP/Depend/DbusUI/ xml rulesets/codesize.xml
+
+
+
+
+ This class has too many methods, consider refactoring it.
+
+
+
+
+You can pass a file name or a directory name containing PHP source
+code to PHPMD.
+
+The PHPMD Phar distribution includes the rule set files inside
+its archive, even if the "rulesets/codesize.xml" parameter above looks
+like a filesystem reference.
+
+Command line options
+====================
+
+- Notice that the default output is in XML, so you can redirect it to
+ a file and XSLT it or whatever
+
+- You can also use shortened names to refer to the built-in rule sets,
+ like this: ::
+
+ phpmd PHP/Depend/DbusUI/ xml codesize
+
+- The command line interface also accepts the following optional arguments:
+
+ - ``--minimumpriority`` - The rule priority threshold; rules with lower
+ priority than they will not be used.
+
+ - ``--reportfile`` - Sends the report output to the specified file,
+ instead of the default output target ``STDOUT``.
+
+ - ``--suffixes`` - Comma-separated string of valid source code filename
+ extensions.
+
+ - ``--exclude`` - Comma-separated string of patterns that are used to ignore
+ directories.
+
+ - ``--strict`` - Also report those nodes with a @SuppressWarnings annotation.
+
+ An example command line: ::
+
+ phpmd PHP/Depend/DbusUI xml codesize --reportfile phpmd.xml --suffixes .php
+
+Using multiple rule sets
+````````````````````````
+
+PHPMD uses so called rule sets that configure/define a set of rules which will
+be applied against the source under test. The default distribution of PHPMD is
+already shipped with a few default sets, that can be used out-of-box. You can
+call PHPMD's cli tool with a set's name to apply this configuration: ::
+
+ ~ $ phpmd /path/to/source text codesize
+
+But what if you would like to apply more than one rule set against your source?
+You can also pass a list of rule set names, separated by comma to PHPMD's cli
+tool: ::
+
+ ~ $ phpmd /path/to/source text codesize,unusedcode,naming
+
+You can also mix custom `rule set files`__ with build-in rule sets: ::
+
+ ~ $ phpmd /path/to/source text codesize,/my/rules.xml
+
+__ /documentation/creating-a-ruleset.html
+
+That's it. With this behavior you can specify you own combination of rule sets
+that will check the source code.
+
+Using multiple source files and folders
+```````````````````````````````````````
+
+PHPMD also allowes you to specify multiple source directories in case you want
+to create one output for certain parts of your code ::
+
+ ~ $ phpmd /path/to/code,index.php,/another/place/with/code text codesize
+
+
+Exit codes
+==========
+
+PHPMD's command line tool currently defines three different exit codes.
+
+- *0*, This exit code indicates that everything worked as expected. This means
+ there was no error/exception and PHPMD hasn't detected any rule violation
+ in the code under test.
+- *1*, This exit code indicates that an error/exception occured which has
+ interrupted PHPMD during execution.
+- *2*, This exit code means that PHPMD has processed the code under test
+ without the occurence of an error/exception, but it has detected rule
+ violations in the analyzed source code.
+
+Renderers
+=========
+
+At the moment PHPMD comes with the following three renderers:
+
+- *xml*, which formats the report as XML.
+- *text*, simple textual format.
+- *html*, single HTML file with possible problems.
diff --git a/vendor/phpmd/phpmd/build.properties b/vendor/phpmd/phpmd/build.properties
new file mode 100644
index 0000000..0147022
--- /dev/null
+++ b/vendor/phpmd/phpmd/build.properties
@@ -0,0 +1,17 @@
+project.dir =
+project.uri = phpmd.org
+project.name = phpmd
+project.version = 2.1.3
+project.stability = stable
+
+# Disable pear support
+project.pear.uri = pear.example.com
+
+# Default coding standard
+codesniffer.standard = PSR2
+
+# Location of the version control system
+project.scm.uri = github.com/${project.name}/${project.name}/commit
+
+# Execute the following command for pdepend profiling
+profile.command = ${basedir}/src/bin/phpmd '/opt/Sources/PHP/Flow3/Packages/Framework' xml naming,codesize,unusedcode,design --reportfile pmd.xml
diff --git a/vendor/phpmd/phpmd/build.xml b/vendor/phpmd/phpmd/build.xml
new file mode 100644
index 0000000..e8112bf
--- /dev/null
+++ b/vendor/phpmd/phpmd/build.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/phpmd/phpmd/composer.json b/vendor/phpmd/phpmd/composer.json
new file mode 100644
index 0000000..4adaadc
--- /dev/null
+++ b/vendor/phpmd/phpmd/composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "phpmd/phpmd",
+ "description": "Official version of PHPMD handled with Composer.",
+ "license": "BSD-3-Clause",
+
+ "minimum-stability" : "stable",
+
+ "require": {
+ "php": ">=5.3.0",
+ "pdepend/pdepend": "2.0.*",
+
+ "symfony/dependency-injection": "2.5.*",
+ "symfony/filesystem": "2.5.*",
+ "symfony/config": "2.5.*"
+ },
+
+ "autoload": {
+ "psr-0": {
+ "PHPMD\\": "src/main/php"
+ }
+ },
+
+ "bin": ["src/bin/phpmd"]
+}
diff --git a/vendor/phpmd/phpmd/composer.lock b/vendor/phpmd/phpmd/composer.lock
new file mode 100644
index 0000000..506e8d1
--- /dev/null
+++ b/vendor/phpmd/phpmd/composer.lock
@@ -0,0 +1,218 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
+ ],
+ "hash": "e8b5a8242b4c5337c824139e1302c8c8",
+ "packages": [
+ {
+ "name": "pdepend/pdepend",
+ "version": "2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/pdepend/pdepend.git",
+ "reference": "5fbe4b9ec9d05057d88b898ac5ba9071f427eeb0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/pdepend/pdepend/zipball/5fbe4b9ec9d05057d88b898ac5ba9071f427eeb0",
+ "reference": "5fbe4b9ec9d05057d88b898ac5ba9071f427eeb0",
+ "shasum": ""
+ },
+ "require": {
+ "symfony/config": "@stable",
+ "symfony/dependency-injection": "@stable",
+ "symfony/filesystem": "@stable"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.*@stable",
+ "squizlabs/php_codesniffer": "@stable"
+ },
+ "bin": [
+ "src/bin/pdepend"
+ ],
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "PDepend\\": "src/main/php/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "description": "Official version of pdepend to be handled with Composer",
+ "time": "2014-09-16 14:04:28"
+ },
+ {
+ "name": "symfony/config",
+ "version": "v2.5.4",
+ "target-dir": "Symfony/Component/Config",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Config.git",
+ "reference": "080eabdc256c1d7a3a7cf6296271edb68eb1ab2b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Config/zipball/080eabdc256c1d7a3a7cf6296271edb68eb1ab2b",
+ "reference": "080eabdc256c1d7a3a7cf6296271edb68eb1ab2b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/filesystem": "~2.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Config\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Symfony Config Component",
+ "homepage": "http://symfony.com",
+ "time": "2014-08-31 03:22:04"
+ },
+ {
+ "name": "symfony/dependency-injection",
+ "version": "v2.5.4",
+ "target-dir": "Symfony/Component/DependencyInjection",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/DependencyInjection.git",
+ "reference": "dcfdfbfdab2dc5bf00e5274719126a3079c6d02c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/dcfdfbfdab2dc5bf00e5274719126a3079c6d02c",
+ "reference": "dcfdfbfdab2dc5bf00e5274719126a3079c6d02c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "symfony/config": "~2.2",
+ "symfony/expression-language": "~2.4",
+ "symfony/yaml": "~2.0"
+ },
+ "suggest": {
+ "symfony/config": "",
+ "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
+ "symfony/yaml": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\DependencyInjection\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Symfony DependencyInjection Component",
+ "homepage": "http://symfony.com",
+ "time": "2014-08-31 03:22:04"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v2.5.4",
+ "target-dir": "Symfony/Component/Filesystem",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Filesystem.git",
+ "reference": "a765efd199e02ff4001c115c318e219030be9364"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a765efd199e02ff4001c115c318e219030be9364",
+ "reference": "a765efd199e02ff4001c115c318e219030be9364",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Filesystem\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Symfony Filesystem Component",
+ "homepage": "http://symfony.com",
+ "time": "2014-09-03 09:00:14"
+ }
+ ],
+ "packages-dev": [
+
+ ],
+ "aliases": [
+
+ ],
+ "minimum-stability": "stable",
+ "stability-flags": [
+
+ ],
+ "prefer-stable": false,
+ "platform": {
+ "php": ">=5.3.0"
+ },
+ "platform-dev": [
+
+ ]
+}
diff --git a/vendor/phpmd/phpmd/phpunit.xml.dist b/vendor/phpmd/phpmd/phpunit.xml.dist
new file mode 100644
index 0000000..e83b4bc
--- /dev/null
+++ b/vendor/phpmd/phpmd/phpunit.xml.dist
@@ -0,0 +1,13 @@
+
+
+
+
+ src/test/php
+
+
+
+
+ src/main/php
+
+
+
diff --git a/vendor/phpmd/phpmd/src/bin/phpmd b/vendor/phpmd/phpmd/src/bin/phpmd
new file mode 100755
index 0000000..2cde49e
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/bin/phpmd
@@ -0,0 +1,122 @@
+#!/usr/bin/env php
+ 0, 'K' => 10, 'M' => 20, 'G' => 30, 'T' => 40);
+ $limit = ($match[1] * (1 << $shift[$match[2]]));
+ }
+ if (ini_get('suhosin.memory_limit') > $limit && $limit > -1) {
+ ini_set('memory_limit', ini_get('suhosin.memory_limit'));
+ }
+} else {
+ ini_set('memory_limit', -1);
+}
+
+// Check php setup for cli arguments
+if (!isset($_SERVER['argv']) && !isset($argv)) {
+ fwrite(STDERR, 'Please enable the "register_argc_argv" directive in your php.ini', PHP_EOL);
+ exit(1);
+} else if (!isset($argv)) {
+ $argv = $_SERVER['argv'];
+}
+
+// Run command line interface
+exit(Command::main($argv));
diff --git a/vendor/phpmd/phpmd/src/bin/phpmd.bat b/vendor/phpmd/phpmd/src/bin/phpmd.bat
new file mode 100644
index 0000000..bfac051
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/bin/phpmd.bat
@@ -0,0 +1,45 @@
+@echo off
+REM This file is part of PHP Mess Detector.
+REM
+REM Copyright (c) 2008-2012, Manuel Pichler .
+REM All rights reserved.
+REM
+REM Redistribution and use in source and binary forms, with or without
+REM modification, are permitted provided that the following conditions
+REM are met:
+REM
+REM * Redistributions of source code must retain the above copyright
+REM notice, this list of conditions and the following disclaimer.
+REM
+REM * Redistributions in binary form must reproduce the above copyright
+REM notice, this list of conditions and the following disclaimer in
+REM the documentation and/or other materials provided with the
+REM distribution.
+REM
+REM * Neither the name of Manuel Pichler nor the names of his
+REM contributors may be used to endorse or promote products derived
+REM from this software without specific prior written permission.
+REM
+REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+REM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+REM LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+REM FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+REM COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+REM INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+REM BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+REM LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+REM CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC
+REM LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+REM ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+REM POSSIBILITY OF SUCH DAMAGE.
+REM
+REM $Id$
+REM
+
+if "%PHPBIN%" == "" set PHPBIN=@php_bin@
+if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
+GOTO RUN
+:USE_PEAR_PATH
+set PHPBIN=%PHP_PEAR_PHP_BIN%
+:RUN
+"%PHPBIN%" "@bin_dir@\phpmd" %*
diff --git a/vendor/phpmd/phpmd/src/conf/phar_bootstrap.stub b/vendor/phpmd/phpmd/src/conf/phar_bootstrap.stub
new file mode 100644
index 0000000..0f01be8
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/conf/phar_bootstrap.stub
@@ -0,0 +1,21 @@
+#!/usr/bin/env php
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+use PHPMD\Node\ASTNode;
+
+/**
+ * This is an abstract base class for PHPMD code nodes, it is just a wrapper
+ * around PDepend's object model.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+abstract class AbstractNode
+{
+ /**
+ *
+ * @var \PDepend\Source\AST\ASTArtifact|\PDepend\Source\AST\ASTNode $node
+ */
+ private $node = null;
+
+ /**
+ * The collected metrics for this node.
+ *
+ * @var array(string=>mixed) $_metrics
+ */
+ private $metrics = null;
+
+ /**
+ * Constructs a new PHPMD node.
+ *
+ * @param \PDepend\Source\AST\ASTArtifact|\PDepend\Source\AST\ASTNode $node
+ */
+ public function __construct($node)
+ {
+ $this->node = $node;
+ }
+
+ /**
+ * The magic call method is used to pipe requests from rules direct
+ * to the underlying PDepend ast node.
+ *
+ * @param string $name
+ * @param array $args
+ * @return mixed
+ * @throws \BadMethodCallException When the underlying PDepend node
+ * does not contain a method named $name.
+ */
+ public function __call($name, array $args)
+ {
+ if (method_exists($this->getNode(), $name)) {
+ return call_user_func_array(array($this->getNode(), $name), $args);
+ }
+ throw new \BadMethodCallException(
+ sprintf('Invalid method %s() called.', $name)
+ );
+ }
+
+ /**
+ * Returns the parent of this node or null when no parent node
+ * exists.
+ *
+ * @return \PHPMD\AbstractNode
+ */
+ public function getParent()
+ {
+ if (($node = $this->node->getParent()) === null) {
+ return null;
+ }
+ return new ASTNode($node, $this->getFileName());
+ }
+
+ /**
+ * Returns a child node at the given index.
+ *
+ * @param integer $index The child offset.
+ *
+ * @return \PHPMD\Node\ASTNode
+ */
+ public function getChild($index)
+ {
+ return new ASTNode(
+ $this->node->getChild($index),
+ $this->getFileName()
+ );
+ }
+
+ /**
+ * Returns the first child of the given type or null when this node
+ * has no child of the given type.
+ *
+ * @param string $type The searched child type.
+ * @return \PHPMD\AbstractNode
+ */
+ public function getFirstChildOfType($type)
+ {
+ $node = $this->node->getFirstChildOfType('PDepend\Source\AST\AST' . $type);
+ if ($node === null) {
+ return null;
+ }
+ return new ASTNode($node, $this->getFileName());
+ }
+
+ /**
+ * Searches recursive for all children of this node that are of the given
+ * type.
+ *
+ * @param string $type The searched child type.
+ * @return \PHPMD\AbstractNode[]
+ */
+ public function findChildrenOfType($type)
+ {
+ $children = $this->node->findChildrenOfType('PDepend\Source\AST\AST' . $type);
+
+ $nodes = array();
+ foreach ($children as $child) {
+ $nodes[] = new ASTNode($child, $this->getFileName());
+ }
+ return $nodes;
+ }
+
+ /**
+ * Tests if this node represents the the given type.
+ *
+ * @param string $type The expected node type.
+ * @return boolean
+ */
+ public function isInstanceOf($type)
+ {
+ $class = 'PDepend\Source\AST\AST' . $type;
+ return ($this->node instanceof $class);
+ }
+
+ /**
+ * Returns the image of the underlying node.
+ *
+ * @return string
+ */
+ public function getImage()
+ {
+ return $this->node->getName();
+ }
+
+ /**
+ * Returns the source name for this node, maybe a class or interface name,
+ * or a package, method, function name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->node->getName();
+ }
+
+ /**
+ * Returns the begin line for this node in the php source code file.
+ *
+ * @return integer
+ */
+ public function getBeginLine()
+ {
+ return $this->node->getStartLine();
+ }
+
+ /**
+ * Returns the end line for this node in the php source code file.
+ *
+ * @return integer
+ */
+ public function getEndLine()
+ {
+ return $this->node->getEndLine();
+ }
+
+ /**
+ * Returns the name of the declaring source file.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return (string) $this->node->getCompilationUnit()->getFileName();
+ }
+
+ /**
+ * Returns the wrapped PDepend node instance.
+ *
+ * @return \PDepend\Source\AST\ASTArtifact
+ */
+ public function getNode()
+ {
+ return $this->node;
+ }
+
+ /**
+ * Returns a textual representation/name for the concrete node type.
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ $type = explode('\\', get_class($this));
+ return preg_replace('(node$)', '', strtolower(array_pop($type)));
+ }
+
+ /**
+ * This method will return the metric value for the given identifier or
+ * null when no such metric exists.
+ *
+ * @param string $name The metric name or abbreviation.
+ *
+ * @return mixed
+ */
+ public function getMetric($name)
+ {
+ if (isset($this->metrics[$name])) {
+ return $this->metrics[$name];
+ }
+ return null;
+ }
+
+ /**
+ * This method will set the metrics for this node.
+ *
+ * @param array(string=>mixed) $metrics The collected node metrics.
+ * @return void
+ */
+ public function setMetrics(array $metrics)
+ {
+ if ($this->metrics === null) {
+ $this->metrics = $metrics;
+ }
+ }
+
+ /**
+ * Checks if this node has a suppressed annotation for the given rule
+ * instance.
+ *
+ * @param \PHPMD\Rule $rule
+ * @return boolean
+ */
+ abstract public function hasSuppressWarningsAnnotationFor(Rule $rule);
+
+ /**
+ * Returns the name of the parent type or null when this node has no
+ * parent type.
+ *
+ * @return string
+ */
+ abstract public function getParentName();
+
+ /**
+ * Returns the name of the parent package.
+ *
+ * @return string
+ */
+ abstract public function getNamespaceName();
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/AbstractRenderer.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/AbstractRenderer.php
new file mode 100644
index 0000000..0d3168b
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/AbstractRenderer.php
@@ -0,0 +1,115 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * Abstract base class for PHPMD rendering engines.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+abstract class AbstractRenderer
+{
+ /**
+ * The associated output writer instance.
+ *
+ * @var \PHPMD\AbstractWriter
+ */
+ private $writer = null;
+
+ /**
+ * Returns the associated output writer instance.
+ *
+ * @return \PHPMD\AbstractWriter
+ */
+ public function getWriter()
+ {
+ return $this->writer;
+ }
+
+ /**
+ * Returns the associated output writer instance.
+ *
+ * @param \PHPMD\AbstractWriter $writer
+ * @return void
+ */
+ public function setWriter(AbstractWriter $writer)
+ {
+ $this->writer = $writer;
+ }
+
+ /**
+ * This method will be called on all renderers before the engine starts the
+ * real report processing.
+ *
+ * @return void
+ */
+ public function start()
+ {
+ // Just a hook
+ }
+
+ /**
+ * This method will be called when the engine has finished the source analysis
+ * phase.
+ *
+ * @param \PHPMD\Report $report
+ * @return void
+ */
+ abstract public function renderReport(Report $report);
+
+ /**
+ * This method will be called the engine has finished the report processing
+ * for all registered renderers.
+ *
+ * @return void
+ */
+ public function end()
+ {
+ // Just a hook
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/AbstractRule.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/AbstractRule.php
new file mode 100644
index 0000000..1944e7e
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/AbstractRule.php
@@ -0,0 +1,427 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * This is the abstract base class for pmd rules.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @SuppressWarnings(PHPMD)
+ */
+abstract class AbstractRule implements Rule
+{
+ /**
+ * List of readable priority names.
+ *
+ * @var array(string) $_priorities
+ */
+ private static $priorities = array(
+ 'High',
+ 'Medium High',
+ 'Medium',
+ 'Medium Low',
+ 'Low'
+ );
+
+ /**
+ * The name for this rule instance.
+ *
+ * @var string $_name
+ */
+ private $name = '';
+
+ /**
+ * The violation message text for this rule.
+ *
+ * @var string
+ */
+ private $message = '';
+
+ /**
+ * The version since when this rule is available.
+ *
+ * @var string
+ */
+ private $since = null;
+
+ /**
+ * An url will external information for this rule.
+ *
+ * @var string
+ */
+ private $externalInfoUrl = '';
+
+ /**
+ * An optional description for this rule.
+ *
+ * @var string
+ */
+ private $description = '';
+
+ /**
+ * A list of code examples for this rule.
+ *
+ * @var array(string)
+ */
+ private $examples = array();
+
+ /**
+ * The name of the parent rule-set instance.
+ *
+ * @var string
+ */
+ private $ruleSetName = '';
+
+ /**
+ * The priority of this rule.
+ *
+ * @var integer
+ */
+ private $priority = self::LOWEST_PRIORITY;
+
+ /**
+ * Configuration properties for this rule instance.
+ *
+ * @var array(string=>string)
+ */
+ private $properties = array();
+
+ /**
+ * The report for object for this rule.
+ *
+ * @var \PHPMD\Report
+ */
+ private $report = null;
+
+ /**
+ * Returns the name for this rule instance.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets the name for this rule instance.
+ *
+ * @param string $name The rule name.
+ *
+ * @return void
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * Returns the version since when this rule is available or null.
+ *
+ * @return string
+ */
+ public function getSince()
+ {
+ return $this->since;
+ }
+
+ /**
+ * Sets the version since when this rule is available.
+ *
+ * @param string $since The version number.
+ *
+ * @return void
+ */
+ public function setSince($since)
+ {
+ $this->since = $since;
+ }
+
+ /**
+ * Returns the violation message text for this rule.
+ *
+ * @return string
+ */
+ public function getMessage()
+ {
+ return $this->message;
+ }
+
+ /**
+ * Sets the violation message text for this rule.
+ *
+ * @param string $message The violation message
+ *
+ * @return void
+ */
+ public function setMessage($message)
+ {
+ $this->message = $message;
+ }
+
+ /**
+ * Returns an url will external information for this rule.
+ *
+ * @return string
+ */
+ public function getExternalInfoUrl()
+ {
+ return $this->externalInfoUrl;
+ }
+
+ /**
+ * Sets an url will external information for this rule.
+ *
+ * @param string $externalInfoUrl The info url.
+ *
+ * @return void
+ */
+ public function setExternalInfoUrl($externalInfoUrl)
+ {
+ $this->externalInfoUrl = $externalInfoUrl;
+ }
+
+ /**
+ * Returns the description text for this rule instance.
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->description;
+ }
+
+ /**
+ * Sets the description text for this rule instance.
+ *
+ * @param string $description The description text.
+ *
+ * @return void
+ */
+ public function setDescription($description)
+ {
+ $this->description = $description;
+ }
+
+ /**
+ * Returns a list of examples for this rule.
+ *
+ * @return array(string)
+ */
+ public function getExamples()
+ {
+ return $this->examples;
+ }
+
+ /**
+ * Adds a code example for this rule.
+ *
+ * @param string $example The code example.
+ *
+ * @return void
+ */
+ public function addExample($example)
+ {
+ $this->examples[] = $example;
+ }
+
+ /**
+ * Returns the priority of this rule.
+ *
+ * @return integer
+ */
+ public function getPriority()
+ {
+ return $this->priority;
+ }
+
+ /**
+ * Set the priority of this rule.
+ *
+ * @param integer $priority The rule priority
+ *
+ * @return void
+ */
+ public function setPriority($priority)
+ {
+ $this->priority = $priority;
+ }
+
+ /**
+ * Returns the name of the parent rule-set instance.
+ *
+ * @return string
+ */
+ public function getRuleSetName()
+ {
+ return $this->ruleSetName;
+ }
+
+ /**
+ * Sets the name of the parent rule set instance.
+ *
+ * @param string $ruleSetName The rule-set name.
+ *
+ * @return void
+ */
+ public function setRuleSetName($ruleSetName)
+ {
+ $this->ruleSetName = $ruleSetName;
+ }
+
+ /**
+ * Returns the violation report for this rule.
+ *
+ * @return \PHPMD\Report
+ */
+ public function getReport()
+ {
+ return $this->report;
+ }
+
+ /**
+ * Sets the violation report for this rule.
+ *
+ * @param \PHPMD\Report $report
+ * @return void
+ */
+ public function setReport(Report $report)
+ {
+ $this->report = $report;
+ }
+
+ /**
+ * Adds a configuration property to this rule instance.
+ *
+ * @param string $name
+ * @param string $value
+ * @return void
+ */
+ public function addProperty($name, $value)
+ {
+ $this->properties[$name] = $value;
+ }
+
+ /**
+ * Returns the value of a configured property as a boolean or throws an
+ * exception when no property with $name exists.
+ *
+ * @param string $name
+ * @return boolean
+ * @throws \OutOfBoundsException When no property for $name exists.
+ */
+ public function getBooleanProperty($name)
+ {
+ if (isset($this->properties[$name])) {
+ return in_array($this->properties[$name], array('true', 'on', 1));
+ }
+ throw new \OutOfBoundsException('Property $' . $name . ' does not exist.');
+ }
+
+ /**
+ * Returns the value of a configured property as an integer or throws an
+ * exception when no property with $name exists.
+ *
+ * @param string $name
+ * @return integer
+ * @throws \OutOfBoundsException When no property for $name exists.
+ */
+ public function getIntProperty($name)
+ {
+ if (isset($this->properties[$name])) {
+ return (int) $this->properties[$name];
+ }
+ throw new \OutOfBoundsException('Property $' . $name . ' does not exist.');
+ }
+
+
+ /**
+ * Returns the raw string value of a configured property or throws an
+ * exception when no property with $name exists.
+ *
+ * @param string $name
+ * @return string
+ * @throws \OutOfBoundsException When no property for $name exists.
+ */
+ public function getStringProperty($name)
+ {
+ if (isset($this->properties[$name])) {
+ return $this->properties[$name];
+ }
+ throw new \OutOfBoundsException('Property $' . $name . ' does not exist.');
+
+ }
+
+ /**
+ * This method adds a violation to all reports for this violation type and
+ * for the given $node instance.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @param array $args
+ * @param mixed $metric
+ * @return void
+ */
+ protected function addViolation(
+ AbstractNode $node,
+ array $args = array(),
+ $metric = null
+ ) {
+ $search = array();
+ $replace = array();
+ foreach ($args as $index => $value) {
+ $search[] = '{' . $index . '}';
+ $replace[] = $value;
+ }
+
+ $message = str_replace($search, $replace, $this->message);
+
+ $ruleViolation = new RuleViolation($this, $node, $message, $metric);
+ $this->report->addRuleViolation($ruleViolation);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/AbstractWriter.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/AbstractWriter.php
new file mode 100644
index 0000000..7564814
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/AbstractWriter.php
@@ -0,0 +1,64 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * This is abstract base class for an output writer.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+abstract class AbstractWriter
+{
+ /**
+ * Writes a data string to the concrete output.
+ *
+ * @param string $data
+ * @return void
+ */
+ abstract public function write($data);
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/ASTNode.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/ASTNode.php
new file mode 100644
index 0000000..2f68a49
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/ASTNode.php
@@ -0,0 +1,143 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PHPMD\Rule;
+
+/**
+ * Wrapper around a PHP_Depend ast node.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class ASTNode extends \PHPMD\AbstractNode
+{
+ /**
+ * The source file of this node.
+ *
+ * @var string
+ */
+ private $fileName = null;
+
+ /**
+ * Constructs a new ast node instance.
+ *
+ * @param \PDepend\Source\AST\ASTNode $node
+ * @param string $fileName
+ */
+ public function __construct(\PDepend\Source\AST\ASTNode $node, $fileName)
+ {
+ parent::__construct($node);
+
+ $this->fileName = $fileName;
+ }
+
+ /**
+ * Checks if this node has a suppressed annotation for the given rule
+ * instance.
+ *
+ * @param \PHPMD\Rule $rule
+ * @return boolean
+ * @SuppressWarnings("PMD.UnusedFormalParameter")
+ */
+ public function hasSuppressWarningsAnnotationFor(Rule $rule)
+ {
+ return false;
+ }
+
+ /**
+ * Returns the source name for this node, maybe a class or interface name,
+ * or a package, method, function name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->getImage();
+ }
+
+ /**
+ * Returns the image of the underlying node.
+ *
+ * @return string
+ */
+ public function getImage()
+ {
+ return $this->getNode()->getImage();
+ }
+
+ /**
+ * Returns the name of the declaring source file.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->fileName;
+ }
+
+ /**
+ * Returns the name of the parent type or null when this node has no
+ * parent type.
+ *
+ * @return string
+ */
+ public function getParentName()
+ {
+ return null;
+ }
+
+ /**
+ * Returns the name of the parent namespace.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return null;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/AbstractCallableNode.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/AbstractCallableNode.php
new file mode 100644
index 0000000..61cc09d
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/AbstractCallableNode.php
@@ -0,0 +1,78 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PDepend\Source\AST\AbstractASTCallable;
+
+/**
+ * Abstract base class for PHP_Depend function and method wrappers.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+abstract class AbstractCallableNode extends AbstractNode
+{
+ /**
+ * Constructs a new callable wrapper.
+ *
+ * @param \PDepend\Source\AST\AbstractASTCallable $node
+ */
+ public function __construct(AbstractASTCallable $node)
+ {
+ parent::__construct($node);
+ }
+
+ /**
+ * Returns the number of parameters in the callable signature.
+ *
+ * @return integer
+ */
+ public function getParameterCount()
+ {
+ return count($this->getNode()->getParameters());
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/AbstractNode.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/AbstractNode.php
new file mode 100644
index 0000000..1539b72
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/AbstractNode.php
@@ -0,0 +1,80 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PHPMD\Rule;
+
+/**
+ * Abstract base class for all code nodes.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+abstract class AbstractNode extends \PHPMD\AbstractNode
+{
+ /**
+ * Annotations associated with node instance.
+ *
+ * @var \PHPMD\Node\Annotations
+ */
+ private $annotations = null;
+
+ /**
+ * Checks if this node has a suppressed annotation for the given rule
+ * instance.
+ *
+ * @param \PHPMD\Rule $rule
+ * @return boolean
+ */
+ public function hasSuppressWarningsAnnotationFor(Rule $rule)
+ {
+ if ($this->annotations === null) {
+ $this->annotations = new Annotations($this);
+ }
+ return $this->annotations->suppresses($rule);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/AbstractTypeNode.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/AbstractTypeNode.php
new file mode 100644
index 0000000..65be422
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/AbstractTypeNode.php
@@ -0,0 +1,129 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PDepend\Source\AST\AbstractASTClassOrInterface;
+
+/**
+ * Abstract base class for classes and interfaces.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+abstract class AbstractTypeNode extends AbstractNode
+{
+ /**
+ * Constructs a new generic class or interface node.
+ *
+ * @param \PDepend\Source\AST\AbstractASTClassOrInterface $node
+ */
+ public function __construct(AbstractASTClassOrInterface $node)
+ {
+ parent::__construct($node);
+ }
+
+ /**
+ * Returns an array with all methods defined in the context class or
+ * interface.
+ *
+ * @return \PHPMD\Node\MethodNode[]
+ */
+ public function getMethods()
+ {
+ $methods = array();
+ foreach ($this->getNode()->getMethods() as $method) {
+ $methods[] = new MethodNode($method);
+ }
+ return $methods;
+ }
+
+ /**
+ * Returns an array with the names of all methods within this class or
+ * interface node.
+ *
+ * @return array(string)
+ */
+ public function getMethodNames()
+ {
+ $names = array();
+ foreach ($this->getNode()->getMethods() as $method) {
+ $names[] = $method->getName();
+ }
+ return $names;
+ }
+
+ /**
+ * Returns the number of constants declared in this type.
+ *
+ * @return integer
+ */
+ public function getConstantCount()
+ {
+ return $this->getNode()->getConstants()->count();
+ }
+
+ /**
+ * Returns the name of the parent namespace.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return $this->getNode()->getNamespace()->getName();
+ }
+
+ /**
+ * Returns the name of the parent type or null when this node has no
+ * parent type.
+ *
+ * @return string
+ */
+ public function getParentName()
+ {
+ return null;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/Annotation.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/Annotation.php
new file mode 100644
index 0000000..2050018
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/Annotation.php
@@ -0,0 +1,119 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PHPMD\Rule;
+
+/**
+ * Simple code annotation class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class Annotation
+{
+ /**
+ * Name of the suppress warnings annotation.
+ */
+ const SUPPRESS_ANNOTATION = 'SuppressWarnings';
+
+ /**
+ * The annotation name.
+ *
+ * @var string
+ */
+ private $name = null;
+
+ /**
+ * The annotation value.
+ *
+ * @var string
+ */
+ private $value = null;
+
+ /**
+ * Constructs a new annotation instance.
+ *
+ * @param string $name
+ * @param string $value
+ */
+ public function __construct($name, $value)
+ {
+ $this->name = $name;
+ $this->value = trim($value, '" ');
+ }
+
+ /**
+ * Checks if this annotation suppresses the given rule.
+ *
+ * @param \PHPMD\Rule $rule
+ * @return boolean
+ */
+ public function suppresses(Rule $rule)
+ {
+ if ($this->name === self::SUPPRESS_ANNOTATION) {
+ return $this->isSuppressed($rule);
+ }
+ return false;
+ }
+
+ /**
+ * Checks if this annotation suppresses the given rule.
+ *
+ * @param \PHPMD\Rule $rule
+ * @return boolean
+ */
+ private function isSuppressed(Rule $rule)
+ {
+ if (in_array($this->value, array('PHPMD', 'PMD'))) {
+ return true;
+ } elseif (strpos($this->value, 'PMD.' . $rule->getName()) !== false) {
+ return true;
+ }
+ return (stripos($rule->getName(), $this->value) !== false);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/Annotations.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/Annotations.php
new file mode 100644
index 0000000..db4d2f7
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/Annotations.php
@@ -0,0 +1,104 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PHPMD\Rule;
+
+/**
+ * Collection of code annotations.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class Annotations
+{
+ /**
+ * Detected annotations.
+ *
+ * @var \PHPMD\Node\Annotation[]
+ */
+ private $annotations = array();
+
+ /**
+ * Regexp used to extract code annotations.
+ *
+ * @var string
+ */
+ private $regexp = '(@([a-z_][a-z0-9_]+)\(([^\)]+)\))i';
+
+ /**
+ * Constructs a new collection instance.
+ *
+ * @param \PHPMD\AbstractNode $node
+ */
+ public function __construct(\PHPMD\AbstractNode $node)
+ {
+ preg_match_all($this->regexp, $node->getDocComment(), $matches);
+ foreach (array_keys($matches[0]) as $i) {
+ $name = $matches[1][$i];
+ $value = trim($matches[2][$i], '" ');
+
+ $this->annotations[] = new Annotation($name, $value);
+ }
+ }
+
+ /**
+ * Checks if one of the annotations suppresses the given rule.
+ *
+ * @param \PHPMD\Rule $rule
+ * @return boolean
+ */
+ public function suppresses(Rule $rule)
+ {
+ foreach ($this->annotations as $annotation) {
+ if ($annotation->suppresses($rule)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/ClassNode.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/ClassNode.php
new file mode 100644
index 0000000..c2a4257
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/ClassNode.php
@@ -0,0 +1,73 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PDepend\Source\AST\ASTClass;
+
+/**
+ * Wrapper around PHP_Depend's class objects.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class ClassNode extends AbstractTypeNode
+{
+ /**
+ * The type of this class.
+ */
+ const CLAZZ = __CLASS__;
+
+ /**
+ * Constructs a new class wrapper node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $node
+ */
+ public function __construct(ASTClass $node)
+ {
+ parent::__construct($node);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/FunctionNode.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/FunctionNode.php
new file mode 100644
index 0000000..6c8e2fd
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/FunctionNode.php
@@ -0,0 +1,89 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PDepend\Source\AST\ASTFunction;
+
+/**
+ * Wrapper around a PDepend function node.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class FunctionNode extends AbstractCallableNode
+{
+ /**
+ * Constructs a new function wrapper.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $node
+ */
+ public function __construct(ASTFunction $node)
+ {
+ parent::__construct($node);
+ }
+
+ /**
+ * Returns the name of the parent package.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return $this->getNode()->getNamespace()->getName();
+ }
+
+ /**
+ * Returns the name of the parent type or null when this node has no
+ * parent type.
+ *
+ * @return string
+ */
+ public function getParentName()
+ {
+ return null;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/InterfaceNode.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/InterfaceNode.php
new file mode 100644
index 0000000..b383bc1
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/InterfaceNode.php
@@ -0,0 +1,68 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PDepend\Source\AST\ASTInterface;
+
+/**
+ * Wrapper around PHP_Depend's interface objects.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class InterfaceNode extends AbstractTypeNode
+{
+ /**
+ * Constructs a new interface wrapper instance.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $node
+ */
+ public function __construct(ASTInterface $node)
+ {
+ parent::__construct($node);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/MethodNode.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/MethodNode.php
new file mode 100644
index 0000000..8fcb84e
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/MethodNode.php
@@ -0,0 +1,169 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTTrait;
+use PHPMD\Rule;
+
+/**
+ * Wrapper around a PHP_Depend method node.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class MethodNode extends AbstractCallableNode
+{
+ /**
+ * Constructs a new method wrapper.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $node
+ */
+ public function __construct(ASTMethod $node)
+ {
+ parent::__construct($node);
+ }
+
+ /**
+ * Returns the name of the parent package.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return $this->getNode()->getParent()->getNamespace()->getName();
+ }
+
+ /**
+ * Returns the name of the parent type or null when this node has no
+ * parent type.
+ *
+ * @return string
+ */
+ public function getParentName()
+ {
+ return $this->getNode()->getParent()->getName();
+ }
+
+ /**
+ * Returns true when the underlying method is declared as abstract or
+ * is declared as child of an interface.
+ *
+ * @return boolean
+ */
+ public function isAbstract()
+ {
+ return $this->getNode()->isAbstract();
+ }
+
+ /**
+ * Checks if this node has a suppressed annotation for the given rule
+ * instance.
+ *
+ * @param \PHPMD\Rule $rule
+ * @return boolean
+ */
+ public function hasSuppressWarningsAnnotationFor(Rule $rule)
+ {
+ if (parent::hasSuppressWarningsAnnotationFor($rule)) {
+ return true;
+ }
+ return $this->getParentType()->hasSuppressWarningsAnnotationFor($rule);
+ }
+
+ /**
+ * Returns the parent class or interface instance.
+ *
+ * @return \PHPMD\Node\AbstractTypeNode
+ */
+ public function getParentType()
+ {
+ $parentNode = $this->getNode()->getParent();
+
+ if ($parentNode instanceof ASTClass) {
+ return new ClassNode($parentNode);
+ }
+ if ($parentNode instanceof ASTTrait) {
+ return new TraitNode($parentNode);
+ }
+ return new InterfaceNode($parentNode);
+ }
+
+ /**
+ * Returns true when this method is the initial method declaration.
+ * Otherwise this method will return false.
+ *
+ * @return boolean
+ * @since 1.2.1
+ */
+ public function isDeclaration()
+ {
+ if ($this->isPrivate()) {
+ return true;
+ }
+
+ $methodName = strtolower($this->getName());
+
+ $parentNode = $this->getNode()->getParent();
+ foreach ($parentNode->getInterfaces() as $parentType) {
+ $methods = $parentType->getAllMethods();
+ if (isset($methods[$methodName])) {
+ return false;
+ }
+ }
+
+ if (is_object($parentType = $parentNode->getParentClass())) {
+ $methods = $parentType->getAllMethods();
+ if (isset($methods[$methodName])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/TraitNode.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/TraitNode.php
new file mode 100644
index 0000000..8c8a5ad
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Node/TraitNode.php
@@ -0,0 +1,68 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PDepend\Source\AST\ASTTrait;
+
+/**
+ * Wrapper around PHP_Depend's interface objects.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 1.3.3
+ */
+class TraitNode extends AbstractTypeNode
+{
+ /**
+ * Constructs a new interface wrapper instance.
+ *
+ * @param \PDepend\Source\AST\ASTTrait $node
+ */
+ public function __construct(ASTTrait $node)
+ {
+ parent::__construct($node);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/PHPMD.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/PHPMD.php
new file mode 100644
index 0000000..324df50
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/PHPMD.php
@@ -0,0 +1,243 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * This is the main facade of the PHP PMD application
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class PHPMD
+{
+ /**
+ * The current PHPMD version.
+ */
+ const VERSION = '@project.version@';
+
+ /**
+ * List of valid file extensions for analyzed files.
+ *
+ * @var array(string)
+ */
+ private $fileExtensions = array('php', 'php3', 'php4', 'php5', 'inc');
+
+ /**
+ * List of exclude directory patterns.
+ *
+ * @var array(string)
+ */
+ private $ignorePatterns = array('.git', '.svn', 'CVS', '.bzr', '.hg', 'SCCS');
+
+ /**
+ * The input source file or directory.
+ *
+ * @var string
+ */
+ private $input;
+
+ /**
+ * This property will be set to true when an error or a violation
+ * was found in the processed source code.
+ *
+ * @var boolean
+ * @since 0.2.5
+ */
+ private $violations = false;
+
+ /**
+ * Additional options for PHPMD or one of it's parser backends.
+ *
+ * @var array
+ * @since 1.2.0
+ */
+ private $options = array();
+
+ /**
+ * This method will return true when the processed source code
+ * contains violations.
+ *
+ * @return boolean
+ * @since 0.2.5
+ */
+ public function hasViolations()
+ {
+ return $this->violations;
+ }
+
+ /**
+ * Returns the input source file or directory path.
+ *
+ * @return string
+ */
+ public function getInput()
+ {
+ return $this->input;
+ }
+
+ /**
+ * Returns an array with valid php source file extensions.
+ *
+ * @return array(string)
+ * @since 0.2.0
+ */
+ public function getFileExtensions()
+ {
+ return $this->fileExtensions;
+ }
+
+ /**
+ * Sets a list of filename extensions for valid php source code files.
+ *
+ * @param array(string) $fileExtensions Extensions without leading dot.
+ *
+ * @return void
+ */
+ public function setFileExtensions(array $fileExtensions)
+ {
+ $this->fileExtensions = $fileExtensions;
+ }
+
+ /**
+ * Returns an array with string patterns that mark a file path as invalid.
+ *
+ * @return array(string)
+ * @since 0.2.0
+ */
+ public function getIgnorePattern()
+ {
+ return $this->ignorePatterns;
+ }
+
+ /**
+ * Sets a list of ignore patterns that is used to exclude directories from
+ * the source analysis.
+ *
+ * @param array(string) $ignorePatterns List of ignore patterns.
+ *
+ * @return void
+ */
+ public function setIgnorePattern(array $ignorePatterns)
+ {
+ $this->ignorePatterns = array_merge(
+ $this->ignorePatterns,
+ $ignorePatterns
+ );
+ }
+
+ /**
+ * Returns additional options for PHPMD or one of it's parser backends.
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ return $this->options;
+ }
+
+ /**
+ * Sets additional options for PHPMD or one of it's parser backends.
+ *
+ * @param array $options Additional backend or PHPMD options.
+ * @return void
+ */
+ public function setOptions(array $options)
+ {
+ $this->options = $options;
+ }
+
+ /**
+ * This method will process all files that can be found in the given input
+ * path. It will apply rules defined in the comma-separated $ruleSets
+ * argument. The result will be passed to all given renderer instances.
+ *
+ * @param string $inputPath
+ * @param string $ruleSets
+ * @param \PHPMD\AbstractRenderer[] $renderers
+ * @param \PHPMD\RuleSetFactory $ruleSetFactory
+ * @return void
+ */
+ public function processFiles(
+ $inputPath,
+ $ruleSets,
+ array $renderers,
+ RuleSetFactory $ruleSetFactory
+ ) {
+
+ // Merge parsed excludes
+ $this->ignorePatterns = array_merge($this->ignorePatterns, $ruleSetFactory->getIgnorePattern($ruleSets));
+
+ $this->input = $inputPath;
+
+ $report = new Report();
+
+ $factory = new ParserFactory();
+ $parser = $factory->create($this);
+
+ foreach ($ruleSetFactory->createRuleSets($ruleSets) as $ruleSet) {
+ $parser->addRuleSet($ruleSet);
+ }
+
+ $report->start();
+ $parser->parse($report);
+ $report->end();
+
+ foreach ($renderers as $renderer) {
+ $renderer->start();
+ }
+
+ foreach ($renderers as $renderer) {
+ $renderer->renderReport($report);
+ }
+
+ foreach ($renderers as $renderer) {
+ $renderer->end();
+ }
+
+ $this->violations = !$report->isEmpty();
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Parser.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Parser.php
new file mode 100644
index 0000000..8faa592
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Parser.php
@@ -0,0 +1,313 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+use PDepend\Engine;
+use PDepend\Report\CodeAwareGenerator;
+use PDepend\Source\ASTVisitor\AbstractASTVisitor;
+use PDepend\Metrics\Analyzer;
+use PDepend\Source\AST\ASTClass;
+use PDepend\Source\AST\ASTMethod;
+use PDepend\Source\AST\ASTInterface;
+use PDepend\Source\AST\ASTFunction;
+use PDepend\Source\AST\ASTArtifactList;
+use PHPMD\Node\ClassNode;
+use PHPMD\Node\FunctionNode;
+use PHPMD\Node\InterfaceNode;
+use PHPMD\Node\MethodNode;
+
+/**
+ * Simple wrapper around the php depend engine.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class Parser extends AbstractASTVisitor implements CodeAwareGenerator
+{
+ /**
+ * The analysing rule-set instance.
+ *
+ * @var \PHPMD\RuleSet[]
+ */
+ private $ruleSets = array();
+
+ /**
+ * The metric containing analyzer instances.
+ *
+ * @var \PDepend\Metrics\Analyzer[]
+ */
+ private $analyzers = array();
+
+ /**
+ * The raw PDepend code nodes.
+ *
+ * @var \PDepend\Source\AST\ASTArtifactList
+ */
+ private $artifacts = null;
+
+ /**
+ * The violation report used by this PDepend adapter.
+ *
+ * @var \PHPMD\Report
+ */
+ private $report = null;
+
+ /**
+ * The wrapped PDepend Engine instance.
+ *
+ * @var \PDepend\Engine
+ */
+ private $pdepend = null;
+
+ /**
+ * Constructs a new parser adapter instance.
+ *
+ * @param \PDepend\Engine $pdepend The context php depend instance.
+ */
+ public function __construct(Engine $pdepend)
+ {
+ $this->pdepend = $pdepend;
+ }
+
+ /**
+ * Parses the projects source and reports all detected errors and violations.
+ *
+ * @param \PHPMD\Report $report
+ * @return void
+ */
+ public function parse(Report $report)
+ {
+ $this->setReport($report);
+
+ $this->pdepend->addReportGenerator($this);
+ $this->pdepend->analyze();
+
+ foreach ($this->pdepend->getExceptions() as $exception) {
+ $report->addError(new ProcessingError($exception->getMessage()));
+ }
+ }
+
+ /**
+ * Adds a new analysis rule-set to this adapter.
+ *
+ * @param \PHPMD\RuleSet $ruleSet
+ * @return void
+ */
+ public function addRuleSet(RuleSet $ruleSet)
+ {
+ $this->ruleSets[] = $ruleSet;
+ }
+
+ /**
+ * Sets the violation report used by the rule-set.
+ *
+ * @param \PHPMD\Report $report
+ * @return void
+ */
+ public function setReport(Report $report)
+ {
+ $this->report = $report;
+ }
+
+ /**
+ * Adds an analyzer to log. If this logger accepts the given analyzer it
+ * with return true, otherwise the return value is false.
+ *
+ * @param \PDepend\Metrics\Analyzer $analyzer The analyzer to log.
+ *
+ * @return boolean
+ */
+ public function log(Analyzer $analyzer)
+ {
+ $this->analyzers[] = $analyzer;
+ }
+
+ /**
+ * Closes the logger process and writes the output file.
+ *
+ * @return void
+ * @throws PDepend\Report\NoLogOutputException If the no log target exists.
+ */
+ public function close()
+ {
+ // Set max nesting level, because we may get really deep data structures
+ ini_set('xdebug.max_nesting_level', 8192);
+
+ foreach ($this->artifacts as $node) {
+ $node->accept($this);
+ }
+ }
+
+ /**
+ * Returns an array with accepted analyzer types. These types can be
+ * concrete analyzer classes or one of the descriptive analyzer interfaces.
+ *
+ * @return array(string)
+ */
+ public function getAcceptedAnalyzers()
+ {
+ return array(
+ 'pdepend.analyzer.cyclomatic_complexity',
+ 'pdepend.analyzer.node_loc',
+ 'pdepend.analyzer.npath_complexity',
+ 'pdepend.analyzer.inheritance',
+ 'pdepend.analyzer.node_count',
+ 'pdepend.analyzer.hierarchy',
+ 'pdepend.analyzer.crap_index',
+ 'pdepend.analyzer.code_rank',
+ 'pdepend.analyzer.coupling',
+ 'pdepend.analyzer.class_level',
+ 'pdepend.analyzer.cohesion',
+ );
+ }
+
+ /**
+ * Visits a class node.
+ *
+ * @param \PDepend\Source\AST\ASTClass $node
+ * @return void
+ */
+ public function visitClass(ASTClass $node)
+ {
+ if (!$node->isUserDefined()) {
+ return;
+ }
+
+ $this->apply(new ClassNode($node));
+ parent::visitClass($node);
+ }
+
+ /**
+ * Visits a function node.
+ *
+ * @param \PDepend\Source\AST\ASTFunction $node
+ * @return void
+ */
+ public function visitFunction(ASTFunction $node)
+ {
+ if ($node->getCompilationUnit()->getFileName() === null) {
+ return;
+ }
+
+ $this->apply(new FunctionNode($node));
+ }
+
+ /**
+ * Visits an interface node.
+ *
+ * @param \PDepend\Source\AST\ASTInterface $node
+ * @return void
+ */
+ public function visitInterface(ASTInterface $node)
+ {
+ if (!$node->isUserDefined()) {
+ return;
+ }
+
+ $this->apply(new InterfaceNode($node));
+ parent::visitInterface($node);
+ }
+
+ /**
+ * Visits a method node.
+ *
+ * @param \PDepend\Source\AST\ASTMethod $node
+ * @return void
+ */
+ public function visitMethod(ASTMethod $node)
+ {
+ if ($node->getCompilationUnit()->getFileName() === null) {
+ return;
+ }
+
+ $this->apply(new MethodNode($node));
+ }
+
+ /**
+ * Sets the context code nodes.
+ *
+ * @param \PDepend\Source\AST\ASTArtifactList $code
+ * @return void
+ */
+ public function setArtifacts(ASTArtifactList $artifacts)
+ {
+ $this->artifacts = $artifacts;
+ }
+
+ /**
+ * Applies all rule-sets to the given $node instance.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ private function apply(AbstractNode $node)
+ {
+ $this->collectMetrics($node);
+ foreach ($this->ruleSets as $ruleSet) {
+ $ruleSet->setReport($this->report);
+ $ruleSet->apply($node);
+ }
+ }
+
+ /**
+ * Collects the collected metrics for the given node and adds them to the
+ * $node.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ private function collectMetrics(AbstractNode $node)
+ {
+ $metrics = array();
+
+ $pdepend = $node->getNode();
+ foreach ($this->analyzers as $analyzer) {
+ $metrics = array_merge($metrics, $analyzer->getNodeMetrics($pdepend));
+ }
+ $node->setMetrics($metrics);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/ParserFactory.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/ParserFactory.php
new file mode 100644
index 0000000..ab6d308
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/ParserFactory.php
@@ -0,0 +1,180 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+use PDepend\Application;
+use PDepend\Engine;
+use PDepend\Input\ExcludePathFilter;
+use PDepend\Input\ExtensionFilter;
+
+/**
+ * Simple factory that is used to return a ready to use PDepend instance.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class ParserFactory
+{
+ /**
+ * Mapping between phpmd option names and those used by pdepend.
+ *
+ * @var array
+ */
+ private $phpmd2pdepend = array(
+ 'coverage' => 'coverage-report'
+ );
+
+ /**
+ * Creates the used {@link \PHPMD\Parser} analyzer instance.
+ *
+ * @param \PHPMD\PHPMD $phpmd
+ * @return \PHPMD\Parser
+ */
+ public function create(PHPMD $phpmd)
+ {
+ $pdepend = $this->createInstance();
+ $pdepend = $this->init($pdepend, $phpmd);
+
+ return new Parser($pdepend);
+ }
+
+ /**
+ * Creates a clean php depend instance with some base settings.
+ *
+ * @return \PDepend\Engine
+ */
+ private function createInstance()
+ {
+ $application = new Application();
+ return $application->getEngine();
+ }
+
+ /**
+ * Configures the given PDepend\Engine instance based on some user settings.
+ *
+ * @param \PDepend\Engine $pdepend
+ * @param \PHPMD\PHPMD $phpmd
+ * @return \PDepend\Engine
+ */
+ private function init(Engine $pdepend, PHPMD $phpmd)
+ {
+ $this->initOptions($pdepend, $phpmd);
+ $this->initInput($pdepend, $phpmd);
+ $this->initIgnores($pdepend, $phpmd);
+ $this->initExtensions($pdepend, $phpmd);
+
+ return $pdepend;
+ }
+
+ /**
+ * Configures the input source.
+ *
+ * @param \PDepend\Engine $pdepend
+ * @param \PHPMD\PHPMD $phpmd
+ * @return void
+ */
+ private function initInput(Engine $pdepend, PHPMD $phpmd)
+ {
+ foreach (explode(',', $phpmd->getInput()) as $path) {
+ if (is_dir(trim($path))) {
+ $pdepend->addDirectory(trim($path));
+ } else {
+ $pdepend->addFile(trim($path));
+ }
+ }
+ }
+
+ /**
+ * Initializes the ignored files and path's.
+ *
+ * @param \PDepend\Engine $pdepend
+ * @param \PHPMD\PHPMD $phpmd
+ * @return void
+ */
+ private function initIgnores(Engine $pdepend, PHPMD $phpmd)
+ {
+ if (count($phpmd->getIgnorePattern()) > 0) {
+ $pdepend->addFileFilter(
+ new ExcludePathFilter($phpmd->getIgnorePattern())
+ );
+ }
+ }
+
+ /**
+ * Initializes the accepted php source file extensions.
+ *
+ * @param \PDepend\Engine $pdepend
+ * @param \PHPMD\PHPMD $phpmd
+ * @return void
+ */
+ private function initExtensions(Engine $pdepend, PHPMD $phpmd)
+ {
+ if (count($phpmd->getFileExtensions()) > 0) {
+ $pdepend->addFileFilter(
+ new ExtensionFilter($phpmd->getFileExtensions())
+ );
+ }
+ }
+
+ /**
+ * Initializes additional options for pdepend.
+ *
+ * @param \PDepend\Engine $pdepend
+ * @param \PHPMD\PHPMD $phpmd
+ * @return void
+ */
+ private function initOptions(Engine $pdepend, PHPMD $phpmd)
+ {
+ $options = array();
+ foreach (array_filter($phpmd->getOptions()) as $name => $value) {
+ if (isset($this->phpmd2pdepend[$name])) {
+ $options[$this->phpmd2pdepend[$name]] = $value;
+ }
+ }
+ $pdepend->setOptions($options);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/ProcessingError.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/ProcessingError.php
new file mode 100644
index 0000000..31a1c5c
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/ProcessingError.php
@@ -0,0 +1,122 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.2.1
+ */
+
+namespace PHPMD;
+
+/**
+ * Simple data class that we use to keep parsing errors for the report renderer.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.2.1
+ */
+class ProcessingError
+{
+ /**
+ * The original processing error message.
+ *
+ * @var string
+ */
+ private $message;
+
+ /**
+ * The source file where the processing error occurred.
+ *
+ * @var string
+ */
+ private $file;
+
+ /**
+ * Constructs a new processing error instance.
+ *
+ * @param string $message
+ */
+ public function __construct($message)
+ {
+ $this->message = $message;
+ $this->file = $this->extractFile($message);
+ }
+
+ /**
+ * Returns the source file where the processing error occurred.
+ *
+ * @return string
+ */
+ public function getFile()
+ {
+ return $this->file;
+ }
+
+ /**
+ * Returns the original processing error message.
+ *
+ * @return string
+ */
+ public function getMessage()
+ {
+ return $this->message;
+ }
+
+ /**
+ * Evil hack that extracts the source file from the original exception
+ * message. This method should be removed once we have added the source file
+ * as a mandatory property to PDepend's exceptions.
+ *
+ * @param string $message
+ * @return string
+ */
+ private function extractFile($message)
+ {
+ preg_match('(file: (.+)\.$| file "([^"]+)")', $message, $match);
+
+ $match = array_values(array_filter($match));
+ if (isset($match[1])) {
+ return $match[1];
+ }
+ return '';
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/HTMLRenderer.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/HTMLRenderer.php
new file mode 100644
index 0000000..9c097d7
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/HTMLRenderer.php
@@ -0,0 +1,188 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Renderer;
+
+use PHPMD\AbstractRenderer;
+use PHPMD\Report;
+
+/**
+ * This renderer output a simple html file with all found violations and suspect
+ * software artifacts.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class HTMLRenderer extends AbstractRenderer
+{
+ /**
+ * This method will be called on all renderers before the engine starts the
+ * real report processing.
+ *
+ * @return void
+ */
+ public function start()
+ {
+ $writer = $this->getWriter();
+
+ $writer->write('PHPMD');
+ $writer->write(PHP_EOL);
+ $writer->write('
PHPMD report
');
+ $writer->write('
Problems found
');
+ $writer->write(PHP_EOL);
+ $writer->write('
');
+ $writer->write('
');
+ $writer->write('
#
File
Line
Problem
');
+ $writer->write('
');
+ $writer->write(PHP_EOL);
+ }
+
+ /**
+ * This method will be called when the engine has finished the source analysis
+ * phase.
+ *
+ * @param \PHPMD\Report $report
+ * @return void
+ */
+ public function renderReport(Report $report)
+ {
+ $index = 0;
+
+ $writer = $this->getWriter();
+ foreach ($report->getRuleViolations() as $violation) {
+ $writer->write('
');
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/TextRenderer.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/TextRenderer.php
new file mode 100644
index 0000000..3d7bcd2
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/TextRenderer.php
@@ -0,0 +1,92 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Renderer;
+
+use PHPMD\AbstractRenderer;
+use PHPMD\Report;
+
+/**
+ * This renderer output a textual log with all found violations and suspect
+ * software artifacts.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class TextRenderer extends AbstractRenderer
+{
+
+ /**
+ * This method will be called when the engine has finished the source analysis
+ * phase.
+ *
+ * @param \PHPMD\Report $report
+ * @return void
+ */
+ public function renderReport(Report $report)
+ {
+ $writer = $this->getWriter();
+ $writer->write(PHP_EOL);
+
+ foreach ($report->getRuleViolations() as $violation) {
+
+ $writer->write($violation->getFileName());
+ $writer->write(':');
+ $writer->write($violation->getBeginLine());
+ $writer->write("\t");
+ $writer->write($violation->getDescription());
+ $writer->write(PHP_EOL);
+ }
+
+ foreach ($report->getErrors() as $error) {
+
+ $writer->write($error->getFile());
+ $writer->write("\t-\t");
+ $writer->write($error->getMessage());
+ $writer->write(PHP_EOL);
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/XMLRenderer.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/XMLRenderer.php
new file mode 100644
index 0000000..9138fc8
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/XMLRenderer.php
@@ -0,0 +1,162 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Renderer;
+
+use PHPMD\AbstractRenderer;
+use PHPMD\PHPMD;
+use PHPMD\Report;
+
+/**
+ * This class will render a Java-PMD compatible xml-report.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class XMLRenderer extends AbstractRenderer
+{
+ /**
+ * Temporary property that holds the name of the last rendered file, it is
+ * used to detect the next processed file.
+ *
+ * @var string
+ */
+ private $fileName = null;
+
+ /**
+ * This method will be called on all renderers before the engine starts the
+ * real report processing.
+ *
+ * @return void
+ */
+ public function start()
+ {
+ $this->getWriter()->write('');
+ $this->getWriter()->write(PHP_EOL);
+ }
+
+ /**
+ * This method will be called when the engine has finished the source analysis
+ * phase.
+ *
+ * @param \PHPMD\Report $report
+ * @return void
+ */
+ public function renderReport(Report $report)
+ {
+ $writer = $this->getWriter();
+ $writer->write('write('timestamp="' . date('c') . '">');
+ $writer->write(PHP_EOL);
+
+ foreach ($report->getRuleViolations() as $violation) {
+ $fileName = $violation->getFileName();
+
+ if ($this->fileName !== $fileName) {
+ // Not first file
+ if ($this->fileName !== null) {
+ $writer->write('
' . PHP_EOL);
+ }
+ // Store current file name
+ $this->fileName = $fileName;
+
+ $writer->write(' ' . PHP_EOL);
+ }
+
+ $rule = $violation->getRule();
+
+ $writer->write(' write(' beginline="' . $violation->getBeginLine() . '"');
+ $writer->write(' endline="' . $violation->getEndLine() . '"');
+ $writer->write(' rule="' . $rule->getName() . '"');
+ $writer->write(' ruleset="' . $rule->getRuleSetName() . '"');
+
+ $this->maybeAdd('package', $violation->getNamespaceName());
+ $this->maybeAdd('externalInfoUrl', $rule->getExternalInfoUrl());
+ $this->maybeAdd('function', $violation->getFunctionName());
+ $this->maybeAdd('class', $violation->getClassName());
+ $this->maybeAdd('method', $violation->getMethodName());
+ //$this->_maybeAdd('variable', $violation->getVariableName());
+
+ $writer->write(' priority="' . $rule->getPriority() . '"');
+ $writer->write('>' . PHP_EOL);
+ $writer->write(' ' . $violation->getDescription() . PHP_EOL);
+ $writer->write(' ' . PHP_EOL);
+ }
+
+ // Last file and at least one violation
+ if ($this->fileName !== null) {
+ $writer->write(' ' . PHP_EOL);
+ }
+
+ foreach ($report->getErrors() as $error) {
+ $writer->write(' ' . PHP_EOL);
+ }
+
+ $writer->write('' . PHP_EOL);
+ }
+
+ /**
+ * This method will write a xml attribute named $attr to the output
+ * when the given $value is not an empty string and is not null.
+ *
+ * @param string $attr The xml attribute name.
+ * @param string $value The attribute value.
+ *
+ * @return void
+ */
+ private function maybeAdd($attr, $value)
+ {
+ if ($value === null || trim($value) === '') {
+ return;
+ }
+ $this->getWriter()->write(' ' . $attr . '="' . $value . '"');
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Report.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Report.php
new file mode 100644
index 0000000..1e7f3e1
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Report.php
@@ -0,0 +1,207 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * The report class collects all found violations and further information about
+ * a PHPMD run.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class Report
+{
+ /**
+ * List of rule violations detected in the analyzed source code.
+ *
+ * @var \PHPMD\RuleViolations[]
+ */
+ private $ruleViolations = array();
+
+ /**
+ * The start time for this report.
+ *
+ * @var float
+ */
+ private $startTime = 0.0;
+
+ /**
+ * The end time for this report.
+ *
+ * @var float
+ */
+ private $endTime = 0.0;
+
+ /**
+ * Errors that occurred while parsing the source.
+ *
+ * @var array
+ * @since 1.2.1
+ */
+ private $errors = array();
+
+ /**
+ * Adds a rule violation to this report.
+ *
+ * @param \PHPMD\RuleViolation $violation
+ * @return void
+ */
+ public function addRuleViolation(RuleViolation $violation)
+ {
+ $fileName = $violation->getFileName();
+ if (!isset($this->ruleViolations[$fileName])) {
+ $this->ruleViolations[$fileName] = array();
+ }
+
+ $beginLine = $violation->getBeginLine();
+ if (!isset($this->ruleViolations[$fileName][$beginLine])) {
+ $this->ruleViolations[$fileName][$beginLine] = array();
+ }
+
+ $this->ruleViolations[$fileName][$beginLine][] = $violation;
+ }
+
+ /**
+ * Returns true when this report does not contain any errors.
+ *
+ * @return boolean
+ * @since 0.2.5
+ */
+ public function isEmpty()
+ {
+ return (count($this->ruleViolations) === 0);
+ }
+
+ /**
+ * Returns an iterator with all occurred rule violations.
+ *
+ * @return \Iterator
+ */
+ public function getRuleViolations()
+ {
+ // First sort by file name
+ ksort($this->ruleViolations);
+
+ $violations = array();
+ foreach ($this->ruleViolations as $violationInLine) {
+ // Second sort is by line number
+ ksort($violationInLine);
+
+ foreach ($violationInLine as $violation) {
+ $violations = array_merge($violations, $violation);
+ }
+ }
+
+ return new \ArrayIterator($violations);
+ }
+
+ /**
+ * Adds a processing error that occurred while parsing the source.
+ *
+ * @param \PHPMD\ProcessingError $error
+ * @return void
+ * @since 1.2.1
+ */
+ public function addError(ProcessingError $error)
+ {
+ $this->errors[] = $error;
+ }
+
+ /**
+ * Returns true when the report contains at least one processing
+ * error. Otherwise this method will return false.
+ *
+ * @return boolean
+ * @since 1.2.1
+ */
+ public function hasErrors()
+ {
+ return count($this->errors) > 0;
+ }
+
+ /**
+ * Returns an iterator with all {@link \PHPMD\ProcessingError} that were
+ * added to this report.
+ *
+ * @return \Iterator
+ * @since 1.2.1
+ */
+ public function getErrors()
+ {
+ return new \ArrayIterator($this->errors);
+ }
+
+ /**
+ * Starts the time tracking of this report instance.
+ *
+ * @return void
+ */
+ public function start()
+ {
+ $this->startTime = microtime(true) * 1000.0;
+ }
+
+ /**
+ * Stops the time tracking of this report instance.
+ *
+ * @return void
+ */
+ public function end()
+ {
+ $this->endTime = microtime(true) * 1000.0;
+ }
+
+ /**
+ * Returns the total time elapsed for the source analysis.
+ *
+ * @return float
+ */
+ public function getElapsedTimeInMillis()
+ {
+ return round($this->endTime - $this->startTime);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule.php
new file mode 100644
index 0000000..7e6b5dc
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule.php
@@ -0,0 +1,235 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * Base interface for a PHPMD rule.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+interface Rule
+{
+ /**
+ * The default lowest rule priority.
+ */
+ const LOWEST_PRIORITY = 5;
+
+ /**
+ * Returns the name for this rule instance.
+ *
+ * @return string
+ */
+ public function getName();
+
+ /**
+ * Sets the name for this rule instance.
+ *
+ * @param string $name
+ * @return void
+ */
+ public function setName($name);
+
+ /**
+ * Returns the version since when this rule is available or null.
+ *
+ * @return string
+ */
+ public function getSince();
+
+ /**
+ * Sets the version since when this rule is available.
+ *
+ * @param string $since
+ * @return void
+ */
+ public function setSince($since);
+
+ /**
+ * Returns the violation message text for this rule.
+ *
+ * @return string
+ */
+ public function getMessage();
+
+ /**
+ * Sets the violation message text for this rule.
+ *
+ * @param string $message
+ * @return void
+ */
+ public function setMessage($message);
+
+ /**
+ * Returns an url will external information for this rule.
+ *
+ * @return string
+ */
+ public function getExternalInfoUrl();
+
+ /**
+ * Sets an url will external information for this rule.
+ *
+ * @param string $externalInfoUrl
+ * @return void
+ */
+ public function setExternalInfoUrl($externalInfoUrl);
+
+ /**
+ * Returns the description text for this rule instance.
+ *
+ * @return string
+ */
+ public function getDescription();
+
+ /**
+ * Sets the description text for this rule instance.
+ *
+ * @param string $description
+ * @return void
+ */
+ public function setDescription($description);
+
+ /**
+ * Returns a list of examples for this rule.
+ *
+ * @return array
+ */
+ public function getExamples();
+
+ /**
+ * Adds a code example for this rule.
+ *
+ * @param string $example
+ * @return void
+ */
+ public function addExample($example);
+
+ /**
+ * Returns the priority of this rule.
+ *
+ * @return integer
+ */
+ public function getPriority();
+
+ /**
+ * Set the priority of this rule.
+ *
+ * @param integer $priority
+ * @return void
+ */
+ public function setPriority($priority);
+
+ /**
+ * Returns the name of the parent rule-set instance.
+ *
+ * @return string
+ */
+ public function getRuleSetName();
+
+ /**
+ * Sets the name of the parent rule set instance.
+ *
+ * @param string $ruleSetName
+ * @return void
+ */
+ public function setRuleSetName($ruleSetName);
+
+ /**
+ * Returns the violation report for this rule.
+ *
+ * @return \PHPMD\Report
+ */
+ public function getReport();
+
+ /**
+ * Sets the violation report for this rule.
+ *
+ * @param \PHPMD\Report $report
+ * @return void
+ */
+ public function setReport(\PHPMD\Report $report);
+
+ /**
+ * Adds a configuration property to this rule instance.
+ *
+ * @param string $name
+ * @param string $value
+ * @return void
+ */
+ public function addProperty($name, $value);
+
+ /**
+ * Returns the value of a configured property as a boolean or throws an
+ * exception when no property with $name exists.
+ *
+ * @param string $name
+ * @return boolean
+ * @throws \OutOfBoundsException When no property for $name exists.
+ */
+ public function getBooleanProperty($name);
+
+ /**
+ * Returns the value of a configured property as an integer or throws an
+ * exception when no property with $name exists.
+ *
+ * @param string $name
+ * @return integer
+ * @throws \OutOfBoundsException When no property for $name exists.
+ */
+ public function getIntProperty($name);
+
+ /**
+ * This method should implement the violation analysis algorithm of concrete
+ * rule implementations. All extending classes must implement this method.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node);
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/AbstractLocalVariable.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/AbstractLocalVariable.php
new file mode 100644
index 0000000..9045543
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/AbstractLocalVariable.php
@@ -0,0 +1,195 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 0.2.6
+ */
+
+namespace PHPMD\Rule;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Node\ASTNode;
+
+/**
+ * Base class for rules that rely on local variables.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 0.2.6
+ */
+abstract class AbstractLocalVariable extends AbstractRule
+{
+ /**
+ * PHP super globals that are available in all php scopes, so that they
+ * can never be unused local variables.
+ *
+ * @var array(string=>boolean)
+ */
+ private static $superGlobals = array(
+ '$argc' => true,
+ '$argv' => true,
+ '$_COOKIE' => true,
+ '$_ENV' => true,
+ '$_FILES' => true,
+ '$_GET' => true,
+ '$_POST' => true,
+ '$_REQUEST' => true,
+ '$_SERVER' => true,
+ '$_SESSION' => true,
+ '$GLOBALS' => true,
+ '$HTTP_RAW_POST_DATA' => true,
+ );
+
+ /**
+ * Tests if the given variable node represents a local variable or if it is
+ * a static object property or something similar.
+ *
+ * @param \PHPMD\Node\ASTNode $variable The variable to check.
+ * @return boolean
+ */
+ protected function isLocal(ASTNode $variable)
+ {
+ return (false === $variable->isThis()
+ && $this->isNotSuperGlobal($variable)
+ && $this->isRegularVariable($variable)
+ );
+ }
+
+ /**
+ * Tests if the given variable represents one of the PHP super globals
+ * that are available in scopes.
+ *
+ * @param \PHPMD\AbstractNode $variable
+ * @return boolean
+ */
+ protected function isNotSuperGlobal(AbstractNode $variable)
+ {
+ return !isset(self::$superGlobals[$variable->getImage()]);
+ }
+
+ /**
+ * Tests if the given variable node is a regular variable an not property
+ * or method postfix.
+ *
+ * @param \PHPMD\Node\ASTNode $variable
+ * @return boolean
+ */
+ protected function isRegularVariable(ASTNode $variable)
+ {
+ $node = $this->stripWrappedIndexExpression($variable);
+ $parent = $node->getParent();
+
+ if ($parent->isInstanceOf('PropertyPostfix')) {
+ $primaryPrefix = $parent->getParent();
+ if ($primaryPrefix->getParent()->isInstanceOf('MemberPrimaryPrefix')) {
+ return !$primaryPrefix->getParent()->isStatic();
+ }
+ return ($parent->getChild(0)->getNode() !== $node->getNode()
+ || !$primaryPrefix->isStatic()
+ );
+ }
+ return true;
+ }
+
+ /**
+ * Removes all index expressions that are wrapped around the given node
+ * instance.
+ *
+ * @param \PHPMD\Node\ASTNode $node
+ * @return \PHPMD\Node\ASTNode
+ */
+ protected function stripWrappedIndexExpression(ASTNode $node)
+ {
+ if (false === $this->isWrappedByIndexExpression($node)) {
+ return $node;
+ }
+
+ $parent = $node->getParent();
+ if ($parent->getChild(0)->getNode() === $node->getNode()) {
+ return $this->stripWrappedIndexExpression($parent);
+ }
+ return $node;
+ }
+
+ /**
+ * Tests if the given variable node os part of an index expression.
+ *
+ * @param \PHPMD\Node\ASTNode $node
+ * @return boolean
+ */
+ protected function isWrappedByIndexExpression(ASTNode $node)
+ {
+ return ($node->getParent()->isInstanceOf('ArrayIndexExpression')
+ || $node->getParent()->isInstanceOf('StringIndexExpression')
+ );
+ }
+
+ /**
+ * PHP is case insensitive so we should compare function names case
+ * insensitive.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @param string $name
+ * @return boolean
+ */
+ protected function isFunctionNameEqual(AbstractNode $node, $name)
+ {
+ return (0 === strcasecmp(trim($node->getImage(), '\\'), $name));
+ }
+
+ /**
+ * AST puts namespace prefix to global functions called from a namespace.
+ * This method checks if the last part of function fully qualified name is equal to $name
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @param string $name
+ * @return boolean
+ */
+ protected function isFunctionNameEndingWith(AbstractNode $node, $name)
+ {
+ $parts = explode('\\', trim($node->getImage(), '\\'));
+
+ return (0 === strcasecmp(array_pop($parts), $name));
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/ClassAware.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/ClassAware.php
new file mode 100644
index 0000000..ced5273
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/ClassAware.php
@@ -0,0 +1,57 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule;
+
+/**
+ * This interface is used to mark a rule implementation as class aware.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+interface ClassAware
+{
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CleanCode/BooleanArgumentFlag.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CleanCode/BooleanArgumentFlag.php
new file mode 100644
index 0000000..0af59e4
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CleanCode/BooleanArgumentFlag.php
@@ -0,0 +1,89 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\CleanCode;
+
+use PDepend\Source\AST\ASTValue;
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * Check for a boolean flag in the method/function signature.
+ *
+ * Boolean flags are signs for single responsibility principle violations.
+ *
+ * @author Benjamin Eberlei
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class BooleanArgumentFlag extends AbstractRule implements MethodAware, FunctionAware
+{
+ /**
+ * This method checks if a method/function has boolean flag arguments and warns about them.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->findChildrenOfType('FormalParameter') as $param) {
+ $declarator = $param->getFirstChildOfType('VariableDeclarator');
+ $value = $declarator->getValue();
+
+ if (false === $this->isBooleanValue($value)) {
+ continue;
+ }
+
+ $this->addViolation($param, array($node->getImage(), $declarator->getImage()));
+ }
+ }
+
+ private function isBooleanValue(ASTValue $value = null)
+ {
+ return $value && $value->isValueAvailable() && ($value->getValue() === true || $value->getValue() === false);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CleanCode/ElseExpression.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CleanCode/ElseExpression.php
new file mode 100644
index 0000000..367358f
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CleanCode/ElseExpression.php
@@ -0,0 +1,101 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\CleanCode;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * Check if there is an else expression somewhere in the method/function and
+ * warn about it.
+ *
+ * Object Calisthenics teaches us, that an else expression can always be
+ * avoided by simple guard clause or return statements.
+ *
+ * @author Benjamin Eberlei
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class ElseExpression extends AbstractRule implements MethodAware, FunctionAware
+{
+ /**
+ * This method checks if a method/function uses an else expression and add a violation for each one found.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->findChildrenOfType('ScopeStatement') as $scope) {
+ $parent = $scope->getParent();
+
+ if (false === $this->isIfOrElseIfStatement($parent)) {
+ continue;
+ }
+
+ if (false === $this->isElseScope($scope, $parent)) {
+ continue;
+ }
+
+ $this->addViolation($scope, array($node->getImage()));
+ }
+ }
+
+ private function isElseScope($scope, $parent)
+ {
+ return (
+ count($parent->getChildren()) === 3 &&
+ $scope->getNode() === $parent->getChild(2)->getNode()
+ );
+ }
+
+ private function isIfOrElseIfStatement($parent)
+ {
+ return ($parent->getName() === "if" || $parent->getName() === "elseif");
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CleanCode/StaticAccess.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CleanCode/StaticAccess.php
new file mode 100644
index 0000000..7723444
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CleanCode/StaticAccess.php
@@ -0,0 +1,105 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\CleanCode;
+
+use PDepend\Source\AST\ASTClassOrInterfaceReference;
+use PDepend\Source\AST\ASTMethodPostfix;
+use PDepend\Source\AST\ASTParentReference;
+use PDepend\Source\AST\ASTSelfReference;
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * Check if static access is used in a method.
+ *
+ * Static access is known to cause hard dependencies between classes
+ * and is a bad practice.
+ *
+ * @author Benjamin Eberlei
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class StaticAccess extends AbstractRule implements MethodAware, FunctionAware
+{
+ /**
+ * Method checks for use of static access and warns about it.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $nodes = $node->findChildrenOfType('MemberPrimaryPrefix');
+
+ foreach ($nodes as $methodCall) {
+ if (!$this->isStaticMethodCall($methodCall)) {
+ continue;
+ }
+
+ $this->addViolation($methodCall, array($methodCall->getImage(), $methodCall->getImage()));
+ }
+ }
+
+ private function isStaticMethodCall($methodCall)
+ {
+ return $methodCall->getChild(0)->getNode() instanceof ASTClassOrInterfaceReference &&
+ $methodCall->getChild(1)->getNode() instanceof ASTMethodPostfix &&
+ !$this->isCallingParent($methodCall) &&
+ !$this->isCallingSelf($methodCall);
+ }
+
+ private function isCallingParent($methodCall)
+ {
+ return $methodCall->getChild(0)->getNode() instanceof ASTParentReference;
+ }
+
+ private function isCallingSelf($methodCall)
+ {
+ return $methodCall->getChild(0)->getNode() instanceof ASTSelfReference;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseClassName.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseClassName.php
new file mode 100644
index 0000000..512793f
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseClassName.php
@@ -0,0 +1,82 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Rule\Controversial;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+use PHPMD\Rule\InterfaceAware;
+
+/**
+ * This rule class detects classes not named in CamelCase.
+ *
+ * @author Francis Besset
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+class CamelCaseClassName extends AbstractRule implements ClassAware, InterfaceAware
+{
+ /**
+ * This method checks if a class is not named in CamelCase
+ * and emits a rule violation.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ if (!preg_match('/^[A-Z][a-zA-Z0-9]*$/', $node->getName())) {
+ $this->addViolation(
+ $node,
+ array(
+ $node->getName(),
+ )
+ );
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseMethodName.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseMethodName.php
new file mode 100644
index 0000000..fd30975
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseMethodName.php
@@ -0,0 +1,108 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Rule\Controversial;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class detects methods not named in camelCase.
+ *
+ * @author Francis Besset
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+class CamelCaseMethodName extends AbstractRule implements MethodAware
+{
+ protected $ignoredMethods = array(
+ '__construct',
+ '__destruct',
+ '__set',
+ '__get',
+ '__call',
+ '__callStatic',
+ '__isset',
+ '__unset',
+ '__sleep',
+ '__wakeup',
+ '__toString',
+ '__invoke',
+ '__set_state',
+ '__clone',
+ );
+
+ /**
+ * This method checks if a method is not named in camelCase
+ * and emits a rule violation.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $methodName = $node->getName();
+ if (!in_array($methodName, $this->ignoredMethods)) {
+ $pattern = '/^[a-z][a-zA-Z0-9]*$/';
+ $allowUnderscore = $this->getBooleanProperty('allow-underscore');
+
+ if ($allowUnderscore == true) {
+ $pattern = '/^[_]?[a-z][a-zA-Z0-9]*$/';
+ }
+
+ if (!preg_match($pattern, $methodName)) {
+ $this->addViolation(
+ $node,
+ array(
+ $methodName,
+ )
+ );
+ }
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseParameterName.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseParameterName.php
new file mode 100644
index 0000000..e30aa80
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseParameterName.php
@@ -0,0 +1,84 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Rule\Controversial;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class detects parameters not named in camelCase.
+ *
+ * @author Francis Besset
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+class CamelCaseParameterName extends AbstractRule implements MethodAware, FunctionAware
+{
+ /**
+ * This method checks if a parameter is not named in camelCase
+ * and emits a rule violation.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->getParameters() as $parameter) {
+ if (!preg_match('/^\$[a-z][a-zA-Z0-9]*$/', $parameter->getName())) {
+ $this->addViolation(
+ $node,
+ array(
+ $parameter->getName(),
+ )
+ );
+ }
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCasePropertyName.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCasePropertyName.php
new file mode 100644
index 0000000..646a673
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCasePropertyName.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Rule\Controversial;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+
+/**
+ * This rule class detects properties not named in camelCase.
+ *
+ * @author Francis Besset
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+class CamelCasePropertyName extends AbstractRule implements ClassAware
+{
+ /**
+ * This method checks if a property is not named in camelCase
+ * and emits a rule violation.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->getProperties() as $property) {
+ if (!preg_match('/^\$[a-zA-Z][a-zA-Z0-9]*$/', $property->getName())) {
+ $this->addViolation(
+ $node,
+ array(
+ $property->getName(),
+ )
+ );
+ }
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseVariableName.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseVariableName.php
new file mode 100644
index 0000000..2b4daa0
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/CamelCaseVariableName.php
@@ -0,0 +1,104 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Rule\Controversial;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class detects variables not named in camelCase.
+ *
+ * @author Francis Besset
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+class CamelCaseVariableName extends AbstractRule implements MethodAware, FunctionAware
+{
+ /**
+ * @var array
+ */
+ private $exceptions = array(
+ '$php_errormsg',
+ '$http_response_header',
+ '$GLOBALS',
+ '$_SERVER',
+ '$_GET',
+ '$_POST',
+ '$_FILES',
+ '$_COOKIE',
+ '$_SESSION',
+ '$_REQUEST',
+ '$_ENV',
+ );
+
+ /**
+ * This method checks if a variable is not named in camelCase
+ * and emits a rule violation.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->findChildrenOfType('Variable') as $variable) {
+ $image = $variable->getImage();
+
+ if (in_array($image, $this->exceptions)) {
+ continue;
+ }
+
+ if (preg_match('/^\$[a-z][a-zA-Z0-9]*$/', $image)) {
+ continue;
+ }
+
+ $this->addViolation($node, array($image));
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/Superglobals.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/Superglobals.php
new file mode 100644
index 0000000..8bce5c3
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Controversial/Superglobals.php
@@ -0,0 +1,97 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Rule\Controversial;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class detects the usage of superglobals.
+ *
+ * @author Francis Besset
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+class Superglobals extends AbstractRule implements MethodAware, FunctionAware
+{
+ protected $superglobals = array(
+ '$GLOBALS',
+ '$_SERVER', '$HTTP_SERVER_VARS',
+ '$_GET', '$HTTP_GET_VARS',
+ '$_POST', '$HTTP_POST_VARS',
+ '$_FILES', '$HTTP_POST_FILES',
+ '$_COOKIE', '$HTTP_COOKIE_VARS',
+ '$_SESSION', '$HTTP_SESSION_VARS',
+ '$_REQUEST',
+ '$_ENV', '$HTTP_ENV_VARS',
+ );
+
+ /**
+ * This method checks if a superglobal is used
+ * and emits a rule violation.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->findChildrenOfType('Variable') as $variable) {
+ if (in_array($variable->getImage(), $this->superglobals)) {
+ $this->addViolation(
+ $node,
+ array(
+ $node->getName(),
+ $variable->getImage()
+ )
+ );
+ }
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CyclomaticComplexity.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CyclomaticComplexity.php
new file mode 100644
index 0000000..0694636
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/CyclomaticComplexity.php
@@ -0,0 +1,86 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+
+/**
+ * This rule checks a given method or function against the configured cyclomatic
+ * complexity threshold.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class CyclomaticComplexity extends AbstractRule implements FunctionAware, MethodAware
+{
+ /**
+ * This method checks the cyclomatic complexity for the given node against
+ * a configured threshold.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('reportLevel');
+ $ccn = $node->getMetric('ccn2');
+ if ($ccn < $threshold) {
+ return;
+ }
+
+ $this->addViolation(
+ $node,
+ array(
+ $node->getType(),
+ $node->getName(),
+ $ccn,
+ $threshold
+ )
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/CouplingBetweenObjects.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/CouplingBetweenObjects.php
new file mode 100644
index 0000000..99b20e7
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/CouplingBetweenObjects.php
@@ -0,0 +1,77 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+
+/**
+ * This rule class detects violations of Coupling Between Objects metric.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+class CouplingBetweenObjects extends AbstractRule implements ClassAware
+{
+ /**
+ * This method should implement the violation analysis algorithm of concrete
+ * rule implementations. All extending classes must implement this method.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $cbo = $node->getMetric('cbo');
+ if ($cbo >= ($threshold = $this->getIntProperty('minimum'))) {
+ $this->addViolation($node, array($node->getName(), $cbo, $threshold));
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/DepthOfInheritance.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/DepthOfInheritance.php
new file mode 100644
index 0000000..35cf000
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/DepthOfInheritance.php
@@ -0,0 +1,84 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+
+/**
+ * This rule will detect classes that are to deep in the inheritance tree.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class DepthOfInheritance extends AbstractRule implements ClassAware
+{
+ /**
+ * This method checks the number of parents for the given class
+ * node.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('minimum');
+ $dit = $node->getMetric('dit');
+ if ($dit >= $threshold) {
+ $this->addViolation(
+ $node,
+ array(
+ $node->getType(),
+ $node->getName(),
+ $dit,
+ $threshold
+ )
+ );
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/EvalExpression.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/EvalExpression.php
new file mode 100644
index 0000000..055736d
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/EvalExpression.php
@@ -0,0 +1,75 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class detects the usage of PHP's eval-expression.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class EvalExpression extends AbstractRule implements MethodAware, FunctionAware
+{
+ /**
+ * This method checks if a given function or method contains an eval-expression
+ * and emits a rule violation when it exists.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->findChildrenOfType('EvalExpression') as $eval) {
+ $this->addViolation($eval, array($node->getType(), $node->getName()));
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/ExitExpression.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/ExitExpression.php
new file mode 100644
index 0000000..b2e0a58
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/ExitExpression.php
@@ -0,0 +1,75 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class detects the usage of PHP's exit statement.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class ExitExpression extends AbstractRule implements MethodAware, FunctionAware
+{
+ /**
+ * This method checks if a given function or method contains an exit-expression
+ * and emits a rule violation when it exists.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->findChildrenOfType('ExitExpression') as $exit) {
+ $this->addViolation($exit, array($node->getType(), $node->getName()));
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/GotoStatement.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/GotoStatement.php
new file mode 100644
index 0000000..b2a06eb
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/GotoStatement.php
@@ -0,0 +1,77 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class detects the usage of PHP's goto statement.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+class GotoStatement extends AbstractRule implements MethodAware, FunctionAware
+{
+ /**
+ * This method should implement the violation analysis algorithm of concrete
+ * rule implementations. All extending classes must implement this method.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->findChildrenOfType('GotoStatement') as $goto) {
+ $this->addViolation($goto, array($node->getType(), $node->getName()));
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/LongClass.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/LongClass.php
new file mode 100644
index 0000000..1d390ef
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/LongClass.php
@@ -0,0 +1,85 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+
+/**
+ * This rule class will detect excessive long classes.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class LongClass extends AbstractRule implements ClassAware
+{
+ /**
+ * This method checks the length of the given class node against a configured
+ * threshold.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('minimum');
+ $ignoreWhitespace = $this->getBooleanProperty('ignore-whitespace');
+
+ if ($ignoreWhitespace) {
+ $loc = $node->getMetric('eloc');
+ } else {
+ $loc = $node->getMetric('loc');
+ }
+
+ if ($loc < $threshold) {
+ return;
+ }
+
+ $this->addViolation($node, array($node->getName(), $loc, $threshold));
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/LongMethod.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/LongMethod.php
new file mode 100644
index 0000000..3256e16
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/LongMethod.php
@@ -0,0 +1,90 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule will detect to long methods, those methods are unreadable and in
+ * many cases the result of copy and paste coding.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class LongMethod extends AbstractRule implements FunctionAware, MethodAware
+{
+ /**
+ * This method checks the lines of code length for the given function or
+ * methode node against a configured threshold.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('minimum');
+ $ignoreWhitespace = $this->getBooleanProperty('ignore-whitespace');
+
+ if ($ignoreWhitespace) {
+ $loc = $node->getMetric('eloc');
+ } else {
+ $loc = $node->getMetric('loc');
+ }
+
+ if ($loc < $threshold) {
+ return;
+ }
+
+ $type = explode('_', get_class($node));
+ $type = strtolower(array_pop($type));
+
+ $this->addViolation($node, array($type, $node->getName(), $loc, $threshold));
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/LongParameterList.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/LongParameterList.php
new file mode 100644
index 0000000..d37f642
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/LongParameterList.php
@@ -0,0 +1,87 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class checks for excessive long function and method parameter lists.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class LongParameterList extends AbstractRule implements FunctionAware, MethodAware
+{
+ /**
+ * This method checks the number of arguments for the given function or method
+ * node against a configured threshold.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('minimum');
+ $count = $node->getParameterCount();
+ if ($count < $threshold) {
+ return;
+ }
+
+ $this->addViolation(
+ $node,
+ array(
+ $node->getType(),
+ $node->getName(),
+ $count,
+ $threshold
+ )
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/NpathComplexity.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/NpathComplexity.php
new file mode 100644
index 0000000..173fc4c
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/NpathComplexity.php
@@ -0,0 +1,88 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule will check the NPath-complexity of a method or function against the
+ * configured threshold.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class NpathComplexity extends AbstractRule implements FunctionAware, MethodAware
+{
+ /**
+ * This method checks the acyclic complexity for the given node against a
+ * configured threshold.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('minimum');
+ $npath = $node->getMetric('npath');
+ if ($npath < $threshold) {
+ return;
+ }
+
+ $this->addViolation(
+ $node,
+ array(
+ $node->getType(),
+ $node->getName(),
+ $npath,
+ $threshold
+ )
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/NumberOfChildren.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/NumberOfChildren.php
new file mode 100644
index 0000000..28578a7
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/NumberOfChildren.php
@@ -0,0 +1,84 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+
+/**
+ * This rule will detect class that have to much direct child classes.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class NumberOfChildren extends AbstractRule implements ClassAware
+{
+ /**
+ * This method checks the number of classes derived from the given class
+ * node.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $nocc = $node->getMetric('nocc');
+ $threshold = $this->getIntProperty('minimum');
+ if ($nocc >= $threshold) {
+ $this->addViolation(
+ $node,
+ array(
+ $node->getType(),
+ $node->getName(),
+ $nocc,
+ $threshold
+ )
+ );
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/TooManyFields.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/TooManyFields.php
new file mode 100644
index 0000000..6c60e63
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/TooManyFields.php
@@ -0,0 +1,85 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+
+/**
+ * This rule class will detect all classes with too much fields.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class TooManyFields extends AbstractRule implements ClassAware
+{
+ /**
+ * This method checks the number of methods with in a given class and checks
+ * this number against a configured threshold.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('maxfields');
+ $vars = $node->getMetric('vars');
+ if ($vars <= $threshold) {
+ return;
+ }
+ $this->addViolation(
+ $node,
+ array(
+ $node->getType(),
+ $node->getName(),
+ $vars,
+ $threshold
+ )
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/TooManyMethods.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/TooManyMethods.php
new file mode 100644
index 0000000..926f518
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/TooManyMethods.php
@@ -0,0 +1,128 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Node\AbstractTypeNode;
+use PHPMD\Rule\ClassAware;
+
+/**
+ * This rule class will detect all classes with too much methods.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class TooManyMethods extends AbstractRule implements ClassAware
+{
+ /**
+ * the default regex pattern for ignore method names. override with
+ * "ignorepattern" rule setting.
+ *
+ * @var string
+ */
+ const DEFAULT_IGNORE_REGEXP = '(^(set|get))i';
+
+ /**
+ * Regular expression that filter all methods that are ignored by this rule.
+ *
+ * @var string
+ */
+ private $ignoreRegexp;
+
+ /**
+ * This method checks the number of methods with in a given class and checks
+ * this number against a configured threshold.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ try {
+ $this->ignoreRegexp = $this->getStringProperty('ignorepattern');
+ } catch (\OutOfBoundsException $e) {
+ $this->ignoreRegexp = self::DEFAULT_IGNORE_REGEXP;
+ }
+
+ $threshold = $this->getIntProperty('maxmethods');
+ if ($node->getMetric('nom') <= $threshold) {
+ return;
+ }
+ $nom = $this->countMethods($node);
+ if ($nom <= $threshold) {
+ return;
+ }
+ $this->addViolation(
+ $node,
+ array(
+ $node->getType(),
+ $node->getName(),
+ $nom,
+ $threshold
+ )
+ );
+ }
+
+ /**
+ * Counts all methods within the given class/interface node.
+ *
+ *
+ * @param \PHPMD\Node\AbstractTypeNode $node
+ * @return integer
+ */
+ private function countMethods(AbstractTypeNode $node)
+ {
+ $count = 0;
+ foreach ($node->getMethodNames() as $name) {
+ if (preg_match($this->ignoreRegexp, $name) === 0) {
+ ++$count;
+ }
+ }
+ return $count;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/WeightedMethodCount.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/WeightedMethodCount.php
new file mode 100644
index 0000000..d32306b
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Design/WeightedMethodCount.php
@@ -0,0 +1,80 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 0.2.5
+ */
+
+namespace PHPMD\Rule\Design;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+
+/**
+ * This rule checks a given class against a configured weighted method count
+ * threshold.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 0.2.5
+ */
+class WeightedMethodCount extends AbstractRule implements ClassAware
+{
+ /**
+ * This method checks the weighted method count for the given class against
+ * a configured threshold.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('maximum');
+ $actual = $node->getMetric('wmc');
+
+ if ($actual >= $threshold) {
+ $this->addViolation($node, array($node->getName(), $actual, $threshold));
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/ExcessivePublicCount.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/ExcessivePublicCount.php
new file mode 100644
index 0000000..9b74818
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/ExcessivePublicCount.php
@@ -0,0 +1,85 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+
+/**
+ * This rule checks the number of public methods and fields in a given class.
+ * Then it compares the number of public members against a configured threshold.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class ExcessivePublicCount extends AbstractRule implements ClassAware
+{
+ /**
+ * This method checks the number of public fields and methods in the given
+ * class and checks that value against a configured threshold.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('minimum');
+ $cis = $node->getMetric('cis');
+ if ($cis < $threshold) {
+ return;
+ }
+ $this->addViolation(
+ $node,
+ array(
+ $node->getType(),
+ $node->getName(),
+ $cis,
+ $threshold
+ )
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/FunctionAware.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/FunctionAware.php
new file mode 100644
index 0000000..6fd133d
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/FunctionAware.php
@@ -0,0 +1,57 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule;
+
+/**
+ * This interface is used to mark a rule implementation as function aware.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+interface FunctionAware
+{
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/InterfaceAware.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/InterfaceAware.php
new file mode 100644
index 0000000..8f3b95b
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/InterfaceAware.php
@@ -0,0 +1,57 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule;
+
+/**
+ * This interface marks a rule implementation as interface aware,
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+interface InterfaceAware
+{
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/MethodAware.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/MethodAware.php
new file mode 100644
index 0000000..aae628f
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/MethodAware.php
@@ -0,0 +1,57 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule;
+
+/**
+ * This interface marks a rule implementation as method aware,
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+interface MethodAware
+{
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/BooleanGetMethodName.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/BooleanGetMethodName.php
new file mode 100644
index 0000000..8ec958d
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/BooleanGetMethodName.php
@@ -0,0 +1,129 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Naming;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Node\MethodNode;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule tests that a method which returns a boolean value does not start
+ * with get or _get for a getter.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class BooleanGetMethodName extends AbstractRule implements MethodAware
+{
+ /**
+ * Extracts all variable and variable declarator nodes from the given node
+ * and checks the variable name length against the configured minimum
+ * length.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ if ($this->isBooleanGetMethod($node)) {
+ $this->addViolation($node, array($node->getImage()));
+ }
+ }
+
+ /**
+ * Tests if the given method matches all criteria to be an invalid
+ * boolean get method.
+ *
+ * @param \PHPMD\Node\MethodNode $node
+ * @return boolean
+ */
+ private function isBooleanGetMethod(MethodNode $node)
+ {
+ return $this->isGetterMethodName($node)
+ && $this->isReturnTypeBoolean($node)
+ && $this->isParameterizedOrIgnored($node);
+ }
+
+ /**
+ * Tests if the given method starts with get or _get.
+ *
+ * @param \PHPMD\Node\MethodNode $node
+ * @return boolean
+ */
+ private function isGetterMethodName(MethodNode $node)
+ {
+ return (preg_match('(^_?get)i', $node->getImage()) > 0);
+ }
+
+ /**
+ * Tests if the given method is declared with return type boolean.
+ *
+ * @param \PHPMD\Node\MethodNode $node
+ * @return boolean
+ */
+ private function isReturnTypeBoolean(MethodNode $node)
+ {
+ $comment = $node->getDocComment();
+ return (preg_match('(\*\s*@return\s+bool(ean)?\s)i', $comment) > 0);
+ }
+
+ /**
+ * Tests if the property $checkParameterizedMethods is set to true
+ * or has no parameters.
+ *
+ * @param \PHPMD\Node\MethodNode $node
+ * @return boolean
+ */
+ private function isParameterizedOrIgnored(MethodNode $node)
+ {
+ if ($this->getBooleanProperty('checkParameterizedMethods')) {
+ return $node->getParameterCount() === 0;
+ }
+ return true;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ConstantNamingConventions.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ConstantNamingConventions.php
new file mode 100644
index 0000000..a046a66
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ConstantNamingConventions.php
@@ -0,0 +1,78 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Naming;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+use PHPMD\Rule\InterfaceAware;
+
+/**
+ * This rule detects class/interface constants that do not follow the upper
+ * case convention.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class ConstantNamingConventions extends AbstractRule implements ClassAware, InterfaceAware
+{
+ /**
+ * Extracts all constant declarations from the given node and tests that
+ * the image only contains upper case characters.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->findChildrenOfType('ConstantDeclarator') as $declarator) {
+ if ($declarator->getImage() !== strtoupper($declarator->getImage())) {
+ $this->addViolation($declarator, array($declarator->getImage()));
+ }
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ConstructorWithNameAsEnclosingClass.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ConstructorWithNameAsEnclosingClass.php
new file mode 100644
index 0000000..0d67b61
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ConstructorWithNameAsEnclosingClass.php
@@ -0,0 +1,80 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Naming;
+
+use PDepend\Source\AST\ASTTrait;
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class will detect methods that define a php4 style constructor
+ * method while has the same name as the enclosing class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class ConstructorWithNameAsEnclosingClass extends AbstractRule implements MethodAware
+{
+ /**
+ * Is method has the same name as the enclosing class
+ * (php4 style constructor).
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ if ($node->getNode()->getParent() instanceof ASTTrait) {
+ return;
+ }
+ if (strcasecmp($node->getName(), $node->getParentName()) !== 0) {
+ return;
+ }
+ $this->addViolation($node);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/LongVariable.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/LongVariable.php
new file mode 100644
index 0000000..a4b7f3c
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/LongVariable.php
@@ -0,0 +1,207 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Naming;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class will detect variables, parameters and properties with really
+ * long names.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class LongVariable extends AbstractRule implements ClassAware, MethodAware, FunctionAware
+{
+ /**
+ * Temporary map holding variables that were already processed in the
+ * current context.
+ *
+ * @var array(string=>boolean)
+ */
+ private $processedVariables = array();
+
+ /**
+ * Extracts all variable and variable declarator nodes from the given node
+ * and checks the variable name length against the configured maximum
+ * length.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $this->resetProcessed();
+
+ if ($node->getType() === 'class') {
+ $fields = $node->findChildrenOfType('FieldDeclaration');
+ foreach ($fields as $field) {
+ if ($field->isPrivate()) {
+ continue;
+ }
+
+ $declarators = $field->findChildrenOfType('VariableDeclarator');
+ foreach ($declarators as $declarator) {
+ $this->checkNodeImage($declarator);
+ }
+ }
+ } else {
+ $declarators = $node->findChildrenOfType('VariableDeclarator');
+ foreach ($declarators as $declarator) {
+ $this->checkNodeImage($declarator);
+ }
+
+ $variables = $node->findChildrenOfType('Variable');
+ foreach ($variables as $variable) {
+ $this->checkNodeImage($variable);
+ }
+ }
+
+ $this->resetProcessed();
+ }
+
+ /**
+ * Checks if the variable name of the given node is smaller/equal to the
+ * configured threshold.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ protected function checkNodeImage(AbstractNode $node)
+ {
+ if ($this->isNotProcessed($node)) {
+ $this->addProcessed($node);
+ $this->doCheckNodeImage($node);
+ }
+ }
+
+ /**
+ * Template method that performs the real node image check.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ protected function doCheckNodeImage(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('maximum');
+ if ($threshold >= strlen($node->getImage()) - 1) {
+ return;
+ }
+ if ($this->isNameAllowedInContext($node)) {
+ return;
+ }
+ $this->addViolation($node, array($node->getImage(), $threshold));
+ }
+
+ /**
+ * Checks if a short name is acceptable in the current context. For the
+ * moment the only context is a static member.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return boolean
+ */
+ private function isNameAllowedInContext(AbstractNode $node)
+ {
+ return $this->isChildOf($node, 'MemberPrimaryPrefix');
+ }
+
+ /**
+ * Checks if the given node is a direct or indirect child of a node with
+ * the given type.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @param string $type
+ * @return boolean
+ */
+ private function isChildOf(AbstractNode $node, $type)
+ {
+ $parent = $node->getParent();
+ while (is_object($parent)) {
+ if ($parent->isInstanceOf($type)) {
+ return true;
+ }
+ $parent = $parent->getParent();
+ }
+ return false;
+ }
+
+ /**
+ * Resets the already processed nodes.
+ *
+ * @return void
+ */
+ protected function resetProcessed()
+ {
+ $this->processedVariables = array();
+ }
+
+ /**
+ * Flags the given node as already processed.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ protected function addProcessed(AbstractNode $node)
+ {
+ $this->processedVariables[$node->getImage()] = true;
+ }
+
+ /**
+ * Checks if the given node was already processed.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return boolean
+ */
+ protected function isNotProcessed(AbstractNode $node)
+ {
+ return !isset($this->processedVariables[$node->getImage()]);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ShortMethodName.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ShortMethodName.php
new file mode 100644
index 0000000..6cee445
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ShortMethodName.php
@@ -0,0 +1,85 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Naming;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class will detect methods and functions with very short names.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class ShortMethodName extends AbstractRule implements MethodAware, FunctionAware
+{
+ /**
+ * Extracts all variable and variable declarator nodes from the given node
+ * and checks the variable name length against the configured minimum
+ * length.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('minimum');
+ if ($threshold <= strlen($node->getName())) {
+ return;
+ }
+ $this->addViolation(
+ $node,
+ array(
+ $node->getParentName(),
+ $node->getName(),
+ $threshold
+ )
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ShortVariable.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ShortVariable.php
new file mode 100644
index 0000000..3384bcd
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/Naming/ShortVariable.php
@@ -0,0 +1,232 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule\Naming;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Rule\ClassAware;
+use PHPMD\Rule\FunctionAware;
+use PHPMD\Rule\MethodAware;
+
+/**
+ * This rule class will detect variables, parameters and properties with short
+ * names.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class ShortVariable extends AbstractRule implements ClassAware, MethodAware, FunctionAware
+{
+ /**
+ * Temporary map holding variables that were already processed in the
+ * current context.
+ *
+ * @var array(string=>boolean)
+ */
+ private $processedVariables = array();
+
+ /**
+ * Extracts all variable and variable declarator nodes from the given node
+ * and checks the variable name length against the configured minimum
+ * length.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $this->resetProcessed();
+
+ if ($node->getType() === 'class') {
+ $fields = $node->findChildrenOfType('FieldDeclaration');
+ foreach ($fields as $field) {
+ $declarators = $field->findChildrenOfType('VariableDeclarator');
+ foreach ($declarators as $declarator) {
+ $this->checkNodeImage($declarator);
+ }
+ }
+ } else {
+ $declarators = $node->findChildrenOfType('VariableDeclarator');
+ foreach ($declarators as $declarator) {
+ $this->checkNodeImage($declarator);
+ }
+
+ $variables = $node->findChildrenOfType('Variable');
+ foreach ($variables as $variable) {
+ $this->checkNodeImage($variable);
+ }
+ }
+
+ $this->resetProcessed();
+ }
+
+ /**
+ * Checks if the variable name of the given node is greater/equal to the
+ * configured threshold or if the given node is an allowed context.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ protected function checkNodeImage(AbstractNode $node)
+ {
+ if ($this->isNotProcessed($node)) {
+ $this->addProcessed($node);
+ $this->doCheckNodeImage($node);
+ }
+ }
+
+ /**
+ * Template method that performs the real node image check.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ protected function doCheckNodeImage(AbstractNode $node)
+ {
+ $threshold = $this->getIntProperty('minimum');
+
+ if ($threshold <= strlen($node->getImage()) - 1) {
+ return;
+ }
+
+ if ($this->isNameAllowedInContext($node)) {
+ return;
+ }
+
+ $exceptions = $this->getExceptionsList();
+
+ if (in_array(substr($node->getImage(), 1), $exceptions)) {
+ return;
+ }
+
+ $this->addViolation($node, array($node->getImage(), $threshold));
+ }
+
+ /**
+ * Gets array of exceptions from property
+ *
+ * @return array
+ */
+ private function getExceptionsList()
+ {
+ try {
+ $exceptions = $this->getStringProperty('exceptions');
+ } catch (\OutOfBoundsException $e) {
+ $exceptions = '';
+ }
+
+ return explode(',', $exceptions);
+ }
+
+ /**
+ * Checks if a short name is acceptable in the current context. For the
+ * moment these contexts are the init section of a for-loop and short
+ * variable names in catch-statements.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return boolean
+ */
+ private function isNameAllowedInContext(AbstractNode $node)
+ {
+ return $this->isChildOf($node, 'CatchStatement')
+ || $this->isChildOf($node, 'ForInit')
+ || $this->isChildOf($node, 'ForeachStatement')
+ || $this->isChildOf($node, 'MemberPrimaryPrefix');
+ }
+
+ /**
+ * Checks if the given node is a direct or indirect child of a node with
+ * the given type.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @param string $type
+ * @return boolean
+ */
+ private function isChildOf(AbstractNode $node, $type)
+ {
+ $parent = $node->getParent();
+ while (is_object($parent)) {
+ if ($parent->isInstanceOf($type)) {
+ return true;
+ }
+ $parent = $parent->getParent();
+ }
+ return false;
+ }
+
+ /**
+ * Resets the already processed nodes.
+ *
+ * @return void
+ */
+ protected function resetProcessed()
+ {
+ $this->processedVariables = array();
+ }
+
+ /**
+ * Flags the given node as already processed.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ protected function addProcessed(AbstractNode $node)
+ {
+ $this->processedVariables[$node->getImage()] = true;
+ }
+
+ /**
+ * Checks if the given node was already processed.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return boolean
+ */
+ protected function isNotProcessed(AbstractNode $node)
+ {
+ return !isset($this->processedVariables[$node->getImage()]);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedFormalParameter.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedFormalParameter.php
new file mode 100644
index 0000000..dfccc3f
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedFormalParameter.php
@@ -0,0 +1,196 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule;
+
+use PHPMD\AbstractNode;
+use PHPMD\Node\MethodNode;
+
+/**
+ * This rule collects all formal parameters of a given function or method that
+ * are not used in a statement of the artifact's body.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class UnusedFormalParameter extends AbstractLocalVariable implements FunctionAware, MethodAware
+{
+ /**
+ * Collected ast nodes.
+ *
+ * @var \PHPMD\Node\ASTNode[]
+ */
+ private $nodes = array();
+
+ /**
+ * This method checks that all parameters of a given function or method are
+ * used at least one time within the artifacts body.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ if ($this->isAbstractMethod($node)) {
+ return;
+ }
+
+ if ($this->isInheritedSignature($node)) {
+ return;
+ }
+
+ if ($this->isNotDeclaration($node)) {
+ return;
+ }
+
+ $this->nodes = array();
+
+ $this->collectParameters($node);
+ $this->removeUsedParameters($node);
+
+ foreach ($this->nodes as $node) {
+ $this->addViolation($node, array($node->getImage()));
+ }
+ }
+
+ /**
+ * Returns true when the given node is an abstract method.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return boolean
+ */
+ private function isAbstractMethod(AbstractNode $node)
+ {
+ if ($node instanceof MethodNode) {
+ return $node->isAbstract();
+ }
+ return false;
+ }
+
+ /**
+ * Returns true when the given node is method with signature declared as inherited using
+ * {@inheritdoc} annotation.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return boolean
+ */
+ private function isInheritedSignature(AbstractNode $node)
+ {
+ if ($node instanceof MethodNode) {
+ return preg_match('/\@inheritdoc/i', $node->getDocComment());
+ }
+ return false;
+ }
+
+ /**
+ * Tests if the given $node is a method and if this method is also
+ * the initial declaration.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return boolean
+ * @since 1.2.1
+ */
+ private function isNotDeclaration(AbstractNode $node)
+ {
+ if ($node instanceof MethodNode) {
+ return !$node->isDeclaration();
+ }
+ return false;
+ }
+
+ /**
+ * This method extracts all parameters for the given function or method node
+ * and it stores the parameter images in the $_images property.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ private function collectParameters(AbstractNode $node)
+ {
+ // First collect the formal parameters container
+ $parameters = $node->getFirstChildOfType('FormalParameters');
+
+ // Now get all declarators in the formal parameters container
+ $declarators = $parameters->findChildrenOfType('VariableDeclarator');
+
+ foreach ($declarators as $declarator) {
+ $this->nodes[$declarator->getImage()] = $declarator;
+ }
+ }
+
+ /**
+ * This method collects all local variables in the body of the currently
+ * analyzed method or function and removes those parameters that are
+ * referenced by one of the collected variables.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ private function removeUsedParameters(AbstractNode $node)
+ {
+ $variables = $node->findChildrenOfType('Variable');
+ foreach ($variables as $variable) {
+ if ($this->isRegularVariable($variable)) {
+ unset($this->nodes[$variable->getImage()]);
+ }
+ }
+
+ /* If the method calls func_get_args() then all parameters are
+ * automatically referenced */
+ $functionCalls = $node->findChildrenOfType('FunctionPostfix');
+ foreach ($functionCalls as $functionCall) {
+ if ($this->isFunctionNameEqual($functionCall, 'func_get_args')) {
+ $this->nodes = array();
+ }
+
+ if ($this->isFunctionNameEndingWith($functionCall, 'compact')) {
+ foreach ($functionCall->findChildrenOfType('Literal') as $literal) {
+ unset($this->nodes['$' . trim($literal->getImage(), '"\'')]);
+ }
+ }
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedLocalVariable.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedLocalVariable.php
new file mode 100644
index 0000000..ecebd3f
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedLocalVariable.php
@@ -0,0 +1,211 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule;
+
+use PHPMD\AbstractNode;
+use PHPMD\Node\AbstractCallableNode;
+use PHPMD\Node\ASTNode;
+
+/**
+ * This rule collects all local variables within a given function or method
+ * that are not used by any code in the analyzed source artifact.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class UnusedLocalVariable extends AbstractLocalVariable implements FunctionAware, MethodAware
+{
+ /**
+ * Found variable images within a single method or function.
+ *
+ * @var array(string)
+ */
+ private $images = array();
+
+ /**
+ * This method checks that all local variables within the given function or
+ * method are used at least one time.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ $this->images = array();
+
+ $this->collectVariables($node);
+ $this->removeParameters($node);
+
+ foreach ($this->images as $nodes) {
+ if (count($nodes) === 1) {
+ $this->doCheckNodeImage($nodes[0]);
+ }
+ }
+ }
+
+ /**
+ * This method removes all variables from the $_images property that
+ * are also found in the formal parameters of the given method or/and
+ * function node.
+ *
+ * @param \PHPMD\Node\AbstractCallableNode $node
+ * @return void
+ */
+ private function removeParameters(AbstractCallableNode $node)
+ {
+ // Get formal parameter container
+ $parameters = $node->getFirstChildOfType('FormalParameters');
+
+ // Now get all declarators in the formal parameters container
+ $declarators = $parameters->findChildrenOfType('VariableDeclarator');
+
+ foreach ($declarators as $declarator) {
+ unset($this->images[$declarator->getImage()]);
+ }
+ }
+
+ /**
+ * This method collects all local variable instances from the given
+ * method/function node and stores their image in the $_images
+ * property.
+ *
+ *
+ * @param \PHPMD\Node\AbstractCallableNode $node
+ * @return void
+ */
+ private function collectVariables(AbstractCallableNode $node)
+ {
+ foreach ($node->findChildrenOfType('Variable') as $variable) {
+ if ($this->isLocal($variable)) {
+ $this->collectVariable($variable);
+ }
+ }
+ foreach ($node->findChildrenOfType('VariableDeclarator') as $variable) {
+ $this->collectVariable($variable);
+ }
+ foreach ($node->findChildrenOfType('FunctionPostfix') as $func) {
+ if ($this->isFunctionNameEndingWith($func, 'compact')) {
+ foreach ($func->findChildrenOfType('Literal') as $literal) {
+ $this->collectLiteral($literal);
+ }
+ }
+ }
+ }
+
+ /**
+ * Stores the given variable node in an internal list of found variables.
+ *
+ * @param \PHPMD\Node\ASTNode $node
+ * @return void
+ */
+ private function collectVariable(ASTNode $node)
+ {
+ if (!isset($this->images[$node->getImage()])) {
+ $this->images[$node->getImage()] = array();
+ }
+ $this->images[$node->getImage()][] = $node;
+ }
+
+ /**
+ * Stores the given literal node in an internal list of found variables.
+ *
+ * @param \PHPMD\Node\ASTNode $node
+ * @return void
+ */
+ private function collectLiteral(ASTNode $node)
+ {
+ $variable = '$' . trim($node->getImage(), '\'');
+ if (!isset($this->images[$variable])) {
+ $this->images[$variable] = array();
+ }
+ $this->images[$variable][] = $node;
+ }
+
+ /**
+ * Template method that performs the real node image check.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ protected function doCheckNodeImage(AbstractNode $node)
+ {
+ if ($this->isNameAllowedInContext($node)) {
+ return;
+ }
+ $this->addViolation($node, array($node->getImage()));
+ }
+
+ /**
+ * Checks if a short name is acceptable in the current context. For the
+ * moment these contexts are the init section of a for-loop and short
+ * variable names in catch-statements.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return boolean
+ */
+ private function isNameAllowedInContext(AbstractNode $node)
+ {
+ return $this->isChildOf($node, 'CatchStatement');
+ }
+
+ /**
+ * Checks if the given node is a direct or indirect child of a node with
+ * the given type.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @param string $type
+ * @return boolean
+ */
+ private function isChildOf(AbstractNode $node, $type)
+ {
+ $parent = $node->getParent();
+ if ($parent->isInstanceOf($type)) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedPrivateField.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedPrivateField.php
new file mode 100644
index 0000000..e188269
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedPrivateField.php
@@ -0,0 +1,220 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Node\ASTNode;
+use PHPMD\Node\ClassNode;
+
+/**
+ * This rule collects all private fields in a class that aren't used in any
+ * method of the analyzed class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class UnusedPrivateField extends AbstractRule implements ClassAware
+{
+ /**
+ * Collected private fields/variable declarators in the currently processed
+ * class.
+ *
+ * @var \PHPMD\Node\ASTNode[]
+ */
+ private $fields = array();
+
+ /**
+ * This method checks that all private class properties are at least accessed
+ * by one method.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ foreach ($this->collectUnusedPrivateFields($node) as $field) {
+ $this->addViolation($field, array($field->getImage()));
+ }
+ }
+
+ /**
+ * This method collects all private fields that aren't used by any class
+ * method.
+ *
+ * @param \PHPMD\Node\ClassNode $class
+ * @return \PHPMD\AbstractNode[]
+ */
+ private function collectUnusedPrivateFields(ClassNode $class)
+ {
+ $this->fields = array();
+
+ $this->collectPrivateFields($class);
+ $this->removeUsedFields($class);
+
+ return $this->fields;
+ }
+
+ /**
+ * This method collects all private fields in the given class and stores
+ * them in the $_fields property.
+ *
+ * @param \PHPMD\Node\ClassNode $class
+ * @return void
+ */
+ private function collectPrivateFields(ClassNode $class)
+ {
+ foreach ($class->findChildrenOfType('FieldDeclaration') as $declaration) {
+ if ($declaration->isPrivate()) {
+ $this->collectPrivateField($declaration);
+ }
+ }
+ }
+
+ /**
+ * This method extracts all variable declarators from the given field
+ * declaration and stores them in the $_fields property.
+ *
+ * @param \PHPMD\Node\ASTNode $declaration
+ * @return void
+ */
+ private function collectPrivateField(ASTNode $declaration)
+ {
+ $fields = $declaration->findChildrenOfType('VariableDeclarator');
+ foreach ($fields as $field) {
+ $this->fields[$field->getImage()] = $field;
+ }
+ }
+
+ /**
+ * This method extracts all property postfix nodes from the given class and
+ * removes all fields from the $_fields property that are accessed by
+ * one of the postfix nodes.
+ *
+ * @param \PHPMD\Node\ClassNode $class
+ * @return void
+ */
+ private function removeUsedFields(ClassNode $class)
+ {
+ foreach ($class->findChildrenOfType('PropertyPostfix') as $postfix) {
+ if ($this->isInScopeOfClass($class, $postfix)) {
+ $this->removeUsedField($postfix);
+ }
+ }
+ }
+
+ /**
+ * This method removes the field from the $_fields property that is
+ * accessed through the given property postfix node.
+ *
+ * @param \PHPMD\Node\ASTNode $postfix
+ * @return void
+ */
+ private function removeUsedField(ASTNode $postfix)
+ {
+ if ($postfix->getParent()->isStatic()) {
+ $image = '';
+ $child = $postfix->getFirstChildOfType('Variable');
+ } else {
+ $image = '$';
+ $child = $postfix->getFirstChildOfType('Identifier');
+ }
+
+
+ if ($this->isValidPropertyNode($child)) {
+ unset($this->fields[$image . $child->getImage()]);
+ }
+ }
+
+ /**
+ * Checks if the given node is a valid property node.
+ *
+ * @param \PHPMD\Node\ASTNode $node
+ * @return boolean
+ * @since 0.2.6
+ */
+ protected function isValidPropertyNode(ASTNode $node = null)
+ {
+ if ($node === null) {
+ return false;
+ }
+
+ $parent = $node->getParent();
+ while (!$parent->isInstanceOf('PropertyPostfix')) {
+ if ($parent->isInstanceOf('CompoundVariable')) {
+ return false;
+ }
+ $parent = $parent->getParent();
+ if (is_null($parent)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * This method checks that the given property postfix is accessed on an
+ * instance or static reference to the given class.
+ *
+ * @param \PHPMD\Node\ClassNode $class
+ * @param \PHPMD\Node\ASTNode $postfix
+ * @return boolean
+ */
+ protected function isInScopeOfClass(ClassNode $class, ASTNode $postfix)
+ {
+ $owner = $postfix->getParent()->getChild(0);
+ if ($owner->isInstanceOf('PropertyPostfix')) {
+ $owner = $owner->getParent()->getParent()->getChild(0);
+ }
+ return (
+ $owner->isInstanceOf('SelfReference') ||
+ $owner->isInstanceOf('StaticReference') ||
+ strcasecmp($owner->getImage(), '$this') === 0 ||
+ strcasecmp($owner->getImage(), $class->getImage()) === 0
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedPrivateMethod.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedPrivateMethod.php
new file mode 100644
index 0000000..a712a35
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Rule/UnusedPrivateMethod.php
@@ -0,0 +1,166 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Rule;
+
+use PHPMD\AbstractNode;
+use PHPMD\AbstractRule;
+use PHPMD\Node\ASTNode;
+use PHPMD\Node\ClassNode;
+use PHPMD\Node\MethodNode;
+
+/**
+ * This rule collects all private methods in a class that aren't used in any
+ * method of the analyzed class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class UnusedPrivateMethod extends AbstractRule implements ClassAware
+{
+ /**
+ * This method checks that all private class methods are at least accessed
+ * by one method.
+ *
+ * @param \PHPMD\AbstractNode $class
+ * @return void
+ */
+ public function apply(AbstractNode $class)
+ {
+ foreach ($this->collectUnusedPrivateMethods($class) as $node) {
+ $this->addViolation($node, array($node->getImage()));
+ }
+ }
+
+ /**
+ * This method collects all methods in the given class that are declared
+ * as private and are not used in the same class' context.
+ *
+ * @param \PHPMD\Node\ClassNode $class
+ * @return \PHPMD\AbstractNode[]
+ */
+ private function collectUnusedPrivateMethods(ClassNode $class)
+ {
+ $methods = $this->collectPrivateMethods($class);
+ return $this->removeUsedMethods($class, $methods);
+ }
+
+ /**
+ * Collects all private methods declared in the given class node.
+ *
+ * @param \PHPMD\Node\ClassNode $class
+ * @return \PHPMD\AbstractNode[]
+ */
+ private function collectPrivateMethods(ClassNode $class)
+ {
+ $methods = array();
+ foreach ($class->getMethods() as $method) {
+ if ($this->acceptMethod($class, $method)) {
+ $methods[strtolower($method->getImage())] = $method;
+ }
+ }
+ return $methods;
+ }
+
+ /**
+ * Returns true when the given method should be used for this rule's
+ * analysis.
+ *
+ * @param \PHPMD\Node\ClassNode $class
+ * @param \PHPMD\Node\MethodNode $method
+ * @return boolean
+ */
+ private function acceptMethod(ClassNode $class, MethodNode $method)
+ {
+ return (
+ $method->isPrivate() &&
+ false === $method->hasSuppressWarningsAnnotationFor($this) &&
+ strcasecmp($method->getImage(), $class->getImage()) !== 0 &&
+ strcasecmp($method->getImage(), '__construct') !== 0 &&
+ strcasecmp($method->getImage(), '__destruct') !== 0 &&
+ strcasecmp($method->getImage(), '__clone') !== 0
+ );
+ }
+
+ /**
+ * This method removes all used methods from the given methods array.
+ *
+ * @param \PHPMD\Node\ClassNode $class
+ * @param \PHPMD\Node\MethodNode[] $methods
+ * @return \PHPMD\AbstractNode[]
+ */
+ private function removeUsedMethods(ClassNode $class, array $methods)
+ {
+ foreach ($class->findChildrenOfType('MethodPostfix') as $postfix) {
+ if ($this->isClassScope($class, $postfix)) {
+ unset($methods[strtolower($postfix->getImage())]);
+ }
+ }
+ return $methods;
+ }
+
+ /**
+ * This method checks that the given method postfix is accessed on an
+ * instance or static reference to the given class.
+ *
+ * @param \PHPMD\Node\ClassNode $class
+ * @param \PHPMD\Node\ASTNode $postfix
+ * @return boolean
+ */
+ private function isClassScope(ClassNode $class, ASTNode $postfix)
+ {
+ $owner = $postfix->getParent()->getChild(0);
+ if ($owner->isInstanceOf('MethodPostfix')) {
+ $owner = $owner->getParent()->getParent()->getChild(0);
+ }
+ return (
+ $owner->isInstanceOf('SelfReference') ||
+ $owner->isInstanceOf('StaticReference') ||
+ strcasecmp($owner->getImage(), '$this') === 0 ||
+ strcasecmp($owner->getImage(), $class->getImage()) === 0
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleClassFileNotFoundException.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleClassFileNotFoundException.php
new file mode 100644
index 0000000..741b57e
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleClassFileNotFoundException.php
@@ -0,0 +1,67 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * This type of exception is thrown when the class file for a configured rule
+ * does not exist within php's include path.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class RuleClassFileNotFoundException extends \RuntimeException
+{
+ /**
+ * Constructs a new class file not found exception.
+ *
+ * @param string $className The rule class name.
+ */
+ public function __construct($className)
+ {
+ parent::__construct('Cannot load source file for class: ' . $className);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleClassNotFoundException.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleClassNotFoundException.php
new file mode 100644
index 0000000..25c6389
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleClassNotFoundException.php
@@ -0,0 +1,66 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * When a configured rule class does not exist.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class RuleClassNotFoundException extends \RuntimeException
+{
+ /**
+ * Constructs a new class not found exception.
+ *
+ * @param $className The configured but not found ruke class name.
+ */
+ public function __construct($className)
+ {
+ parent::__construct('Cannot find rule class: ' . $className);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSet.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSet.php
new file mode 100644
index 0000000..59ea0fc
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSet.php
@@ -0,0 +1,301 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * This class is a collection of concrete source analysis rules.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class RuleSet implements \IteratorAggregate
+{
+ /**
+ * Should this rule set force the strict mode.
+ *
+ * @var boolean
+ * @since 1.2.0
+ */
+ private $strict = false;
+
+ /**
+ * The name of the file where this set is specified.
+ *
+ * @var string
+ */
+ private $fileName = '';
+
+ /**
+ * The name of this rule-set.
+ *
+ * @var string
+ */
+ private $name = '';
+
+ /**
+ * An optional description for this rule-set.
+ *
+ * @var string
+ */
+ private $description = '';
+
+ /**
+ * The violation report used by the rule-set.
+ *
+ * @var \PHPMD\Report
+ */
+ private $report;
+
+ /**
+ * Mapping between marker interfaces and concrete context code node classes.
+ *
+ * @var array(string=>string)
+ */
+ private $applyTo = array(
+ 'PHPMD\\Rule\\ClassAware' => 'PHPMD\\Node\\ClassNode',
+ 'PHPMD\\Rule\\FunctionAware' => 'PHPMD\\Node\\FunctionNode',
+ 'PHPMD\\Rule\\InterfaceAware' => 'PHPMD\\Node\\InterfaceNode',
+ 'PHPMD\\Rule\\MethodAware' => 'PHPMD\\Node\\MethodNode',
+ );
+
+ /**
+ * Mapping of rules that apply to a concrete code node type.
+ *
+ * @var array(string=>array)
+ */
+ private $rules = array(
+ 'PHPMD\\Node\\ClassNode' => array(),
+ 'PHPMD\\Node\\FunctionNode' => array(),
+ 'PHPMD\\Node\\InterfaceNode' => array(),
+ 'PHPMD\\Node\\MethodNode' => array(),
+ );
+
+ /**
+ * Returns the file name where the definition of this rule-set comes from.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->fileName;
+ }
+
+ /**
+ * Sets the file name where the definition of this rule-set comes from.
+ *
+ * @param string $fileName The file name.
+ *
+ * @return void
+ */
+ public function setFileName($fileName)
+ {
+ $this->fileName = $fileName;
+ }
+
+ /**
+ * Returns the name of this rule-set.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets the name of this rule-set.
+ *
+ * @param string $name The name of this rule-set.
+ *
+ * @return void
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * Returns the description text for this rule-set instance.
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->description;
+ }
+
+ /**
+ * Sets the description text for this rule-set instance.
+ *
+ * @param string $description The description text.
+ *
+ * @return void
+ */
+ public function setDescription($description)
+ {
+ $this->description = $description;
+ }
+
+ /**
+ * Activates the strict mode for this rule set instance.
+ *
+ * @return void
+ * @since 1.2.0
+ */
+ public function setStrict()
+ {
+ $this->strict = true;
+ }
+
+ /**
+ * Returns the violation report used by the rule-set.
+ *
+ * @return \PHPMD\Report
+ */
+ public function getReport()
+ {
+ return $this->report;
+ }
+
+ /**
+ * Sets the violation report used by the rule-set.
+ *
+ * @param \PHPMD\Report $report
+ * @return void
+ */
+ public function setReport(Report $report)
+ {
+ $this->report = $report;
+ }
+
+ /**
+ * This method returns a rule by its name or null if it doesn't exist.
+ *
+ * @param string $name
+ * @return \PHPMD\Rule
+ */
+ public function getRuleByName($name)
+ {
+ foreach ($this->getRules() as $rule) {
+ if ($rule->getName() === $name) {
+ return $rule;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * This method returns an iterator will all rules that belong to this
+ * rule-set.
+ *
+ * @return \Iterator
+ */
+ public function getRules()
+ {
+ $result = array();
+ foreach ($this->rules as $rules) {
+ foreach ($rules as $rule) {
+ if (in_array($rule, $result, true) === false) {
+ $result[] = $rule;
+ }
+ }
+ }
+
+ return new \ArrayIterator($result);
+ }
+
+ /**
+ * Adds a new rule to this rule-set.
+ *
+ * @param \PHPMD\Rule $rule
+ * @return void
+ */
+ public function addRule(Rule $rule)
+ {
+ foreach ($this->applyTo as $applyTo => $type) {
+ if ($rule instanceof $applyTo) {
+ $this->rules[$type][] = $rule;
+ }
+ }
+ }
+
+ /**
+ * Applies all registered rules that match against the concrete node type.
+ *
+ * @param \PHPMD\AbstractNode $node
+ * @return void
+ */
+ public function apply(AbstractNode $node)
+ {
+ // Current node type
+ $className = get_class($node);
+
+ // Check for valid node type
+ if (!isset($this->rules[$className])) {
+ return;
+ }
+
+ // Apply all rules to this node
+ foreach ($this->rules[$className] as $rule) {
+ if ($node->hasSuppressWarningsAnnotationFor($rule) && !$this->strict) {
+ continue;
+ }
+ $rule->setReport($this->report);
+ $rule->apply($node);
+ }
+ }
+
+ /**
+ * Returns an iterator with all rules that are part of this rule-set.
+ *
+ * @return \Iterator
+ */
+ public function getIterator()
+ {
+ return $this->getRules();
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php
new file mode 100644
index 0000000..d49fbd6
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php
@@ -0,0 +1,527 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * This factory class is used to create the {@link \PHPMD\RuleSet} instance
+ * that PHPMD will use to analyze the source code.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class RuleSetFactory
+{
+ /**
+ * Is the strict mode active?
+ *
+ * @var boolean
+ * @since 1.2.0
+ */
+ private $strict = false;
+
+ /**
+ * The data directory set by PEAR or a dynamic property set within the class
+ * constructor.
+ *
+ * @var string
+ */
+ private $location = '@data_dir@';
+
+ /**
+ * The minimum priority for rules to load.
+ *
+ * @var integer
+ */
+ private $minimumPriority = Rule::LOWEST_PRIORITY;
+
+ /**
+ * Constructs a new default rule-set factory instance.
+ */
+ public function __construct()
+ {
+ // PEAR installer workaround
+ if (strpos($this->location, '@data_dir') === 0) {
+ $this->location = __DIR__ . '/../../resources';
+ } else {
+ $this->location .= '/PHPMD/resources';
+ }
+ }
+
+ /**
+ * Activates the strict mode for all rule sets.
+ *
+ * @return void
+ * @since 1.2.0
+ */
+ public function setStrict()
+ {
+ $this->strict = true;
+ }
+
+ /**
+ * Sets the minimum priority that a rule must have.
+ *
+ * @param integer $minimumPriority The minimum priority value.
+ *
+ * @return void
+ */
+ public function setMinimumPriority($minimumPriority)
+ {
+ $this->minimumPriority = $minimumPriority;
+ }
+
+ /**
+ * Creates an array of rule-set instances for the given argument.
+ *
+ * @param string $ruleSetFileNames Comma-separated string of rule-set filenames or identifier.
+ * @return \PHPMD\RuleSet[]
+ */
+ public function createRuleSets($ruleSetFileNames)
+ {
+ $ruleSets = array();
+
+ $ruleSetFileName = strtok($ruleSetFileNames, ',');
+ while ($ruleSetFileName !== false) {
+ $ruleSets[] = $this->createSingleRuleSet($ruleSetFileName);
+
+ $ruleSetFileName = strtok(',');
+ }
+ return $ruleSets;
+ }
+
+ /**
+ * Creates a single rule-set instance for the given filename or identifier.
+ *
+ * @param string $ruleSetOrFileName The rule-set filename or identifier.
+ * @return \PHPMD\RuleSet
+ */
+ public function createSingleRuleSet($ruleSetOrFileName)
+ {
+ $fileName = $this->createRuleSetFileName($ruleSetOrFileName);
+ return $this->parseRuleSetNode($fileName);
+ }
+
+ /**
+ * Lists available rule-set identifiers.
+ *
+ * @return array(string)
+ */
+ public function listAvailableRuleSets()
+ {
+ return array_merge(
+ self::listRuleSetsInDirectory($this->location . '/rulesets/'),
+ self::listRuleSetsInDirectory(getcwd() . '/rulesets/')
+ );
+ }
+
+ /**
+ * This method creates the filename for a rule-set identifier or it returns
+ * the input when it is already a filename.
+ *
+ * @param string $ruleSetOrFileName The rule-set filename or identifier.
+ * @return string
+ */
+ private function createRuleSetFileName($ruleSetOrFileName)
+ {
+ if (file_exists($ruleSetOrFileName) === true) {
+ return $ruleSetOrFileName;
+ }
+
+ $fileName = $this->location . '/' . $ruleSetOrFileName;
+ if (file_exists($fileName) === true) {
+ return $fileName;
+ }
+
+ $fileName = $this->location . '/rulesets/' . $ruleSetOrFileName . '.xml';
+ if (file_exists($fileName) === true) {
+ return $fileName;
+ }
+
+ $fileName = getcwd() . '/rulesets/' . $ruleSetOrFileName . '.xml';
+ if (file_exists($fileName) === true) {
+ return $fileName;
+ }
+
+ throw new RuleSetNotFoundException($ruleSetOrFileName);
+ }
+
+ /**
+ * Lists available rule-set identifiers in given directory.
+ *
+ * @param string $directory The directory to scan for rule-sets.
+ *
+ * @return array(string)
+ */
+ private static function listRuleSetsInDirectory($directory)
+ {
+ $ruleSets = array();
+ if (is_dir($directory)) {
+ foreach (scandir($directory) as $file) {
+ $matches = array();
+ if (is_file($directory . $file) && preg_match('/^(.*)\.xml$/', $file, $matches)) {
+ $ruleSets[] = $matches[1];
+ }
+ }
+ }
+ return $ruleSets;
+ }
+
+ /**
+ * This method parses the rule-set definition in the given file.
+ *
+ * @param string $fileName
+ * @return \PHPMD\RuleSet
+ */
+ private function parseRuleSetNode($fileName)
+ {
+ // Hide error messages
+ $libxml = libxml_use_internal_errors(true);
+
+ $xml = simplexml_load_string(file_get_contents($fileName));
+ if ($xml === false) {
+ // Reset error handling to previous setting
+ libxml_use_internal_errors($libxml);
+
+ throw new \RuntimeException(trim(libxml_get_last_error()->message));
+ }
+
+ $ruleSet = new RuleSet();
+ $ruleSet->setFileName($fileName);
+ $ruleSet->setName((string) $xml['name']);
+
+ if ($this->strict) {
+ $ruleSet->setStrict();
+ }
+
+ foreach ($xml->children() as $node) {
+ if ($node->getName() === 'description') {
+ $ruleSet->setDescription((string) $node);
+ } elseif ($node->getName() === 'rule') {
+ $this->parseRuleNode($ruleSet, $node);
+ }
+ }
+
+ return $ruleSet;
+ }
+
+ /**
+ * This method parses a single rule xml node. Bases on the structure of the
+ * xml node this method delegates the parsing process to another method in
+ * this class.
+ *
+ * @param \PHPMD\RuleSet $ruleSet
+ * @param \SimpleXMLElement $node
+ * @return void
+ */
+ private function parseRuleNode(RuleSet $ruleSet, \SimpleXMLElement $node)
+ {
+ if (substr($node['ref'], -3, 3) === 'xml') {
+ $this->parseRuleSetReferenceNode($ruleSet, $node);
+ } elseif ('' === (string) $node['ref']) {
+ $this->parseSingleRuleNode($ruleSet, $node);
+ } else {
+ $this->parseRuleReferenceNode($ruleSet, $node);
+ }
+ }
+
+ /**
+ * This method parses a complete rule set that was includes a reference in
+ * the currently parsed ruleset.
+ *
+ * @param \PHPMD\RuleSet $ruleSet
+ * @param \SimpleXMLElement $ruleSetNode
+ * @return void
+ */
+ private function parseRuleSetReferenceNode(RuleSet $ruleSet, \SimpleXMLElement $ruleSetNode)
+ {
+ $rules = $this->parseRuleSetReference($ruleSetNode);
+ foreach ($rules as $rule) {
+ if ($this->isIncluded($rule, $ruleSetNode)) {
+ $ruleSet->addRule($rule);
+ }
+ }
+ }
+
+ /**
+ * Parses a rule-set xml file referenced by the given rule-set xml element.
+ *
+ * @param \SimpleXMLElement $ruleSetNode
+ * @return \PHPMD\RuleSet
+ * @since 0.2.3
+ */
+ private function parseRuleSetReference(\SimpleXMLElement $ruleSetNode)
+ {
+ $ruleSetFactory = new RuleSetFactory();
+ $ruleSetFactory->setMinimumPriority($this->minimumPriority);
+
+ return $ruleSetFactory->createSingleRuleSet((string) $ruleSetNode['ref']);
+ }
+
+ /**
+ * Checks if the given rule is included/not excluded by the given rule-set
+ * reference node.
+ *
+ * @param \PHPMD\Rule $rule
+ * @param \SimpleXMLElement $ruleSetNode
+ * @return boolean
+ * @since 0.2.3
+ */
+ private function isIncluded(Rule $rule, \SimpleXMLElement $ruleSetNode)
+ {
+ foreach ($ruleSetNode->exclude as $exclude) {
+ if ($rule->getName() === (string) $exclude['name']) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * This method will create a single rule instance and add it to the given
+ * {@link \PHPMD\RuleSet} object.
+ *
+ * @param \PHPMD\RuleSet $ruleSet
+ * @param \SimpleXMLElement $ruleNode
+ * @return void
+ * @throws \PHPMD\RuleClassFileNotFoundException
+ * @throws \PHPMD\RuleClassNotFoundException
+ */
+ private function parseSingleRuleNode(RuleSet $ruleSet, \SimpleXMLElement $ruleNode)
+ {
+ $className = (string) $ruleNode['class'];
+ $fileName = strtr($className, '\\', '/') . '.php';
+
+ if (class_exists($className) === false) {
+ $handle = @fopen($fileName, 'r', true);
+ if ($handle === false) {
+ throw new RuleClassFileNotFoundException($className);
+ }
+ fclose($handle);
+
+ include_once $fileName;
+
+ if (class_exists($className) === false) {
+ throw new RuleClassNotFoundException($className);
+ }
+ }
+
+ /* @var $rule \PHPMD\Rule */
+ $rule = new $className();
+ $rule->setName((string) $ruleNode['name']);
+ $rule->setMessage((string) $ruleNode['message']);
+ $rule->setExternalInfoUrl((string) $ruleNode['externalInfoUrl']);
+
+ $rule->setRuleSetName($ruleSet->getName());
+
+ if (trim($ruleNode['since']) !== '') {
+ $rule->setSince((string) $ruleNode['since']);
+ }
+
+ foreach ($ruleNode->children() as $node) {
+ if ($node->getName() === 'description') {
+ $rule->setDescription((string) $node);
+ } elseif ($node->getName() === 'example') {
+ $rule->addExample((string) $node);
+ } elseif ($node->getName() === 'priority') {
+ $rule->setPriority((integer) $node);
+ } elseif ($node->getName() === 'properties') {
+ $this->parsePropertiesNode($rule, $node);
+ }
+ }
+
+ if ($rule->getPriority() <= $this->minimumPriority) {
+ $ruleSet->addRule($rule);
+ }
+ }
+
+ /**
+ * This method parses a single rule that was included from a different
+ * rule-set.
+ *
+ * @param \PHPMD\RuleSet $ruleSet
+ * @param \SimpleXMLElement $ruleNode
+ * @return void
+ */
+ private function parseRuleReferenceNode(RuleSet $ruleSet, \SimpleXMLElement $ruleNode)
+ {
+ $ref = (string) $ruleNode['ref'];
+
+ $fileName = substr($ref, 0, strpos($ref, '.xml/') + 4);
+ $fileName = $this->createRuleSetFileName($fileName);
+
+ $ruleName = substr($ref, strpos($ref, '.xml/') + 5);
+
+ $ruleSetFactory = new RuleSetFactory();
+
+ $ruleSetRef = $ruleSetFactory->createSingleRuleSet($fileName);
+ $rule = $ruleSetRef->getRuleByName($ruleName);
+
+ if (trim($ruleNode['name']) !== '') {
+ $rule->setName((string) $ruleNode['name']);
+ }
+ if (trim($ruleNode['message']) !== '') {
+ $rule->setMessage((string) $ruleNode['message']);
+ }
+ if (trim($ruleNode['externalInfoUrl']) !== '') {
+ $rule->setExternalInfoUrl((string) $ruleNode['externalInfoUrl']);
+ }
+
+ foreach ($ruleNode->children() as $node) {
+ if ($node->getName() === 'description') {
+ $rule->setDescription((string) $node);
+ } elseif ($node->getName() === 'example') {
+ $rule->addExample((string) $node);
+ } elseif ($node->getName() === 'priority') {
+ $rule->setPriority((integer) $node);
+ } elseif ($node->getName() === 'properties') {
+ $this->parsePropertiesNode($rule, $node);
+ }
+ }
+
+ if ($rule->getPriority() <= $this->minimumPriority) {
+ $ruleSet->addRule($rule);
+ }
+ }
+
+ /**
+ * This method parses a xml properties structure and adds all found properties
+ * to the given $rule object.
+ *
+ *
+ * ...
+ *
+ *
+ *
+ * ...
+ *
+ * ...
+ *
+ *
+ * @param \PHPMD\Rule $rule
+ * @param \SimpleXMLElement $propertiesNode
+ * @return void
+ */
+ private function parsePropertiesNode(Rule $rule, \SimpleXMLElement $propertiesNode)
+ {
+ foreach ($propertiesNode->children() as $node) {
+ if ($node->getName() === 'property') {
+ $this->addProperty($rule, $node);
+ }
+ }
+ }
+
+ /**
+ * Adds an additional property to the given $rule instance.
+ *
+ * @param \PHPMD\Rule $rule
+ * @param \SimpleXMLElement $node
+ * @return void
+ */
+ private function addProperty(Rule $rule, \SimpleXMLElement $node)
+ {
+ $name = trim($node['name']);
+ $value = trim($this->getPropertyValue($node));
+ if ($name !== '' && $value !== '') {
+ $rule->addProperty($name, $value);
+ }
+ }
+
+ /**
+ * Returns the value of a property node. This value can be expressed in
+ * two different notations. First version is an attribute named value
+ * and the second valid notation is a child element named value that
+ * contains the value as character data.
+ *
+ * @param \SimpleXMLElement $propertyNode
+ * @return string
+ * @since 0.2.5
+ */
+ private function getPropertyValue(\SimpleXMLElement $propertyNode)
+ {
+ if (isset($propertyNode->value)) {
+ return (string) $propertyNode->value;
+ }
+ return (string) $propertyNode['value'];
+ }
+
+ /**
+ * Returns an array of path exclude patterns in format described at
+ *
+ * http://pmd.sourceforge.net/pmd-5.0.4/howtomakearuleset.html#Excluding_files_from_a_ruleset
+ *
+ * @param $fileName The filename of a rule-set definition.
+ *
+ * @return array
+ * @throws \RuntimeException
+ */
+ public function getIgnorePattern($fileName)
+ {
+ $excludes = array();
+ foreach (array_map('trim', explode(',', $fileName)) as $ruleSetFileName) {
+ $ruleSetFileName = $this->createRuleSetFileName($ruleSetFileName);
+
+ // Hide error messages
+ $libxml = libxml_use_internal_errors(true);
+
+ $xml = simplexml_load_string(file_get_contents($ruleSetFileName));
+ if ($xml === false) {
+ // Reset error handling to previous setting
+ libxml_use_internal_errors($libxml);
+
+ throw new \RuntimeException(trim(libxml_get_last_error()->message));
+ }
+
+ foreach ($xml->children() as $node) {
+ if ($node->getName() === 'exclude-pattern') {
+ $excludes[] = '' . $node;
+ }
+ }
+
+ return $excludes;
+ }
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetNotFoundException.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetNotFoundException.php
new file mode 100644
index 0000000..a30cd19
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetNotFoundException.php
@@ -0,0 +1,66 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * This type of exception is thrown when a not existing rule-set was specified.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class RuleSetNotFoundException extends \RuntimeException
+{
+ /**
+ * Constructs a new exception for the given rule-set identifier or file name.
+ *
+ * @param string $ruleSet The rule-set identifier or file name.
+ */
+ public function __construct($ruleSet)
+ {
+ parent::__construct('Cannot find specified rule-set "' . $ruleSet . '".');
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleViolation.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleViolation.php
new file mode 100644
index 0000000..d0ed9b3
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleViolation.php
@@ -0,0 +1,241 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+use PHPMD\AbstractNode;
+use PHPMD\Node\AbstractTypeNode;
+use PHPMD\Node\FunctionNode;
+use PHPMD\Node\MethodNode;
+
+/**
+ * This class is used as container for a single rule violation related to a source
+ * node.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class RuleViolation
+{
+ /**
+ * The rule that causes this violation.
+ *
+ * @var \PHPMD\Rule
+ */
+ private $rule;
+
+ /**
+ * The context code node for this rule violation.
+ *
+ * @var \PHPMD\AbstractNode
+ */
+ private $node;
+
+ /**
+ * The description/message text that describes the violation.
+ *
+ * @var string
+ */
+ private $description;
+
+ /**
+ * The raw metric value which caused this rule violation.
+ *
+ * @var mixed
+ */
+ private $metric;
+
+ /**
+ * Name of the owning/context class or interface of this violation.
+ *
+ * @var string
+ */
+ private $className = null;
+
+ /**
+ * The name of a method or null when this violation has no method
+ * context.
+ *
+ * @var string
+ */
+ private $methodName = null;
+
+ /**
+ * The name of a function or null when this violation has no function
+ * context.
+ *
+ * @var string
+ */
+ private $functionName = null;
+
+ /**
+ * Constructs a new rule violation instance.
+ *
+ * @param \PHPMD\Rule $rule
+ * @param \PHPMD\AbstractNode $node
+ * @param string $violationMessage
+ * @param mixed $metric
+ */
+ public function __construct(Rule $rule, AbstractNode $node, $violationMessage, $metric = null)
+ {
+ $this->rule = $rule;
+ $this->node = $node;
+ $this->metric = $metric;
+ $this->description = $violationMessage;
+
+ if ($node instanceof AbstractTypeNode) {
+ $this->className = $node->getName();
+ } elseif ($node instanceof MethodNode) {
+ $this->className = $node->getParentName();
+ $this->methodName = $node->getName();
+ } elseif ($node instanceof FunctionNode) {
+ $this->functionName = $node->getName();
+ }
+ }
+
+ /**
+ * Returns the rule that causes this violation.
+ *
+ * @return \PHPMD\Rule
+ */
+ public function getRule()
+ {
+ return $this->rule;
+ }
+
+ /**
+ * Returns the description/message text that describes the violation.
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->description;
+ }
+
+ /**
+ * Returns the raw metric value which caused this rule violation.
+ *
+ * @return mixed|null
+ */
+ public function getMetric()
+ {
+ return $this->metric;
+ }
+
+ /**
+ * Returns the file name where this rule violation was detected.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->node->getFileName();
+ }
+
+ /**
+ * Returns the first line of the node that causes this rule violation.
+ *
+ * @return integer
+ */
+ public function getBeginLine()
+ {
+ return $this->node->getBeginLine();
+ }
+
+ /**
+ * Returns the last line of the node that causes this rule violation.
+ *
+ * @return integer
+ */
+ public function getEndLine()
+ {
+ return $this->node->getEndLine();
+ }
+
+ /**
+ * Returns the name of the package that contains this violation.
+ *
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return $this->node->getNamespaceName();
+ }
+
+ /**
+ * Returns the name of the parent class or interface or null when there
+ * is no parent class.
+ *
+ * @return string
+ */
+ public function getClassName()
+ {
+ return $this->className;
+ }
+
+ /**
+ * Returns the name of a method or null when this violation has no
+ * method context.
+ *
+ * @return string
+ */
+ public function getMethodName()
+ {
+ return $this->methodName;
+ }
+
+ /**
+ * Returns the name of a function or null when this violation has no
+ * function context.
+ *
+ * @return string
+ */
+ public function getFunctionName()
+ {
+ return $this->functionName;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/TextUI/Command.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/TextUI/Command.php
new file mode 100644
index 0000000..55d8788
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/TextUI/Command.php
@@ -0,0 +1,188 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\TextUI;
+
+use PHPMD\PHPMD;
+use PHPMD\RuleSetFactory;
+use PHPMD\Writer\StreamWriter;
+
+/**
+ * This class provides a command line interface for PHPMD
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class Command
+{
+ /**
+ * Exit codes used by the phpmd command line tool.
+ */
+ const EXIT_SUCCESS = 0,
+ EXIT_EXCEPTION = 1,
+ EXIT_VIOLATION = 2;
+
+ /**
+ * This method creates a PHPMD instance and configures this object based
+ * on the user's input, then it starts the source analysis.
+ *
+ * The return value of this method can be used as an exit code. A value
+ * equal to EXIT_SUCCESS means that no violations or errors were
+ * found in the analyzed code. Otherwise this method will return a value
+ * equal to EXIT_VIOLATION.
+ *
+ * @param \PHPMD\TextUI\CommandLineOptions $opts
+ * @param \PHPMD\RuleSetFactory $ruleSetFactory
+ * @return integer
+ */
+ public function run(CommandLineOptions $opts, RuleSetFactory $ruleSetFactory)
+ {
+ if ($opts->hasVersion()) {
+ fwrite(STDOUT, sprintf('PHPMD %s', $this->getVersion()) . PHP_EOL);
+ return self::EXIT_SUCCESS;
+ }
+
+ // Create a report stream
+ if ($opts->getReportFile() === null) {
+ $stream = STDOUT;
+ } else {
+ $stream = fopen($opts->getReportFile(), 'wb');
+ }
+
+ // Create renderer and configure output
+ $renderer = $opts->createRenderer();
+ $renderer->setWriter(new StreamWriter($stream));
+
+ $renderers = array($renderer);
+
+ foreach ($opts->getReportFiles() as $reportFormat => $reportFile) {
+ $reportRenderer = $opts->createRenderer($reportFormat);
+ $reportRenderer->setWriter(new StreamWriter(fopen($reportFile, 'wb')));
+
+ $renderers[] = $reportRenderer;
+ }
+
+ // Configure a rule set factory
+ $ruleSetFactory->setMinimumPriority($opts->getMinimumPriority());
+ if ($opts->hasStrict()) {
+ $ruleSetFactory->setStrict();
+ }
+
+ $phpmd = new PHPMD();
+ $phpmd->setOptions(
+ array_filter(
+ array(
+ 'coverage' => $opts->getCoverageReport()
+ )
+ )
+ );
+
+ $extensions = $opts->getExtensions();
+ if ($extensions !== null) {
+ $phpmd->setFileExtensions(explode(',', $extensions));
+ }
+
+ $ignore = $opts->getIgnore();
+ if ($ignore !== null) {
+ $phpmd->setIgnorePattern(explode(',', $ignore));
+ }
+
+ $phpmd->processFiles(
+ $opts->getInputPath(),
+ $opts->getRuleSets(),
+ $renderers,
+ $ruleSetFactory
+ );
+
+ if ($phpmd->hasViolations()) {
+ return self::EXIT_VIOLATION;
+ }
+ return self::EXIT_SUCCESS;
+ }
+
+ /**
+ * Returns the current version number.
+ *
+ * @return string
+ */
+ private function getVersion()
+ {
+ $build = __DIR__ . '/../../../../../build.properties';
+
+ if (file_exists($build)) {
+ $data = @parse_ini_file($build);
+ $version = $data['project.version'];
+ } else {
+ $version = '@package_version@';
+ }
+ return $version;
+ }
+
+ /**
+ * The main method that can be used by a calling shell script, the return
+ * value can be used as exit code.
+ *
+ * @param array $args The raw command line arguments array.
+ *
+ * @return integer
+ */
+ public static function main(array $args)
+ {
+ try {
+ $ruleSetFactory = new RuleSetFactory();
+ $options = new CommandLineOptions($args, $ruleSetFactory->listAvailableRuleSets());
+ $command = new Command();
+
+ $exitCode = $command->run($options, $ruleSetFactory);
+ } catch (\Exception $e) {
+ fwrite(STDERR, $e->getMessage());
+ fwrite(STDERR, PHP_EOL);
+
+ $exitCode = self::EXIT_EXCEPTION;
+ }
+ return $exitCode;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/TextUI/CommandLineOptions.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/TextUI/CommandLineOptions.php
new file mode 100644
index 0000000..5aff1be
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/TextUI/CommandLineOptions.php
@@ -0,0 +1,500 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\TextUI;
+
+use PHPMD\Renderer\HTMLRenderer;
+use PHPMD\Renderer\TextRenderer;
+use PHPMD\Renderer\XMLRenderer;
+use PHPMD\Rule;
+
+/**
+ * This is a helper class that collects the specified cli arguments and puts them
+ * into accessible properties.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class CommandLineOptions
+{
+ /**
+ * Error code for invalid input
+ */
+ const INPUT_ERROR = 23;
+
+ /**
+ * The minimum rule priority.
+ *
+ * @var integer
+ */
+ protected $minimumPriority = Rule::LOWEST_PRIORITY;
+
+ /**
+ * A php source code filename or directory.
+ *
+ * @var string
+ */
+ protected $inputPath;
+
+ /**
+ * The specified report format.
+ *
+ * @var string
+ */
+ protected $reportFormat;
+
+ /**
+ * An optional filename for the generated report.
+ *
+ * @var string
+ */
+ protected $reportFile;
+
+ /**
+ * Additional report files.
+ *
+ * @var array
+ */
+ protected $reportFiles = array();
+
+ /**
+ * A ruleset filename or a comma-separated string of ruleset filenames.
+ *
+ * @var string
+ */
+ protected $ruleSets;
+
+ /**
+ * File name of a PHPUnit code coverage report.
+ *
+ * @var string
+ */
+ protected $coverageReport;
+
+ /**
+ * A string of comma-separated extensions for valid php source code filenames.
+ *
+ * @var string
+ */
+ protected $extensions;
+
+ /**
+ * A string of comma-separated pattern that is used to exclude directories.
+ *
+ * @var string
+ */
+ protected $ignore;
+
+ /**
+ * Should the shell show the current phpmd version?
+ *
+ * @var boolean
+ */
+ protected $version = false;
+
+ /**
+ * Should PHPMD run in strict mode?
+ *
+ * @var boolean
+ * @since 1.2.0
+ */
+ protected $strict = false;
+
+ /**
+ * List of available rule-sets.
+ *
+ * @var array(string)
+ */
+ protected $availableRuleSets = array();
+
+ /**
+ * Constructs a new command line options instance.
+ *
+ * @param array $args
+ * @param array $availableRuleSets
+ * @throws \InvalidArgumentException
+ */
+ public function __construct(array $args, array $availableRuleSets = array())
+ {
+ // Remove current file name
+ array_shift($args);
+
+ $this->availableRuleSets = $availableRuleSets;
+
+ $arguments = array();
+ while (($arg = array_shift($args)) !== null) {
+ switch ($arg) {
+
+ case '--minimumpriority':
+ $this->minimumPriority = (int) array_shift($args);
+ break;
+
+ case '--reportfile':
+ $this->reportFile = array_shift($args);
+ break;
+
+ case '--inputfile':
+ array_unshift($arguments, $this->readInputFile(array_shift($args)));
+ break;
+
+ case '--coverage':
+ $this->coverageReport = array_shift($args);
+ break;
+
+ case '--extensions':
+ $this->logDeprecated('extensions', 'suffixes');
+ /* Deprecated: We use the suffixes option now */
+
+ case '--suffixes':
+ $this->extensions = array_shift($args);
+ break;
+
+ case '--ignore':
+ $this->logDeprecated('ignore', 'exclude');
+ /* Deprecated: We use the exclude option now */
+
+ case '--exclude':
+ $this->ignore = array_shift($args);
+ break;
+
+ case '--version':
+ $this->version = true;
+ return;
+
+ case '--strict':
+ $this->strict = true;
+ break;
+
+ case (preg_match('(^\-\-reportfile\-(xml|html|text)$)', $arg, $match) > 0):
+ $this->reportFiles[$match[1]] = array_shift($args);
+ break;
+
+ default:
+ $arguments[] = $arg;
+ break;
+ }
+ }
+
+ if (count($arguments) < 3) {
+ throw new \InvalidArgumentException($this->usage(), self::INPUT_ERROR);
+ }
+
+ $this->inputPath = (string) array_shift($arguments);
+ $this->reportFormat = (string) array_shift($arguments);
+ $this->ruleSets = (string) array_shift($arguments);
+ }
+
+ /**
+ * Returns a php source code filename or directory.
+ *
+ * @return string
+ */
+ public function getInputPath()
+ {
+ return $this->inputPath;
+ }
+
+ /**
+ * Returns the specified report format.
+ *
+ * @return string
+ */
+ public function getReportFormat()
+ {
+ return $this->reportFormat;
+ }
+
+ /**
+ * Returns the output filename for a generated report or null when
+ * the report should be displayed in STDOUT.
+ *
+ * @return string
+ */
+ public function getReportFile()
+ {
+ return $this->reportFile;
+ }
+
+ /**
+ * Returns a hash with report files specified for different renderers. The
+ * key represents the report format and the value the report file location.
+ *
+ * @return array
+ */
+ public function getReportFiles()
+ {
+ return $this->reportFiles;
+ }
+
+ /**
+ * Returns a ruleset filename or a comma-separated string of ruleset
+ *
+ * @return string
+ */
+ public function getRuleSets()
+ {
+ return $this->ruleSets;
+ }
+
+ /**
+ * Returns the minimum rule priority.
+ *
+ * @return integer
+ */
+ public function getMinimumPriority()
+ {
+ return $this->minimumPriority;
+ }
+
+ /**
+ * Returns the file name of a supplied code coverage report or NULL
+ * if the user has not supplied the --coverage option.
+ *
+ * @return string
+ */
+ public function getCoverageReport()
+ {
+ return $this->coverageReport;
+ }
+
+ /**
+ * Returns a string of comma-separated extensions for valid php source code
+ * filenames or null when this argument was not set.
+ *
+ * @return string
+ */
+ public function getExtensions()
+ {
+ return $this->extensions;
+ }
+
+ /**
+ * Returns string of comma-separated pattern that is used to exclude
+ * directories or null when this argument was not set.
+ *
+ * @return string
+ */
+ public function getIgnore()
+ {
+ return $this->ignore;
+ }
+
+ /**
+ * Was the --version passed to PHPMD's command line interface?
+ *
+ * @return boolean
+ */
+ public function hasVersion()
+ {
+ return $this->version;
+ }
+
+ /**
+ * Was the --strict option passed to PHPMD's command line interface?
+ *
+ * @return boolean
+ * @since 1.2.0
+ */
+ public function hasStrict()
+ {
+ return $this->strict;
+ }
+
+ /**
+ * Creates a report renderer instance based on the user's command line
+ * argument.
+ *
+ * Valid renderers are:
+ *
+ *
xml
+ *
html
+ *
text
+ *
+ *
+ * @param string $reportFormat
+ * @return \PHPMD\AbstractRenderer
+ * @throws \InvalidArgumentException When the specified renderer does not exist.
+ */
+ public function createRenderer($reportFormat = null)
+ {
+ $reportFormat = $reportFormat ?: $this->reportFormat;
+
+ switch ($reportFormat) {
+
+ case 'xml':
+ return $this->createXmlRenderer();
+
+ case 'html':
+ return $this->createHtmlRenderer();
+
+ case 'text':
+ return $this->createTextRenderer();
+
+ default:
+ return $this->createCustomRenderer();
+ }
+ }
+
+ /**
+ * @return \PHPMD\Renderer\XMLRenderer
+ */
+ protected function createXmlRenderer()
+ {
+ return new XMLRenderer();
+ }
+
+ /**
+ * @return \PHPMD\Renderer\XMLRenderer
+ */
+ protected function createTextRenderer()
+ {
+ return new TextRenderer();
+ }
+
+ /**
+ * @return \PHPMD\Renderer\HTMLRenderer
+ */
+ protected function createHtmlRenderer()
+ {
+ return new HTMLRenderer();
+ }
+
+ /**
+ * @return \PHPMD\AbstractRenderer
+ * @throws \InvalidArgumentException
+ */
+ protected function createCustomRenderer()
+ {
+ if ($this->reportFormat !== '') {
+ if (class_exists($this->reportFormat)) {
+ return new $this->reportFormat();
+ }
+
+ // Try to load a custom renderer
+ $fileName = strtr($this->reportFormat, '_', '/') . '.php';
+
+ $fileHandle = @fopen($fileName, 'r', true);
+ if (is_resource($fileHandle) === false) {
+ $message = 'Can\'t find the custom report class: '
+ . $this->reportFormat;
+ throw new \InvalidArgumentException($message, self::INPUT_ERROR);
+ }
+ @fclose($fileHandle);
+
+ include_once $fileName;
+
+ return new $this->reportFormat();
+ }
+ $message = 'Can\'t create report with format of ' . $this->reportFormat;
+ throw new \InvalidArgumentException($message, self::INPUT_ERROR);
+ }
+
+ /**
+ * Returns usage information for the PHPMD command line interface.
+ *
+ * @return string
+ */
+ public function usage()
+ {
+ return 'Mandatory arguments:' . \PHP_EOL .
+ '1) A php source code filename or directory. Can be a comma-' .
+ 'separated string' . \PHP_EOL .
+ '2) A report format' . \PHP_EOL .
+ '3) A ruleset filename or a comma-separated string of ruleset' .
+ 'filenames' . \PHP_EOL . \PHP_EOL .
+ 'Available formats: xml, text, html.' . \PHP_EOL .
+ 'Available rulesets: ' . implode(', ', $this->availableRuleSets) . '.' . \PHP_EOL . \PHP_EOL .
+ 'Optional arguments that may be put after the mandatory arguments:' .
+ \PHP_EOL .
+ '--minimumpriority: rule priority threshold; rules with lower ' .
+ 'priority than this will not be used' . \PHP_EOL .
+ '--reportfile: send report output to a file; default to STDOUT' .
+ \PHP_EOL .
+ '--suffixes: comma-separated string of valid source code ' .
+ 'filename extensions' . \PHP_EOL .
+ '--exclude: comma-separated string of patterns that are used to ' .
+ 'ignore directories' . \PHP_EOL .
+ '--strict: also report those nodes with a @SuppressWarnings ' .
+ 'annotation' . \PHP_EOL;
+ }
+
+ /**
+ * Logs a deprecated option to the current user interface.
+ *
+ * @param string $deprecatedName
+ * @param string $newName
+ * @return void
+ */
+ protected function logDeprecated($deprecatedName, $newName)
+ {
+ $message = sprintf(
+ 'The --%s option is deprecated, please use --%s instead.',
+ $deprecatedName,
+ $newName
+ );
+
+ fwrite(STDERR, $message . \PHP_EOL . \PHP_EOL);
+ }
+
+ /**
+ * This method takes the given input file, reads the newline separated paths
+ * from that file and creates a comma separated string of the file paths. If
+ * the given $inputFile not exists, this method will throw an
+ * exception.
+ *
+ * @param string $inputFile Specified input file name.
+ * @return string
+ * @throws \InvalidArgumentException If the specified input file does not exist.
+ * @since 1.1.0
+ */
+ protected function readInputFile($inputFile)
+ {
+ if (file_exists($inputFile)) {
+ return join(',', array_map('trim', file($inputFile)));
+ }
+ throw new \InvalidArgumentException("Input file '{$inputFile}' not exists.");
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/php/PHPMD/Writer/StreamWriter.php b/vendor/phpmd/phpmd/src/main/php/PHPMD/Writer/StreamWriter.php
new file mode 100644
index 0000000..862b0a2
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/php/PHPMD/Writer/StreamWriter.php
@@ -0,0 +1,110 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Writer;
+
+use PHPMD\AbstractWriter;
+
+/**
+ * This writer uses PHP's stream api as its output target.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+class StreamWriter extends AbstractWriter
+{
+ /**
+ * The stream resource handle
+ *
+ * @var resource
+ */
+ private $stream = null;
+
+ /**
+ * Constructs a new stream writer instance.
+ *
+ * @param resource|string $streamResourceOrUri
+ */
+ public function __construct($streamResourceOrUri)
+ {
+ if (is_resource($streamResourceOrUri) === true) {
+ $this->stream = $streamResourceOrUri;
+ } else {
+ $dirName = dirname($streamResourceOrUri);
+ if (file_exists($dirName) === false) {
+ mkdir($dirName);
+ }
+ if (file_exists($dirName) === false) {
+ $message = 'Cannot find output directory "' . $dirName . '".';
+ throw new \RuntimeException($message);
+ }
+
+ $this->stream = fopen($streamResourceOrUri, 'wb');
+ }
+ }
+
+ /**
+ * The dtor closes the open output resource.
+ */
+ public function __destruct()
+ {
+ if ($this->stream !== STDOUT && is_resource($this->stream) === true) {
+ @fclose($this->stream);
+ }
+ $this->stream = null;
+ }
+
+ /**
+ * Writes the given $data fragment to the wrapper output stream.
+ *
+ * @param string $data
+ * @return void
+ */
+ public function write($data)
+ {
+ fwrite($this->stream, $data);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/main/resources/rulesets/cleancode.xml b/vendor/phpmd/phpmd/src/main/resources/rulesets/cleancode.xml
new file mode 100644
index 0000000..882f05a
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/resources/rulesets/cleancode.xml
@@ -0,0 +1,97 @@
+
+
+
+
+
+The Clean Code ruleset contains rules that enforce a clean code base. This includes rules from SOLID and object calisthenics.
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
diff --git a/vendor/phpmd/phpmd/src/main/resources/rulesets/codesize.xml b/vendor/phpmd/phpmd/src/main/resources/rulesets/codesize.xml
new file mode 100644
index 0000000..e53f315
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/resources/rulesets/codesize.xml
@@ -0,0 +1,397 @@
+
+
+
+
+
+The Code Size Ruleset contains a collection of rules that find code size related problems.
+
+
+
+
+
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+The NPath complexity of a method is the number of acyclic execution paths through that method.
+A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+Violations of this rule usually indicate that the method is doing
+too much. Try to reduce the method size by creating helper methods and removing any copy/pasted code.
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+Long Class files are indications that the class may be trying to
+do too much. Try to break it down, and reduce the size to something
+manageable.
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+Long parameter lists can indicate that a new object should be created to
+wrap the numerous parameters. Basically, try to group the parameters together.
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+A large number of public methods and attributes declared in a class can indicate
+the class may need to be broken up as increased effort will be required to
+thoroughly test it.
+
+ 3
+
+
+
+
+
+
+
+
+
+
+Classes that have too many fields could be redesigned to have fewer fields,
+possibly through some nested object grouping of some of the information. For
+example, a class with city/state/zip fields could instead have one Address
+field.
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+
+
+
+
+
+
+
+
+
+ 3
+
+
+
+
+
+
+
+
diff --git a/vendor/phpmd/phpmd/src/main/resources/rulesets/controversial.xml b/vendor/phpmd/phpmd/src/main/resources/rulesets/controversial.xml
new file mode 100644
index 0000000..a2373a6
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/resources/rulesets/controversial.xml
@@ -0,0 +1,149 @@
+
+
+
+
+
+This ruleset contains a collection of controversial rules.
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
diff --git a/vendor/phpmd/phpmd/src/main/resources/rulesets/design.xml b/vendor/phpmd/phpmd/src/main/resources/rulesets/design.xml
new file mode 100644
index 0000000..9de1a30
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/resources/rulesets/design.xml
@@ -0,0 +1,193 @@
+
+
+
+
+
+The Code Size Ruleset contains a collection of rules that find software design related problems.
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ 2
+
+
+
+
+
+
+
+
+
+
+ 2
+
+
+
+
+
+
+
+
+
+
+ 2
+
+
+
+
+
+
+
+
diff --git a/vendor/phpmd/phpmd/src/main/resources/rulesets/naming.xml b/vendor/phpmd/phpmd/src/main/resources/rulesets/naming.xml
new file mode 100644
index 0000000..85e6f95
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/resources/rulesets/naming.xml
@@ -0,0 +1,362 @@
+
+
+
+The Naming Ruleset contains a collection of rules about names - too long, too short, and so forth.
+
+
+
+
+Detects when a field, local, or parameter has a very short name.
+
+ 3
+
+
+
+
+
+ q; // VIOLATION - Local
+ for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
+ $r += $this->q;
+ }
+ }
+}
+ ]]>
+
+
+
+
+
+Detects when a field, formal or local variable is declared with a long name.
+
+ 3
+
+
+
+
+
+
+
+
+
+
+Detects when very short method names are used.
+
+ 3
+
+
+
+
+
+
+
+
+
+
+A constructor method should not have the same name as the enclosing class, consider
+to use the PHP 5 __construct method.
+
+ 3
+
+
+
+
+
+
+
+Class/Interface constant nanmes should always be defined in uppercase.
+
+ 4
+
+
+
+
+
+
+
+
+Looks for methods named 'getX()' with 'boolean' as the return type. The convention
+is to name these methods 'isX()' or 'hasX()'.
+
+ 4
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/phpmd/phpmd/src/main/resources/rulesets/unusedcode.xml b/vendor/phpmd/phpmd/src/main/resources/rulesets/unusedcode.xml
new file mode 100644
index 0000000..e5d080e
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/main/resources/rulesets/unusedcode.xml
@@ -0,0 +1,99 @@
+
+
+
+
+The Unused Code Ruleset contains a collection of rules that find unused code.
+
+
+
+
+Detects when a private field is declared and/or assigned a value, but not used.
+
+ 3
+
+j++;
+ }
+}
+]]>
+
+
+
+
+
+Detects when a local variable is declared and/or assigned, but not used.
+
+ 3
+
+
+
+
+
+
+
+Unused Private Method detects when a private method is declared but is unused.
+
+ 3
+
+
+
+
+
+
+
+Avoid passing parameters to methods or constructors and then not using those parameters.
+
+ 3
+
+
+
+
+
+
diff --git a/vendor/phpmd/phpmd/src/site/docx/changes.xml b/vendor/phpmd/phpmd/src/site/docx/changes.xml
new file mode 100644
index 0000000..db23b59
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/docx/changes.xml
@@ -0,0 +1,458 @@
+
+
+
+
+ PHPMD
+ Manuel Pichler
+
+
+
+
+
+ Missing version number in composer.json file replaced with build.properties version number.
+
+
+
+
+ Fixed IRC link
+
+
+ Removed lie regarding PEAR
+
+
+ Tweak with CamelCase matching inheritDoc
+
+
+ Documentation changes, fixed typo in PHPMD's online documentation.
+
+
+ Missing composer install documentation
+
+
+ Updating composer.json
+
+
+ Superglobals are not named in CamelCase
+
+
+ Fix a typo. These are the 'design rules' not the 'code size rules
+
+
+
+
+ 404 error on your website release area
+
+
+ --version argument doesn't return version
+
+
+ exceptions for CamelCaseVariableName and UnusedLocalVariable
+
+
+
+
+ Fix for unused variables rules when handling namespace compact()
+
+
+ Added PHP 5.6 and HHVM to travis.yml
+
+
+ Fix [Naming]: Trait can have method same as trait's name
+
+
+ Allow a single underscore at the beginning
+
+
+ Quick change to add support for exclude-pattern in a ruleset
+
+
+ --exclude not working
+
+
+ Get XML contents before parsing
+
+
+
+
+
+ Allow multiple report files
+
+ Now it is possible to render multiple report files during a single
+ PHPMD run, just add:
+
+ --reportfile-xml report.xml
+ --reportfile-html report.html
+ --reportfile-text report.txt
+
+ to the PHP command line call.
+
+
+ UnusedLocalVariable fix for compact handling in Symfony2
+
+
+ Changelog with old releases and invalid dates removed.
+
+
+ PDepend 2.0 support
+
+
+ Add: New parameter 'ignore-whitespace' to LongClass and LongMethod rules
+
+
+
+
+ Added support for short variable name exceptions
+
+
+ Show available formats and rulesets
+
+
+ Fix: PHP Fatal error: Call to a member function isInstanceOf() on a non-object
+
+
+ Fix error when using entire ruleset "Naming"
+
+
+ (tiny) documentation typo fix
+
+
+
+
+
+
+ Fix UnusedLocalVariable to recognize compact function.
+
+
+ Skip "unused formal parameter" checking when method signature has been annotated as inherited using @inheritdoc.
+
+
+ package.xml date invalid: 2011/02/12.
+
+
+
+
+
+ Add getStringProperty($name) to AbstractRule.php.
+
+
+ Update README.rst on cmd line arguments.
+
+
+ Fixed handling of traits.
+
+
+ Added getStringProperty and rule-setting to change TooManyMethods ignore Regexp.
+
+
+ Provide PHPMD as composer dependency on packagist.org.
+
+
+
+
+
+ Fixed fatal error due to bug in memory_limit modification code.
+
+
+
+
+ Alert disable memory_limit
+
+
+
+
+
+ Fatal: Maximum function nesting level reached in ASTNode.php:425
+
+
+
+
+
+
+
+
+
+ False detection of unused variable
+
+
+
+ PHPMD should exclude unused parameters from inherited methods
+
+
+
+ Move PHPUnit annotations from method doc block to class doc block
+
+
+ PHP_Depend exceptions are silently ignored
+
+
+ Added Superglobals rule in Controversial
+
+
+ Added rules to check CamelCase
+
+
+
+
+
+ Controverial PHPMD rule that checks if the project under
+ test does not utilize PHP's super globals.
+
+
+ PHPMD needs a *strict* mode.
+
+
+
+
+
+
+ Bug in PHPMD's package manifest file.
+
+
+
+
+
+
+ Add rule for PHP's goto statement.
+
+
+ Implement rule for CBO metric.
+
+
+ Replace deprecated PHPUnit features in test suite.
+
+
+ LongVariable rule should not apply on private properties.
+
+
+
+
+
+ The include_path does not match with PHP_Depend's new directory
+ layout.
+
+
+ Clear temporary resources after a test has finished.
+
+
+
+
+
+ New source layout that follows maven's conventions for the
+ directory structure of a product.
+
+
+ Switched to PHPUnit 3.5.x as testing framework
+
+
+ Clear temporary resources after a test has finished.
+
+
+
+
+
+ Improved help text for the PHPMD command line. Thanks to Volker
+ Dusch for this contribution. https://github.com/edorian/phpmd
+
+
+ PHPMD is now compatible with next PHP_Depend release 0.10.0
+
+
+
+
+
+ @SupressWarnings annotation does not work for
+ UnusedPrivateMethod rule.
+
+
+ Stream Writer closes STDOUT.
+
+
+ PEAR package.xml does not @php_bin@ and @bin_dir@ on phpmd.bat.
+
+
+
+
+
+ Implement Depth Of Inheritance Rule.
+
+
+ Implement Number of Children Rule.
+
+
+ Implement Rule that detects the usage of PHP's eval() function.
+
+
+ Implement Rule that detects the usage of PHP's exit()
+ expression.
+
+
+ New option --version added to PHPMD's command line interface.
+
+
+ Names of several command line options unified with PHPUnit and
+ PHPCPD. The --ignore option is now --exclude and --extensions
+ is now --suffixes.
+
+
+ Unused local variable and unused parameter rule produces false
+ positives.
+
+
+
+
+
+ Add rule for the Weighted Methods Per Class Metric.
+
+
+ Alternative syntax for properties in rule set files implemented.
+
+
+ Do not return success exit code when PHPMD detects rule
+ violations in analyzed source code.
+
+
+ Super globals were detected as unused variables.
+
+
+ Local static variables were treated as unused variables.
+
+
+
+
+
+ E_NOTICE bug fix in naming rule.
+
+
+
+
+
+ Add support for "Suppress warnings" annotations.
+
+
+ Support for exclude element in rule-set files added.
+
+
+ Implement naming rules, e.g. short variables, parameter etc.
+
+
+ PHP Tokenizer required but no error when installing.
+
+
+ UnusedLocalVariable ruleset incorrectly flags variables as
+ unused when used inside double quoted string.
+
+
+ ExcessivePublicCount rule should utilize PHP_Depend's cis
+ metric.
+
+
+ ExcessivePublicCount rule is never used.
+
+
+
+
+
+ Small change to the command line interface, which did not return
+ an exit code != 0 when an exception occured.
+
+
+
+
+
+ Allow multiple input files/directories.
+
+
+ Additional unit tests for multiple components added.
+
+
+
+
+
+ Support for unused code fules completed.
+
+
+ Text renderer implemented.
+
+
+ Implement a html renderer.
+
+
+ Several performance improvements.
+
+
+
+
+
+
diff --git a/vendor/phpmd/phpmd/src/site/resources/config/authors.ini b/vendor/phpmd/phpmd/src/site/resources/config/authors.ini
new file mode 100644
index 0000000..d3ca3ce
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/config/authors.ini
@@ -0,0 +1,14 @@
+[mapping]
+
+# The metadata handlers may provide different author names why mean the same
+# author. For this you may define a mapping of author names.
+name[pichler] = Manuel Pichler
+name[mapi] = Manuel Pichler
+name[manu] = Manuel Pichler
+
+# It is possible to assiciate a mail address to the author name which may be
+# used by some display handlers.
+mail[pichler] = mapi@pdepend.org
+mail[mapi] = mapi@pdepend.org
+mail[manu] = mapi@pdepend.org
+
diff --git a/vendor/phpmd/phpmd/src/site/resources/config/binaries.ini b/vendor/phpmd/phpmd/src/site/resources/config/binaries.ini
new file mode 100644
index 0000000..a816fab
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/config/binaries.ini
@@ -0,0 +1,41 @@
+# Location definitions for all binaries, required by WCV. Normally the default
+# should just work fine, which means, that the binary with the requested name
+# is available in your $PATH. If the binary is only available at another
+# location, or even has another name, you may specify an option for this here.
+#
+# You may of course specify the full absolute path to the binary, isntead of
+# just its name, if it is not in $PATH.
+
+[core]
+
+# The SVN binary is required by the SVN metadata handler
+#svn=/usr/bin/svn
+
+# The RST content handler for now uses the python docutils package to transform
+# the RST documents into XML for further processing inside of WCV. These
+# binaries may differ in name on some systems like fedora, or ubuntu, where the
+# file extension is removed.
+rst2xml=rst2xml
+#rst2newlatex=rst2newlatex.py
+
+# For all XSLT modifications for now we use the binary xsltproc from the
+# libxml2 distribution..
+#xsltproc=xsltproc
+
+[search]
+
+# The default search uses glimspe as an indexer and search tool. Nearly each
+# distribution offers glimpse as a package, and you need two binaries from this
+# package.
+glimpse=glimpse
+glimpseindex=glimpseindex
+
+[gallery]
+
+# For the resizing and image manipulation the pecl/iMagick is used, which does
+# not ofer support for all maker specific relevant image information (which are
+# not all available as EXIF headers). To extract those and similar data the
+# perl software exiftool is used, which should also be available as apackage in
+# most distribvutions.
+#exiftool=exiftool
+
diff --git a/vendor/phpmd/phpmd/src/site/resources/config/content/blog.ini b/vendor/phpmd/phpmd/src/site/resources/config/content/blog.ini
new file mode 100644
index 0000000..6cb5659
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/config/content/blog.ini
@@ -0,0 +1,27 @@
+[blog]
+
+# Blog post handlers
+handler[] = wcvIndexerFileBlogPostRst
+
+# Number of entries per page
+entries=10
+
+# Akisment key for comment spam checking
+# You may get one signing up on wordpress.com
+akismet_key=
+
+# Absolut path to page notifying the user, that his comment has been rated as
+# spam
+spamUrl=/spam.html
+
+# Optionally you may provide an URL (including auth information) to some xmlrpc
+# spam collecting service, which understands the XMLRPC protocol specification
+# supported by WCV and defined at: !URL!
+#xmlrpc=http://norro.de/Spam/Pot1
+
+# Absolut path to page containing XML repsonse for trackback spammers
+trackbackSpamUrl=/trackback_spam.xml
+# Absolut path to page containing XML repsonse for trackback spammers
+trackbackErrorUrl=/trackback_error.xml
+# Absolut path to page containing XML repsonse for trackback spammers
+trackbackSuccessUrl=/trackback_success.xml
diff --git a/vendor/phpmd/phpmd/src/site/resources/config/display/sitemap.ini b/vendor/phpmd/phpmd/src/site/resources/config/display/sitemap.ini
new file mode 100644
index 0000000..0ed943d
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/config/display/sitemap.ini
@@ -0,0 +1,37 @@
+[generator]
+
+# Calculate change frequency from log in versioning handler. When versioning
+# metadata handler takes some time to fetch the log (like svn does) this may
+# result in a very slow sitemap generation.
+changefreq=false
+
+[priorities]
+
+# Flag wheather to include priority flags in the generated sitemap. Either
+# "true" or "false". Defaults to "false".
+include=true
+
+# Format priorities.
+#
+# Defines an additional factor (float value between 0 and 1) for each format to
+# modify the ranking of a site. Defaults to .5 if not set.
+format[html]=1
+format[pdf]=.6
+format[rss]=.6
+format[txt]=.3
+format[rdf]=.1
+format[sitemap]=0
+
+# Node priorities
+#
+# You may specify a higher priority for some spcial nodes, which should gain
+# more importance. You may use factors bigger then 1 here.
+node[/description]=2
+node[/spam]=0
+
+[pingback]
+
+# Searchengines to ping with regenerated sitemap
+#searchengine[]=http://google.com/webmasters/sitemaps/ping
+#searchengine[]=http://search.yahooapis.com/SiteExplorerService/V1/ping
+searchengine[]=http://webmaster.live.com/ping.aspx
diff --git a/vendor/phpmd/phpmd/src/site/resources/config/handlers.ini b/vendor/phpmd/phpmd/src/site/resources/config/handlers.ini
new file mode 100644
index 0000000..2352397
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/config/handlers.ini
@@ -0,0 +1,50 @@
+[indexers]
+
+# The indexer handlers define the mechanism used to handle the content of a
+# directory. The top most handler has the highest priority.
+
+handler[]=wcvIndexerGallery
+handler[]=wcvIndexerBlog
+handler[]=wcvIndexerSearch
+handler[]=wcvIndexerXml
+handler[]=wcvIndexerDirectory
+
+[file]
+
+# The file handlers describe how to handle a file. The top most handler has
+# the highest priotity.
+
+handler[]=wcvIndexerFileHtml
+handler[]=wcvIndexerFileRst
+handler[]=wcvIndexerFileStatic
+
+[metadata]
+
+# The metadata handlers describe how to receive metadata associated with
+# files. The top most handler has the highest priotity.
+
+handler[]=wcvMetadataSvn
+handler[]=wcvMetadataFilesystem
+
+[display]
+
+# The list of display handlers define a decorator used to fulfill the users
+# request for a file. The default decorator is used as a fallback when no
+# other handler was defined for the requested file extension.
+
+handler[rdf]=wcvDisplayRdf
+handler[html]=wcvDisplayHtml
+handler[txt]=wcvDisplayText
+#handler[pdf]=wcvDisplayPdf
+handler[rss]=wcvDisplayRss
+handler[sitemap]=wcvDisplaySitemap
+
+# Pseudo handler to force dynamic contents. Will issue a redirect to static
+# content and not display anything.
+
+handler[dyn]=wcvDisplayRedirect
+
+# Deafult to binary handeler which will just passthru the content with setting
+# the correct mime type.
+
+default=wcvDisplayBinary
diff --git a/vendor/phpmd/phpmd/src/site/resources/config/metadata.ini b/vendor/phpmd/phpmd/src/site/resources/config/metadata.ini
new file mode 100644
index 0000000..27ad33b
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/config/metadata.ini
@@ -0,0 +1,19 @@
+[base]
+
+# Title of the webpage
+title=PHPMD - PHP Mess Detector
+
+# Website description
+description=PHPMD - Project mess detection for your PHP projects..
+
+# Website tags, sperated by commas
+tags=PHPMD, PMD, Project Mess Detection, Design, Maintenance, Quality Assurence, Violations, Reporting
+
+# Basic language of website.
+# Maybe could be ovirwritten by content handlers later
+language=en
+
+# Default license of the displayed content. May be overwritten by the content
+# handler with more appropriate values
+license=CC by-nc-sa
+
diff --git a/vendor/phpmd/phpmd/src/site/resources/config/site.ini b/vendor/phpmd/phpmd/src/site/resources/config/site.ini
new file mode 100644
index 0000000..c3cd6f9
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/config/site.ini
@@ -0,0 +1,76 @@
+[base]
+
+# Base path to content repository
+#
+# If you want to use a relative URL, this is evaluated relative from the
+# position of the index.php in your directory tree.
+content=../content
+
+# Default display handler
+# Which display handler to use if none was specified - also affects the
+# display handler used to display a request to /
+default=html
+
+# Base URL for webpage
+#
+# This one is autodetected from your server variables, of not set. The
+# autodetection does not work with https for now, and also does not work, when
+# the caches are regenerated from CLI.
+url=http://phpmd.org/
+
+# Classes to notify with a static call to ::postUpdate() after cache
+# regeneration
+# The class should implement the interface wcvContentPostUpdate
+class[]=wcvContentSitemap
+
+# Optional template override paths to use custom templates
+override[]=override/
+
+# To switch on the debug mode set this to 1
+debug = 1
+
+# List of files, which are included after the base initialization.
+#
+# This may be used to add custom modules / classes to WCV. You may want to add
+# a autoload function in this init script, or just include your required
+# classes.
+#
+# All pathes must be given relative to the WCV installation base
+#scripts[]=external/myModule/init.php
+
+[cache]
+
+# Cache settings
+#
+# The cache setting is a bitmask of the single cache entries below. -1 will
+# always cache everything. To explicitely cache tree and content you may use 3:
+# 1 | 2 = 3
+#
+# 1 = Cache content tree
+# 2 = Cache generated content
+types = -1
+
+# When deleting files in the htdocs/ folder exclude the directories listed here
+# from deletion. Ensure you add directories here, when uploading some stuff
+# into you htdocs/ folder.
+exclude[]=.svn
+exclude[]=index.php
+exclude[]=styles
+exclude[]=scripts
+exclude[]=images
+exclude[]=robots.txt
+
+[mail]
+
+# General flag indicating wheather to send mail. May be ignored by modules of
+# course.
+send=yes
+
+# Sender address for mails from WCV
+sender=no-response@wcv.org
+
+# Receiver, who should receive mails
+reporting=mail@kore-nordmann.de
+
+# Subject for mails
+subject=[WCV] - %s
diff --git a/vendor/phpmd/phpmd/src/site/resources/override/html/footer.ezt b/vendor/phpmd/phpmd/src/site/resources/override/html/footer.ezt
new file mode 100644
index 0000000..c77df4d
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/override/html/footer.ezt
@@ -0,0 +1,36 @@
+{use $content}
+
diff --git a/vendor/phpmd/phpmd/src/site/resources/override/html/formats.ezt b/vendor/phpmd/phpmd/src/site/resources/override/html/formats.ezt
new file mode 100644
index 0000000..d2f05cd
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/override/html/formats.ezt
@@ -0,0 +1,21 @@
+{use $content}
+
diff --git a/vendor/phpmd/phpmd/src/site/resources/override/html/release.ezt b/vendor/phpmd/phpmd/src/site/resources/override/html/release.ezt
new file mode 100644
index 0000000..eeab029
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/override/html/release.ezt
@@ -0,0 +1,6 @@
+
Get your copy
+
+
+
+
+Download PHPMD
diff --git a/vendor/phpmd/phpmd/src/site/resources/web/css/print.css b/vendor/phpmd/phpmd/src/site/resources/web/css/print.css
new file mode 100644
index 0000000..59538d7
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/web/css/print.css
@@ -0,0 +1,36 @@
+body {
+ font-size: 12px;
+ font-family: sans-serif;
+}
+
+a {
+ color: inherit;
+}
+
+p {
+ font-size: 12px;
+ font-family: sans-serif;
+ color: #000000;
+ margin-bottom: 1em;
+}
+
+img {
+ border: none;
+}
+
+code {
+ white-space: pre;
+ display: block;
+}
+
+div.footer {
+ margin-top: 10px;
+ font-size: 10px;
+}
+
+/* Hide unimportant stuff */
+fieldset,
+div.changelog,
+ul.navigation {
+ display: none;
+}
diff --git a/vendor/phpmd/phpmd/src/site/resources/web/css/screen.css b/vendor/phpmd/phpmd/src/site/resources/web/css/screen.css
new file mode 100644
index 0000000..4d8382d
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/resources/web/css/screen.css
@@ -0,0 +1,251 @@
+@charset "UTF-8";
+
+* {
+ border: 0;
+ padding: 0;
+ margin: 0;
+
+ text-decoration: none;
+
+ list-style: none;
+ list-style-image: none;
+ list-style-position: outside;
+}
+
+html {
+ background-color: #fff;
+
+ font-size: 99.4%;
+}
+
+body {
+ background-color: #fff;
+
+
+ font-size: 1.1em;
+ line-height: 1.4em;
+ font-family: Arial, Verdana, Helvetica, Geneva, sans-serif;
+ color: #2e3436;
+
+ margin: 0 auto;
+ width: 55em;
+}
+
+h1, h2, h3, h4 {
+ font-family: Verdana, Arial, Helvetica, Geneva, sans-serif;
+}
+
+h1 {
+ background: #fff url(../images/logo.png) 1em 40px no-repeat;
+
+ border-bottom: 1px solid #204a87;
+
+ text-indent: -9999px;
+
+ margin: 0;
+ height: 150px;
+}
+
+h1 a {
+ display: block;
+
+ margin-left: 1em;
+
+ height: 120px;
+ width: 250px;
+}
+
+h2 {
+ font-size: 1.5em;
+ font-weight: normal;
+ color: #204a87;
+
+ margin-top: 1.5em;
+ margin-bottom: 0.5em;
+}
+
+h3 {
+ font-size: 1.3em;
+ font-weight: normal;
+ font-style: italic;
+ color: #555753;
+
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+}
+
+a {
+ color: #204a87;
+}
+
+p {
+ text-align: justify;
+ margin-bottom: 1.0em;
+}
+
+blockquote p {
+ font-weight: 0.8em;
+ font-style: italic;
+
+ padding-left: 2em;
+}
+
+code {
+ font-size: 1.1em;
+ line-height: 1.4em;
+
+ white-space: pre;
+
+ margin-bottom: 1.0em;
+}
+
+code.block {
+ background: #eeeeec;
+
+ font-size: 1.05em;
+
+ padding: 0.2em 0.5em;
+ display: block;
+}
+
+code.inline {
+ font-style: italic;
+}
+
+table {
+ border-collapse: separate;
+
+ width: 100%;
+
+ margin-bottom: 0.3em;
+}
+
+table td, table th {
+ font-size: 0.9em;
+ padding-left: 0.3em;
+ padding-right: 1em;
+}
+
+table th {
+ background-color: #babdb6;
+
+ text-align: left;
+ color: #fff;
+
+ white-space: nowrap;
+}
+
+table td {
+ background-color: #eeeeec;
+}
+
+#content {
+ padding-left: 2em;
+
+ float: left;
+ width: 37em;
+}
+
+#content a {
+ text-decoration: underline;
+}
+
+#content ul, #content ol {
+ margin-left: 2em;
+ margin-bottom: 1.2em;
+}
+
+#content li p {
+ margin-bottom: 0.5em;
+}
+
+#content ul li {
+ list-style: circle;
+}
+
+#content ol li {
+ list-style: decimal;
+}
+
+#navigation {
+ margin-left: 3em;
+
+ float: left;
+}
+
+#navigation a {
+ font-style: italic;
+}
+#navigation a:hover {
+ text-decoration: underline;
+}
+
+#navigation h2 {
+ color: #555753;
+}
+
+#navigation ul ul {
+ padding-left: 1em;
+}
+
+#footer {
+ border-top: 1px solid #204a87;
+ font-size: 0.8em;
+
+ padding-left: 2.6em;
+ margin-bottom: 1em;
+
+ clear: both;
+}
+
+#footer .revision {
+ cursor: help;
+ display: inline;
+ position: relative;
+}
+
+#footer .revision ul {
+ display: none;
+}
+
+#footer .revision:hover ul {
+ display: block;
+
+ position: absolute;
+ left: -300px;
+ bottom: 25px;
+ width: 400px;
+
+ list-style-type: circle;
+ margin: 0px;
+ padding: 2px 2px 2px 15px;
+
+ border: 1px solid #555753;
+ font-size: 0.8em;
+
+ background-color: #fff;
+}
+
+#footer .revision ul li {
+ margin: 1px 0px;
+ padding: 0px;
+}
+
+#footer .revision ul li p {
+ margin: 1px 0px;
+ padding: 0px;
+}
+
+#formats {
+ text-align: right;
+ color: #babdb6;
+
+ position: absolute;
+ top: 128px;
+
+ width: 55em;
+}
+#formats a {
+ font-size: 0.5em;
+ color: #babdb6;
+}
diff --git a/vendor/phpmd/phpmd/src/site/resources/web/favicon.ico b/vendor/phpmd/phpmd/src/site/resources/web/favicon.ico
new file mode 100644
index 0000000..e193e7c
Binary files /dev/null and b/vendor/phpmd/phpmd/src/site/resources/web/favicon.ico differ
diff --git a/vendor/phpmd/phpmd/src/site/resources/web/images/box.png b/vendor/phpmd/phpmd/src/site/resources/web/images/box.png
new file mode 100644
index 0000000..e0f2ad4
Binary files /dev/null and b/vendor/phpmd/phpmd/src/site/resources/web/images/box.png differ
diff --git a/vendor/phpmd/phpmd/src/site/resources/web/images/logo.png b/vendor/phpmd/phpmd/src/site/resources/web/images/logo.png
new file mode 100644
index 0000000..99d0bbd
Binary files /dev/null and b/vendor/phpmd/phpmd/src/site/resources/web/images/logo.png differ
diff --git a/vendor/phpmd/phpmd/src/site/rst/.index.xml b/vendor/phpmd/phpmd/src/site/rst/.index.xml
new file mode 100644
index 0000000..8108fa9
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/.index.xml
@@ -0,0 +1,32 @@
+
+
+
+ About
+ about.rst
+
+
+ Documentation
+ documentation/
+
+
+ Rules
+ rules/
+
+
+ Download
+ download/
+
+
+ People behind
+ people-behind.rst
+
+
+ Support & Contact
+ support/
+
+
+
+ robots.txt
+
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/about.rst b/vendor/phpmd/phpmd/src/site/rst/about.rst
new file mode 100644
index 0000000..f286920
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/about.rst
@@ -0,0 +1,32 @@
+=========================
+PHPMD - PHP Mess Detector
+=========================
+
+This is the project site of *PHPMD*. It is a spin-off project of
+`PHP Depend`__ and aims to be a PHP equivalent of the well known
+Java tool `PMD`__. PHPMD can be seen as an user friendly and easy
+to configure frontend for the raw metrics measured by PHP Depend.
+
+__ http://pdepend.org
+__ http://pmd.sourceforge.net
+
+What PHPMD does is: It takes a given PHP source code base and look
+for several potential problems within that source. These problems
+can be things like:
+
+- Possible bugs
+- Suboptimal code
+- Overcomplicated expressions
+- Unused parameters, methods, properties
+
+PHPMD is a young project and so it only provides a limited set of
+pre defined rules, compared with it's brother PMD, that detect code
+smells and possible errors within the analyzed source code. Checkout
+the `rules section`__ to learn more about all implemented rules.
+
+__ /rules/index.html
+
+Recent Releases
+===============
+
+.. include:: download/release/parts/latest.rst
diff --git a/vendor/phpmd/phpmd/src/site/rst/documentation/.index.xml b/vendor/phpmd/phpmd/src/site/rst/documentation/.index.xml
new file mode 100644
index 0000000..f797382
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/documentation/.index.xml
@@ -0,0 +1,23 @@
+
+
+
+ index.rst
+
+
+ Suppress warnings
+ suppress-warnings.rst
+
+
+ Writing a PHPMD Rule
+ writing-a-phpmd-rule.rst
+
+
+ Creating a rule set
+ creating-a-ruleset.rst
+
+
+ Ant task usage
+ ant-task.rst
+
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/documentation/ant-task.rst b/vendor/phpmd/phpmd/src/site/rst/documentation/ant-task.rst
new file mode 100644
index 0000000..108d031
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/documentation/ant-task.rst
@@ -0,0 +1,115 @@
+====================
+PHPMD ant task usage
+====================
+
+To ease the usage of PHPMD in your build process we provide an `ant task`__
+that integrates PHPMD into the `ant`__ build tool. The ant task jar file can
+be found in the `download`__ section of the PHPMD homepage.
+
+__ http://ant.apache.org/manual/targets.html
+__ http://ant.apache.org/
+__ /download/extensions#ant-task
+
+To make the task available in your ant build file you have two options.
+The first option is to copy or link the ``*.jar`` file into the ``lib``
+directory of your ant installation. ::
+
+ mapi@arwen ~ $ wget \
+ http://phpmd.org/download/extensions/ant-phpmd-0.1.0.jar
+ ...
+ mapi@arwen ~ $ ln -s ~/ant-phpmd-0.1.0.jar /opt/ant/lib/ant-phpmd.jar
+
+The second option is to call ant with the command line switch ``-lib`` ::
+
+ mapi@arwen ~ $ ant -lib ant-phpmd-0.1.0.jar
+
+
+Now we can start using PHPMD in our ant ``build.xml`` file by adding
+a task definition that informs ant about the new task and registers
+it with a custom identifier. ::
+
+
+
+
+
+
+
+
+Now the PHPMD task can be called through an xml element named ````
+in this build: ::
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Parameters
+==========
+
+The following attributes can be defined on the PHPMD task xml-element.
+
+===================== ========================================================================================================================= ================================================
+ Attribute Description Required
+===================== ========================================================================================================================= ================================================
+ rulesetfiles A comma delimited list of ruleset files ('rulesets/basic.xml,rulesets/design.xml') or identifiers of build-in rulesets. Yes, unless the ruleset nested element is used
+ failonerror Whether or not to fail the build if any errors occur while processing the files No
+ failOnRuleViolation Whether or not to fail the build if PHPMD finds any problems No
+ minimumPriority The rule priority threshold; rules with lower priority than they will not be used No
+===================== ========================================================================================================================= ================================================
+
+Nested xml elements
+===================
+
+The ```` specifies the format of and the output file to
+which the report is written.
+
+**Parameters**
+
+=========== =================================================================== ==========
+ Attribute Description Required
+=========== =================================================================== ==========
+ format The report output format. Supported formats are xml,html and text. Yes
+ toFile A filename into which the report is written Yes
+=========== =================================================================== ==========
+
+The ```` xml element is another way to specify rulesets. Here
+is a modified version of the previous example: ::
+
+
+
+
+ unusedcode
+ codesize
+
+
+
+
+
+Postprocessing the report file with XSLT
+========================================
+
+There are several XSLT scripts which can be used to transform the XML
+report into some nice html pages. To do this, make sure you use the
+XML formatter in the PHPMD task invocation, i.e.: ::
+
+
+
+Then, after the end of the PHPMD task, do this: ::
+
+
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/documentation/creating-a-ruleset.rst b/vendor/phpmd/phpmd/src/site/rst/documentation/creating-a-ruleset.rst
new file mode 100755
index 0000000..c4bd7aa
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/documentation/creating-a-ruleset.rst
@@ -0,0 +1,197 @@
+==============================
+Howto create a custom rule set
+==============================
+
+If you would like to only pick some of the rules that come with PHPMD and
+you want to customize some of the pre defined thresholds, you can do this
+by creating your own rule set file that references a custom collection of
+rules with an individual configuration.
+
+Starting with an empty ruleset.xml file
+=======================================
+
+The simpliest way to start with a new rule set is to copy one of the
+existing files and remove all the rule-tags from the document body.
+Otherwise you can use the following example as a template for your own
+rule set file. You should change the content of the ``@name`` attribute
+and ```` element to something that describes the purpose
+of this set. ::
+
+
+
+
+ My custom rule set that checks my code...
+
+
+
+Adding rule references to the new ruleset.xml file
+==================================================
+
+The first thing we would like to do is to add all `unused code`__ rules
+to the new rule set file. This can simply be done with a ````
+element that references the entire `unused code`__ rule set that comes
+with PHPMD.
+
+__ /rules/unusedcode.html
+__ /rules/unusedcode.html
+
+::
+
+
+
+
+ My custom rule set that checks my code...
+
+
+
+
+
+
+That's it. Now the custom rule set applies all `unused code`__ rules
+against the analyzed source code.
+
+__ /rules/unusedcode.html
+
+We would also like to use the `cyclomatic complexity`__ rule from the
+existing `codesize`__ set in our custom rule set. To achieve this we can
+reuse the same syntax with a ```` element and a ``@ref`` attribute.
+
+__ /rules/codesize.html#cyclomaticcomplexity
+__ /rules/codesize.html
+
+::
+
+
+
+
+ My custom rule set that checks my code...
+
+
+
+
+
+
+
+
+
+Now that the new rule set uses the `cyclomatic complexity`__ rule we would
+also like to customize some of the rule's properties. First we will
+increase the rule's priority to the highest possible priority value ``1``
+and we also decrease the threshold when the rule reports a violation. This
+customization can be done with same xml elements that are used to configure
+the original rule, so that you can take a look at one of the original rule
+set file.
+
+__ /rules/codesize.html#cyclomaticcomplexity
+
+::
+
+
+
+
+ My custom rule set that checks my code...
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+You should know that PHPMD handles all custom settings additive. This
+means that PHPMD keeps the original configuration for every setting that
+isn't customized in a rule reference.
+
+Excluding rules from a rule set
+===============================
+
+Finally we would like to reuse the `naming`__ rule set of PHPMD. But we
+don't like the two variable naming rules, so that we must exclude them
+from out rule set file. This exclusion can be achieved by declaring an
+```` element within the rule reference. This element has an
+attribute ``@name`` which specifies the name of the excluded rule.
+
+__ /rules/naming.html
+
+
+::
+
+
+
+
+ My custom rule set that checks my code...
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+Conclusion
+==========
+
+With PHPMD's rule set syntax it is possible to customize all aspects of
+rules for your own needs and you can reuse every existing rule set xml file
+in your own set. You should take a look at PHPMD's rule `documentation`__
+if it happens that you don't know what rules exist or you don't know
+exactly, which settings are available for one rule, while you create your
+own set of rules. Another good source of information are the rule set
+`files`__ that are shipped with PHPMD.
+
+__ /rules/
+__ http://tracker.phpmd.org/php_mess_detector/browse_code/view/rulesets/
diff --git a/vendor/phpmd/phpmd/src/site/rst/documentation/index.rst b/vendor/phpmd/phpmd/src/site/rst/documentation/index.rst
new file mode 100644
index 0000000..a654f48
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/documentation/index.rst
@@ -0,0 +1,109 @@
+==================
+Command line usage
+==================
+
+Type phpmd [filename|directory] [report format] [ruleset file], i.e: ::
+
+ mapi@arwen ~ $ phpmd PHP/Depend/DbusUI/ xml rulesets/codesize.xml
+
+
+
+
+ This class has too many methods, consider refactoring it.
+
+
+
+
+You can pass a file name or a directory name containing PHP source
+code to PHPMD.
+
+The PHPMD Phar distribution includes the rule set files inside
+its archive, even if the "rulesets/codesize.xml" parameter above looks
+like a filesystem reference.
+
+Command line options
+====================
+
+- Notice that the default output is in XML, so you can redirect it to
+ a file and XSLT it or whatever
+
+- You can also use shortened names to refer to the built-in rule sets,
+ like this: ::
+
+ phpmd PHP/Depend/DbusUI/ xml codesize
+
+- The command line interface also accepts the following optional arguments:
+
+ - ``--minimumpriority`` - The rule priority threshold; rules with lower
+ priority than they will not be used.
+
+ - ``--reportfile`` - Sends the report output to the specified file,
+ instead of the default output target ``STDOUT``.
+
+ - ``--suffixes`` - Comma-separated string of valid source code filename
+ extensions.
+
+ - ``--exclude`` - Comma-separated string of patterns that are used to ignore
+ directories.
+
+ - ``--strict`` - Also report those nodes with a @SuppressWarnings annotation.
+
+ An example command line: ::
+
+ phpmd PHP/Depend/DbusUI xml codesize --reportfile phpmd.xml --suffixes .php
+
+
+Using multiple rule sets
+````````````````````````
+
+PHPMD uses so called rule sets that configure/define a set of rules which will
+be applied against the source under test. The default distribution of PHPMD is
+already shipped with a few default sets, that can be used out-of-box. You can
+call PHPMD's cli tool with a set's name to apply this configuration: ::
+
+ ~ $ phpmd /path/to/source text codesize
+
+But what if you would like to apply more than one rule set against your source?
+You can also pass a list of rule set names, separated by comma to PHPMD's cli
+tool: ::
+
+ ~ $ phpmd /path/to/source text codesize,unusedcode,naming
+
+You can also mix custom `rule set files`__ with build-in rule sets: ::
+
+ ~ $ phpmd /path/to/source text codesize,/my/rules.xml
+
+__ /documentation/creating-a-ruleset.html
+
+That's it. With this behavior you can specify you own combination of rule sets
+that will check the source code.
+
+Exit codes
+==========
+
+PHPMD's command line tool currently defines three different exit codes.
+
+- *0*, This exit code indicates that everything worked as expected. This means
+ there was no error/exception and PHPMD hasn't detected any rule violation
+ in the code under test.
+- *1*, This exit code indicates that an error/exception occured which has
+ interrupted PHPMD during execution.
+- *2*, This exit code means that PHPMD has processed the code under test
+ without the occurence of an error/exception, but it has detected rule
+ violations in the analyzed source code.
+
+Renderers
+=========
+
+At the moment PHPMD comes with the following three renderers:
+
+- *xml*, which formats the report as XML.
+- *text*, simple textual format.
+- *html*, single HTML file with possible problems.
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/documentation/suppress-warnings.rst b/vendor/phpmd/phpmd/src/site/rst/documentation/suppress-warnings.rst
new file mode 100644
index 0000000..84f3465
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/documentation/suppress-warnings.rst
@@ -0,0 +1,71 @@
+==========================
+PHPMD Suppressing Warnings
+==========================
+
+You can use doc comment annotations to exclude methods or classes
+from PHPMD or to suppress special rules for some software artifacts. ::
+
+ /**
+ * This will suppress all the PMD warnings in
+ * this class.
+ *
+ * @SuppressWarnings(PHPMD)
+ */
+ class Bar {
+ function foo() {
+ $baz = 23;
+ }
+ }
+
+Or you can suppress one rule with an annotation like this: ::
+
+ /**
+ *
+ */
+ class Bar {
+ /**
+ * This will suppress UnusedLocalVariable
+ * warnings in this method
+ *
+ * @SuppressWarnings(PHPMD.UnusedLocalVariable)
+ */
+ public function foo() {
+ $baz = 42;
+ }
+ }
+
+The ``@SuppressWarnings`` annotation of PHPMD also supports some
+wildcard exclusion, so that you can suppress several warnings with
+a single annotation. ::
+
+ /**
+ * Suppress all rules containing "unused" in this
+ * class
+ *
+ * @SuppressWarnings("unused")
+ */
+ class Bar {
+ private $unusedPrivateField = 42;
+ public function foo($unusedFormalParameter = 23)
+ {
+ $unusedLocalVariable = 17;
+ }
+ private function unusedPrivateMethod() {
+ }
+ }
+
+A doc comment can contain multiple ``@SuppressWarnings`` annotations,
+so that you can exclude multiple rules by name. ::
+
+ /**
+ * Suppress all warnings from these two rules.
+ *
+ * @SuppressWarnings(PHPMD.LongVariable)
+ * @SuppressWarnings(PHPMD.UnusedLocalVariable)
+ */
+ class Bar {
+ public function foo($thisIsALongAndUnusedVariable)
+ {
+
+ }
+ }
diff --git a/vendor/phpmd/phpmd/src/site/rst/documentation/writing-a-phpmd-rule.rst b/vendor/phpmd/phpmd/src/site/rst/documentation/writing-a-phpmd-rule.rst
new file mode 100644
index 0000000..e762fa8
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/documentation/writing-a-phpmd-rule.rst
@@ -0,0 +1,418 @@
+============================
+Howto write a Rule for PHPMD
+============================
+
+:Author: Manuel Pichler
+:Copyright: All rights reserved
+:Description: This article describes the how to develop custom rule classes
+ for PHPMD (PHP Mess Detector). You will learn how to develop
+ different rule types and how to configure them in a custom rule
+ set file, so that PHPMD can use those rules for its analysis
+ runs. Additionally you will learn several other aspects about
+ PHPMD, like the violation message template engine and how to
+ write customizable rule classes.
+:Keywords: NPM, Number of Public Methods, Software Metrics, PHPMD, PMD, rule set, rule, xml, violation, AST, Abstract Syntax Tree
+
+This article describes how you can extend PHPMD with custom rule classes that
+can be used to detect design issues or errors in the analyzed source code.
+
+Let us start with some architecture basics behind PHPMD. All rules in PHPMD
+must at least implement the `PHPMD\Rule`__ interface. You can also extend
+the abstract rule base class `\PHPMD\AbstractRule`__ which already provides
+an implementation of all required infrastructure methods and application logic,
+so that the only task which is left to you is the implementation of the
+concrete validation code of your rule. To implement this validation-code the
+PHPMD rule interface declares the ``apply()`` method which will be invoked by
+the application during the source analysis phase. ::
+
+ require_once 'PHPMD/AbstractRule.php';
+
+ class Com_Example_Rule_NoFunctions extends \PHPMD\AbstractRule
+ {
+ public function apply(\PHPMD\AbstractNode $node)
+ {
+ // Check constraints against the given node instance
+ }
+ }
+
+The ``apply()`` method gets an instance of `\PHPMD\AbstractNode`__ as
+argument. This node instance represents the different high level code artifacts
+found in the analyzed source code. In this context high level artifact means
+*interfaces*, *classes*, *methods* and *functions*. But how do we tell PHPMD
+which of these artifacts are interesting for our rule, because we do not want
+duplicate implementations of the descision code in every rule? To solve this
+problem PHPMD uses so-called marker interfaces. The only purpose of these
+interfaces is to label a rule class, which says: Hey I'm interessted in nodes
+of type class and interface, or I am interessted in function artifacts. The
+following list shows the available marker interfaces:
+
+- `\PHPMD\Rule\ClassAware`__
+- `\PHPMD\Rule\FunctionAware`__
+- `\PHPMD\Rule\InterfaceAware`__
+- `\PHPMD\Rule\MethodAware`__
+
+With this marker interfaces we can now extend the previous example, so that
+the rule will be called for functions found in the analyzed source code. ::
+
+ class Com_Example_Rule_NoFunctions
+ extends \PHPMD\AbstractRule
+ implements \PHPMD\Rule\FunctionAware
+ {
+ public function apply(\PHPMD\AbstractNode $node)
+ {
+ // Check constraints against the given node instance
+ }
+ }
+
+And because our coding guideline forbids functions every call to the ``apply()``
+method will result in a rule violation. Such a violation can be reported to
+PHPMD through the ``addViolation()`` method. The rule inherits this helper
+method from it's parent class `\PHPMD\AbstractRule`__. ::
+
+ class Com_Example_Rule_NoFunctions // ...
+ {
+ public function apply(\PHPMD\AbstractNode $node)
+ {
+ $this->addViolation($node);
+ }
+ }
+
+That's it. The only thing left to do is adding a configuration entry for this
+rule to a rule set file. This ruleset file is an XML document where all settings
+of one or more rules can be configured, so that everyone can customize an
+existing rule without any changes the rule's source. The syntax of the rule set
+file is completly adapted from PHPMD's inspiring example `PMD`__. To get
+started with a custom rule set you should take a look at one of the existing
+`XML files`__ and then adapt one of the rule configurations for a newly created
+rule. The most important elements of a rule configuration are:
+
+- *@name*: Human readable name for the rule.
+- *@message*: The error/violation message that will shown in the report.
+- *@class*: The full qualified class name of the rule.
+- *priority*: The priority for the rule. This can be a value in the range 1-5,
+ where 1 is the highest priority and 5 the lowest priority.
+
+::
+
+
+
+
+
+ 1
+
+
+
+The previous listing shows a basic rule set file that configures all required
+settings for the created example rule. For more details on PHPMD's rule set
+file format you should take a look a the `Create a custom rule set`__ tutorial.
+
+Finally the real world test. Let's assume we have saved the rule class in a
+file ``Com/Example/Rule/NoFunction.php`` that is somewhere in the PHP
+``include_path`` and we have saved the rule set in a file named
+``example-rule.xml``. No we can test the rule from the command line with the
+following command: ::
+
+ ~ $ phpmd /my/source/example.com text /my/rules/example-rule.xml
+
+ /my/source/example.com/functions.php:2 Please do not use functions.
+
+That's it. Now we have a first custom rule class that can be used with PHPMD.
+
+Writing a rule based on an existing Software Metric
+===================================================
+
+Since the root goal for the development of PHPMD was the implementation of a
+simple and user friendly interface for PHP_Depend, we will show you in this
+section how to develop a rule class, that uses a software metric measured by
+`PHP_Depend`__ as input data.
+
+In this section you will learn how to access software metrics for a given
+`\PHPMD\AbstractNode`__ instance. And you will learn how to use PHPMD's
+configuration backend in such a way, that thresholds and other settings can
+be customized without changing any PHP code. Additionally you will see how
+the information content of an error message can be improved.
+
+The first thing we need now is a software metric that we want to use as basis
+for the new rule. A complete and up2date list of available software metrics
+can be found PHP_Depend's `metric catalog`__. For this article we choose the
+`Number of Public Methods (npm)`__ metric and we define an upper and a lower
+threshold for our rule. The upper threshold is ``10``, because we think a class
+with more public methods exposes to much of its privates and should be
+refactored into two or more classes. For the lower threshold we choose ``1``,
+because a class without any public method does not expose any service to
+surrounding application.
+
+The following code listing shows the entire rule class skeleton. As you can
+see, this class implements the `\PHPMD\Rule\ClassAware`__ interface, so that
+PHPMD knows that this rule will only be called for classes. ::
+
+ class Com_Example_Rule_NumberOfPublicMethods
+ extends \PHPMD\AbstractRule
+ implements \PHPMD\Rule\ClassAware
+ {
+ const MINIMUM = 1,
+ MAXIMUM = 10;
+
+ public function apply(\PHPMD\AbstractNode $node)
+ {
+ // Check constraints against the given node instance
+ }
+ }
+
+Now that we have the rule skeleton we must access the ``npm`` metric which
+is associated with the given node instance. All software metrics calculated for
+a node object can directly be accessed through the ``getMetric()`` method of the
+node instance. This method takes a single parameter, the abbreviation/acronym
+of the metric as documented in PHP_Depends `metric catalog`__. ::
+
+ class Com_Example_Rule_NumberOfPublicMethods
+ extends \PHPMD\AbstractRule
+ implements \PHPMD\Rule\ClassAware
+ {
+ const MINIMUM = 1,
+ MAXIMUM = 10;
+
+ public function apply(\PHPMD\AbstractNode $node)
+ {
+ $npm = $node->getMetric('npm');
+ if ($npm < self::MINIMUM || $npm > self::MAXIMUM) {
+ $this->addViolation($node);
+ }
+ }
+ }
+
+That's the coding part for the metric based rule. Now we must add this class
+to a rule set file.
+
+::
+
+
+
+
+
+
+
+ 3
+
+
+
+Now we can run PHPMD with this rule set file and it will report us all classes
+that do not fulfill our requirement for the NPM metric. But as promised, we
+will make this rule more customizable, so that it can be adjusted for different
+project requirements. Therefore we will replace the two constants ``MINIMUM``
+and ``MAXIMUM`` with properties that can be configured in the rule set file.
+So let us start with the modified rule set file. ::
+
+
+
+
+
+
+
+ 3
+
+
+
+
+
+
+
+In PMD rule set files you can define as many properties for a rule as you like.
+All of them will be injected into a rule instance by PHPMD's runtime
+environment and then can be accessed through the ``getProperty()``
+methods. Currently PHPMD supports the following getter methods.
+
+- ``getBooleanProperty()``
+- ``getIntProperty()``
+
+So now let's modify the rule class and replace the hard coded constants with
+the configurable properties. ::
+
+ class Com_Example_Rule_NumberOfPublicMethods
+ extends \PHPMD\AbstractRule
+ implements \PHPMD\Rule\ClassAware
+ {
+ public function apply(\PHPMD\AbstractNode $node)
+ {
+ $npm = $node->getMetric('npm');
+ if ($npm < $this->getIntProperty('minimum') ||
+ $npm > $this->getIntProperty('maximum')
+ ) {
+ $this->addViolation($node);
+ }
+ }
+ }
+
+Now we are nearly done, but one issue is still left out. When we execute this
+rule, the user will get the message *"The context class violates the NPM
+metric."* which isn't really informative, because he must manually check if the
+upper or lower threshold was exceeded and what the actual thresholds are. To
+provide more information about a rule violation you can use PHPMD's minimalistic
+template/placeholder engine for violation messages. With this engine you can
+define violation messages with placeholders, that will be replaced with actual
+values. The format for such placeholders is ``'{' + \d+ '}'``. ::
+
+
+
+
+
+
+
+ 3
+
+
+
+
+
+
+
+Now we can adjust the rule class in such a manner, that it will set the correct
+values for the placeholders ``{0}``, ``{1}`` and ``{2}`` ::
+
+ class Com_Example_Rule_NumberOfPublicMethods
+ extends \PHPMD\AbstractRule
+ implements \PHPMD\Rule\ClassAware
+ {
+ public function apply(\PHPMD\AbstractNode $node)
+ {
+ $min = $this->getIntProperty('minimum');
+ $max = $this->getIntProperty('maximum');
+ $npm = $node->getMetric('npm');
+
+ if ($npm < $min) {
+ $this->addViolation($node, array(get_class($node), $npm, $min));
+ } else if ($npm > $max) {
+ $this->addViolation($node, array(get_class($node), $npm, $max));
+ }
+ }
+ }
+
+If we run this version of the rule we will get an error message like the one
+shown in the following figure. ::
+
+ The class FooBar has 42 public method, the threshold is 10.
+
+Writing a rule based on the Abstract Syntax Tree
+================================================
+
+Now we will learn how to develop a PHPMD rule that utilizes PHP_Depend's
+abstract syntax tree to detect violations or possible error in the analyzed
+source code. The ability to access PHP_Depend's abstract syntax tree gives you
+the most powerful way to write rules for PHPMD, because you can analyze nearly
+all apects of the software under test. The syntax tree can be accessed through
+the ``getFirstChildOfType()`` and ``findChildrenOfType()`` methods of the
+`\PHPMD\AbstractNode`__ class.
+
+In this example we will implement a rule that detects the usage of the new and
+controversial PHP feature ``goto``. Because we all know and agree that ``goto``
+was already bad in Basic, we would like to prevent our developers from using
+the bad feature. Therefore we implement a PHPMD rule, that searches through
+PHP_Depend's for the ``goto`` language construct.
+
+Because the ``goto`` statement cannot be found in classes and interfaces, but
+in methods and functions, the new rule class must implement the two marker
+interfaces `\PHPMD\Rule\FunctionAware`__ and `\PHPMD\Rule\MethodAware`__.
+
+::
+
+ namespace PHPMD\Rule\Design;
+
+ use PHPMD\AbstractNode;
+ use PHPMD\AbstractRule;
+ use PHPMD\Rule\MethodAware;
+ use PHPMD\Rule\FunctionAware;
+
+ class GotoStatement extends AbstractRule implements MethodAware, FunctionAware
+ {
+ public function apply(AbstractNode $node)
+ {
+ foreach ($node->findChildrenOfType('GotoStatement') as $goto) {
+ $this->addViolation($goto, array($node->getType(), $node->getName()));
+ }
+ }
+ }
+
+As you can see, we are searching for the string ``GotoStatement`` in the
+previous example. This is a shortcut notation used by PHPMD to address concrete
+PHP_Depend syntax tree nodes. All abstract syntax tree classes in PDepend
+have the following format: ::
+
+ \PDepend\Source\AST\ASTGotoStatement
+
+where ::
+
+ \PDepend\Source\AST\AST
+
+is fixed and everything else depends on the node type. And this fixed part of
+the class name can be ommitted in PHPMD when searching for an abstract syntax
+tree node. To implement additional rules you should take a look at PHP_Depend's
+`Code package`__ where you can find all currently supported code nodes.
+
+Conclusion
+==========
+
+In this article we have shown you several ways to implement custom rules for
+PHPMD. If you think one of your rules could be reusable for other projects and
+user, don't hesitate to propose your custom rules on the project's issue tracker
+at `GitHub`__ or open a pull request.
+
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Rule.php
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/AbstractRule.php
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/AbstractNode.php
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Rule/ClassAware.php
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Rule/FunctionAware.php
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Rule/InterfaceAware.php
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Rule/MethodAware.php
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/AbstractRule.php
+__ http://pmd.sf.net/
+__ https://github.com/phpmd/phpmd/tree/master/src/main/resources/rulesets
+__ http://phpmd.org/documentation/creating-a-ruleset.html
+
+__ http://pdepend.org
+__ http://pdepend.org/documentation/software-metrics.html
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/AbstractNode.php
+__ http://pdepend.org/documentation/software-metrics/number-of-public-methods.html
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Rule/IClassAware.php
+__ http://pdepend.org/documentation/software-metrics.html
+
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/AbstractNode.php
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Rule/FunctionAware.php
+__ https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Rule/MethodAware.php
+__ https://github.com/pdepend/pdepend/tree/master/src/main/phpHP/Depend/Source/AST
+__ https://github.com/phpmd/phpmd
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/.index.xml b/vendor/phpmd/phpmd/src/site/rst/download/.index.xml
new file mode 100644
index 0000000..5549ff2
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/.index.xml
@@ -0,0 +1,18 @@
+
+
+
+ Index
+ index.rst
+
+
+ Releases
+ releases/
+
+
+ release/
+
+
+ Extensions
+ extensions/
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/extensions/.index.xml b/vendor/phpmd/phpmd/src/site/rst/download/extensions/.index.xml
new file mode 100644
index 0000000..ae012a1
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/extensions/.index.xml
@@ -0,0 +1,6 @@
+
+
+
+ index.rst
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/extensions/index.rst b/vendor/phpmd/phpmd/src/site/rst/download/extensions/index.rst
new file mode 100644
index 0000000..54f9329
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/extensions/index.rst
@@ -0,0 +1,63 @@
+================
+PHPMD Extensions
+================
+
+On this page you can find extensions available for the PHP Mess Detector
+project.
+
+Ant Task
+========
+
+Simple task that allows a seamless integration of PHPMD into the
+`ant`__ build tool.
+
+__ http://ant.apache.org/
+
+2010/08/10 - ant-phpmd-0.1.2 (`api`__, `src`__)
+```````````````````````````````````````````````
+
+- `ant-phpmd-0.1.2.jar`__
+
+__ http://static.phpmd.org/ant-phpmd/0.1.2/api
+__ http://static.phpmd.org/ant-phpmd/0.1.2/src
+__ http://static.phpmd.org/ant-phpmd/0.1.2/ant-phpmd.jar
+
+2010/04/07 - ant-phpmd-0.1.1 (`api`__, `src`__)
+```````````````````````````````````````````````
+
+- `ant-phpmd-0.1.1.jar`__
+
+__ http://static.phpmd.org/ant-phpmd/0.1.1/api
+__ http://static.phpmd.org/ant-phpmd/0.1.1/src
+__ http://static.phpmd.org/ant-phpmd/0.1.1/ant-phpmd.jar
+
+2010/01/20 - ant-phpmd-0.1.0
+````````````````````````````
+
+- `ant-phpmd-0.1.0.jar`__
+
+__ http://static.phpmd.org/ant-phpmd/0.1.0/ant-phpmd.jar
+
+Java Binding
+============
+
+JAR file that provides a Java binding for PHPMD. This library can be used
+to develop Java applications that utilize PHPMD's features.
+
+2010/08/10 - java-phpmd-0.1.1 (`api`__, `src`__)
+````````````````````````````````````````````````
+
+- `java-phpmd-0.1.1.jar`__
+
+__ http://static.phpmd.org/java-phpmd/0.1.1/api
+__ http://static.phpmd.org/java-phpmd/0.1.1/src
+__ http://static.phpmd.org/java-phpmd/0.1.1/java-phpmd.jar
+
+2010/04/07 - java-phpmd-0.1.0 (`api`__, `src`__)
+````````````````````````````````````````````````
+
+- `java-phpmd-0.1.0.jar`__
+
+__ http://static.phpmd.org/java-phpmd/0.1.0/api
+__ http://static.phpmd.org/java-phpmd/0.1.0/src
+__ http://static.phpmd.org/java-phpmd/0.1.0/java-phpmd.jar
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/index.rst b/vendor/phpmd/phpmd/src/site/rst/download/index.rst
new file mode 100644
index 0000000..536a190
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/index.rst
@@ -0,0 +1,62 @@
+=========
+Downloads
+=========
+
+Installing via Composer
+=======================
+
+Create a ``composer.json`` file in your project directory and add *PHPMD*
+as a required dependency: ::
+
+ {
+ "require-dev": {
+ "phpmd/phpmd" : "@stable"
+ }
+ }
+
+Then install Composer in your project (or `download the composer.phar`__
+directly): ::
+
+ ~ $ curl -s http://getcomposer.org/installer | php
+
+And finally let Composer install the project dependencies: ::
+
+ ~ $ php composer.phar install
+
+__ http://getcomposer.org/composer.phar
+
+From the github repository
+==========================
+
+If you like to participate on the social coding plattform `GitHub`__,
+you can use PHPMD's mirror to fork and contribute to PHPMD. ::
+
+ ~ $ git clone git://github.com/phpmd/phpmd.git
+
+Then ``cd`` into the checkout directory initialize the referenced sub modules: ::
+
+ ~ $ cd phpmd
+ ~/phpmd $ git submodule update --init
+
+Then install Composer in your project (or `download the composer.phar`__
+directly): ::
+
+ ~ $ curl -s http://getcomposer.org/installer | php
+
+And finally let Composer install the project dependencies: ::
+
+ ~ $ php composer.phar install
+
+Requirements
+============
+
+PHPMD itself is considered as an early development version at its
+current state. It relies on the following software products:
+
+- `PHP_Depend >= 2.0.0`__
+- `PHP >= 5.3.0`__
+
+__ https://github.com/phpmd/phpmd
+__ http://getcomposer.org/composer.phar
+__ http://pdepend.org
+__ http://php.net/downloads.php
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/releases/.index.xml b/vendor/phpmd/phpmd/src/site/rst/download/releases/.index.xml
new file mode 100644
index 0000000..6da2ccd
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/releases/.index.xml
@@ -0,0 +1,24 @@
+
+
+
+ PHPMD Releases
+ index.rst
+
+
+
+ 1.1.1
+ 1.1.1/
+
+
+ 1.1.0
+ 1.1.0/
+
+
+ 1.0.1
+ 1.0.1/
+
+
+ 1.0.0
+ 1.0.0/
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.0/.index.xml b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.0/.index.xml
new file mode 100644
index 0000000..d327b8f
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.0/.index.xml
@@ -0,0 +1,7 @@
+
+
+
+ Release 1.0.0
+ changelog.rst
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.0/changelog.rst b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.0/changelog.rst
new file mode 100644
index 0000000..7dddeef
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.0/changelog.rst
@@ -0,0 +1,30 @@
+=============
+Release 1.0.0
+=============
+
+:Author: Manuel Pichler
+:Copyright: All rights reserved
+:Description: This document describes the news features and bugfixes of the
+ next feature release 1.0.0 of PHPMD.
+:Keywords: Release, Version, Features, Bugfixes
+
+Version 1.0.0 of PHPMD was released on Februrary the 05th 2011. This release
+closes a bug in PHPMD and introduces a completly new directory layout and
+build process for PHPMD.
+
+Bugfixes
+--------
+
+- Fixed `#9626017`__: Clear temporary resources after a test has finished. Fixed
+ with commit `#b385f15`__.
+
+Download
+--------
+
+You can download release 1.0.1 through PHPMD's `PEAR Channel Server`__ or you
+can download the release as a `Phar archive`__
+
+__ https://www.pivotaltracker.com/story/show/9626017
+__ https://github.com/phpmd/phpmd/commit/b385f15
+__ http://pear.phpmd.org
+__ http://static.phpmd.org/php/1.0.1/phpmd.phar
\ No newline at end of file
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.1/.index.xml b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.1/.index.xml
new file mode 100644
index 0000000..3b23dd6
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.1/.index.xml
@@ -0,0 +1,7 @@
+
+
+
+ Release 1.0.1
+ changelog.rst
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.1/changelog.rst b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.1/changelog.rst
new file mode 100644
index 0000000..b6a38f0
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.0.1/changelog.rst
@@ -0,0 +1,33 @@
+=============
+Release 1.0.1
+=============
+
+:Author: Manuel Pichler
+:Copyright: All rights reserved
+:Description: This document describes the news features and bugfixes of the
+ next feature release 1.0.1 of PHPMD.
+:Keywords: Release, Version, Features, Bugfixes
+
+Version 1.0.1 of PHPMD was released on Februrary the 12th 2011. This release
+closes two bugs in PHPMD.
+
+Bugfixes
+--------
+
+- Fixed `#9930643`__: The include_path does not match with PHP_Depend's new
+ directory layout. Fixed with commit `#531be78`__.
+- Fixed `#9626017`__: Clear temporary resources after a test has finished.
+ Fixed with commit `#b385f15`__.
+
+Download
+--------
+
+You can download release 1.0.1 through PHPMD's `PEAR Channel Server`__ or you
+can download the release as a `Phar archive`__
+
+__ https://www.pivotaltracker.com/story/show/9930643
+__ https://github.com/phpmd/phpmd/commit/531be78
+__ https://www.pivotaltracker.com/story/show/9626017
+__ https://github.com/phpmd/phpmd/commit/b385f15
+__ http://pear.phpmd.org
+__ http://static.phpmd.org/php/1.0.1/phpmd.phar
\ No newline at end of file
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.0/.index.xml b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.0/.index.xml
new file mode 100644
index 0000000..e4ac834
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.0/.index.xml
@@ -0,0 +1,7 @@
+
+
+
+ Release 1.1.0
+ changelog.rst
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.0/changelog.rst b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.0/changelog.rst
new file mode 100644
index 0000000..d7cee15
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.0/changelog.rst
@@ -0,0 +1,56 @@
+=============
+Release 1.1.0
+=============
+
+:Author: Manuel Pichler
+:Copyright: All rights reserved
+:Description: This document describes the news features and bugfixes of the
+ next feature release 1.1.0 of PHPMD. This version provides two
+ new rules, one that utilizes the CBO metric to detect strong
+ coupled classes and a second on that detects the usage of PHP's
+ goto statement. Additionally this release closes a minor bug
+ in the LongVariable rule.
+:Keywords: Release, Version, Features, Bugfixes, Coupling Between Objects, CBO, Goto Statement, PHPUnit
+
+Version 1.1.0 of PHPMD was released on March the 20th 2011. The key features
+for this release were two new rules. The first one utilizes the `Coupling
+Between Objects (CBO)`__ metric to detect strongly coupled classes. The second
+one detects the usage of PHP's questionable ``goto`` statement. Beside that
+we have closed a minor bug in the LongVariable rule, where also private
+properties with descriptive names were reported. And finally we have replaced
+deprecated PHPUnit features in the PHPMD's test suite, so that PHPMD's tests
+should now work with PHPUnit 3.4.x and 3.5.x without deprecated warnings.
+
+Features
+--------
+
+- Implemented `#10474873`__: Add rule for PHP's goto statement. Implemented
+ with commit `#2745a20`__.
+- Implemented `#10474987`__: Implement rule for CBO metric. Implemented with
+ commit `#14277b4`__.
+- Implemented `#11012465`__: Replace deprecated PHPUnit features in test suite.
+ Implemented with commit `#4adb88d`__.
+
+Bugfixes
+--------
+
+- Fixed `#10096717`__: LongVariable rule should not apply on private
+ properties. Fixed with commit `#f063bc9`__.
+
+Download
+--------
+
+You can download release 1.1.0 through PHPMD's `PEAR Channel Server`__ or you
+can download the release as a `Phar archive`__
+
+__ http://pdepend.org/documentation/software-metrics/coupling-between-objects.html
+__ https://www.pivotaltracker.com/story/show/10474873
+__ https://github.com/phpmd/phpmd/commit/2745a20
+__ https://www.pivotaltracker.com/story/show/10474987
+__ https://github.com/phpmd/phpmd/commit/14277b4
+__ https://www.pivotaltracker.com/story/show/11012465
+__ https://github.com/phpmd/phpmd/commit/4adb88d
+__ https://www.pivotaltracker.com/story/show/10096717
+__ https://github.com/phpmd/phpmd/commit/f063bc9
+__ http://pear.phpmd.org
+__ http://static.phpmd.org/php/1.1.0/phpmd.phar
\ No newline at end of file
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.1/.index.xml b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.1/.index.xml
new file mode 100644
index 0000000..aed1460
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.1/.index.xml
@@ -0,0 +1,7 @@
+
+
+
+ Release 1.1.1
+ changelog.rst
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.1/changelog.rst b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.1/changelog.rst
new file mode 100644
index 0000000..1685344
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/releases/1.1.1/changelog.rst
@@ -0,0 +1,28 @@
+=============
+Release 1.1.1
+=============
+
+:Author: Manuel Pichler
+:Copyright: All rights reserved
+:Description: This document describes the news features and bugfixes of the
+ next release 1.1.1 of PHPMD. This version fixes a critical bug
+ in PHPMD's package file that causes the Pyrus installer to fail.
+:Keywords: Release, Version, Features, Bugfixes, Pyrus
+
+Version 1.1.1 of PHPMD is a pure Bugfix release that fixes an issue in PHPMD's
+package manifest. This bug prevents Pyrus the PEAR2 installer from installing
+PHPMD. Version 1.1.1 was released on June the 30th 2011.
+
+Bugfixes
+--------
+
+- Fixed: Bug in PHPMD's package manifest file.
+
+Download
+--------
+
+You can download release 1.1.0 through PHPMD's `PEAR Channel Server`__ or you
+can download the release as a `Phar archive`__
+
+__ http://pear.phpmd.org
+__ http://static.phpmd.org/php/1.1.0/phpmd.phar
diff --git a/vendor/phpmd/phpmd/src/site/rst/download/releases/index.rst b/vendor/phpmd/phpmd/src/site/rst/download/releases/index.rst
new file mode 100644
index 0000000..6581abd
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/download/releases/index.rst
@@ -0,0 +1,8 @@
+========
+Releases
+========
+
+The following releases of PHPMD are available for download
+
+.. include:: ../release/parts/latest.rst
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/people-behind.rst b/vendor/phpmd/phpmd/src/site/rst/people-behind.rst
new file mode 100644
index 0000000..ce9058d
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/people-behind.rst
@@ -0,0 +1,85 @@
+===================
+People behind PHPMD
+===================
+
+Contributors
+============
+
+- `Volker Dusch`__ (Since 2010) / `https://github.com/edorian`__
+- `timmartin`__ (Since 2010) / `https://github.com/timmartin`__
+- `Sebastian Bergmann`__ (Since 2011) / `https://github.com/sebastianbergmann`__
+- `Zsolt Takacs`__ (Since 2011) / `https://github.com/zstakacs`__
+- `Che Hodgins`__ (Since 2011) / `https://github.com/chehodgins`__
+- `Gennadiy Litvinyuk`__ (Since 2011) / `https://github.com/gennadiylitvinyuk`__
+- `Francis Besset`__ (Since 2011) / `https://github.com/francisbesset`__
+- `zerkalica`__ (Since 2012) / `https://github.com/zerkalica`__
+- `palbertin`__ (Since 2012) / `https://github.com/palbertini`__
+- `bahulneel`__ (Since 2012) / `https://github.com/bahulneel`__
+- `Willem Stuursma`__ (Since 2012) / `https://github.com/willemstuursma`__
+- `Nimlhug`__ (Since 2012) / `https://github.com/Nimlhug`__
+- `A. Martin Llano`__ (Since 2012) / `https://github.com/amllano`__
+- `Juan Basso`__ (Since 2012) / `https://github.com/jrbasso`__
+- `Brian Ridley`__ (Since 2013) / `https://github.com/ptlis`__
+- `Radosław Mejer`__ (Since 2014) / `https://github.com/radmen`__
+- `Tobias Nyholm`__ (Since 2014) / `https://github.com/Nyholm`__
+- `Gasillo`__ (Since 2014) / `https://github.com/Gasillo`__
+- `Marc Würth`__ (Since 2014) / `https://github.com/ravage84`__
+
+... and many others.
+See the full list on GitHub:
+https://github.com/phpmd/phpmd/graphs/contributors
+
+__ https://github.com/edorian
+__ https://github.com/edorian
+__ https://github.com/timmartin
+__ https://github.com/timmartin
+__ https://github.com/sebastianbergmann
+__ https://github.com/sebastianbergmann
+__ https://github.com/zstakacs
+__ https://github.com/zstakacs
+__ https://github.com/chehodgins
+__ https://github.com/chehodgins
+__ https://github.com/gennadiylitvinyuk
+__ https://github.com/gennadiylitvinyuk
+__ https://github.com/francisbesset
+__ https://github.com/francisbesset
+__ https://github.com/zerkalica
+__ https://github.com/zerkalica
+__ https://github.com/palbertini
+__ https://github.com/palbertini
+__ https://github.com/bahulneel
+__ https://github.com/bahulneel
+__ https://github.com/willemstuursma
+__ https://github.com/willemstuursma
+__ https://github.com/Nimlhug
+__ https://github.com/Nimlhug
+__ https://github.com/amllano
+__ https://github.com/amllano
+__ https://github.com/jrbasso
+__ https://github.com/jrbasso
+__ https://github.com/ptlis
+__ https://github.com/ptlis
+__ https://github.com/radmen
+__ https://github.com/radmen
+__ https://github.com/Nyholm
+__ https://github.com/Nyholm
+__ https://github.com/Gasillo
+__ https://github.com/Gasillo
+__ https://github.com/ravage84
+__ https://github.com/ravage84
+
+Project founder
+===============
+
+- `Manuel Pichler`__ / `https://github.com/manuelpichler`__ / (Since 2009)
+
+__ https://github.com/manuelpichler
+__ https://github.com/manuelpichler
+
+
+..
+ Local Variables:
+ mode: rst
+ fill-column: 79
+ End:
+ vim: et syn=rst tw=79
diff --git a/vendor/phpmd/phpmd/src/site/rst/robots.txt b/vendor/phpmd/phpmd/src/site/rst/robots.txt
new file mode 100644
index 0000000..17a3cf4
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/robots.txt
@@ -0,0 +1,35 @@
+#
+# robots.txt for http://kore-nordmann.de
+#
+# Please note: There are a lot of pages on this site, and there are
+# some misbehaved spiders out there that go _way_ too fast. If you're
+# irresponsible, your access to the site may be blocked.
+
+Sitemap: http://pdepend.org/.sitemap
+
+# advertising-related bots:
+User-agent: Mediapartners-Google*
+Disallow: /
+
+# A capture bot, downloads gazillions of pages with no public benefit
+# http://www.webreaper.net/
+User-agent: WebReaper
+Disallow: /
+
+#
+# Friendly, low-speed bots are welcome viewing article pages, but not
+# dynamically-generated pages please.
+#
+
+# Only googles bots now '$'
+# User-agent: Googlebot
+# Disallow: /relation/find$
+
+User-agent: *
+Disallow: /styles/
+Disallow: /images/
+
+#
+# *at least* 1 second please. preferably more :D
+#
+Crawl-delay: 1
diff --git a/vendor/phpmd/phpmd/src/site/rst/rules/.index.xml b/vendor/phpmd/phpmd/src/site/rst/rules/.index.xml
new file mode 100644
index 0000000..266f2c9
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/rules/.index.xml
@@ -0,0 +1,27 @@
+
+
+
+ Index
+ index.rst
+
+
+ Code Size Rules
+ codesize.rst
+
+
+ Controversial Rules
+ controversial.rst
+
+
+ Design Rules
+ design.rst
+
+
+ Naming Rules
+ naming.rst
+
+
+ Unused Code Rules
+ unusedcode.rst
+
+
\ No newline at end of file
diff --git a/vendor/phpmd/phpmd/src/site/rst/rules/cleancode.rst b/vendor/phpmd/phpmd/src/site/rst/rules/cleancode.rst
new file mode 100644
index 0000000..8e8b3c7
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/rules/cleancode.rst
@@ -0,0 +1,72 @@
+================
+Clean Code Rules
+================
+
+The Clean Code ruleset contains a collection of rules that enforce
+software design principles such as the SOLID Principles and Object
+Callisthenics.
+
+They are very strict and cannot easily be followed without any violations.
+If you use this ruleset you should:
+
+1. Select important packages that should follow this ruleset and others that
+ don't
+2. Set a treshold for failures and not fail at the first occurance.
+
+ElseExpression
+==============
+
+Since: PHPMD 1.5
+
+An if expression with an else branch is never necessary. You can rewrite the
+conditions in a way that the else is not necessary and the code becomes simpler
+to read. To achieve this use early return statements. To achieve this you may
+need to split the code it several smaller methods. For very simple assignments
+you could also use the ternary operations.
+
+Example: ::
+
+ class Foo
+ {
+ public function bar($flag)
+ {
+ if ($flag) {
+ // one branch
+ } else {
+ // another branch
+ }
+ }
+ }
+
+BooleanArgumentFlag
+===================
+
+A boolean flag argument is a reliable indicator for a violation of
+the Single Responsibility Principle (SRP). You can fix this problem
+by extracting the logic in the boolean flag into its own class
+or method.
+
+Example: ::
+
+ class Foo {
+ public function bar($flag = true) {
+ }
+ }
+
+StaticAccess
+============
+
+Static acccess causes inexchangable dependencies to other classes and leads to
+hard to test code. Avoid using static access at all costs and instead inject
+dependencies through the constructor. The only case when static access is
+acceptable is when used for factory methods.
+
+Example: ::
+
+ class Foo
+ {
+ public function bar()
+ {
+ Bar::baz();
+ }
+ }
diff --git a/vendor/phpmd/phpmd/src/site/rst/rules/codesize.rst b/vendor/phpmd/phpmd/src/site/rst/rules/codesize.rst
new file mode 100644
index 0000000..d48f45f
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/rules/codesize.rst
@@ -0,0 +1,283 @@
+===============
+Code Size Rules
+===============
+
+The Code Size Ruleset contains a collection of rules that find code size related problems.
+
+CyclomaticComplexity
+====================
+
+Since: PHPMD 0.1
+
+Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
+
+
+Example: ::
+
+ // Cyclomatic Complexity = 12
+ class Foo {
+ 1 public function example() {
+ 2 if ($a == $b) {
+ 3 if ($a1 == $b1) {
+ fiddle();
+ 4 } else if ($a2 == $b2) {
+ fiddle();
+ } else {
+ fiddle();
+ }
+ 5 } else if ($c == $d) {
+ 6 while ($c == $d) {
+ fiddle();
+ }
+ 7 } else if ($e == $f) {
+ 8 for ($n = 0; $n < $h; $n++) {
+ fiddle();
+ }
+ } else{
+ switch ($z) {
+ 9 case 1:
+ fiddle();
+ break;
+ 10 case 2:
+ fiddle();
+ break;
+ 11 case 3:
+ fiddle();
+ break;
+ 12 default:
+ fiddle();
+ break;
+ }
+ }
+ }
+ }
+
+This rule has the following properties:
+
+=================================== =============== ===================================================================
+ Name Default Value Description
+=================================== =============== ===================================================================
+ reportLevel 10 The Cyclomatic Complexity reporting threshold
+ showClassesComplexity true Indicate if class average violation should be added to the report
+ showMethodsComplexity true Indicate if class average violation should be added to the report
+=================================== =============== ===================================================================
+
+NPathComplexity
+===============
+
+Since: PHPMD 0.1
+
+The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
+
+
+Example: ::
+
+ class Foo {
+ function bar() {
+ // lots of complicated code
+ }
+ }
+
+This rule has the following properties:
+
+=================================== =============== ===============================
+ Name Default Value Description
+=================================== =============== ===============================
+ minimum 200 The npath reporting threshold
+=================================== =============== ===============================
+
+ExcessiveMethodLength
+=====================
+
+Since: PHPMD 0.1
+
+Violations of this rule usually indicate that the method is doing too much. Try to reduce the method size by creating helper methods and removing any copy/pasted code.
+
+
+Example: ::
+
+ class Foo {
+ public function doSomething() {
+ print("Hello world!" . PHP_EOL);
+ print("Hello world!" . PHP_EOL);
+ // 98 copies omitted for brevity.
+ }
+ }
+
+This rule has the following properties:
+
+=================================== =============== =====================================
+ Name Default Value Description
+=================================== =============== =====================================
+ minimum 100 The method size reporting threshold
+=================================== =============== =====================================
+
+ExcessiveClassLength
+====================
+
+Since: PHPMD 0.1
+
+Long Class files are indications that the class may be trying to do too much. Try to break it down, and reduce the size to something manageable.
+
+
+Example: ::
+
+ class Foo {
+ public function bar() {
+ // 1000 lines of code
+ }
+ }
+
+This rule has the following properties:
+
+=================================== =============== ====================================
+ Name Default Value Description
+=================================== =============== ====================================
+ minimum 1000 The class size reporting threshold
+=================================== =============== ====================================
+
+ExcessiveParameterList
+======================
+
+Since: PHPMD 0.1
+
+Long parameter lists can indicate that a new object should be created to wrap the numerous parameters. Basically, try to group the parameters together.
+
+
+Example: ::
+
+ class Foo {
+ public function addData(
+ $p0, $p1, $p2, $p3, $p4, $p5,
+ $p5, $p6, $p7, $p8, $p9, $p10) {
+ }
+ }
+
+This rule has the following properties:
+
+=================================== =============== =========================================
+ Name Default Value Description
+=================================== =============== =========================================
+ minimum 10 The parameter count reporting threshold
+=================================== =============== =========================================
+
+ExcessivePublicCount
+====================
+
+Since: PHPMD 0.1
+
+A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.
+
+
+Example: ::
+
+ public class Foo {
+ public $value;
+ public $something;
+ public $var;
+ // [... more more public attributes ...]
+
+ public function doWork() {}
+ public function doMoreWork() {}
+ public function doWorkAgain() {}
+ // [... more more public methods ...]
+ }
+
+This rule has the following properties:
+
+=================================== =============== =====================================
+ Name Default Value Description
+=================================== =============== =====================================
+ minimum 45 The public item reporting threshold
+=================================== =============== =====================================
+
+TooManyFields
+=============
+
+Since: PHPMD 0.1
+
+Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
+
+
+Example: ::
+
+ class Person {
+ protected $one;
+ private $two;
+ private $three;
+ [... many more fields ...]
+ }
+
+This rule has the following properties:
+
+=================================== =============== ======================================
+ Name Default Value Description
+=================================== =============== ======================================
+ maxfields 15 The field count reporting threshold
+=================================== =============== ======================================
+
+TooManyMethods
+==============
+
+Since: PHPMD 0.1
+
+A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
+
+This rule has the following properties:
+
+=================================== =============== =======================================
+ Name Default Value Description
+=================================== =============== =======================================
+ maxmethods 10 The method count reporting threshold
+=================================== =============== =======================================
+
+ExcessiveClassComplexity
+========================
+
+Since: PHPMD 0.2.5
+
+The WMC of a class is a good indicator of how much time and effort is required to modify and maintain this class. A large number of methods also means that this class has a greater potential impact on derived classes.
+
+
+Example: ::
+
+ class Foo {
+ public function bar() {
+ if ($a == $b) {
+ if ($a1 == $b1) {
+ fiddle();
+ } else if ($a2 == $b2) {
+ fiddle();
+ } else {
+ }
+ }
+ }
+ public function baz() {
+ if ($a == $b) {
+ if ($a1 == $b1) {
+ fiddle();
+ } else if ($a2 == $b2) {
+ fiddle();
+ } else {
+ }
+ }
+ }
+ // Several other complex methods
+ }
+
+This rule has the following properties:
+
+=================================== =============== ========================================
+ Name Default Value Description
+=================================== =============== ========================================
+ maximum 50 The maximum WMC tolerable for a class.
+=================================== =============== ========================================
+
+
+Remark
+======
+
+ This document is based on a ruleset xml-file, that was taken from the original source of the `PMD`__ project. This means that most parts of the content on this page are the intellectual work of the PMD community and its contributors and not of the PHPMD project.
+
+__ http://pmd.sourceforge.net/
+
\ No newline at end of file
diff --git a/vendor/phpmd/phpmd/src/site/rst/rules/controversial.rst b/vendor/phpmd/phpmd/src/site/rst/rules/controversial.rst
new file mode 100644
index 0000000..d57ba87
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/rules/controversial.rst
@@ -0,0 +1,103 @@
+===================
+Controversial Rules
+===================
+
+This ruleset contains a collection of controversial rules.
+
+Superglobals
+============
+
+Since: PHPMD 0.2
+
+Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
+
+
+Example: ::
+
+ class Foo {
+ public function bar() {
+ $name = $_POST['foo'];
+ }
+ }
+
+CamelCaseClassName
+==================
+
+Since: PHPMD 0.2
+
+It is considered best practice to use the CamelCase notation to name classes.
+
+
+Example: ::
+
+ class class_name {
+ }
+
+CamelCasePropertyName
+=====================
+
+Since: PHPMD 0.2
+
+It is considered best practice to use the camelCase notation to name attributes.
+
+
+Example: ::
+
+ class ClassName {
+ protected $property_name;
+ }
+
+CamelCaseMethodName
+===================
+
+Since: PHPMD 0.2
+
+It is considered best practice to use the CamelCase notation to name methods.
+
+
+Example: ::
+
+ class ClassName {
+ public function get_name() {
+ }
+ }
+
+CamelCaseParameterName
+======================
+
+Since: PHPMD 0.2
+
+It is considered best practice to use the camelCase notation to name parameters.
+
+
+Example: ::
+
+ class ClassName {
+ public function doSomething($user_name) {
+ }
+ }
+
+CamelCaseVariableName
+=====================
+
+Since: PHPMD 0.2
+
+It is considered best practice to use the camelCase notation to name variables.
+
+
+Example: ::
+
+ class ClassName {
+ public function doSomething() {
+ $data_module = new DataModule();
+ }
+ }
+
+
+Remark
+======
+
+ This document is based on a ruleset xml-file, that was taken from the original source of the `PMD`__ project. This means that most parts of the content on this page are the intellectual work of the PMD community and its contributors and not of the PHPMD project.
+
+__ http://pmd.sourceforge.net/
+
\ No newline at end of file
diff --git a/vendor/phpmd/phpmd/src/site/rst/rules/design.rst b/vendor/phpmd/phpmd/src/site/rst/rules/design.rst
new file mode 100644
index 0000000..0ed55da
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/rules/design.rst
@@ -0,0 +1,161 @@
+============
+Design Rules
+============
+
+The Design Ruleset contains a collection of rules that find software design related problems.
+
+ExitExpression
+==============
+
+Since: PHPMD 0.2
+
+An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
+
+
+Example: ::
+
+ class Foo {
+ public function bar($param) {
+ if ($param === 42) {
+ exit(23);
+ }
+ }
+ }
+
+EvalExpression
+==============
+
+Since: PHPMD 0.2
+
+An eval-expression is untestable, a security risk and bad practice. Therefore it should be avoided. Consider to replace the eval-expression with regular code.
+
+
+Example: ::
+
+ class Foo {
+ public function bar($param) {
+ if ($param === 42) {
+ eval('$param = 23;');
+ }
+ }
+ }
+
+GotoStatement
+=============
+
+Since: PHPMD 1.1.0
+
+Goto makes code harder to read and it is nearly impossible to understand the control flow of an application that uses this language construct. Therefore it should be avoided. Consider to replace Goto with regular control structures and separate methods/function, which are easier to read.
+
+
+Example: ::
+
+ class Foo {
+ public function bar($param) {
+ A:
+ if ($param === 42) {
+ goto X;
+ }
+ Y:
+ if (time() % 42 === 23) {
+ goto Z;
+ }
+ X:
+ if (time() % 23 === 42) {
+ goto Y;
+ }
+ Z:
+ return 42;
+ }
+ }
+
+NumberOfChildren
+================
+
+Since: PHPMD 0.2
+
+A class with an excessive number of children is an indicator for an unbalanced class hierarchy. You should consider to refactor this class hierarchy.
+
+
+
+This rule has the following properties:
+
+=================================== =============== =============================================
+ Name Default Value Description
+=================================== =============== =============================================
+ minimum 15 Maximum number of acceptable child classes.
+=================================== =============== =============================================
+
+DepthOfInheritance
+==================
+
+Since: PHPMD 0.2
+
+A class with many parents is an indicator for an unbalanced and wrong class hierarchy. You should consider to refactor this class hierarchy.
+
+
+
+This rule has the following properties:
+
+=================================== =============== ==============================================
+ Name Default Value Description
+=================================== =============== ==============================================
+ minimum 6 Maximum number of acceptable parent classes.
+=================================== =============== ==============================================
+
+CouplingBetweenObjects
+======================
+
+Since: PHPMD 1.1.0
+
+A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
+
+
+Example: ::
+
+ class Foo {
+ /**
+ * @var \foo\bar\X
+ */
+ private $x = null;
+
+ /**
+ * @var \foo\bar\Y
+ */
+ private $y = null;
+
+ /**
+ * @var \foo\bar\Z
+ */
+ private $z = null;
+
+ public function setFoo(\Foo $foo) {}
+ public function setBar(\Bar $bar) {}
+ public function setBaz(\Baz $baz) {}
+
+ /**
+ * @return \SplObjectStorage
+ * @throws \OutOfRangeException
+ * @throws \InvalidArgumentException
+ * @throws \ErrorException
+ */
+ public function process(\Iterator $it) {}
+
+ // ...
+ }
+
+This rule has the following properties:
+
+=================================== =============== ============================================
+ Name Default Value Description
+=================================== =============== ============================================
+ minimum 13 Maximum number of acceptable dependencies.
+=================================== =============== ============================================
+
+
+Remark
+======
+
+ This document is based on a ruleset xml-file, that was taken from the original source of the `PMD`__ project. This means that most parts of the content on this page are the intellectual work of the PMD community and its contributors and not of the PHPMD project.
+
+__ http://pmd.sourceforge.net/
diff --git a/vendor/phpmd/phpmd/src/site/rst/rules/index.rst b/vendor/phpmd/phpmd/src/site/rst/rules/index.rst
new file mode 100644
index 0000000..59ff953
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/rules/index.rst
@@ -0,0 +1,112 @@
+================
+Current Rulesets
+================
+
+List of rulesets and rules contained in each ruleset.
+
+- `Code Size Rules`__: The Code Size Ruleset contains a collection of rules that find code size related problems.
+- `Controversial Rules`__: This ruleset contains a collection of controversial rules.
+- `Design Rules`__: The Code Size Ruleset contains a collection of rules that find software design related problems.
+- `Naming Rules`__: The Naming Ruleset contains a collection of rules about names - too long, too short, and so forth.
+- `Unused Code Rules`__: The Unused Code Ruleset contains a collection of rules that find unused code.
+
+__ index.html#code-size-rules
+__ index.html#controversial-rules
+__ index.html#design-rules
+__ index.html#naming-rules
+__ index.html#unused-code-rules
+
+Code Size Rules
+===============
+
+- `CyclomaticComplexity`__: Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
+- `NPathComplexity`__: The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
+- `ExcessiveMethodLength`__: Violations of this rule usually indicate that the method is doing too much. Try to reduce the method size by creating helper methods and removing any copy/pasted code.
+- `ExcessiveClassLength`__: Long Class files are indications that the class may be trying to do too much. Try to break it down, and reduce the size to something manageable.
+- `ExcessiveParameterList`__: Long parameter lists can indicate that a new object should be created to wrap the numerous parameters. Basically, try to group the parameters together.
+- `ExcessivePublicCount`__: A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.
+- `TooManyFields`__: Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
+- `TooManyMethods`__: A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
+- `ExcessiveClassComplexity`__: The WMC of a class is a good indicator of how much time and effort is required to modify and maintain this class. A large number of methods also means that this class has a greater potential impact on derived classes.
+
+__ codesize.html#cyclomaticcomplexity
+__ codesize.html#npathcomplexity
+__ codesize.html#excessivemethodlength
+__ codesize.html#excessiveclasslength
+__ codesize.html#excessiveparameterlist
+__ codesize.html#excessivepubliccount
+__ codesize.html#toomanyfields
+__ codesize.html#toomanymethods
+__ codesize.html#excessiveclasscomplexity
+
+Controversial Rules
+===================
+
+- `Superglobals`__: Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
+- `CamelCaseClassName`__: It is considered best practice to use the CamelCase notation to name classes.
+- `CamelCasePropertyName`__: It is considered best practice to use the camelCase notation to name attributes.
+- `CamelCaseMethodName`__: It is considered best practice to use the CamelCase notation to name methods.
+- `CamelCaseParameterName`__: It is considered best practice to use the camelCase notation to name parameters.
+- `CamelCaseVariableName`__: It is considered best practice to use the camelCase notation to name variables.
+
+__ controversial.html#superglobals
+__ controversial.html#camelcaseclassname
+__ controversial.html#camelcasepropertyname
+__ controversial.html#camelcasemethodname
+__ controversial.html#camelcaseparametername
+__ controversial.html#camelcasevariablename
+
+Design Rules
+============
+
+- `ExitExpression`__: An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
+- `EvalExpression`__: An eval-expression is untestable, a security risk and bad practice. Therefore it should be avoided. Consider to replace the eval-expression with regular code.
+- `GotoStatement`__: Goto makes code harder to read and it is nearly impossible to understand the control flow of an application that uses this language construct. Therefore it should be avoided. Consider to replace Goto with regular control structures and separate methods/function, which are easier to read.
+- `NumberOfChildren`__: A class with an excessive number of children is an indicator for an unbalanced class hierarchy. You should consider to refactor this class hierarchy.
+- `DepthOfInheritance`__: A class with many parents is an indicator for an unbalanced and wrong class hierarchy. You should consider to refactor this class hierarchy.
+- `CouplingBetweenObjects`__: A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
+
+__ design.html#exitexpression
+__ design.html#evalexpression
+__ design.html#gotostatement
+__ design.html#numberofchildren
+__ design.html#depthofinheritance
+__ design.html#couplingbetweenobjects
+
+Naming Rules
+============
+
+- `ShortVariable`__: Detects when a field, local, or parameter has a very short name.
+- `LongVariable`__: Detects when a field, formal or local variable is declared with a long name.
+- `ShortMethodName`__: Detects when very short method names are used.
+- `ConstructorWithNameAsEnclosingClass`__: A constructor method should not have the same name as the enclosing class, consider to use the PHP 5 __construct method.
+- `ConstantNamingConventions`__: Class/Interface constant nanmes should always be defined in uppercase.
+- `BooleanGetMethodName`__: Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.
+
+__ naming.html#shortvariable
+__ naming.html#longvariable
+__ naming.html#shortmethodname
+__ naming.html#constructorwithnameasenclosingclass
+__ naming.html#constantnamingconventions
+__ naming.html#booleangetmethodname
+
+Unused Code Rules
+=================
+
+- `UnusedPrivateField`__: Detects when a private field is declared and/or assigned a value, but not used.
+- `UnusedLocalVariable`__: Detects when a local variable is declared and/or assigned, but not used.
+- `UnusedPrivateMethod`__: Unused Private Method detects when a private method is declared but is unused.
+- `UnusedFormalParameter`__: Avoid passing parameters to methods or constructors and then not using those parameters.
+
+__ unusedcode.html#unusedprivatefield
+__ unusedcode.html#unusedlocalvariable
+__ unusedcode.html#unusedprivatemethod
+__ unusedcode.html#unusedformalparameter
+
+
+Remark
+======
+
+ This document is based on a ruleset xml-file, that was taken from the original source of the `PMD`__ project. This means that most parts of the content on this page are the intellectual work of the PMD community and its contributors and not of the PHPMD project.
+
+__ http://pmd.sourceforge.net/
diff --git a/vendor/phpmd/phpmd/src/site/rst/rules/naming.rst b/vendor/phpmd/phpmd/src/site/rst/rules/naming.rst
new file mode 100644
index 0000000..ca15357
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/rules/naming.rst
@@ -0,0 +1,161 @@
+============
+Naming Rules
+============
+
+The Naming Ruleset contains a collection of rules about names - too long, too short, and so forth.
+
+ShortVariable
+=============
+
+Since: PHPMD 0.2
+
+Detects when a field, local, or parameter has a very short name.
+
+
+Example: ::
+
+ class Something {
+ private $q = 15; // VIOLATION - Field
+ public static function main( array $as ) { // VIOLATION - Formal
+ $r = 20 + $this->q; // VIOLATION - Local
+ for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
+ $r += $this->q;
+ }
+ }
+ }
+
+This rule has the following properties:
+
+=================================== =============== ===========================================================
+ Name Default Value Description
+=================================== =============== ===========================================================
+ minimum 3 Minimum length for a variable, property or parameter name
+=================================== =============== ===========================================================
+ exceptions empty Comma-separated list of names that should be allowed
+=================================== =============== ===========================================================
+
+LongVariable
+============
+
+Since: PHPMD 0.2
+
+Detects when a field, formal or local variable is declared with a long name.
+
+
+Example: ::
+
+ class Something {
+ protected $reallyLongIntName = -3; // VIOLATION - Field
+ public static function main( array $argumentsList[] ) { // VIOLATION - Formal
+ $otherReallyLongName = -5; // VIOLATION - Local
+ for ($interestingIntIndex = 0; // VIOLATION - For
+ $interestingIntIndex < 10;
+ $interestingIntIndex++ ) {
+ }
+ }
+ }
+
+This rule has the following properties:
+
+=================================== =============== =========================================
+ Name Default Value Description
+=================================== =============== =========================================
+ maximum 20 The variable length reporting threshold
+=================================== =============== =========================================
+
+ShortMethodName
+===============
+
+Since: PHPMD 0.2
+
+Detects when very short method names are used.
+
+
+Example: ::
+
+ class ShortMethod {
+ public function a( $index ) { // Violation
+ }
+ }
+
+This rule has the following properties:
+
+=================================== =============== ==============================================
+ Name Default Value Description
+=================================== =============== ==============================================
+ minimum 3 Minimum length for a method or function name
+=================================== =============== ==============================================
+
+ConstructorWithNameAsEnclosingClass
+===================================
+
+Since: PHPMD 0.2
+
+A constructor method should not have the same name as the enclosing class, consider to use the PHP 5 __construct method.
+
+
+Example: ::
+
+ class MyClass {
+ // this is bad because it is PHP 4 style
+ public function MyClass() {}
+ // this is good because it is a PHP 5 constructor
+ public function __construct() {}
+ }
+
+ConstantNamingConventions
+=========================
+
+Since: PHPMD 0.2
+
+Class/Interface constant nanmes should always be defined in uppercase.
+
+
+Example: ::
+
+ class Foo {
+ const MY_NUM = 0; // ok
+ const myTest = ""; // fail
+ }
+
+BooleanGetMethodName
+====================
+
+Since: PHPMD 0.2
+
+Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.
+
+
+Example: ::
+
+ class Foo {
+ /**
+ * @return boolean
+ */
+ public function getFoo() {} // bad
+ /**
+ * @return bool
+ */
+ public function isFoo(); // ok
+ /**
+ * @return boolean
+ */
+ public function getFoo($bar); // ok, unless checkParameterizedMethods=true
+ }
+
+This rule has the following properties:
+
+=================================== =============== ============================================================
+ Name Default Value Description
+=================================== =============== ============================================================
+ checkParameterizedMethods false Applies only to methods without parameter when set to true
+=================================== =============== ============================================================
+
+
+Remark
+======
+
+ This document is based on a ruleset xml-file, that was taken from the original source of the `PMD`__ project. This means that most parts of the content on this page are the intellectual work of the PMD community and its contributors and not of the PHPMD project.
+
+__ http://pmd.sourceforge.net/
+
\ No newline at end of file
diff --git a/vendor/phpmd/phpmd/src/site/rst/rules/unusedcode.rst b/vendor/phpmd/phpmd/src/site/rst/rules/unusedcode.rst
new file mode 100644
index 0000000..1ff67ce
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/rules/unusedcode.rst
@@ -0,0 +1,85 @@
+=================
+Unused Code Rules
+=================
+
+The Unused Code Ruleset contains a collection of rules that find unused code.
+
+UnusedPrivateField
+==================
+
+Since: PHPMD 0.2
+
+Detects when a private field is declared and/or assigned a value, but not used.
+
+
+Example: ::
+
+ class Something
+ {
+ private static $FOO = 2; // Unused
+ private $i = 5; // Unused
+ private $j = 6;
+ public function addOne()
+ {
+ return $this->j++;
+ }
+ }
+
+UnusedLocalVariable
+===================
+
+Since: PHPMD 0.2
+
+Detects when a local variable is declared and/or assigned, but not used.
+
+
+Example: ::
+
+ class Foo {
+ public function doSomething()
+ {
+ $i = 5; // Unused
+ }
+ }
+
+UnusedPrivateMethod
+===================
+
+Since: PHPMD 0.2
+
+Unused Private Method detects when a private method is declared but is unused.
+
+
+Example: ::
+
+ class Something
+ {
+ private function foo() {} // unused
+ }
+
+UnusedFormalParameter
+=====================
+
+Since: PHPMD 0.2
+
+Avoid passing parameters to methods or constructors and then not using those parameters.
+
+
+Example: ::
+
+ class Foo
+ {
+ private function bar($howdy)
+ {
+ // $howdy is not used
+ }
+ }
+
+
+Remark
+======
+
+ This document is based on a ruleset xml-file, that was taken from the original source of the `PMD`__ project. This means that most parts of the content on this page are the intellectual work of the PMD community and its contributors and not of the PHPMD project.
+
+__ http://pmd.sourceforge.net/
+
\ No newline at end of file
diff --git a/vendor/phpmd/phpmd/src/site/rst/support/.index.xml b/vendor/phpmd/phpmd/src/site/rst/support/.index.xml
new file mode 100644
index 0000000..e311dcf
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/support/.index.xml
@@ -0,0 +1,7 @@
+
+
+
+ index.rst
+
+
+
diff --git a/vendor/phpmd/phpmd/src/site/rst/support/index.rst b/vendor/phpmd/phpmd/src/site/rst/support/index.rst
new file mode 100644
index 0000000..b62b3f1
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/rst/support/index.rst
@@ -0,0 +1,40 @@
+=================
+Support & Contact
+=================
+
+If you think you found an error or you have an improvment for
+PHPMD, you can send questions and suggestions to our mailinglist.
+Or if you are interested in helping to improve this software,
+by writing patches, extensions or just providing new ideas, you
+should feel free to join PHPMD's `IRC channel`__ or send a
+message to the phpmd-users@phpmd.org mailinglist.
+
+IRC
+===
+
+- You will always find help on PHPMD related topics in the
+ `#phpmd`__ channel on the `Freenode`__ network.
+
+Issue-Tracker
+=============
+
+- You can file a ticket in PHPMD's `Issue tracker`__ when you
+ think you found a bug or you have a feature request for future
+ versions of PHPMD.
+
+Commercial support
+==================
+
+There are also companies providing commercial support for PHPMD:
+
+- `Qafoo GmbH - passion for software quality`__
+
+ Founded by me, the lead developer of PHPMD, and two friends, Qafoo
+ provides support for PHPMD and general consulting and training on
+ software quality tools and processes.
+
+__ irc://irc.freenode.net/#phpmd
+__ irc://irc.freenode.net/#phpmd
+__ http://freenode.net
+__ https://github.com/phpmd/phpmd/issues
+__ http://qafoo.com
diff --git a/vendor/phpmd/phpmd/src/site/scripts/pmd.xsl b/vendor/phpmd/phpmd/src/site/scripts/pmd.xsl
new file mode 100644
index 0000000..29ab46d
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/scripts/pmd.xsl
@@ -0,0 +1,279 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Remark
+======
+
+ This document is based on a ruleset xml-file, that was taken from the original source of the `PMD`__ project. This means that most parts of the content on this page are the intellectual work of the PMD community and its contributors and not of the PHPMD project.
+
+__ http://pmd.sourceforge.net/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Since: PHPMD
+
+
+
+
+
+
+
+
+
+
+
+
+ Example: ::
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This rule has the following properties:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/phpmd/phpmd/src/site/scripts/update-rules.php b/vendor/phpmd/phpmd/src/site/scripts/update-rules.php
new file mode 100755
index 0000000..7fbfb88
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/site/scripts/update-rules.php
@@ -0,0 +1,143 @@
+#!/usr/bin/env php
+' . PHP_EOL .
+ '' . PHP_EOL .
+ ' ' . PHP_EOL .
+ ' Index' . PHP_EOL .
+ ' index.rst' . PHP_EOL .
+ ' ' . PHP_EOL;
+
+foreach ( $files as $file )
+{
+ echo 'Processing: ', $file, PHP_EOL;
+
+ $name = pathinfo( $file, PATHINFO_FILENAME );
+ $path = $output . '/' . $name . '.rst';
+
+ $cmd = sprintf(
+ 'xsltproc %s/pmd.xsl %s > %s',
+ escapeshellarg( dirname( __FILE__ ) ),
+ escapeshellarg( $file ),
+ escapeshellarg( $path )
+ );
+ shell_exec( $cmd );
+
+ $sxml = simplexml_load_file( $file );
+ $index .= ' ' . PHP_EOL .
+ ' ' . $sxml['name'] . '' . PHP_EOL .
+ ' ' . $name . '.rst' . PHP_EOL .
+ ' ' . PHP_EOL;
+
+ $rules = array();
+ foreach ( $sxml->rule as $rule )
+ {
+ $rules[] = array(
+ 'name' => normalize( $rule['name'] ),
+ 'desc' => normalize( $rule->description ),
+ 'href' => $name . '.html#' . strtolower( $rule['name'] ),
+ );
+ }
+
+ $sets[] = array(
+ 'name' => normalize( $sxml['name'] ),
+ 'desc' => normalize( $sxml->description ),
+ 'rules' => $rules,
+ );
+}
+
+$index .= '';
+
+file_put_contents( $output . '/index.rst', generate_index( $sets ) );
+file_put_contents( $output . '/.index.xml', $index );
+
+
+exit( 0 );
+
+function normalize( $elem )
+{
+ return preg_replace( '(\s+)s', ' ', trim( (string) $elem ) );
+}
+
+function generate_index( array $sets )
+{
+ $content = '================' . PHP_EOL
+ . 'Current Rulesets' . PHP_EOL
+ . '================'
+ . PHP_EOL . PHP_EOL
+ . 'List of rulesets and rules contained in each ruleset.'
+ . PHP_EOL . PHP_EOL;
+
+ foreach ( $sets as $set )
+ {
+ $content .= sprintf(
+ '- `%s`__: %s%s',
+ $set['name'],
+ $set['desc'],
+ PHP_EOL
+ );
+ }
+
+ $content .= PHP_EOL;
+ foreach ( $sets as $set )
+ {
+ $anchor = preg_replace( '([^a-z0-9]+)i', '-', $set['name'] );
+ $anchor = strtolower( $anchor );
+
+ $content .= '__ index.html#' . $anchor . PHP_EOL;
+ }
+ $content .= PHP_EOL;
+
+ foreach ( $sets as $set )
+ {
+ $content .= $set['name'] . PHP_EOL;
+ $content .= str_repeat( '=', strlen( $set['name' ] ) );
+ $content .= PHP_EOL . PHP_EOL;
+
+ foreach ( $set['rules'] as $rule )
+ {
+ $content .= sprintf(
+ '- `%s`__: %s%s',
+ $rule['name'],
+ $rule['desc'],
+ PHP_EOL
+ );
+ }
+
+ $content .= PHP_EOL;
+ foreach ( $set['rules'] as $rule )
+ {
+ $content .= '__ ' . $rule['href'] . PHP_EOL;
+ }
+ $content .= PHP_EOL;
+ }
+ $content .= PHP_EOL;
+ $content .= 'Remark' . PHP_EOL .
+ '======' . PHP_EOL . PHP_EOL .
+ ' This document is based on a ruleset xml-file, that ' .
+ 'was taken from the original source of the `PMD`__ ' .
+ 'project. This means that most parts of the content ' .
+ 'on this page are the intellectual work of the PMD ' .
+ 'community and its contributors and not of the PHPMD ' .
+ 'project.' .
+ PHP_EOL . PHP_EOL .
+ '__ http://pmd.sourceforge.net/' .
+ PHP_EOL;
+
+ return $content;
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/AbstractTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/AbstractTest.php
new file mode 100644
index 0000000..63bba75
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/AbstractTest.php
@@ -0,0 +1,562 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+use PHPMD\Node\ClassNode;
+use PHPMD\Node\FunctionNode;
+use PHPMD\Node\InterfaceNode;
+use PHPMD\Node\MethodNode;
+use PHPMD\Stubs\RuleStub;
+
+/**
+ * Abstract base class for PHPMD test cases.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+abstract class AbstractTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Directory with test files.
+ *
+ * @var string $_filesDirectory
+ */
+ private static $filesDirectory = null;
+
+ /**
+ * Original directory is used to reset a changed working directory.
+ *
+ * @return void
+ */
+ private static $originalWorkingDirectory = null;
+
+ /**
+ * Temporary files created by a test.
+ *
+ * @var array(string)
+ */
+ private static $tempFiles = array();
+
+ /**
+ * Resets a changed working directory.
+ *
+ * @return void
+ */
+ protected function tearDown()
+ {
+ if (self::$originalWorkingDirectory !== null) {
+ chdir(self::$originalWorkingDirectory);
+ }
+ self::$originalWorkingDirectory = null;
+
+ foreach (self::$tempFiles as $tempFile) {
+ unlink($tempFile);
+ }
+ self::$tempFiles = array();
+
+ parent::tearDown();
+ }
+
+ /**
+ * Returns the first class found in a source file related to the calling
+ * test method.
+ *
+ * @return \PHPMD\Node\ClassNode
+ */
+ protected function getClass()
+ {
+ return new ClassNode(
+ $this->getNodeForCallingTestCase(
+ $this->parseTestCaseSource()->getClasses()
+ )
+ );
+ }
+
+ /**
+ * Returns the first interface found in a source file related to the calling
+ * test method.
+ *
+ * @return \PHPMD\Node\InterfaceNode
+ */
+ protected function getInterface()
+ {
+ return new InterfaceNode(
+ $this->getNodeForCallingTestCase(
+ $this->parseTestCaseSource()->getInterfaces()
+ )
+ );
+ }
+
+ /**
+ * Returns the first method found in a source file related to the calling
+ * test method.
+ *
+ * @return \PHPMD\Node\MethodNode
+ */
+ protected function getMethod()
+ {
+ return new MethodNode(
+ $this->getNodeForCallingTestCase(
+ $this->parseTestCaseSource()
+ ->getTypes()
+ ->current()
+ ->getMethods()
+ )
+ );
+ }
+
+ /**
+ * Returns the first function found in a source files related to the calling
+ * test method.
+ *
+ * @return \PHPMD\Node\FunctionNode
+ */
+ protected function getFunction()
+ {
+ return new FunctionNode(
+ $this->getNodeForCallingTestCase(
+ $this->parseTestCaseSource()->getFunctions()
+ )
+ );
+ }
+
+ /**
+ * Returns the absolute path for a test resource for the current test.
+ *
+ * @return string
+ * @since 1.1.0
+ */
+ protected static function createCodeResourceUriForTest()
+ {
+ $frame = self::getCallingTestCase();
+ return self::createResourceUriForTest($frame['function'] . '.php');
+ }
+
+ /**
+ * Returns the absolute path for a test resource for the current test.
+ *
+ * @param string $localPath The local/relative file location
+ *
+ * @return string
+ * @since 1.1.0
+ */
+ protected static function createResourceUriForTest($localPath)
+ {
+ $frame = self::getCallingTestCase();
+
+ $regexp = '([a-z]([0-9]+)Test$)i';
+ if (preg_match($regexp, $frame['class'], $match)) {
+ $parts = explode('\\', $frame['class']);
+ $testPath = $parts[count($parts) - 2] . '/' . $match[1];
+ } else {
+ $testPath = strtr(substr($frame['class'], 6, -4), '\\', '/');
+ }
+
+ return sprintf(
+ '%s/../../resources/files/%s/%s',
+ dirname(__FILE__),
+ $testPath,
+ $localPath
+ );
+ }
+
+ /**
+ * Parses the source code for the calling test method and returns the first
+ * package node found in the parsed file.
+ *
+ * @return PHP_Depend_Code_Package
+ */
+ private function parseTestCaseSource()
+ {
+ return $this->parseSource($this->createCodeResourceUriForTest());
+ }
+
+ /**
+ * Returns the trace frame of the calling test case.
+ *
+ * @return array
+ */
+ private static function getCallingTestCase()
+ {
+ foreach (debug_backtrace() as $frame) {
+ if (strpos($frame['function'], 'test') === 0) {
+ return $frame;
+ }
+ }
+ throw new \ErrorException('Cannot locate calling test case.');
+ }
+
+ /**
+ * Returns the PHP_Depend node for the calling test case.
+ *
+ * @param \Iterator $nodes
+ * @return PHP_Depend_Code_AbstractItem
+ */
+ private function getNodeForCallingTestCase(\Iterator $nodes)
+ {
+ $frame = $this->getCallingTestCase();
+ foreach ($nodes as $node) {
+ if ($node->getName() === $frame['function']) {
+ return $node;
+ }
+ }
+ throw new \ErrorException('Cannot locate node for test case.');
+ }
+
+ /**
+ * Parses the source of the given file and returns the first package found
+ * in that file.
+ *
+ * @param string $sourceFile
+ * @return PHP_Depend_Code_Package
+ */
+ private function parseSource($sourceFile)
+ {
+ if (file_exists($sourceFile) === false) {
+ throw new \ErrorException('Cannot locate source file: ' . $sourceFile);
+ }
+
+ $tokenizer = new \PDepend\Source\Language\PHP\PHPTokenizerInternal();
+ $tokenizer->setSourceFile($sourceFile);
+
+ $builder = new \PDepend\Source\Language\PHP\PHPBuilder();
+
+ $parser = new \PDepend\Source\Language\PHP\PHPParserGeneric(
+ $tokenizer,
+ $builder,
+ new \PDepend\Util\Cache\Driver\MemoryCacheDriver()
+ );
+ $parser->parse();
+
+ return $builder->getNamespaces()->current();
+ }
+
+ /**
+ * Creates a mocked class node instance.
+ *
+ * @param string $metric
+ * @param mixed $value
+ * @return \PHPMD\Node\ClassNode
+ */
+ protected function getClassMock($metric = null, $value = null)
+ {
+ $class = $this->getMock(
+ 'PHPMD\\Node\\ClassNode',
+ array(),
+ array(null),
+ '',
+ false
+ );
+
+ if ($metric !== null) {
+ $class->expects($this->atLeastOnce())
+ ->method('getMetric')
+ ->with($this->equalTo($metric))
+ ->will($this->returnValue($value));
+ }
+ return $class;
+ }
+
+ /**
+ * Creates a mocked method node instance.
+ *
+ * @param string $metric
+ * @param mixed $value
+ * @return \PHPMD\Node\MethodNode
+ */
+ protected function getMethodMock($metric = null, $value = null)
+ {
+ return $this->initFunctionOrMethod(
+ $this->getMock('PHPMD\\Node\\MethodNode', array(), array(null), '', false),
+ $metric,
+ $value
+ );
+ }
+
+ /**
+ * Creates a mocked function node instance.
+ *
+ * @param string $metric The metric acronym used by PHP_Depend.
+ * @param mixed $value The expected metric return value.
+ *
+ * @return \PHPMD\Node\FunctionNode
+ */
+ protected function createFunctionMock($metric = null, $value = null)
+ {
+ return $this->initFunctionOrMethod(
+ $this->getMock('PHPMD\\Node\\FunctionNode', array(), array(null), '', false),
+ $metric,
+ $value
+ );
+ }
+
+ /**
+ * Initializes the getMetric() method of the given function or method node.
+ *
+ * @param \PHPMD\Node\FunctionNode|\PHPMD\Node\MethodNode $mock
+ * @param string $metric
+ * @param mixed $value
+ * @return \PHPMD\Node\FunctionNode|\PHPMD\Node\MethodNode
+ */
+ protected function initFunctionOrMethod($mock, $metric, $value)
+ {
+ if ($metric === null) {
+ return $mock;
+ }
+
+ $mock->expects($this->atLeastOnce())
+ ->method('getMetric')
+ ->with($this->equalTo($metric))
+ ->will($this->returnValue($value));
+
+ return $mock;
+ }
+
+ /**
+ * Creates a mocked report instance.
+ *
+ * @param integer $expectedInvokes Number of expected invokes.
+ *
+ * @return \PHPMD\Report
+ */
+ protected function getReportMock($expectedInvokes = -1)
+ {
+ $expects = null;
+ if ($expectedInvokes < 0) {
+ $expects = $this->atLeastOnce();
+ } elseif ($expectedInvokes === 0) {
+ $expects = $this->never();
+ } elseif ($expectedInvokes === 1) {
+ $expects = $this->once();
+ } else {
+ $expects = $this->exactly($expectedInvokes);
+ }
+
+ $report = $this->getMock('PHPMD\\Report');
+ $report->expects($expects)
+ ->method('addRuleViolation');
+
+ return $report;
+ }
+
+ /**
+ * Creates a mocked {@link \PHPMD\AbstractRule} instance.
+ *
+ * @return \PHPMD\AbstractRule
+ */
+ protected function getRuleMock()
+ {
+ return $this->getMockForAbstractClass('PHPMD\\AbstractRule');
+ }
+
+ /**
+ * Creates a mocked rule-set instance.
+ *
+ * @param string $expectedClass Optional class name for apply() expected at least once.
+ * @param mixed $count How often should apply() be called?
+ * @return \PHPMD\RuleSet
+ */
+ protected function getRuleSetMock($expectedClass = null, $count = '*')
+ {
+ $ruleSet = $this->getMock('PHPMD\RuleSet');
+ if ($expectedClass === null) {
+ $ruleSet->expects($this->never())->method('apply');
+ } else {
+ $ruleSet->expects(
+ $count === '*' ? $this->atLeastOnce() : $this->exactly($count)
+ )
+ ->method('apply')
+ ->with($this->isInstanceOf($expectedClass));
+ }
+ return $ruleSet;
+ }
+
+ /**
+ * Creates a mocked rul violation instance.
+ *
+ * @param string $fileName
+ * @param integer $beginLine
+ * @param integer $endLine
+ * @param object $rule
+ * @return \PHPMD\RuleViolation
+ */
+ protected function getRuleViolationMock(
+ $fileName = '/foo/bar.php',
+ $beginLine = 23,
+ $endLine = 42,
+ $rule = null
+ ) {
+ $ruleViolation = $this->getMock(
+ 'PHPMD\\RuleViolation',
+ array(),
+ array(null, null, null),
+ '',
+ false
+ );
+
+ if ($rule === null) {
+ $rule = new RuleStub();
+ }
+
+ $ruleViolation->expects($this->any())
+ ->method('getRule')
+ ->will($this->returnValue($rule));
+ $ruleViolation->expects($this->any())
+ ->method('getFileName')
+ ->will($this->returnValue($fileName));
+ $ruleViolation->expects($this->any())
+ ->method('getBeginLine')
+ ->will($this->returnValue($beginLine));
+ $ruleViolation->expects($this->any())
+ ->method('getEndLine')
+ ->will($this->returnValue($endLine));
+ $ruleViolation->expects($this->any())
+ ->method('getNamespaceName')
+ ->will($this->returnValue('TestStubPackage'));
+ $ruleViolation->expects($this->any())
+ ->method('getDescription')
+ ->will($this->returnValue('Test description'));
+
+ return $ruleViolation;
+ }
+
+ /**
+ * Asserts the actual xml output matches against the expected file.
+ *
+ * @param string $actualOutput Generated xml output.
+ * @param string $expectedFileName File with expected xml result.
+ *
+ * @return void
+ */
+ public static function assertXmlEquals($actualOutput, $expectedFileName)
+ {
+ $actual = simplexml_load_string($actualOutput);
+ // Remove dynamic timestamp and duration attribute
+ if (isset($actual['timestamp'])) {
+ $actual['timestamp'] = '';
+ }
+ if (isset($actual['duration'])) {
+ $actual['duration'] = '';
+ }
+ if (isset($actual['version'])) {
+ $actual['version'] = '@package_version@';
+ }
+
+ $expected = str_replace(
+ '#{rootDirectory}',
+ self::$filesDirectory,
+ file_get_contents(self::createFileUri($expectedFileName))
+ );
+
+ self::assertXmlStringEqualsXmlString($expected, $actual->saveXML());
+ }
+
+ /**
+ * This method initializes the test environment, it configures the files
+ * directory and sets the include_path for svn versions.
+ *
+ * @return void
+ */
+ public static function setUpBeforeClass()
+ {
+ self::$filesDirectory = realpath(__DIR__ . '/../../resources/files');
+
+ if (false === strpos(get_include_path(), self::$filesDirectory)) {
+ set_include_path(
+ sprintf(
+ '%s%s%s%s%s',
+ get_include_path(),
+ PATH_SEPARATOR,
+ self::$filesDirectory,
+ PATH_SEPARATOR,
+ realpath(__DIR__ . '/../')
+ )
+ );
+ }
+
+ // Prevent timezone warnings if no default TZ is set (PHP > 5.1.0)
+ date_default_timezone_set('UTC');
+ }
+
+ /**
+ * Changes the working directory for a single test.
+ *
+ * @param string $localPath The temporary working directory.
+ *
+ * @return void
+ */
+ protected static function changeWorkingDirectory($localPath = '')
+ {
+ self::$originalWorkingDirectory = getcwd();
+
+ if (0 === preg_match('(^([A-Z]:|/))', $localPath)) {
+ $localPath = self::createFileUri($localPath);
+ }
+ chdir($localPath);
+ }
+
+ /**
+ * Creates a full filename for a test content in the _files directory.
+ *
+ * @param string $localPath
+ * @return string
+ */
+ protected static function createFileUri($localPath = '')
+ {
+ return self::$filesDirectory . '/' . $localPath;
+ }
+
+ /**
+ * Creates a file uri for a temporary test file.
+ *
+ * @return string
+ */
+ protected static function createTempFileUri()
+ {
+ return (self::$tempFiles[] = tempnam(sys_get_temp_dir(), 'phpmd.'));
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Integration/CommandLineInputFileOptionTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Integration/CommandLineInputFileOptionTest.php
new file mode 100644
index 0000000..b079c41
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Integration/CommandLineInputFileOptionTest.php
@@ -0,0 +1,119 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Integration;
+
+use PHPMD\AbstractTest;
+use PHPMD\TextUI\Command;
+
+/**
+ * Integration tests for the command line option --inputfile.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ *
+ * @group phpmd
+ * @group phpmd::integration
+ * @group integrationtest
+ */
+class CommandLineInputFileOptionTest extends AbstractTest
+{
+ /**
+ * testReportContainsExpectedRuleViolationWarning
+ *
+ * @return void
+ * @outputBuffering enabled
+ */
+ public function testReportContainsExpectedRuleViolationWarning()
+ {
+ self::assertContains(
+ "Avoid unused local variables such as '\$foo'.",
+ self::runCommandLine()
+ );
+ }
+
+ /**
+ * testReportNotContainsRuleViolationWarningForFileNotInList
+ *
+ * @return void
+ * @outputBuffering enabled
+ */
+ public function testReportNotContainsRuleViolationWarningForFileNotInList()
+ {
+ self::assertNotContains(
+ "Avoid unused local variables such as '\$bar'.",
+ self::runCommandLine()
+ );
+ }
+
+ /**
+ * Runs the PHPMD command line interface and returns the report content.
+ *
+ * @return string
+ */
+ protected static function runCommandLine()
+ {
+ $inputfile = self::createResourceUriForTest('inputfile.txt');
+ $reportfile = self::createTempFileUri();
+
+ self::changeWorkingDirectory(dirname($inputfile));
+
+ Command::main(
+ array(
+ __FILE__,
+ 'text',
+ 'unusedcode',
+ '--reportfile',
+ $reportfile,
+ '--inputfile',
+ $inputfile
+ )
+ );
+ return file_get_contents($reportfile);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Integration/CouplingBetweenObjectsIntegrationTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Integration/CouplingBetweenObjectsIntegrationTest.php
new file mode 100644
index 0000000..6e2b245
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Integration/CouplingBetweenObjectsIntegrationTest.php
@@ -0,0 +1,93 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Integration;
+
+use PHPMD\AbstractTest;
+use PHPMD\TextUI\Command;
+
+/**
+ * Integration tests for the coupling between objects rule class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ *
+ * @group phpmd
+ * @group phpmd::integration
+ * @group integrationtest
+ */
+class CouplingBetweenObjectsIntegrationTest extends AbstractTest
+{
+ /**
+ * testReportContainsCouplingBetweenObjectsWarning
+ *
+ * @return void
+ * @outputBuffering enabled
+ */
+ public function testReportContainsCouplingBetweenObjectsWarning()
+ {
+ $file = self::createTempFileUri();
+
+ Command::main(
+ array(
+ __FILE__,
+ $this->createCodeResourceUriForTest(),
+ 'text',
+ 'design',
+ '--reportfile',
+ $file
+ )
+ );
+
+ self::assertContains(
+ 'has a coupling between objects value of 14. ' .
+ 'Consider to reduce the number of dependencies under 13.',
+ file_get_contents($file)
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Integration/GotoStatementIntegrationTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Integration/GotoStatementIntegrationTest.php
new file mode 100644
index 0000000..d52f64e
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Integration/GotoStatementIntegrationTest.php
@@ -0,0 +1,89 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ */
+
+namespace PHPMD\Integration;
+
+use PHPMD\AbstractTest;
+use PHPMD\TextUI\Command;
+
+/**
+ * Test case for the goto statement GotoStatementIntegrationTest.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.1.0
+ *
+ * @group phpmd
+ * @group phpmd::integration
+ * @group integrationtest
+ */
+class GotoStatementIntegrationTest extends AbstractTest
+{
+ /**
+ * testReportContainsGotoStatementWarning
+ *
+ * @return void
+ * @outputBuffering enabled
+ */
+ public function testReportContainsGotoStatementWarning()
+ {
+ $file = self::createTempFileUri();
+
+ Command::main(
+ array(
+ __FILE__,
+ $this->createCodeResourceUriForTest(),
+ 'text',
+ 'design',
+ '--reportfile',
+ $file
+ )
+ );
+
+ self::assertContains('utilizes a goto statement.', file_get_contents($file));
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/ASTNodeTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/ASTNodeTest.php
new file mode 100644
index 0000000..7845779
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/ASTNodeTest.php
@@ -0,0 +1,134 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PHPMD\AbstractTest;
+
+/**
+ * Test case for the {@link \PHPMD\Node\ASTNode} class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\Node\ASTNode
+ * @group phpmd
+ * @group phpmd::node
+ * @group unittest
+ */
+class ASTNodeTest extends AbstractTest
+{
+ /**
+ * testGetImageDelegatesToGetImageMethodOfWrappedNode
+ *
+ * @return void
+ */
+ public function testGetImageDelegatesToGetImageMethodOfWrappedNode()
+ {
+ $mock = $this->getMock('PDepend\Source\AST\ASTNode');
+ $mock->expects($this->once())
+ ->method('getImage');
+
+ $node = new ASTNode($mock, __FILE__);
+ $node->getImage();
+ }
+
+ /**
+ * testGetNameDelegatesToGetImageMethodOfWrappedNode
+ *
+ * @return void
+ */
+ public function testGetNameDelegatesToGetImageMethodOfWrappedNode()
+ {
+ $mock = $this->getMock('PDepend\Source\AST\ASTNode');
+ $mock->expects($this->once())
+ ->method('getImage');
+
+ $node = new ASTNode($mock, __FILE__);
+ $node->getName();
+ }
+
+ /**
+ * testHasSuppressWarningsAnnotationForAlwaysReturnsFalse
+ *
+ * @return void
+ */
+ public function testHasSuppressWarningsAnnotationForAlwaysReturnsFalse()
+ {
+ $mock = $this->getMock('PDepend\Source\AST\ASTNode');
+
+ $node = new ASTNode($mock, __FILE__);
+ $rule = $this->getMockForAbstractClass('PHPMD\\AbstractRule');
+
+ $this->assertFalse($node->hasSuppressWarningsAnnotationFor($rule));
+ }
+
+ /**
+ * testGetParentNameReturnsNull
+ *
+ * @return void
+ */
+ public function testGetParentNameReturnsNull()
+ {
+ $mock = $this->getMock('PDepend\Source\AST\ASTNode');
+ $node = new ASTNode($mock, __FILE__);
+
+ $this->assertNull($node->getParentName());
+ }
+
+ /**
+ * testGetNamespaceNameReturnsNull
+ *
+ * @return void
+ */
+ public function testGetNamespaceNameReturnsNull()
+ {
+ $mock = $this->getMock('PDepend\Source\AST\ASTNode');
+ $node = new ASTNode($mock, __FILE__);
+
+ $this->assertNull($node->getNamespaceName());
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/AnnotationTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/AnnotationTest.php
new file mode 100644
index 0000000..0c8506b
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/AnnotationTest.php
@@ -0,0 +1,149 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PHPMD\AbstractTest;
+
+/**
+ * Test case for the {@link \PHPMD\Node\Annotation} class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\Node\Annotation
+ * @group phpmd
+ * @group phpmd::node
+ * @group unittest
+ */
+class AnnotationTest extends AbstractTest
+{
+ /**
+ * testAnnotationReturnsFalseWhenNoSuppressWarningAnnotationExists
+ *
+ * @return void
+ */
+ public function testAnnotationReturnsFalseWhenNoSuppressWarningAnnotationExists()
+ {
+ $annotation = new Annotation('NoSuppressWarning', 'PMD');
+ $this->assertFalse($annotation->suppresses($this->getRuleMock()));
+ }
+
+ /**
+ * testAnnotationReturnsFalseWhenSuppressWarningContainsInvalidValue
+ *
+ * @return void
+ */
+ public function testAnnotationReturnsFalseWhenSuppressWarningContainsInvalidValue()
+ {
+ $annotation = new Annotation('SuppressWarnings', 'PHP');
+ $this->assertFalse($annotation->suppresses($this->getRuleMock()));
+ }
+
+ /**
+ * testAnnotationReturnsTrueWhenSuppressWarningContainsWithPMD
+ *
+ * @return void
+ */
+ public function testAnnotationReturnsTrueWhenSuppressWarningContainsWithPMD()
+ {
+ $annotation = new Annotation('SuppressWarnings', 'PMD');
+ $this->assertTrue($annotation->suppresses($this->getRuleMock()));
+ }
+
+ /**
+ * testAnnotationReturnsTrueWhenSuppressWarningContainsWithPHPMD
+ *
+ * @return void
+ */
+ public function testAnnotationReturnsTrueWhenSuppressWarningContainsWithPHPMD()
+ {
+ $annotation = new Annotation('SuppressWarnings', 'PHPMD');
+ $this->assertTrue($annotation->suppresses($this->getRuleMock()));
+ }
+
+ /**
+ * testAnnotationReturnsTrueWhenSuppressWarningContainsPMDPlusRuleName
+ *
+ * @return void
+ */
+ public function testAnnotationReturnsTrueWhenSuppressWarningContainsPMDPlusRuleName()
+ {
+ $rule = $this->getRuleMock();
+ $rule->setName('UnusedCodeRule');
+
+ $annotation = new Annotation('SuppressWarnings', 'PMD.UnusedCodeRule');
+ $this->assertTrue($annotation->suppresses($rule));
+ }
+
+ /**
+ * testAnnotationReturnsTrueWhenSuppressWarningContainsPHPMDPlusRuleName
+ *
+ * @return void
+ */
+ public function testAnnotationReturnsTrueWhenSuppressWarningContainsPHPMDPlusRuleName()
+ {
+ $rule = $this->getRuleMock();
+ $rule->setName('UnusedCodeRule');
+
+ $annotation = new Annotation('SuppressWarnings', 'PHPMD.UnusedCodeRule');
+ $this->assertTrue($annotation->suppresses($rule));
+ }
+
+ /**
+ * testAnnotationReturnsTrueWhenSuppressWarningContainsPartialRuleName
+ *
+ * @return void
+ */
+ public function testAnnotationReturnsTrueWhenSuppressWarningContainsPartialRuleName()
+ {
+ $rule = $this->getRuleMock();
+ $rule->setName('UnusedCodeRule');
+
+ $annotation = new Annotation('SuppressWarnings', 'unused');
+ $this->assertTrue($annotation->suppresses($rule));
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/AnnotationsTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/AnnotationsTest.php
new file mode 100644
index 0000000..a0e169a
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/AnnotationsTest.php
@@ -0,0 +1,140 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PHPMD\AbstractTest;
+
+/**
+ * Test case for the {@link \PHPMD\Node\Annotations} class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\Node\Annotations
+ * @group phpmd
+ * @group phpmd::node
+ * @group unittest
+ */
+class AnnotationsTest extends AbstractTest
+{
+ /**
+ * testCollectionReturnsFalseWhenNoAnnotationExists
+ *
+ * @return void
+ */
+ public function testCollectionReturnsFalseWhenNoAnnotationExists()
+ {
+ $annotations = new Annotations($this->getClassMock());
+ $this->assertFalse($annotations->suppresses($this->getRuleMock()));
+ }
+
+ /**
+ * testCollectionReturnsFalseWhenNoMatchingAnnotationExists
+ *
+ * @return void
+ */
+ public function testCollectionReturnsFalseWhenNoMatchingAnnotationExists()
+ {
+ $class = $this->getClassMock();
+ $class->expects($this->once())
+ ->method('__call')
+ ->with($this->equalTo('getDocComment'))
+ ->will(
+ $this->returnValue(
+ '/**
+ * @SuppressWarnings("Foo")
+ * @SuppressWarnings("Bar")
+ * @SuppressWarnings("Baz")
+ */'
+ )
+ );
+
+ $annotations = new Annotations($class);
+ $this->assertFalse($annotations->suppresses($this->getRuleMock()));
+ }
+
+ /**
+ * testCollectionReturnsTrueWhenMatchingAnnotationExists
+ *
+ * @return void
+ */
+ public function testCollectionReturnsTrueWhenMatchingAnnotationExists()
+ {
+ $class = $this->getClassMock();
+ $class->expects($this->once())
+ ->method('__call')
+ ->with($this->equalTo('getDocComment'))
+ ->will($this->returnValue('/** @SuppressWarnings("PMD") */'));
+
+ $annotations = new Annotations($class);
+ $this->assertTrue($annotations->suppresses($this->getRuleMock()));
+ }
+
+ /**
+ * testCollectionReturnsTrueWhenOneMatchingAnnotationExists
+ *
+ * @return void
+ */
+ public function testCollectionReturnsTrueWhenOneMatchingAnnotationExists()
+ {
+ $class = $this->getClassMock();
+ $class->expects($this->once())
+ ->method('__call')
+ ->with($this->equalTo('getDocComment'))
+ ->will(
+ $this->returnValue(
+ '/**
+ * @SuppressWarnings("FooBar")
+ * @SuppressWarnings("PMD")
+ */'
+ )
+ );
+
+ $annotations = new Annotations($class);
+ $this->assertTrue($annotations->suppresses($this->getRuleMock()));
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/ClassNodeTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/ClassNodeTest.php
new file mode 100644
index 0000000..1be170e
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/ClassNodeTest.php
@@ -0,0 +1,96 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PHPMD\AbstractTest;
+
+/**
+ * Test case for the class node implementation.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\Node\ClassNode
+ * @covers \PHPMD\Node\AbstractTypeNode
+ * @group phpmd
+ * @group phpmd::node
+ * @group unittest
+ */
+class ClassNodeTest extends AbstractTest
+{
+ /**
+ * testGetMethodNamesReturnsExpectedResult
+ *
+ * @return void
+ */
+ public function testGetMethodNamesReturnsExpectedResult()
+ {
+ $class = new \PDepend\Source\AST\ASTClass(null);
+ $class->addMethod(new \PDepend\Source\AST\ASTMethod(__CLASS__));
+ $class->addMethod(new \PDepend\Source\AST\ASTMethod(__FUNCTION__));
+
+ $node = new ClassNode($class);
+ $this->assertEquals(array(__CLASS__, __FUNCTION__), $node->getMethodNames());
+ }
+
+ /**
+ * testHasSuppressWarningsAnnotationForReturnsTrue
+ *
+ * @return void
+ */
+ public function testHasSuppressWarningsAnnotationForReturnsTrue()
+ {
+ $class = new \PDepend\Source\AST\ASTClass(null);
+ $class->setDocComment('/** @SuppressWarnings("PMD") */');
+
+ $rule = $this->getMock('PHPMD\\AbstractRule');
+
+ $node = new ClassNode($class);
+
+ $this->assertTrue($node->hasSuppressWarningsAnnotationFor($rule));
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/FunctionTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/FunctionTest.php
new file mode 100644
index 0000000..a766d16
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/FunctionTest.php
@@ -0,0 +1,92 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PDepend\Source\AST\ASTFunction;
+use PHPMD\AbstractTest;
+
+/**
+ * Test case for the function node implementation.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\Node\FunctionNode
+ * @covers \PHPMD\Node\AbstractCallableNode
+ * @group phpmd
+ * @group phpmd::node
+ * @group unittest
+ */
+class FunctionNodeTest extends AbstractTest
+{
+ /**
+ * testMagicCallDelegatesToWrappedPHPDependFunction
+ *
+ * @return void
+ */
+ public function testMagicCallDelegatesToWrappedPHPDependFunction()
+ {
+ $function = $this->getMock('PDepend\\Source\\AST\\ASTFunction', array(), array(null));
+ $function->expects($this->once())
+ ->method('getStartLine');
+
+ $node = new FunctionNode($function);
+ $node->getStartLine();
+ }
+
+ /**
+ * testMagicCallThrowsExceptionWhenNoMatchingMethodExists
+ *
+ * @return void
+ * @expectedException BadMethodCallException
+ */
+ public function testMagicCallThrowsExceptionWhenNoMatchingMethodExists()
+ {
+ $node = new FunctionNode(new ASTFunction(null));
+ $node->getFooBar();
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/MethodNodeTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/MethodNodeTest.php
new file mode 100644
index 0000000..b098ee3
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Node/MethodNodeTest.php
@@ -0,0 +1,219 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Node;
+
+use PHPMD\AbstractTest;
+
+/**
+ * Test case for the method node implementation.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\Node\MethodNode
+ * @covers \PHPMD\Node\AbstractCallableNode
+ * @group phpmd
+ * @group phpmd::node
+ * @group unittest
+ */
+class MethodNodeTest extends AbstractTest
+{
+ /**
+ * testMagicCallDelegatesToWrappedPHPDependMethod
+ *
+ * @return void
+ */
+ public function testMagicCallDelegatesToWrappedPHPDependMethod()
+ {
+ $method = $this->getMock('PDepend\\Source\\AST\\ASTMethod', array(), array(null));
+ $method->expects($this->once())
+ ->method('getStartLine');
+
+ $node = new MethodNode($method);
+ $node->getStartLine();
+ }
+
+ /**
+ * testMagicCallThrowsExceptionWhenNoMatchingMethodExists
+ *
+ * @return void
+ * @expectedException \BadMethodCallException
+ */
+ public function testMagicCallThrowsExceptionWhenNoMatchingMethodExists()
+ {
+ $node = new MethodNode(new \PDepend\Source\AST\ASTMethod(null));
+ $node->getFooBar();
+ }
+
+ /**
+ * testGetParentTypeReturnsInterfaceForInterfaceMethod
+ *
+ * @return void
+ */
+ public function testGetParentTypeReturnsInterfaceForInterfaceMethod()
+ {
+ $this->assertInstanceOf(
+ 'PHPMD\\Node\\InterfaceNode',
+ $this->getMethod()->getParentType()
+ );
+ }
+
+ /**
+ * testGetParentTypeReturnsClassForClassMethod
+ *
+ * @return void
+ */
+ public function testGetParentTypeReturnsClassForClassMethod()
+ {
+ $this->assertInstanceOf(
+ 'PHPMD\\Node\\ClassNode',
+ $this->getMethod()->getParentType()
+ );
+ }
+
+ /**
+ * testHasSuppressWarningsExecutesDefaultImplementation
+ *
+ * @return void
+ */
+ public function testHasSuppressWarningsExecutesDefaultImplementation()
+ {
+ $rule = $this->getRuleMock();
+ $rule->setName('FooBar');
+
+ $method = $this->getMethod();
+ $this->assertTrue($method->hasSuppressWarningsAnnotationFor($rule));
+ }
+
+ /**
+ * testHasSuppressWarningsDelegatesToParentClassMethod
+ *
+ * @return void
+ */
+ public function testHasSuppressWarningsDelegatesToParentClassMethod()
+ {
+ $rule = $this->getRuleMock();
+ $rule->setName('FooBar');
+
+ $method = $this->getMethod();
+ $this->assertTrue($method->hasSuppressWarningsAnnotationFor($rule));
+ }
+
+ /**
+ * testHasSuppressWarningsDelegatesToParentInterfaceMethod
+ *
+ * @return void
+ */
+ public function testHasSuppressWarningsDelegatesToParentInterfaceMethod()
+ {
+ $rule = $this->getRuleMock();
+ $rule->setName('FooBar');
+
+ $method = $this->getMethod();
+ $this->assertTrue($method->hasSuppressWarningsAnnotationFor($rule));
+ }
+
+ /**
+ * testIsDeclarationReturnsTrueForMethodDeclaration
+ *
+ * @return void
+ * @since 1.2.1
+ */
+ public function testIsDeclarationReturnsTrueForMethodDeclaration()
+ {
+ $method = $this->getMethod();
+ $this->assertTrue($method->isDeclaration());
+ }
+
+ /**
+ * testIsDeclarationReturnsTrueForMethodDeclarationWithParent
+ *
+ * @return void
+ * @since 1.2.1
+ */
+ public function testIsDeclarationReturnsTrueForMethodDeclarationWithParent()
+ {
+ $method = $this->getMethod();
+ $this->assertTrue($method->isDeclaration());
+ }
+
+ /**
+ * testIsDeclarationReturnsFalseForInheritMethodDeclaration
+ *
+ * @return void
+ * @since 1.2.1
+ */
+ public function testIsDeclarationReturnsFalseForInheritMethodDeclaration()
+ {
+ $method = $this->getMethod();
+ $this->assertFalse($method->isDeclaration());
+ }
+
+ /**
+ * testIsDeclarationReturnsFalseForImplementedAbstractMethod
+ *
+ * @return void
+ * @since 1.2.1
+ */
+ public function testIsDeclarationReturnsFalseForImplementedAbstractMethod()
+ {
+ $method = $this->getMethod();
+ $this->assertFalse($method->isDeclaration());
+ }
+
+ /**
+ * testIsDeclarationReturnsFalseForImplementedInterfaceMethod
+ *
+ * @return void
+ * @since 1.2.1
+ */
+ public function testIsDeclarationReturnsFalseForImplementedInterfaceMethod()
+ {
+ $method = $this->getMethod();
+ $this->assertFalse($method->isDeclaration());
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/PMDTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/PMDTest.php
new file mode 100644
index 0000000..1c2068b
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/PMDTest.php
@@ -0,0 +1,195 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+use PHPMD\Renderer\XMLRenderer;
+use PHPMD\Stubs\WriterStub;
+
+/**
+ * Test case for the main PHPMD class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\PHPMD
+ * @group phpmd
+ * @group unittest
+ */
+class PHPMDTest extends AbstractTest
+{
+ /**
+ * Tests the main PHPMD interface with default settings an a xml-renderer.
+ *
+ * @return void
+ */
+ public function testRunWithDefaultSettingsAndXmlRenderer()
+ {
+ self::changeWorkingDirectory();
+
+ $writer = new WriterStub();
+
+ $renderer = new XMLRenderer();
+ $renderer->setWriter($writer);
+
+ $phpmd = new PHPMD();
+ $phpmd->processFiles(
+ self::createFileUri('source/ccn_function.php'),
+ 'pmd-refset1',
+ array($renderer),
+ new RuleSetFactory()
+ );
+
+ $this->assertXmlEquals($writer->getData(), 'pmd/default-xml.xml');
+ }
+
+ /**
+ * testRunWithDefaultSettingsAndXmlRendererAgainstSingleFile
+ *
+ * @return void
+ */
+ public function testRunWithDefaultSettingsAndXmlRendererAgainstDirectory()
+ {
+ self::changeWorkingDirectory();
+
+ $writer = new WriterStub();
+
+ $renderer = new XMLRenderer();
+ $renderer->setWriter($writer);
+
+ $phpmd = new PHPMD();
+ $phpmd->processFiles(
+ self::createFileUri('source'),
+ 'pmd-refset1',
+ array($renderer),
+ new RuleSetFactory()
+ );
+
+ $this->assertXmlEquals($writer->getData(), 'pmd/single-directory.xml');
+ }
+
+ /**
+ * testRunWithDefaultSettingsAndXmlRendererAgainstSingleFile
+ *
+ * @return void
+ */
+ public function testRunWithDefaultSettingsAndXmlRendererAgainstSingleFile()
+ {
+ self::changeWorkingDirectory();
+
+ $writer = new WriterStub();
+
+ $renderer = new XMLRenderer();
+ $renderer->setWriter($writer);
+
+ $phpmd = new PHPMD();
+ $phpmd->processFiles(
+ self::createFileUri('source/ccn_function.php'),
+ 'pmd-refset1',
+ array($renderer),
+ new RuleSetFactory()
+ );
+
+ $this->assertXmlEquals($writer->getData(), 'pmd/single-file.xml');
+ }
+
+ /**
+ * testHasViolationsReturnsFalseByDefault
+ *
+ * @return void
+ */
+ public function testHasViolationsReturnsFalseByDefault()
+ {
+ $phpmd = new PHPMD();
+ $this->assertFalse($phpmd->hasViolations());
+ }
+
+ /**
+ * testHasViolationsReturnsFalseForSourceWithoutViolations
+ *
+ * @return void
+ */
+ public function testHasViolationsReturnsFalseForSourceWithoutViolations()
+ {
+ self::changeWorkingDirectory();
+
+ $renderer = new XMLRenderer();
+ $renderer->setWriter(new WriterStub());
+
+ $phpmd = new PHPMD();
+ $phpmd->processFiles(
+ self::createFileUri('source/source_without_violations.php'),
+ 'pmd-refset1',
+ array($renderer),
+ new RuleSetFactory()
+ );
+
+ $this->assertFalse($phpmd->hasViolations());
+ }
+
+ /**
+ * testHasViolationsReturnsTrueForSourceWithViolation
+ *
+ * @return void
+ */
+ public function testHasViolationsReturnsTrueForSourceWithViolation()
+ {
+ self::changeWorkingDirectory();
+
+ $renderer = new XMLRenderer();
+ $renderer->setWriter(new WriterStub());
+
+ $phpmd = new PHPMD();
+ $phpmd->processFiles(
+ self::createFileUri('source/source_with_npath_violation.php'),
+ 'pmd-refset1',
+ array($renderer),
+ new RuleSetFactory()
+ );
+
+ $this->assertTrue($phpmd->hasViolations());
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/ParserFactoryTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/ParserFactoryTest.php
new file mode 100644
index 0000000..5bc3fd5
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/ParserFactoryTest.php
@@ -0,0 +1,198 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * Test case for the parser factory class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2009 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\ParserFactory
+ * @group phpmd
+ * @group unittest
+ */
+class ParserFactoryTest extends AbstractTest
+{
+ /**
+ * testFactoryConfiguresInputDirectory
+ *
+ * @return void
+ */
+ public function testFactoryConfiguresInputDirectory()
+ {
+ $factory = new ParserFactory();
+
+ $uri = $this->createFileUri('ParserFactory/Directory');
+
+ $phpmd = $this->getMock('PHPMD\\PHPMD', array('getInput'));
+ $phpmd->expects($this->once())
+ ->method('getInput')
+ ->will($this->returnValue($uri));
+
+ $ruleSet = $this->getRuleSetMock('PHPMD\\Node\\ClassNode');
+
+ $parser = $factory->create($phpmd);
+ $parser->addRuleSet($ruleSet);
+ $parser->parse($this->getReportMock(0));
+ }
+
+ /**
+ * testFactoryConfiguresInputFile
+ *
+ * @return void
+ */
+ public function testFactoryConfiguresInputFile()
+ {
+ $factory = new ParserFactory();
+
+ $uri = $this->createFileUri('ParserFactory/File/Test.php');
+
+ $phpmd = $this->getMock('PHPMD\\PHPMD', array('getInput'));
+ $phpmd->expects($this->once())
+ ->method('getInput')
+ ->will($this->returnValue($uri));
+
+ $ruleSet = $this->getRuleSetMock('PHPMD\\Node\\ClassNode');
+
+ $parser = $factory->create($phpmd);
+ $parser->addRuleSet($ruleSet);
+ $parser->parse($this->getReportMock(0));
+ }
+
+ /**
+ * testFactoryConfiguresMultipleInputDirectories
+ *
+ * @return void
+ */
+ public function testFactoryConfiguresMultipleInputDirectories()
+ {
+ $factory = new ParserFactory();
+
+ $uri1 = $this->createFileUri('ParserFactory/File');
+ $uri2 = $this->createFileUri('ParserFactory/Directory');
+
+ $phpmd = $this->getMock('PHPMD\\PHPMD', array('getInput'));
+ $phpmd->expects($this->once())
+ ->method('getInput')
+ ->will($this->returnValue($uri1 . ',' . $uri2));
+
+ $ruleSet = $this->getRuleSetMock('PHPMD\\Node\\ClassNode', 2);
+
+ $parser = $factory->create($phpmd);
+ $parser->addRuleSet($ruleSet);
+ $parser->parse($this->getReportMock(0));
+ }
+
+ /**
+ * testFactoryConfiguresMultipleInputFilesAndDirectories
+ *
+ * @return void
+ */
+ public function testFactoryConfiguresMultipleInputFilesAndDirectories()
+ {
+ $factory = new ParserFactory();
+
+ $uri1 = $this->createFileUri('ParserFactory/File/Test.php');
+ $uri2 = $this->createFileUri('ParserFactory/Directory');
+
+ $phpmd = $this->getMock('PHPMD\\PHPMD', array('getInput'));
+ $phpmd->expects($this->once())
+ ->method('getInput')
+ ->will($this->returnValue($uri1 . ',' . $uri2));
+
+ $ruleSet = $this->getRuleSetMock('PHPMD\\Node\\ClassNode', 2);
+
+ $parser = $factory->create($phpmd);
+ $parser->addRuleSet($ruleSet);
+ $parser->parse($this->getReportMock(0));
+ }
+
+ /**
+ * testFactoryConfiguresIgnorePattern
+ *
+ * @return void
+ */
+ public function testFactoryConfiguresIgnorePattern()
+ {
+ $factory = new ParserFactory();
+
+ $uri = $this->createFileUri('ParserFactory/File/Test.php');
+
+ $phpmd = $this->getMock('PHPMD\\PHPMD', array('getIgnorePattern', 'getInput'));
+ $phpmd->expects($this->exactly(2))
+ ->method('getIgnorePattern')
+ ->will($this->returnValue(array('Test')));
+ $phpmd->expects($this->once())
+ ->method('getInput')
+ ->will($this->returnValue($uri));
+
+ $factory->create($phpmd);
+ }
+
+ /**
+ * testFactoryConfiguresFileExtensions
+ *
+ * @return void
+ */
+ public function testFactoryConfiguresFileExtensions()
+ {
+ $factory = new ParserFactory();
+
+ $uri = $this->createFileUri('ParserFactory/File/Test.php');
+
+ $phpmd = $this->getMock('PHPMD\\PHPMD', array('getFileExtensions', 'getInput'));
+ $phpmd->expects($this->exactly(2))
+ ->method('getFileExtensions')
+ ->will($this->returnValue(array('.php')));
+ $phpmd->expects($this->once())
+ ->method('getInput')
+ ->will($this->returnValue($uri));
+
+ $factory->create($phpmd);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/ParserTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/ParserTest.php
new file mode 100644
index 0000000..1e6969f
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/ParserTest.php
@@ -0,0 +1,259 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * Test case for the PHP_Depend backend adapter class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\Parser
+ * @group phpmd
+ * @group unittest
+ */
+class ParserTest extends AbstractTest
+{
+ /**
+ * Tests that the metrics adapter delegates a node to a registered rule-set.
+ *
+ * @return void
+ */
+ public function testAdapterDelegatesClassNodeToRuleSet()
+ {
+ $mock = $this->getPHPDependClassMock();
+ $mock->expects($this->once())
+ ->method('isUserDefined')
+ ->will($this->returnValue(true));
+
+ $adapter = new \PHPMD\Parser($this->getPHPDependMock());
+ $adapter->addRuleSet($this->getRuleSetMock('PHPMD\\Node\\ClassNode'));
+ $adapter->setReport($this->getReportMock(0));
+ $adapter->visitClass($mock);
+ }
+
+ /**
+ * Tests that the metrics adapter does not delegate a node without source
+ * code file to a registered rule-set.
+ *
+ * @return void
+ */
+ public function testAdapterDoesNotDelegateNonSourceClassNodeToRuleSet()
+ {
+ $mock = $this->getPHPDependClassMock();
+ $mock->expects($this->once())
+ ->method('isUserDefined')
+ ->will($this->returnValue(false));
+
+ $adapter = new \PHPMD\Parser($this->getPHPDependMock());
+ $adapter->addRuleSet($this->getRuleSetMock());
+ $adapter->setReport($this->getReportMock(0));
+ $adapter->visitClass($mock);
+ }
+
+ /**
+ * Tests that the metrics adapter delegates a node to a registered rule-set.
+ *
+ * @return void
+ */
+ public function testAdapterDelegatesMethodNodeToRuleSet()
+ {
+ $adapter = new \PHPMD\Parser($this->getPHPDependMock());
+ $adapter->addRuleSet($this->getRuleSetMock('PHPMD\\Node\\MethodNode'));
+ $adapter->setReport($this->getReportMock(0));
+ $adapter->visitMethod($this->getPHPDependMethodMock());
+ }
+
+ /**
+ * Tests that the metrics adapter does not delegate a node without source
+ * code file to a registered rule-set.
+ *
+ * @return void
+ */
+ public function testAdapterDoesNotDelegateNonSourceMethodNodeToRuleSet()
+ {
+ $adapter = new \PHPMD\Parser($this->getPHPDependMock());
+ $adapter->addRuleSet($this->getRuleSetMock());
+ $adapter->setReport($this->getReportMock(0));
+ $adapter->visitMethod($this->getPHPDependMethodMock(null));
+ }
+
+ /**
+ * Tests that the metrics adapter delegates a node to a registered rule-set.
+ *
+ * @return void
+ */
+ public function testAdapterDelegatesFunctionNodeToRuleSet()
+ {
+ $adapter = new \PHPMD\Parser($this->getPHPDependMock());
+ $adapter->addRuleSet($this->getRuleSetMock('PHPMD\\Node\\FunctionNode'));
+ $adapter->setReport($this->getReportMock(0));
+ $adapter->visitFunction($this->getPHPDependFunctionMock());
+ }
+
+ /**
+ * Tests that the metrics adapter does not delegate a node without source
+ * code file to a registered rule-set.
+ *
+ * @return void
+ */
+ public function testAdapterDoesNotDelegateNonSourceFunctionNodeToRuleSet()
+ {
+ $adapter = new \PHPMD\Parser($this->getPHPDependMock());
+ $adapter->addRuleSet($this->getRuleSetMock());
+ $adapter->setReport($this->getReportMock(0));
+ $adapter->visitFunction($this->getPHPDependFunctionMock(null));
+ }
+
+ /**
+ * testParserStoreParsingExceptionsInReport
+ *
+ * @return void
+ * @since 1.2.1
+ */
+ public function testParserStoreParsingExceptionsInReport()
+ {
+ $report = $this->getReportMock(0);
+ $report->expects($this->once())
+ ->method('addError');
+
+ $pdepend = $this->getPHPDependMock();
+ $pdepend->expects($this->once())
+ ->method('getExceptions')
+ ->will($this->returnValue(array(
+ new \PDepend\Source\Parser\InvalidStateException(42, __FILE__, 'foo')
+ )));
+
+ $parser = new \PHPMD\Parser($pdepend);
+ $parser->parse($report);
+ }
+
+ /**
+ * Creates a mocked PDepend instance.
+ *
+ * @return \PDepend\Engine
+ */
+ private function getPHPDependMock()
+ {
+ return $this->getMock('PDepend\Engine', array(), array(null), '', false);
+ }
+
+ /**
+ * Creates a mocked PDepend class instance.
+ *
+ * @return PDepend\Source\AST\ASTClass
+ */
+ protected function getPHPDependClassMock()
+ {
+ $class = $this->getMock('PDepend\\Source\\AST\\ASTClass', array(), array(null));
+ $class->expects($this->any())
+ ->method('getCompilationUnit')
+ ->will($this->returnValue($this->getPHPDependFileMock('foo.php')));
+ $class->expects($this->any())
+ ->method('getConstants')
+ ->will($this->returnValue(new \ArrayIterator(array())));
+ $class->expects($this->any())
+ ->method('getProperties')
+ ->will($this->returnValue(new \ArrayIterator(array())));
+ $class->expects($this->any())
+ ->method('getMethods')
+ ->will($this->returnValue(new \ArrayIterator(array())));
+
+ return $class;
+ }
+
+ /**
+ * Creates a mocked PHP_Depend function instance.
+ *
+ * @param string $fileName Optional file name for the source file.
+ *
+ * @return PHP_Depend_Code_Function
+ */
+ protected function getPHPDependFunctionMock($fileName = '/foo/bar.php')
+ {
+ $function = $this->getMock('PDepend\Source\AST\ASTFunction', array(), array(null));
+ $function->expects($this->atLeastOnce())
+ ->method('getCompilationUnit')
+ ->will($this->returnValue($this->getPHPDependFileMock($fileName)));
+
+ return $function;
+ }
+
+ /**
+ * Creates a mocked PHP_Depend method instance.
+ *
+ * @param string $fileName Optional file name for the source file.
+ *
+ * @return PHP_Depend_Code_CodeMethod
+ */
+ protected function getPHPDependMethodMock($fileName = '/foo/bar.php')
+ {
+ $method = $this->getMock('PDepend\Source\AST\ASTMethod', array(), array(null));
+ $method->expects($this->atLeastOnce())
+ ->method('getCompilationUnit')
+ ->will($this->returnValue($this->getPHPDependFileMock($fileName)));
+
+ return $method;
+ }
+
+ /**
+ * Creates a mocked PHP_Depend file instance.
+ *
+ * @param string $fileName The temporary file name.
+ *
+ * @return PHP_Depend_Code_File
+ */
+ protected function getPHPDependFileMock($fileName)
+ {
+ $file = $this->getMock('PDepend\Source\AST\ASTCompilationUnit', array(), array(null));
+ $file->expects($this->any())
+ ->method('getFileName')
+ ->will($this->returnValue($fileName));
+
+ return $file;
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/ProcessingErrorTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/ProcessingErrorTest.php
new file mode 100644
index 0000000..645a514
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/ProcessingErrorTest.php
@@ -0,0 +1,113 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.2.1
+ */
+
+namespace PHPMD;
+
+/**
+ * Test case for the processing error class.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @since 1.2.1
+ *
+ * @covers \PHPMD\ProcessingError
+ * @group phpmd
+ * @group unittest
+ */
+class ProcessingErrorTest extends AbstractTest
+{
+ /**
+ * testGetMessageReturnsTheExpectedValue
+ *
+ * @return void
+ */
+ public function testGetMessageReturnsTheExpectedValue()
+ {
+ $processingError = new ProcessingError('Hello World.');
+ $this->assertEquals('Hello World.', $processingError->getMessage());
+ }
+
+ /**
+ * Tests that the processing error class extracts the source filename from
+ * a given exception message,
+ *
+ * @param string $message The original exception message
+ *
+ * @return void
+ * @dataProvider getParserExceptionMessages
+ */
+ public function testGetFileReturnsExpectedFileName($message)
+ {
+ $processingError = new ProcessingError($message);
+ $this->assertEquals('/tmp/foo.php', $processingError->getFile());
+ }
+
+ /**
+ * Data provider that returns common exception messages used by PHP_Depend's
+ * parser.
+ *
+ * @return array
+ */
+ public function getParserExceptionMessages()
+ {
+ return array(
+ array(
+ 'The parser has reached an invalid state near line "42" in file ' .
+ '"/tmp/foo.php". Please check the following conditions: message'
+ ),
+ array(
+ 'Unexpected token: >, line: 42, col: 23, file: /tmp/foo.php.'
+ ),
+ array(
+ 'Unexpected end of token stream in file: /tmp/foo.php.'
+ ),
+ array(
+ 'Missing default value on line: 42, col: 23, file: /tmp/foo.php.'
+ )
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/AbstractTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/AbstractTest.php
new file mode 100644
index 0000000..f036058
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/AbstractTest.php
@@ -0,0 +1,78 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Regression;
+
+/**
+ * Regression test for issue 001.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+abstract class AbstractTest extends \PHPMD\AbstractTest
+{
+ /**
+ * Creates a full filename for a test content in the _files directory.
+ *
+ * @param string $localPath The local path within the _files dir.
+ *
+ * @return string
+ */
+ protected static function createFileUri($localPath = '')
+ {
+ $trace = debug_backtrace();
+
+ $ticket = '';
+ if (preg_match('(\D(\d+)Test$)', $trace[1]['class'], $match)) {
+ $ticket = $match[1];
+ }
+
+ if ($localPath === '') {
+ $localPath = $trace[1]['function'] . '.php';
+ }
+ return parent::createFileUri('Regression/' . $ticket . '/' . $localPath);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/AcceptsFilesAndDirectoriesAsInputTicket001Test.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/AcceptsFilesAndDirectoriesAsInputTicket001Test.php
new file mode 100644
index 0000000..5bda847
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/AcceptsFilesAndDirectoriesAsInputTicket001Test.php
@@ -0,0 +1,107 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Regression;
+
+use PHPMD\PHPMD;
+use PHPMD\Renderer\XMLRenderer;
+use PHPMD\RuleSetFactory;
+use PHPMD\Stubs\WriterStub;
+
+/**
+ * Regression test for issue 001.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \stdClass
+ * @group phpmd
+ * @group regression
+ */
+class AcceptsFilesAndDirectoriesAsInputTicket001Test extends AbstractTest
+{
+ /**
+ * testCliAcceptsDirectoryAsInput
+ *
+ * @return void
+ */
+ public function testCliAcceptsDirectoryAsInput()
+ {
+ self::changeWorkingDirectory();
+
+ $renderer = new XMLRenderer();
+ $renderer->setWriter(new WriterStub());
+
+ $phpmd = new PHPMD();
+ $phpmd->processFiles(
+ self::createFileUri('source'),
+ 'pmd-refset1',
+ array($renderer),
+ new RuleSetFactory()
+ );
+ }
+
+ /**
+ * testCliAcceptsSingleFileAsInput
+ *
+ * @return void
+ */
+ public function testCliAcceptsSingleFileAsInput()
+ {
+ self::changeWorkingDirectory();
+
+ $renderer = new XMLRenderer();
+ $renderer->setWriter(new WriterStub());
+
+ $phpmd = new PHPMD();
+ $phpmd->processFiles(
+ self::createFileUri('source/FooBar.php'),
+ 'pmd-refset1',
+ array($renderer),
+ new RuleSetFactory()
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/ExcessivePublicCountRuleNeverExecutedTicket015Test.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/ExcessivePublicCountRuleNeverExecutedTicket015Test.php
new file mode 100644
index 0000000..cc56b51
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/ExcessivePublicCountRuleNeverExecutedTicket015Test.php
@@ -0,0 +1,83 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Regression;
+
+use PHPMD\Rule\ExcessivePublicCount;
+use PHPMD\RuleSet;
+
+/**
+ * Regression test for issue 015.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers stdClass
+ * @group phpmd
+ * @group regression
+ */
+class ExcessivePublicCountRuleNeverExecutedTicket015Test extends AbstractTest
+{
+ /**
+ * testRuleSetInvokesRuleForClassInstance
+ *
+ * @return void
+ */
+ public function testRuleSetInvokesRuleForClassInstance()
+ {
+ $rule = new ExcessivePublicCount();
+ $rule->addProperty('minimum', 3);
+
+ $class = $this->getClass();
+ $class->setMetrics(array('cis' => 4));
+
+ $ruleSet = new RuleSet();
+ $ruleSet->addRule($rule);
+ $ruleSet->setReport($this->getReportMock(1));
+
+ $ruleSet->apply($class);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/InvalidUnusedLocalVariableAndFormalParameterTicket007Test.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/InvalidUnusedLocalVariableAndFormalParameterTicket007Test.php
new file mode 100644
index 0000000..999cde1
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/InvalidUnusedLocalVariableAndFormalParameterTicket007Test.php
@@ -0,0 +1,87 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Regression;
+
+use PHPMD\Rule\UnusedFormalParameter;
+use PHPMD\Rule\UnusedLocalVariable;
+
+/**
+ * Regression test for issue 007.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers stdClass
+ * @group phpmd
+ * @group regression
+ */
+class InvalidUnusedLocalVariableAndFormalParameterTicket007Test extends AbstractTest
+{
+ /**
+ * testLocalVariableUsedInDoubleQuoteStringGetsNotReported
+ *
+ * @return void
+ */
+ public function testLocalVariableUsedInDoubleQuoteStringGetsNotReported()
+ {
+ $rule = new UnusedLocalVariable();
+ $rule->setReport($this->getReportMock(0));
+ $rule->apply($this->getMethod());
+ }
+
+ /**
+ * testFormalParameterUsedInDoubleQuoteStringGetsNotReported
+ *
+ * @return void
+ */
+ public function testFormalParameterUsedInDoubleQuoteStringGetsNotReported()
+ {
+ $rule = new UnusedFormalParameter();
+ $rule->setReport($this->getReportMock(0));
+ $rule->apply($this->getMethod());
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/LongVariablePrivatePropertiesTicket010096717Test.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/LongVariablePrivatePropertiesTicket010096717Test.php
new file mode 100644
index 0000000..2de7827
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/LongVariablePrivatePropertiesTicket010096717Test.php
@@ -0,0 +1,93 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @link https://www.pivotaltracker.com/story/show/10096717
+ */
+
+namespace PHPMD\Regression;
+
+use PHPMD\Rule\Naming\LongVariable;
+
+/**
+ * Regression test for issue 10096717.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @link https://www.pivotaltracker.com/story/show/10096717
+ * @since 1.1.0
+ *
+ * @ticket 10096717
+ * @covers stdClass
+ * @group phpmd
+ * @group phpmd::integration
+ * @group integrationtest
+ */
+class LongVariablePrivatePropertiesTicket010096717Test extends AbstractTest
+{
+ /**
+ * testRuleNotAppliesForLongPrivateProperty
+ *
+ * @return void
+ */
+ public function testRuleNotAppliesForLongPrivateProperty()
+ {
+ $rule = new LongVariable();
+ $rule->setReport($this->getReportMock(0));
+ $rule->addProperty('maximum', 17);
+ $rule->apply($this->getClass());
+ }
+
+ /**
+ * testRuleNotAppliesForLongPrivateStaticProperty
+ *
+ * @return void
+ */
+ public function testRuleNotAppliesForLongPrivateStaticProperty()
+ {
+ $rule = new LongVariable();
+ $rule->setReport($this->getReportMock(0));
+ $rule->addProperty('maximum', 17);
+ $rule->apply($this->getClass());
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/MaximumNestingLevelTicket24975295Test.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/MaximumNestingLevelTicket24975295Test.php
new file mode 100644
index 0000000..bdbd14a
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/MaximumNestingLevelTicket24975295Test.php
@@ -0,0 +1,91 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @link https://www.pivotaltracker.com/story/show/24975295
+ * @since 1.3.1
+ */
+
+namespace PHPMD\Regression;
+
+use PHPMD\PHPMD;
+use PHPMD\Renderer\TextRenderer;
+use PHPMD\RuleSetFactory;
+use PHPMD\Writer\StreamWriter;
+
+/**
+ * Regression test for issue 14990109.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @link https://www.pivotaltracker.com/story/show/24975295
+ * @since 1.3.1
+ *
+ * @ticket 24975295
+ * @covers \stdClass
+ * @group phpmd
+ * @group phpmd::regression
+ * @group regressiontest
+ */
+class MaximumNestingLevelTicket24975295Test extends AbstractTest
+{
+ /**
+ * testLocalVariableUsedInDoubleQuoteStringGetsNotReported
+ *
+ * @return void
+ * @outputBuffering enabled
+ */
+ public function testLocalVariableUsedInDoubleQuoteStringGetsNotReported()
+ {
+ $renderer = new TextRenderer();
+ $renderer->setWriter(new StreamWriter(self::createTempFileUri()));
+
+ $inputs = self::createCodeResourceUriForTest();
+ $rules = 'unusedcode';
+ $renderes = array($renderer);
+ $factory = new RuleSetFactory();
+
+ $phpmd = new PHPMD();
+ $phpmd->processFiles($inputs, $rules, $renderes, $factory);
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/StaticVariablesFlaggedAsUnusedTicket020Test.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/StaticVariablesFlaggedAsUnusedTicket020Test.php
new file mode 100644
index 0000000..567c215
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/StaticVariablesFlaggedAsUnusedTicket020Test.php
@@ -0,0 +1,74 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Regression;
+
+use PHPMD\Rule\UnusedLocalVariable;
+
+/**
+ * Regression test for issue 020.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \stdClass
+ * @group phpmd
+ * @group regression
+ */
+class StaticVariablesFlaggedAsUnusedTicket020Test extends AbstractTest
+{
+ /**
+ * testRuleDoesNotApplyToAnySuperGlobalVariable
+ *
+ * @return void
+ */
+ public function testRuleDoesNotApplyToAnyStaticLocalVariable()
+ {
+ $rule = new UnusedLocalVariable();
+ $rule->setReport($this->getReportMock(0));
+ $rule->apply($this->getMethod());
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/SuperGlobalsFlaggedAsUnusedTicket019Test.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/SuperGlobalsFlaggedAsUnusedTicket019Test.php
new file mode 100644
index 0000000..56eed72
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/SuperGlobalsFlaggedAsUnusedTicket019Test.php
@@ -0,0 +1,74 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Regression;
+
+use PHPMD\Rule\UnusedLocalVariable;
+
+/**
+ * Regression test for issue 019.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \stdClass
+ * @group phpmd
+ * @group regression
+ */
+class SuperGlobalsFlaggedAsUnusedTicket019Test extends AbstractTest
+{
+ /**
+ * testRuleDoesNotApplyToAnySuperGlobalVariable
+ *
+ * @return void
+ */
+ public function testRuleDoesNotApplyToAnySuperGlobalVariable()
+ {
+ $rule = new UnusedLocalVariable();
+ $rule->setReport($this->getReportMock(0));
+ $rule->apply($this->getMethod());
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/SuppressWarningsNotAppliesToUnusedPrivateMethod036Test.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/SuppressWarningsNotAppliesToUnusedPrivateMethod036Test.php
new file mode 100644
index 0000000..95b4903
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/SuppressWarningsNotAppliesToUnusedPrivateMethod036Test.php
@@ -0,0 +1,77 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Regression;
+
+use PHPMD\Rule\UnusedPrivateMethod;
+use PHPMD\RuleSet;
+
+/**
+ * Regression test for issue 036.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers stdClass
+ * @group phpmd
+ * @group regression
+ */
+class SuppressWarningsNotAppliesToUnusedPrivateMethod036Test extends AbstractTest
+{
+ /**
+ * testRuleDoesNotApplyToPrivateMethodWithSuppressWarningsAnnotation
+ *
+ * @return void
+ */
+ public function testRuleDoesNotApplyToPrivateMethodWithSuppressWarningsAnnotation()
+ {
+ $ruleSet = new RuleSet();
+ $ruleSet->addRule(new UnusedPrivateMethod());
+ $ruleSet->setReport($this->getReportMock(0));
+
+ $ruleSet->apply($this->getClass());
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/UnusedParameterArgvTicket14990109Test.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/UnusedParameterArgvTicket14990109Test.php
new file mode 100644
index 0000000..049f840
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Regression/UnusedParameterArgvTicket14990109Test.php
@@ -0,0 +1,96 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @link https://www.pivotaltracker.com/story/show/14990109
+ */
+
+namespace PHPMD\Regression;
+
+use PHPMD\Rule\UnusedFormalParameter;
+use PHPMD\RuleSet;
+
+/**
+ * Regression test for issue 14990109.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ * @link https://www.pivotaltracker.com/story/show/14990109
+ * @since 1.1.0
+ *
+ * @ticket 14990109
+ * @covers \stdClass
+ * @group phpmd
+ * @group phpmd::regression
+ * @group regressiontest
+ */
+class UnusedParameterArgvTicket14990109Test extends AbstractTest
+{
+ /**
+ * testRuleDoesNotApplyToFunctionParameterNamedArgv
+ *
+ * @return void
+ */
+ public function testRuleDoesNotApplyToFunctionParameterNamedArgv()
+ {
+ $ruleSet = new RuleSet();
+ $ruleSet->addRule(new UnusedFormalParameter());
+ $ruleSet->setReport($this->getReportMock(0));
+
+ $ruleSet->apply($this->getFunction());
+ }
+
+ /**
+ * testRuleDoesNotApplyToMethodParameterNamedArgv
+ *
+ * @return void
+ */
+ public function testRuleDoesNotApplyToMethodParameterNamedArgv()
+ {
+ $ruleSet = new RuleSet();
+ $ruleSet->addRule(new UnusedFormalParameter());
+ $ruleSet->setReport($this->getReportMock(0));
+
+ $ruleSet->apply($this->getMethod());
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Renderer/HTMLRendererTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Renderer/HTMLRendererTest.php
new file mode 100644
index 0000000..0d979cf
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Renderer/HTMLRendererTest.php
@@ -0,0 +1,147 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Renderer;
+
+use PHPMD\AbstractTest;
+use PHPMD\ProcessingError;
+use PHPMD\Stubs\WriterStub;
+
+/**
+ * Test case for the html renderer implementation.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\Renderer\HTMLRenderer
+ * @group phpmd
+ * @group phpmd::renderer
+ * @group unittest
+ */
+class HTMLRendererTest extends AbstractTest
+{
+ /**
+ * testRendererCreatesExpectedNumberOfTextEntries
+ *
+ * @return void
+ */
+ public function testRendererCreatesExpectedHtmlTableRow()
+ {
+ // Create a writer instance.
+ $writer = new WriterStub();
+
+ $violations = array(
+ $this->getRuleViolationMock('/bar.php', 1),
+ $this->getRuleViolationMock('/foo.php', 2),
+ $this->getRuleViolationMock('/foo.php', 3),
+ );
+
+ $report = $this->getReportMock(0);
+ $report->expects($this->once())
+ ->method('getRuleViolations')
+ ->will($this->returnValue(new \ArrayIterator($violations)));
+ $report->expects($this->once())
+ ->method('getErrors')
+ ->will($this->returnValue(new \ArrayIterator(array())));
+
+ $renderer = new HTMLRenderer();
+ $renderer->setWriter($writer);
+
+ $renderer->start();
+ $renderer->renderReport($report);
+ $renderer->end();
+
+ $this->assertContains(
+ '
',
+ $writer->getData()
+ );
+ }
+
+ /**
+ * testRendererAddsProcessingErrorsToHtmlReport
+ *
+ * @return void
+ */
+ public function testRendererAddsProcessingErrorsToHtmlReport()
+ {
+ // Create a writer instance.
+ $writer = new WriterStub();
+
+ $errors = array(
+ new ProcessingError('Failed for file "/tmp/foo.php".'),
+ new ProcessingError('Failed for file "/tmp/bar.php".'),
+ new ProcessingError('Failed for file "/tmp/baz.php".'),
+ );
+
+ $report = $this->getReportMock(0);
+ $report->expects($this->once())
+ ->method('getRuleViolations')
+ ->will($this->returnValue(new \ArrayIterator(array())));
+ $report->expects($this->once())
+ ->method('getErrors')
+ ->will($this->returnValue(new \ArrayIterator($errors)));
+
+ $renderer = new HTMLRenderer();
+ $renderer->setWriter($writer);
+
+ $renderer->start();
+ $renderer->renderReport($report);
+ $renderer->end();
+
+ $this->assertContains(
+ '
' .
+ '
/tmp/bar.php
' .
+ '
Failed for file "/tmp/bar.php".
' .
+ '
',
+ $writer->getData()
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Renderer/TextRendererTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Renderer/TextRendererTest.php
new file mode 100644
index 0000000..f46b587
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Renderer/TextRendererTest.php
@@ -0,0 +1,145 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Renderer;
+
+use PHPMD\AbstractTest;
+use PHPMD\ProcessingError;
+use PHPMD\Stubs\WriterStub;
+
+/**
+ * Test case for the text renderer implementation.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\Renderer\TextRenderer
+ * @group phpmd
+ * @group phpmd::renderer
+ * @group unittest
+ */
+class TextRendererTest extends AbstractTest
+{
+ /**
+ * testRendererCreatesExpectedNumberOfTextEntries
+ *
+ * @return void
+ */
+ public function testRendererCreatesExpectedNumberOfTextEntries()
+ {
+ // Create a writer instance.
+ $writer = new WriterStub();
+
+ $violations = array(
+ $this->getRuleViolationMock('/bar.php', 1),
+ $this->getRuleViolationMock('/foo.php', 2),
+ $this->getRuleViolationMock('/foo.php', 3),
+ );
+
+ $report = $this->getReportMock(0);
+ $report->expects($this->once())
+ ->method('getRuleViolations')
+ ->will($this->returnValue(new \ArrayIterator($violations)));
+ $report->expects($this->once())
+ ->method('getErrors')
+ ->will($this->returnValue(new \ArrayIterator(array())));
+
+ $renderer = new TextRenderer();
+ $renderer->setWriter($writer);
+
+ $renderer->start();
+ $renderer->renderReport($report);
+ $renderer->end();
+
+ $this->assertEquals(
+ PHP_EOL .
+ "/bar.php:1\tTest description" . PHP_EOL .
+ "/foo.php:2\tTest description" . PHP_EOL .
+ "/foo.php:3\tTest description" . PHP_EOL,
+ $writer->getData()
+ );
+ }
+
+ /**
+ * testRendererAddsProcessingErrorsToTextReport
+ *
+ * @return void
+ */
+ public function testRendererAddsProcessingErrorsToTextReport()
+ {
+ // Create a writer instance.
+ $writer = new WriterStub();
+
+ $errors = array(
+ new ProcessingError('Failed for file "/tmp/foo.php".'),
+ new ProcessingError('Failed for file "/tmp/bar.php".'),
+ new ProcessingError('Failed for file "/tmp/baz.php".'),
+ );
+
+ $report = $this->getReportMock(0);
+ $report->expects($this->once())
+ ->method('getRuleViolations')
+ ->will($this->returnValue(new \ArrayIterator(array())));
+ $report->expects($this->once())
+ ->method('getErrors')
+ ->will($this->returnValue(new \ArrayIterator($errors)));
+
+ $renderer = new TextRenderer();
+ $renderer->setWriter($writer);
+
+ $renderer->start();
+ $renderer->renderReport($report);
+ $renderer->end();
+
+ $this->assertEquals(
+ PHP_EOL .
+ "/tmp/foo.php\t-\tFailed for file \"/tmp/foo.php\"." . PHP_EOL .
+ "/tmp/bar.php\t-\tFailed for file \"/tmp/bar.php\"." . PHP_EOL .
+ "/tmp/baz.php\t-\tFailed for file \"/tmp/baz.php\"." . PHP_EOL,
+ $writer->getData()
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/Renderer/XMLRendererTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/Renderer/XMLRendererTest.php
new file mode 100644
index 0000000..1030017
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/Renderer/XMLRendererTest.php
@@ -0,0 +1,140 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD\Renderer;
+
+use PHPMD\AbstractTest;
+use PHPMD\ProcessingError;
+use PHPMD\Stubs\WriterStub;
+
+/**
+ * Test case for the xml renderer implementation.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ *
+ * @covers \PHPMD\Renderer\XMLRenderer
+ * @group phpmd
+ * @group phpmd::renderer
+ * @group unittest
+ */
+class XMLRendererTest extends AbstractTest
+{
+ /**
+ * testRendererCreatesExpectedNumberOfXmlElements
+ *
+ * @return void
+ */
+ public function testRendererCreatesExpectedNumberOfXmlElements()
+ {
+ // Create a writer instance.
+ $writer = new WriterStub();
+
+ $violations = array(
+ $this->getRuleViolationMock('/bar.php'),
+ $this->getRuleViolationMock('/foo.php'),
+ $this->getRuleViolationMock('/foo.php'),
+ );
+
+ $report = $this->getReportMock(0);
+ $report->expects($this->once())
+ ->method('getRuleViolations')
+ ->will($this->returnValue(new \ArrayIterator($violations)));
+ $report->expects($this->once())
+ ->method('getErrors')
+ ->will($this->returnValue(new \ArrayIterator(array())));
+
+ $renderer = new XMLRenderer();
+ $renderer->setWriter($writer);
+
+ $renderer->start();
+ $renderer->renderReport($report);
+ $renderer->end();
+
+ $this->assertXmlEquals(
+ $writer->getData(),
+ 'renderer/xml_renderer_expected1.xml'
+ );
+ }
+
+ /**
+ * testRendererAddsProcessingErrorsToXmlReport
+ *
+ * @return void
+ * @since 1.2.1
+ */
+ public function testRendererAddsProcessingErrorsToXmlReport()
+ {
+ // Create a writer instance.
+ $writer = new WriterStub();
+
+ $processingErrors = array(
+ new ProcessingError('Failed for file "/tmp/foo.php".'),
+ new ProcessingError('Failed for file "/tmp/bar.php".'),
+ new ProcessingError('Failed for file "/tmp/baz.php".'),
+ );
+
+ $report = $this->getReportMock(0);
+ $report->expects($this->once())
+ ->method('getRuleViolations')
+ ->will($this->returnValue(new \ArrayIterator(array())));
+ $report->expects($this->once())
+ ->method('getErrors')
+ ->will($this->returnValue(new \ArrayIterator($processingErrors)));
+
+ $renderer = new XMLRenderer();
+ $renderer->setWriter($writer);
+
+ $renderer->start();
+ $renderer->renderReport($report);
+ $renderer->end();
+
+ $this->assertXmlEquals(
+ $writer->getData(),
+ 'renderer/xml_renderer_processing_errors.xml'
+ );
+ }
+}
diff --git a/vendor/phpmd/phpmd/src/test/php/PHPMD/ReportTest.php b/vendor/phpmd/phpmd/src/test/php/PHPMD/ReportTest.php
new file mode 100644
index 0000000..785c7e3
--- /dev/null
+++ b/vendor/phpmd/phpmd/src/test/php/PHPMD/ReportTest.php
@@ -0,0 +1,217 @@
+.
+ * 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 Manuel Pichler nor the names of his
+ * 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.
+ *
+ * @author Manuel Pichler
+ * @copyright 2008-2014 Manuel Pichler. All rights reserved.
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version @project.version@
+ */
+
+namespace PHPMD;
+
+/**
+ * Test case for the report class.
+ *
+ * @author Manuel Pichler