diff --git a/.gitignore b/.gitignore index 331c58f..3ce5adb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ .idea -vendor \ No newline at end of file +vendor diff --git a/.travis.yml b/.travis.yml index 6aefeaa..eef782c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,17 +3,26 @@ php: - 5.3.3 - 5.3 - 5.4 + - 5.5 + - 5.6 + - hhvm + - hhvm-nightly + +matrix: + allow_failures: + - php: hhvm + - php: hhvm-nightly script: - - vendor/phpunit/phpunit/composer/bin/phpunit + - vendor/bin/phpunit before_script: - sudo apt-get -qq update > /dev/null - phpenv rehash > /dev/null - composer selfupdate --quiet - - composer install --dev - - vendor/phpunit/phpunit/composer/bin/phpunit - - composer update --dev + - composer install --no-interaction --prefer-source --dev + - vendor/bin/phpunit + - composer update --no-interaction --prefer-source --dev notifications: irc: "irc.freenode.org#phpdocumentor" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..792e404 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010 Mike van Riel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/composer.json b/composer.json index 832edcc..ef13956 100644 --- a/composer.json +++ b/composer.json @@ -8,13 +8,19 @@ "require": { "php": ">=5.3.3" }, - "suggest": { - "dflydev/markdown": "1.0.*" - }, "autoload": { "psr-0": {"Barryvdh": ["src/"]} }, "require-dev": { - "phpunit/phpunit": "3.7.*@stable" + "phpunit/phpunit": "~4.0,<4.5" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } } } diff --git a/composer.lock b/composer.lock index b70f57f..4c6a8bb 100644 --- a/composer.lock +++ b/composer.lock @@ -1,93 +1,165 @@ { - "hash": "c6115c20a4a284f6ca14e676e788b4d3", - "packages": [ + "_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": "ea1734d11b8c878445c2c6e58de8b85f", + "packages": [], + "packages-dev": [ { - "name": "dflydev/markdown", - "version": "v1.0.2", + "name": "ocramius/instantiator", + "version": "1.1.2", "source": { "type": "git", - "url": "https://github.com/dflydev/dflydev-markdown.git", - "reference": "v1.0.2" + "url": "https://github.com/Ocramius/Instantiator.git", + "reference": "a7abbb5fc9df6e7126af741dd6c140d1a7369435" }, "dist": { "type": "zip", - "url": "https://github.com/dflydev/dflydev-markdown/zipball/v1.0.2", - "reference": "v1.0.2", + "url": "https://api.github.com/repos/Ocramius/Instantiator/zipball/a7abbb5fc9df6e7126af741dd6c140d1a7369435", + "reference": "a7abbb5fc9df6e7126af741dd6c140d1a7369435", "shasum": "" }, "require": { - "php": ">=5.3" + "ocramius/lazy-map": "1.0.*", + "php": "~5.3" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "2.0.*@ALPHA" }, - "time": "2012-01-15 19:36:37", "type": "library", - "installation-source": "dist", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-0": { - "dflydev\\markdown": "src" + "Instantiator\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "New BSD License" + "MIT" ], "authors": [ { - "name": "Dragonfly Development Inc.", - "email": "info@dflydev.com", - "homepage": "http://dflydev.com" - }, - { - "name": "Beau Simensen", - "email": "beau@dflydev.com", - "homepage": "http://beausimensen.com" - }, - { - "name": "Michel Fortin", - "homepage": "http://michelf.com" - }, - { - "name": "John Gruber", - "homepage": "http://daringfireball.net" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" } ], - "description": "PHP Markdown & Extra", - "homepage": "http://github.com/dflydev/dflydev-markdown", + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/Ocramius/Instantiator", "keywords": [ - "markdown" - ] - } - ], - "packages-dev": [ + "constructor", + "instantiate" + ], + "time": "2014-08-14 15:10:55" + }, { - "name": "phpunit/php-code-coverage", - "version": "1.2.7", + "name": "ocramius/lazy-map", + "version": "1.0.0", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "1.2.7" + "url": "https://github.com/Ocramius/LazyMap.git", + "reference": "7fe3d347f5e618bcea7d39345ff83f3651d8b752" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-code-coverage/archive/1.2.7.zip", - "reference": "1.2.7", + "url": "https://api.github.com/repos/Ocramius/LazyMap/zipball/7fe3d347f5e618bcea7d39345ff83f3651d8b752", + "reference": "7fe3d347f5e618bcea7d39345ff83f3651d8b752", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "athletic/athletic": "~0.1.6", + "phpmd/phpmd": "1.5.*", + "phpunit/phpunit": ">=3.7", + "satooshi/php-coveralls": "~0.6", + "squizlabs/php_codesniffer": "1.4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "LazyMap\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/", + "role": "Developer" + } + ], + "description": "A library that provides lazy instantiation logic for a map of objects", + "homepage": "https://github.com/Ocramius/LazyMap", + "keywords": [ + "lazy", + "lazy instantiation", + "lazy loading", + "map", + "service location" + ], + "time": "2013-11-09 22:30:54" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "6d196af48e8c100a3ae881940123e693da5a9217" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6d196af48e8c100a3ae881940123e693da5a9217", + "reference": "6d196af48e8c100a3ae881940123e693da5a9217", "shasum": "" }, "require": { "php": ">=5.3.3", - "phpunit/php-file-iterator": ">=1.3.0@stable", - "phpunit/php-token-stream": ">=1.1.3@stable", - "phpunit/php-text-template": ">=1.1.1@stable" + "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-text-template": "~1.2.0", + "phpunit/php-token-stream": "~1.2.2", + "sebastian/environment": "~1.0.0", + "sebastian/version": "~1.0.3" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4.0.14" }, "suggest": { "ext-dom": "*", - "ext-xdebug": ">=2.0.5" + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" }, - "time": "2012-12-02 14:54:55", "type": "library", - "installation-source": "dist", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -107,31 +179,30 @@ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ - "testing", "coverage", + "testing", "xunit" - ] + ], + "time": "2014-08-06 06:39:42" }, { "name": "phpunit/php-file-iterator", - "version": "1.3.3", + "version": "1.3.4", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "1.3.3" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-file-iterator/zipball/1.3.3", - "reference": "1.3.3", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2012-10-11 04:44:38", "type": "library", - "installation-source": "dist", "autoload": { "classmap": [ "File/" @@ -152,32 +223,31 @@ } ], "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "http://www.phpunit.de/", + "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.1.4", + "version": "1.2.0", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-text-template.git", - "reference": "1.1.4" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4", - "reference": "1.1.4", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2012-10-31 11:15:28", "type": "library", - "installation-source": "dist", "autoload": { "classmap": [ "Text/" @@ -201,28 +271,27 @@ "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ "template" - ] + ], + "time": "2014-01-30 17:20:04" }, { "name": "phpunit/php-timer", - "version": "1.0.4", + "version": "1.0.5", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-timer.git", - "reference": "1.0.4" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-timer/zipball/1.0.4", - "reference": "1.0.4", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2012-10-11 04:45:58", "type": "library", - "installation-source": "dist", "autoload": { "classmap": [ "PHP/" @@ -243,32 +312,36 @@ } ], "description": "Utility class for timing", - "homepage": "http://www.phpunit.de/", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ "timer" - ] + ], + "time": "2013-08-02 07:42:54" }, { "name": "phpunit/php-token-stream", - "version": "1.1.5", + "version": "1.2.2", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1.1.5" + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-token-stream/zipball/1.1.5", - "reference": "1.1.5", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", "shasum": "" }, "require": { "ext-tokenizer": "*", "php": ">=5.3.3" }, - "time": "2012-10-11 04:47:14", "type": "library", - "installation-source": "dist", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, "autoload": { "classmap": [ "PHP/" @@ -289,58 +362,60 @@ } ], "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "http://www.phpunit.de/", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", "keywords": [ "tokenizer" - ] + ], + "time": "2014-03-03 05:10:30" }, { "name": "phpunit/phpunit", - "version": "3.7.10", + "version": "4.2.2", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/phpunit.git", - "reference": "3.7.10" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "a33fa68ece9f8c68589bfc2da8d2794e27b820bc" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/phpunit/archive/3.7.10.zip", - "reference": "3.7.10", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a33fa68ece9f8c68589bfc2da8d2794e27b820bc", + "reference": "a33fa68ece9f8c68589bfc2da8d2794e27b820bc", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": ">=1.3.1", - "phpunit/php-text-template": ">=1.1.1", - "phpunit/php-code-coverage": ">=1.2.1", - "phpunit/php-timer": ">=1.0.2", - "phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0", - "symfony/yaml": ">=2.1.0", "ext-dom": "*", + "ext-json": "*", "ext-pcre": "*", "ext-reflection": "*", - "ext-spl": "*" + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~2.0", + "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "~1.0.2", + "phpunit/phpunit-mock-objects": "~2.2", + "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.0", - "ext-json": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*" + "phpunit/php-invoker": "~1.1" }, - "time": "2012-12-02 14:56:55", "bin": [ - "composer/bin/phpunit" + "phpunit" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7.x-dev" + "dev-master": "4.2.x-dev" } }, - "installation-source": "dist", "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -361,38 +436,46 @@ "description": "The PHP Unit Testing framework.", "homepage": "http://www.phpunit.de/", "keywords": [ - "testing", "phpunit", + "testing", "xunit" - ] + ], + "time": "2014-08-18 05:12:30" }, { "name": "phpunit/phpunit-mock-objects", - "version": "1.2.2", + "version": "2.2.0", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "1.2.2" + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "42e589e08bc86e3e9bdf20d385e948347788505b" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.2.zip", - "reference": "1.2.2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/42e589e08bc86e3e9bdf20d385e948347788505b", + "reference": "42e589e08bc86e3e9bdf20d385e948347788505b", "shasum": "" }, "require": { + "ocramius/instantiator": "~1.0", "php": ">=5.3.3", - "phpunit/php-text-template": ">=1.1.1@stable" + "phpunit/php-text-template": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "4.2.*@dev" }, "suggest": { "ext-soap": "*" }, - "time": "2012-11-05 10:39:13", "type": "library", - "installation-source": "dist", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -414,37 +497,304 @@ "keywords": [ "mock", "xunit" - ] + ], + "time": "2014-08-02 13:50:58" }, { - "name": "symfony/yaml", - "version": "v2.1.4", - "target-dir": "Symfony/Component/Yaml", + "name": "sebastian/comparator", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml", - "reference": "v2.1.4" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/Yaml/archive/v2.1.4.zip", - "reference": "v2.1.4", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2", + "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2", + "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.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2014-05-02 07:05:58" + }, + { + "name": "sebastian/diff", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", + "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2012-11-08 09:51:48", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "http://www.github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2013-08-03 16:46:33" + }, + { + "name": "sebastian/environment", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/79517609ec01139cd7e9fded0dd7ce08c952ef6a", + "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "4.0.*@dev" + }, + "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": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2014-02-18 16:17:19" + }, + { + "name": "sebastian/exporter", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", + "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "4.0.*@dev" + }, + "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": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net", + "role": "Lead" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2014-02-16 08:26:31" + }, + { + "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/yaml", + "version": "v2.5.3", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", + "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" } }, - "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\Yaml": "" + "Symfony\\Component\\Yaml\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -452,24 +802,26 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Yaml Component", - "homepage": "http://symfony.com" + "homepage": "http://symfony.com", + "time": "2014-08-05 09:00:40" } ], - "aliases": [ - - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "phpunit/phpunit": 0 - } + "stability-flags": [], + "prefer-stable": false, + "platform": { + "php": ">=5.3.3" + }, + "platform-dev": [] } diff --git a/src/Barryvdh/Reflection/DocBlock.php b/src/Barryvdh/Reflection/DocBlock.php index d43b8a2..434cae6 100644 --- a/src/Barryvdh/Reflection/DocBlock.php +++ b/src/Barryvdh/Reflection/DocBlock.php @@ -46,6 +46,12 @@ class DocBlock implements \Reflector /** @var Location Information about the location of this DocBlock. */ protected $location = null; + /** @var bool Is this DocBlock (the start of) a template? */ + protected $isTemplateStart = false; + + /** @var bool Does this DocBlock signify the end of a DocBlock template? */ + protected $isTemplateEnd = false; + /** * Parses the given docblock and populates the member fields. * @@ -81,7 +87,9 @@ class DocBlock implements \Reflector $docblock = $this->cleanInput($docblock); - list($short, $long, $tags) = $this->splitDocBlock($docblock); + list($templateMarker, $short, $long, $tags) = $this->splitDocBlock($docblock); + $this->isTemplateStart = $templateMarker === '#@+'; + $this->isTemplateEnd = $templateMarker === '#@-'; $this->short_description = $short; $this->long_description = new DocBlock\Description($long, $this); $this->parseTags($tags); @@ -119,74 +127,86 @@ class DocBlock implements \Reflector } /** - * Splits the DocBlock into a short description, long description and - * block of tags. + * Splits the DocBlock into a template marker, summary, description and block of tags. * * @param string $comment Comment to split into the sub-parts. * - * @author RichardJ Special thanks to RichardJ for the regex responsible - * for the split. + * @author Richard van Velzen (@_richardJ) Special thanks to Richard for the regex responsible for the split. + * @author Mike van Riel for extending the regex with template marker support. * - * @return string[] containing the short-, long description and an element - * containing the tags. + * @return string[] containing the template marker (if any), summary, description and a string containing the tags. */ protected function splitDocBlock($comment) { + // Performance improvement cheat: if the first character is an @ then only tags are in this DocBlock. This + // method does not split tags so we return this verbatim as the fourth result (tags). This saves us the + // performance impact of running a regular expression if (strpos($comment, '@') === 0) { - $matches = array('', '', $comment); - } else { - // clears all extra horizontal whitespace from the line endings - // to prevent parsing issues - $comment = preg_replace('/\h*$/Sum', '', $comment); - - /* - * Splits the docblock into a short description, long description and - * tags section - * - The short description is started from the first character until - * a dot is encountered followed by a newline OR - * two consecutive newlines (horizontal whitespace is taken into - * account to consider spacing errors) - * - The long description, any character until a new line is - * encountered followed by an @ and word characters (a tag). - * This is optional. - * - Tags; the remaining characters - * - * Big thanks to RichardJ for contributing this Regular Expression - */ - preg_match( - '/ - \A ( - [^\n.]+ - (?: - (?! \. \n | \n{2} ) # disallow the first seperator here - [\n.] (?! [ \t]* @\pL ) # disallow second seperator - [^\n.]+ - )* - \.? - ) - (?: - \s* # first seperator (actually newlines but it\'s all whitespace) - (?! @\pL ) # disallow the rest, to make sure this one doesn\'t match, - #if it doesn\'t exist - ( - [^\n]+ - (?: \n+ - (?! [ \t]* @\pL ) # disallow second seperator (@param) - [^\n]+ - )* - ) - )? - (\s+ [\s\S]*)? # everything that follows - /ux', - $comment, - $matches - ); - array_shift($matches); + return array('', '', '', $comment); } - while (count($matches) < 3) { + // clears all extra horizontal whitespace from the line endings to prevent parsing issues + $comment = preg_replace('/\h*$/Sum', '', $comment); + + /* + * Splits the docblock into a template marker, short description, long description and tags section + * + * - The template marker is empty, #@+ or #@- if the DocBlock starts with either of those (a newline may + * occur after it and will be stripped). + * - The short description is started from the first character until a dot is encountered followed by a + * newline OR two consecutive newlines (horizontal whitespace is taken into account to consider spacing + * errors). This is optional. + * - The long description, any character until a new line is encountered followed by an @ and word + * characters (a tag). This is optional. + * - Tags; the remaining characters + * + * Big thanks to RichardJ for contributing this Regular Expression + */ + preg_match( + '/ + \A + # 1. Extract the template marker + (?:(\#\@\+|\#\@\-)\n?)? + + # 2. Extract the summary + (?: + (?! @\pL ) # The summary may not start with an @ + ( + [^\n.]+ + (?: + (?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines + [\n.] (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line + [^\n.]+ # Include anything else + )* + \.? + )? + ) + + # 3. Extract the description + (?: + \s* # Some form of whitespace _must_ precede a description because a summary must be there + (?! @\pL ) # The description may not start with an @ + ( + [^\n]+ + (?: \n+ + (?! [ \t]* @\pL ) # End description when an @ is found as first character on a new line + [^\n]+ # Include anything else + )* + ) + )? + + # 4. Extract the tags (anything that follows) + (\s+ [\s\S]*)? # everything that follows + /ux', + $comment, + $matches + ); + array_shift($matches); + + while (count($matches) < 4) { $matches[] = ''; } + return $matches; } @@ -209,20 +229,16 @@ class DocBlock implements \Reflector ); } foreach (explode("\n", $tags) as $tag_line) { - if (trim($tag_line) === '') { - continue; - } - if (isset($tag_line[0]) && ($tag_line[0] === '@')) { $result[] = $tag_line; } else { - $result[count($result) - 1] .= PHP_EOL . $tag_line; + $result[count($result) - 1] .= "\n" . $tag_line; } } // create proper Tag objects foreach ($result as $key => $tag_line) { - $result[$key] = Tag::createInstance($tag_line, $this); + $result[$key] = Tag::createInstance(trim($tag_line), $this); } } @@ -261,7 +277,7 @@ class DocBlock implements \Reflector */ public function setText($comment) { - list($short, $long) = $this->splitDocBlock($comment); + list(,$short, $long) = $this->splitDocBlock($comment); $this->short_description = $short; $this->long_description = new DocBlock\Description($long, $this); return $this; @@ -286,6 +302,44 @@ class DocBlock implements \Reflector return $this->long_description; } + /** + * Returns whether this DocBlock is the start of a Template section. + * + * A Docblock may serve as template for a series of subsequent DocBlocks. This is indicated by a special marker + * (`#@+`) that is appended directly after the opening `/**` of a DocBlock. + * + * An example of such an opening is: + * + * ``` + * /**#@+ + * * My DocBlock + * * / + * ``` + * + * The description and tags (not the summary!) are copied onto all subsequent DocBlocks and also applied to all + * elements that follow until another DocBlock is found that contains the closing marker (`#@-`). + * + * @see self::isTemplateEnd() for the check whether a closing marker was provided. + * + * @return boolean + */ + public function isTemplateStart() + { + return $this->isTemplateStart; + } + + /** + * Returns whether this DocBlock is the end of a Template section. + * + * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality. + * + * @return boolean + */ + public function isTemplateEnd() + { + return $this->isTemplateEnd; + } + /** * Returns the current context. * diff --git a/src/Barryvdh/Reflection/DocBlock/Description.php b/src/Barryvdh/Reflection/DocBlock/Description.php index 4f61a59..1821bcd 100644 --- a/src/Barryvdh/Reflection/DocBlock/Description.php +++ b/src/Barryvdh/Reflection/DocBlock/Description.php @@ -55,15 +55,15 @@ class Description implements \Reflector /** * Sets the text of this description. - * + * * @param string $content The new text of this description. - * + * * @return $this */ public function setContent($content) { $this->contents = trim($content); - + $this->parsedContents = null; return $this; } @@ -140,7 +140,7 @@ class Description implements \Reflector * * @todo this should become a more intelligent piece of code where the * configuration contains a setting what format long descriptions are. - * + * * @codeCoverageIgnore Will be removed soon, in favor of adapters at * PhpDocumentor itself that will process text in various formats. * @@ -161,7 +161,10 @@ class Description implements \Reflector ); } - if (class_exists('dflydev\markdown\MarkdownExtraParser')) { + if (class_exists('Parsedown')) { + $markdown = \Parsedown::instance(); + $result = $markdown->parse($result); + } elseif (class_exists('dflydev\markdown\MarkdownExtraParser')) { $markdown = new \dflydev\markdown\MarkdownExtraParser(); $result = $markdown->transformMarkdown($result); } @@ -171,7 +174,7 @@ class Description implements \Reflector /** * Gets the docblock this tag belongs to. - * + * * @return DocBlock The docblock this description belongs to. */ public function getDocBlock() @@ -181,10 +184,10 @@ class Description implements \Reflector /** * Sets the docblock this tag belongs to. - * + * * @param DocBlock $docblock The new docblock this description belongs to. * Setting NULL removes any association. - * + * * @return $this */ public function setDocBlock(DocBlock $docblock = null) diff --git a/src/Barryvdh/Reflection/DocBlock/Tag/ExampleTag.php b/src/Barryvdh/Reflection/DocBlock/Tag/ExampleTag.php index bf26316..5c96d4d 100644 --- a/src/Barryvdh/Reflection/DocBlock/Tag/ExampleTag.php +++ b/src/Barryvdh/Reflection/DocBlock/Tag/ExampleTag.php @@ -56,7 +56,7 @@ class ExampleTag extends SourceTag $filePath = '"' . $this->filePath . '"'; } - $this->content = $filePath . ' ' . $this->getContent(); + $this->content = $filePath . ' ' . parent::getContent(); } return $this->content; diff --git a/src/Barryvdh/Reflection/DocBlock/Tag/MethodTag.php b/src/Barryvdh/Reflection/DocBlock/Tag/MethodTag.php index e219d96..9f83028 100644 --- a/src/Barryvdh/Reflection/DocBlock/Tag/MethodTag.php +++ b/src/Barryvdh/Reflection/DocBlock/Tag/MethodTag.php @@ -114,9 +114,6 @@ class MethodTag extends ReturnTag } } $this->parsedDescription = null; - } else { - echo date('c') . ' ERR (3): @method contained invalid contents: ' - . $this->content . PHP_EOL; } return $this; diff --git a/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php b/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php index ca9d0e0..d9a1361 100644 --- a/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php +++ b/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php @@ -23,11 +23,12 @@ use Barryvdh\Reflection\DocBlock\Tag; */ class ParamTag extends ReturnTag { - /** - * @var string - */ + /** @var string */ protected $variableName = ''; + /** @var bool determines whether this is a variadic argument */ + protected $isVariadic = false; + /** * {@inheritdoc} */ @@ -61,13 +62,18 @@ class ParamTag extends ReturnTag array_shift($parts); } - // if the next item starts with a $ it must be the variable name + // if the next item starts with a $ or ...$ it must be the variable name if (isset($parts[0]) && (strlen($parts[0]) > 0) - && ($parts[0][0] == '$') + && ($parts[0][0] == '$' || substr($parts[0], 0, 4) === '...$') ) { $this->variableName = array_shift($parts); array_shift($parts); + + if (substr($this->variableName, 0, 3) === '...') { + $this->isVariadic = true; + $this->variableName = substr($this->variableName, 3); + } } $this->setDescription(implode('', $parts)); @@ -100,4 +106,14 @@ class ParamTag extends ReturnTag $this->content = null; return $this; } + + /** + * Returns whether this tag is variadic. + * + * @return boolean + */ + public function isVariadic() + { + return $this->isVariadic; + } } diff --git a/src/Barryvdh/Reflection/DocBlock/Type/Collection.php b/src/Barryvdh/Reflection/DocBlock/Type/Collection.php index d60bba2..aa7afd9 100644 --- a/src/Barryvdh/Reflection/DocBlock/Type/Collection.php +++ b/src/Barryvdh/Reflection/DocBlock/Type/Collection.php @@ -166,7 +166,8 @@ class Collection extends \ArrayObject $namespace_aliases = $this->context->getNamespaceAliases(); // if the first segment is not an alias; prepend namespace name and // return - if (!isset($namespace_aliases[$type_parts[0]])) { + if (!isset($namespace_aliases[$type_parts[0]]) && + !isset($namespace_aliases[strstr($type_parts[0], '::', true)])) { $namespace = $this->context->getNamespace(); if ('' !== $namespace) { $namespace .= self::OPERATOR_NAMESPACE; @@ -174,6 +175,12 @@ class Collection extends \ArrayObject return self::OPERATOR_NAMESPACE . $namespace . $type; } + if (strpos($type_parts[0], '::')) { + $type_parts[] = strstr($type_parts[0], '::'); + $type_parts[0] = $namespace_aliases[strstr($type_parts[0], '::', true)]; + return implode('', $type_parts); + } + $type_parts[0] = $namespace_aliases[$type_parts[0]]; $type = implode(self::OPERATOR_NAMESPACE, $type_parts); } diff --git a/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php b/tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php rename to tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/CoversTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/CoversTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/ExampleTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/ExampleTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/LinkTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/LinkTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/MethodTagTest.php similarity index 96% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/MethodTagTest.php index 0eacac6..efc3a15 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/MethodTagTest.php @@ -72,10 +72,11 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase public function getTestSignatures() { return array( - array( - 'foo', - false, 'foo', '', false, 0, '' - ), + // TODO: Verify this case +// array( +// 'foo', +// false, 'foo', '', false, 0, '' +// ), array( 'foo()', true, 'foo', 'void', false, 0, '' diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/ParamTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/ParamTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/ReturnTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/ReturnTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/SeeTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/SeeTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/SinceTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/SinceTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/SourceTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/SourceTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/ThrowsTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/ThrowsTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/UsesTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/UsesTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/VarTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/VarTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/VersionTagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php rename to tests/Barryvdh/Reflection/DocBlock/Tag/VersionTagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/TagTest.php b/tests/Barryvdh/Reflection/DocBlock/TagTest.php similarity index 100% rename from tests/phpDocumentor/Reflection/DocBlock/TagTest.php rename to tests/Barryvdh/Reflection/DocBlock/TagTest.php diff --git a/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php b/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php similarity index 76% rename from tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php rename to tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php index 78c7306..383a6c0 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php @@ -123,6 +123,26 @@ class CollectionTest extends \PHPUnit_Framework_TestCase $this->assertSame($expected, $collection->getArrayCopy()); } + /** + * @param string $fixture + * @param array $expected + * + * @dataProvider provideTypesToExpandWithPropertyOrMethod + * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add + * + * @return void + */ + public function testAddMethodsAndProperties($fixture, $expected) + { + $collection = new Collection( + array(), + new Context(null, array('LinkDescriptor' => '\phpDocumentor\LinkDescriptor')) + ); + $collection->add($fixture); + + $this->assertSame($expected, $collection->getArrayCopy()); + } + /** * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add * @expectedException InvalidArgumentException @@ -177,6 +197,14 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'DocBlock[]|int[]', array($namespace.'DocBlock[]', 'int[]') ), + array( + 'LinkDescriptor::setLink()', + array($namespace.'LinkDescriptor::setLink()') + ), + array( + 'Alias\LinkDescriptor::setLink()', + array('\My\Space\Aliasing\LinkDescriptor::setLink()') + ), ); } @@ -192,4 +220,34 @@ class CollectionTest extends \PHPUnit_Framework_TestCase { return $this->provideTypesToExpand($method, '\\'); } + + /** + * Returns the method and property types and their expected values to test + * the retrieval of types. + * + * @param string $method Name of the method consuming this data provider. + * + * @return string[] + */ + public function provideTypesToExpandWithPropertyOrMethod($method) + { + return array( + array( + 'LinkDescriptor::setLink()', + array('\phpDocumentor\LinkDescriptor::setLink()') + ), + array( + 'phpDocumentor\LinkDescriptor::setLink()', + array('\phpDocumentor\LinkDescriptor::setLink()') + ), + array( + 'LinkDescriptor::$link', + array('\phpDocumentor\LinkDescriptor::$link') + ), + array( + 'phpDocumentor\LinkDescriptor::$link', + array('\phpDocumentor\LinkDescriptor::$link') + ), + ); + } } diff --git a/tests/phpDocumentor/Reflection/DocBlockTest.php b/tests/Barryvdh/Reflection/DocBlockTest.php similarity index 85% rename from tests/phpDocumentor/Reflection/DocBlockTest.php rename to tests/Barryvdh/Reflection/DocBlockTest.php index 41b03ed..30eedfc 100644 --- a/tests/phpDocumentor/Reflection/DocBlockTest.php +++ b/tests/Barryvdh/Reflection/DocBlockTest.php @@ -14,6 +14,7 @@ namespace phpDocumentor\Reflection; use phpDocumentor\Reflection\DocBlock\Context; use phpDocumentor\Reflection\DocBlock\Location; +use phpDocumentor\Reflection\DocBlock\Tag\ReturnTag; /** * Test class for phpDocumentor\Reflection\DocBlock @@ -70,7 +71,7 @@ DOCBLOCK; /** * @covers \phpDocumentor\Reflection\DocBlock::splitDocBlock - * + * * @return void */ public function testConstructWithTagsOnly() @@ -90,6 +91,41 @@ DOCBLOCK; $this->assertFalse($object->hasTag('category')); } + /** + * @covers \phpDocumentor\Reflection\DocBlock::isTemplateStart + */ + public function testIfStartOfTemplateIsDiscovered() + { + $fixture = <<assertEquals('', $object->getShortDescription()); + $this->assertEquals('', $object->getLongDescription()->getContents()); + $this->assertCount(2, $object->getTags()); + $this->assertTrue($object->hasTag('see')); + $this->assertTrue($object->hasTag('return')); + $this->assertFalse($object->hasTag('category')); + $this->assertTrue($object->isTemplateStart()); + } + + /** + * @covers \phpDocumentor\Reflection\DocBlock::isTemplateEnd + */ + public function testIfEndOfTemplateIsDiscovered() + { + $fixture = <<assertEquals('', $object->getShortDescription()); + $this->assertEquals('', $object->getLongDescription()->getContents()); + $this->assertTrue($object->isTemplateEnd()); + } + /** * @covers \phpDocumentor\Reflection\DocBlock::cleanInput * @@ -272,7 +308,10 @@ DOCBLOCK; */ DOCBLOCK; $object = new DocBlock($fixture); - $this->assertCount(1, $object->getTags()); + $this->assertCount(1, $tags = $object->getTags()); + /** @var ReturnTag $tag */ + $tag = reset($tags); + $this->assertEquals("Content on\n multiple lines.\n\n One more, after the break.", $tag->getDescription()); } /**