mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db125e8df4 | ||
|
|
62d62638b2 | ||
|
|
476f62b577 | ||
|
|
e5c8b970d6 | ||
|
|
d5d2d76892 | ||
|
|
fba297a2a7 | ||
|
|
0fd348d3fe | ||
|
|
67e478e26a | ||
|
|
e292151642 | ||
|
|
8bb2a5f9b7 | ||
|
|
ac3b854893 | ||
|
|
c6fad15f7c | ||
|
|
836d531676 | ||
|
|
bba116ba9d | ||
|
|
23fa082874 | ||
|
|
e6811e927f | ||
|
|
05596d7626 | ||
|
|
e5e172728c | ||
|
|
9a2f0eb8ba | ||
|
|
bf44b757fe | ||
|
|
e6526132ee | ||
|
|
6b7c110b33 | ||
|
|
ad1e63e15c | ||
|
|
6eafab0ff3 | ||
|
|
fe49c3d9ee | ||
|
|
3f6ec1c280 | ||
|
|
72df918400 | ||
|
|
c10c41e932 | ||
|
|
977da00f0f | ||
|
|
7e5538a638 | ||
|
|
295d2fba38 | ||
|
|
ef9f04dd59 | ||
|
|
6171834fde | ||
|
|
7f729dc9a7 | ||
|
|
144140cd39 | ||
|
|
be72a2d318 | ||
|
|
6d03fa81d9 | ||
|
|
3e7bb6e171 | ||
|
|
0f32bd0e61 | ||
|
|
b0b90f44f0 | ||
|
|
6b69015d83 | ||
|
|
053005ed4e | ||
|
|
64165bd4ba | ||
|
|
9b08619fbd |
@@ -0,0 +1,10 @@
|
|||||||
|
# Path-based git attributes
|
||||||
|
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
|
||||||
|
|
||||||
|
# Ignore all test and documentation with "export-ignore".
|
||||||
|
/.gitignore export-ignore
|
||||||
|
/.gitattributes export-ignore
|
||||||
|
/.travis.yml export-ignore
|
||||||
|
/composer.lock export-ignore
|
||||||
|
/phpunit.xml.dist export-ignore
|
||||||
|
/tests export-ignore
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
name: Unit Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "*"
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
php-tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
env:
|
||||||
|
COMPOSER_NO_INTERACTION: 1
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php: [8.4, 8.3, 8.2, 8.1, 8.0, 7.4, 7.3, 7.2]
|
||||||
|
dependency-version: [prefer-lowest, prefer-stable]
|
||||||
|
|
||||||
|
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php }}
|
||||||
|
coverage: none
|
||||||
|
tools: composer:v2
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress
|
||||||
|
|
||||||
|
- name: Execute Unit Tests
|
||||||
|
run: vendor/bin/phpunit
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
.idea
|
.idea
|
||||||
|
.phpunit.result.cache
|
||||||
|
composer.lock
|
||||||
vendor
|
vendor
|
||||||
|
|||||||
-32
@@ -1,32 +0,0 @@
|
|||||||
language: php
|
|
||||||
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/bin/phpunit
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- sudo apt-get -qq update > /dev/null
|
|
||||||
- phpenv rehash > /dev/null
|
|
||||||
- composer selfupdate --quiet
|
|
||||||
- composer install --no-interaction --prefer-source --dev
|
|
||||||
- vendor/bin/phpunit
|
|
||||||
- composer update --no-interaction --prefer-source --dev
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
irc: "irc.freenode.org#phpdocumentor"
|
|
||||||
email:
|
|
||||||
- [email protected]
|
|
||||||
- [email protected]
|
|
||||||
- [email protected]
|
|
||||||
+2
-2
@@ -12,7 +12,7 @@
|
|||||||
"psr-0": {"Barryvdh": ["src/"]}
|
"psr-0": {"Barryvdh": ["src/"]}
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "~4.0,<4.5"
|
"phpunit/phpunit": "^8.5.14|^9"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"dflydev/markdown": "~1.0",
|
"dflydev/markdown": "~1.0",
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "2.0.x-dev"
|
"dev-master": "2.2.x-dev"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
-864
@@ -1,864 +0,0 @@
|
|||||||
{
|
|
||||||
"_readme": [
|
|
||||||
"This file locks the dependencies of your project to a known state",
|
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
|
||||||
"This file is @generated automatically"
|
|
||||||
],
|
|
||||||
"hash": "deff4b2e029043b60cdbe896c5b18d6d",
|
|
||||||
"content-hash": "7b23fd3607c50c95f9d65e81785cf289",
|
|
||||||
"packages": [],
|
|
||||||
"packages-dev": [
|
|
||||||
{
|
|
||||||
"name": "doctrine/instantiator",
|
|
||||||
"version": "1.0.5",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/doctrine/instantiator.git",
|
|
||||||
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
|
|
||||||
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.0.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Marco Pivetta",
|
|
||||||
"email": "[email protected]",
|
|
||||||
"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": "2015-06-14 21:17:01"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "phpunit/php-code-coverage",
|
|
||||||
"version": "2.2.4",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
|
||||||
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
|
|
||||||
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
|
|
||||||
"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.3.2",
|
|
||||||
"sebastian/version": "~1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"ext-xdebug": ">=2.1.4",
|
|
||||||
"phpunit/phpunit": "~4"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"ext-dom": "*",
|
|
||||||
"ext-xdebug": ">=2.2.1",
|
|
||||||
"ext-xmlwriter": "*"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "2.2.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]",
|
|
||||||
"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": "2015-10-06 15:47:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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": "[email protected]",
|
|
||||||
"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.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/php-text-template.git",
|
|
||||||
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
|
|
||||||
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.3"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]",
|
|
||||||
"role": "lead"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Simple template engine.",
|
|
||||||
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
|
|
||||||
"keywords": [
|
|
||||||
"template"
|
|
||||||
],
|
|
||||||
"time": "2015-06-21 13:50:34"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "phpunit/php-timer",
|
|
||||||
"version": "1.0.8",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/php-timer.git",
|
|
||||||
"reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
|
|
||||||
"reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.3"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "~4|~5"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]",
|
|
||||||
"role": "lead"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Utility class for timing",
|
|
||||||
"homepage": "https://github.com/sebastianbergmann/php-timer/",
|
|
||||||
"keywords": [
|
|
||||||
"timer"
|
|
||||||
],
|
|
||||||
"time": "2016-05-12 18:03:57"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "phpunit/php-token-stream",
|
|
||||||
"version": "1.4.8",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
|
|
||||||
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
|
|
||||||
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"ext-tokenizer": "*",
|
|
||||||
"php": ">=5.3.3"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "~4.2"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.4-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Wrapper around PHP's tokenizer extension.",
|
|
||||||
"homepage": "https://github.com/sebastianbergmann/php-token-stream/",
|
|
||||||
"keywords": [
|
|
||||||
"tokenizer"
|
|
||||||
],
|
|
||||||
"time": "2015-09-15 10:49:45"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "phpunit/phpunit",
|
|
||||||
"version": "4.4.5",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
|
||||||
"reference": "2e8580deebb7d1ac92ac878595e6bffe01069c2a"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2e8580deebb7d1ac92ac878595e6bffe01069c2a",
|
|
||||||
"reference": "2e8580deebb7d1ac92ac878595e6bffe01069c2a",
|
|
||||||
"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.1",
|
|
||||||
"sebastian/exporter": "~1.1",
|
|
||||||
"sebastian/global-state": "~1.0",
|
|
||||||
"sebastian/recursion-context": "~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.4.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]",
|
|
||||||
"role": "lead"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "The PHP Unit Testing framework.",
|
|
||||||
"homepage": "https://phpunit.de/",
|
|
||||||
"keywords": [
|
|
||||||
"phpunit",
|
|
||||||
"testing",
|
|
||||||
"xunit"
|
|
||||||
],
|
|
||||||
"time": "2015-01-27 16:06:15"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "phpunit/phpunit-mock-objects",
|
|
||||||
"version": "2.3.8",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
|
||||||
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
|
|
||||||
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"doctrine/instantiator": "^1.0.2",
|
|
||||||
"php": ">=5.3.3",
|
|
||||||
"phpunit/php-text-template": "~1.2",
|
|
||||||
"sebastian/exporter": "~1.2"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "~4.4"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"ext-soap": "*"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "2.3.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]",
|
|
||||||
"role": "lead"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Mock Object library for PHPUnit",
|
|
||||||
"homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
|
|
||||||
"keywords": [
|
|
||||||
"mock",
|
|
||||||
"xunit"
|
|
||||||
],
|
|
||||||
"time": "2015-10-02 06:51:40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sebastian/comparator",
|
|
||||||
"version": "1.2.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/comparator.git",
|
|
||||||
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
|
|
||||||
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.3",
|
|
||||||
"sebastian/diff": "~1.2",
|
|
||||||
"sebastian/exporter": "~1.2"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "~4.4"
|
|
||||||
},
|
|
||||||
"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": "Jeff Welch",
|
|
||||||
"email": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Volker Dusch",
|
|
||||||
"email": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bernhard Schussek",
|
|
||||||
"email": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Provides the functionality to compare PHP values for equality",
|
|
||||||
"homepage": "http://www.github.com/sebastianbergmann/comparator",
|
|
||||||
"keywords": [
|
|
||||||
"comparator",
|
|
||||||
"compare",
|
|
||||||
"equality"
|
|
||||||
],
|
|
||||||
"time": "2015-07-26 15:48:44"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sebastian/diff",
|
|
||||||
"version": "1.4.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/diff.git",
|
|
||||||
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
|
|
||||||
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.3"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "~4.8"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.4-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Kore Nordmann",
|
|
||||||
"email": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Diff implementation",
|
|
||||||
"homepage": "https://github.com/sebastianbergmann/diff",
|
|
||||||
"keywords": [
|
|
||||||
"diff"
|
|
||||||
],
|
|
||||||
"time": "2015-12-08 07:14:41"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sebastian/environment",
|
|
||||||
"version": "1.3.7",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/environment.git",
|
|
||||||
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716",
|
|
||||||
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.3"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "~4.4"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.3.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Provides functionality to handle HHVM/PHP environments",
|
|
||||||
"homepage": "http://www.github.com/sebastianbergmann/environment",
|
|
||||||
"keywords": [
|
|
||||||
"Xdebug",
|
|
||||||
"environment",
|
|
||||||
"hhvm"
|
|
||||||
],
|
|
||||||
"time": "2016-05-17 03:18:57"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sebastian/exporter",
|
|
||||||
"version": "1.2.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/exporter.git",
|
|
||||||
"reference": "7ae5513327cb536431847bcc0c10edba2701064e"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e",
|
|
||||||
"reference": "7ae5513327cb536431847bcc0c10edba2701064e",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.3",
|
|
||||||
"sebastian/recursion-context": "~1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "~4.4"
|
|
||||||
},
|
|
||||||
"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": "Jeff Welch",
|
|
||||||
"email": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Volker Dusch",
|
|
||||||
"email": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bernhard Schussek",
|
|
||||||
"email": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Adam Harvey",
|
|
||||||
"email": "[email protected]"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Provides the functionality to export PHP variables for visualization",
|
|
||||||
"homepage": "http://www.github.com/sebastianbergmann/exporter",
|
|
||||||
"keywords": [
|
|
||||||
"export",
|
|
||||||
"exporter"
|
|
||||||
],
|
|
||||||
"time": "2015-06-21 07:55:53"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sebastian/global-state",
|
|
||||||
"version": "1.1.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/global-state.git",
|
|
||||||
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
|
|
||||||
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.3"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "~4.2"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"ext-uopz": "*"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.0-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Snapshotting of global state",
|
|
||||||
"homepage": "http://www.github.com/sebastianbergmann/global-state",
|
|
||||||
"keywords": [
|
|
||||||
"global state"
|
|
||||||
],
|
|
||||||
"time": "2015-10-12 03:26:01"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sebastian/recursion-context",
|
|
||||||
"version": "1.0.2",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/recursion-context.git",
|
|
||||||
"reference": "913401df809e99e4f47b27cdd781f4a258d58791"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
|
|
||||||
"reference": "913401df809e99e4f47b27cdd781f4a258d58791",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.3"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "~4.4"
|
|
||||||
},
|
|
||||||
"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": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Adam Harvey",
|
|
||||||
"email": "[email protected]"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Provides functionality to recursively process PHP variables",
|
|
||||||
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
|
|
||||||
"time": "2015-11-11 19:50:13"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sebastian/version",
|
|
||||||
"version": "1.0.6",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sebastianbergmann/version.git",
|
|
||||||
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
|
|
||||||
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Sebastian Bergmann",
|
|
||||||
"email": "[email protected]",
|
|
||||||
"role": "lead"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
|
|
||||||
"homepage": "https://github.com/sebastianbergmann/version",
|
|
||||||
"time": "2015-06-21 13:59:46"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "symfony/yaml",
|
|
||||||
"version": "v2.8.7",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/symfony/yaml.git",
|
|
||||||
"reference": "815fabf3f48c7d1df345a69d1ad1a88f59757b34"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/815fabf3f48c7d1df345a69d1ad1a88f59757b34",
|
|
||||||
"reference": "815fabf3f48c7d1df345a69d1ad1a88f59757b34",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.9"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "2.8-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Component\\Yaml\\": ""
|
|
||||||
},
|
|
||||||
"exclude-from-classmap": [
|
|
||||||
"/Tests/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Fabien Potencier",
|
|
||||||
"email": "[email protected]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Symfony Community",
|
|
||||||
"homepage": "https://symfony.com/contributors"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Symfony Yaml Component",
|
|
||||||
"homepage": "https://symfony.com",
|
|
||||||
"time": "2016-06-06 11:11:27"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"aliases": [],
|
|
||||||
"minimum-stability": "stable",
|
|
||||||
"stability-flags": [],
|
|
||||||
"prefer-stable": false,
|
|
||||||
"prefer-lowest": false,
|
|
||||||
"platform": {
|
|
||||||
"php": ">=5.3.3"
|
|
||||||
},
|
|
||||||
"platform-dev": []
|
|
||||||
}
|
|
||||||
+6
-7
@@ -1,14 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
||||||
<phpunit colors="true" strict="true" bootstrap="vendor/autoload.php">
|
<coverage>
|
||||||
|
<include>
|
||||||
|
<directory suffix=".php">./src/</directory>
|
||||||
|
</include>
|
||||||
|
</coverage>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="phpDocumentor\Reflection\DocBlock">
|
<testsuite name="phpDocumentor\Reflection\DocBlock">
|
||||||
<directory>./tests/</directory>
|
<directory>./tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<filter>
|
|
||||||
<whitelist>
|
|
||||||
<directory suffix=".php">./src/</directory>
|
|
||||||
</whitelist>
|
|
||||||
</filter>
|
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace Barryvdh\Reflection;
|
|||||||
use Barryvdh\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
use Barryvdh\Reflection\DocBlock\Context;
|
use Barryvdh\Reflection\DocBlock\Context;
|
||||||
use Barryvdh\Reflection\DocBlock\Location;
|
use Barryvdh\Reflection\DocBlock\Location;
|
||||||
|
use Barryvdh\Reflection\DocBlock\Tag\TemplateTag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses the DocBlock for any structure.
|
* Parses the DocBlock for any structure.
|
||||||
@@ -40,6 +41,9 @@ class DocBlock implements \Reflector
|
|||||||
*/
|
*/
|
||||||
protected $tags = array();
|
protected $tags = array();
|
||||||
|
|
||||||
|
/** @var string[] An array containing all the generics in this docblock. */
|
||||||
|
protected $generics = array();
|
||||||
|
|
||||||
/** @var Context Information about the context of this DocBlock. */
|
/** @var Context Information about the context of this DocBlock. */
|
||||||
protected $context = null;
|
protected $context = null;
|
||||||
|
|
||||||
@@ -71,8 +75,8 @@ class DocBlock implements \Reflector
|
|||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
$docblock,
|
$docblock,
|
||||||
Context $context = null,
|
?Context $context = null,
|
||||||
Location $location = null
|
?Location $location = null
|
||||||
) {
|
) {
|
||||||
if (is_object($docblock)) {
|
if (is_object($docblock)) {
|
||||||
if (!method_exists($docblock, 'getDocComment')) {
|
if (!method_exists($docblock, 'getDocComment')) {
|
||||||
@@ -238,7 +242,11 @@ class DocBlock implements \Reflector
|
|||||||
|
|
||||||
// create proper Tag objects
|
// create proper Tag objects
|
||||||
foreach ($result as $key => $tag_line) {
|
foreach ($result as $key => $tag_line) {
|
||||||
$result[$key] = Tag::createInstance(trim($tag_line), $this);
|
$tag = Tag::createInstance(trim($tag_line), $this);
|
||||||
|
if ($tag instanceof TemplateTag) {
|
||||||
|
$this->generics[] = $tag->getTemplateName();
|
||||||
|
}
|
||||||
|
$result[$key] = $tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,6 +447,33 @@ class DocBlock implements \Reflector
|
|||||||
return $tag;
|
return $tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a tag from the list of tags.
|
||||||
|
*
|
||||||
|
* @param Tag $tag The tag to be deleted.
|
||||||
|
*
|
||||||
|
* @return bool True if the tag was deleted.
|
||||||
|
*/
|
||||||
|
public function deleteTag(Tag $tag)
|
||||||
|
{
|
||||||
|
if (($key = array_search($tag, $this->tags)) !== false) {
|
||||||
|
unset($this->tags[$key]);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the generics for this DocBlock.
|
||||||
|
*
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public function getGenerics()
|
||||||
|
{
|
||||||
|
return $this->generics;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds a string representation of this object.
|
* Builds a string representation of this object.
|
||||||
|
|||||||
@@ -29,7 +29,10 @@ class Context
|
|||||||
|
|
||||||
/** @var string Name of the structural element, within the namespace. */
|
/** @var string Name of the structural element, within the namespace. */
|
||||||
protected $lsen = '';
|
protected $lsen = '';
|
||||||
|
|
||||||
|
/** @var string[] List of generics */
|
||||||
|
protected $generics = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cteates a new context.
|
* Cteates a new context.
|
||||||
* @param string $namespace The namespace where this DocBlock
|
* @param string $namespace The namespace where this DocBlock
|
||||||
@@ -42,13 +45,15 @@ class Context
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
$namespace = '',
|
$namespace = '',
|
||||||
array $namespace_aliases = array(),
|
array $namespace_aliases = array(),
|
||||||
$lsen = ''
|
$lsen = '',
|
||||||
|
array $generics = array()
|
||||||
) {
|
) {
|
||||||
if (!empty($namespace)) {
|
if (!empty($namespace)) {
|
||||||
$this->setNamespace($namespace);
|
$this->setNamespace($namespace);
|
||||||
}
|
}
|
||||||
$this->setNamespaceAliases($namespace_aliases);
|
$this->setNamespaceAliases($namespace_aliases);
|
||||||
$this->setLSEN($lsen);
|
$this->setLSEN($lsen);
|
||||||
|
$this->setGenerics($generics);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,6 +81,16 @@ class Context
|
|||||||
{
|
{
|
||||||
return $this->lsen;
|
return $this->lsen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the list of generics.
|
||||||
|
*
|
||||||
|
* @return string[] List of generics
|
||||||
|
*/
|
||||||
|
public function getGenerics()
|
||||||
|
{
|
||||||
|
return $this->generics;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a new namespace.
|
* Sets a new namespace.
|
||||||
@@ -151,4 +166,17 @@ class Context
|
|||||||
$this->lsen = (string)$lsen;
|
$this->lsen = (string)$lsen;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a new list of generics.
|
||||||
|
*
|
||||||
|
* @param string[] $generics The new list of generics.
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setGenerics(array $generics)
|
||||||
|
{
|
||||||
|
$this->generics = $generics;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ class Description implements \Reflector
|
|||||||
/**
|
/**
|
||||||
* Populates the fields of a description.
|
* Populates the fields of a description.
|
||||||
*
|
*
|
||||||
* @param string $content The description's conetnts.
|
* @param string $content The description's contents.
|
||||||
* @param DocBlock $docblock The DocBlock which this description belongs to.
|
* @param DocBlock $docblock The DocBlock which this description belongs to.
|
||||||
*/
|
*/
|
||||||
public function __construct($content, DocBlock $docblock = null)
|
public function __construct($content, ?DocBlock $docblock = null)
|
||||||
{
|
{
|
||||||
$this->setContent($content)->setDocBlock($docblock);
|
$this->setContent($content)->setDocBlock($docblock);
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ class Description implements \Reflector
|
|||||||
)
|
)
|
||||||
\}/Sux',
|
\}/Sux',
|
||||||
$this->contents,
|
$this->contents,
|
||||||
null,
|
-1,
|
||||||
PREG_SPLIT_DELIM_CAPTURE
|
PREG_SPLIT_DELIM_CAPTURE
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ class Description implements \Reflector
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setDocBlock(DocBlock $docblock = null)
|
public function setDocBlock(?DocBlock $docblock = null)
|
||||||
{
|
{
|
||||||
$this->docblock = $docblock;
|
$this->docblock = $docblock;
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ class Serializer
|
|||||||
/** @var int|null The max length of a line. */
|
/** @var int|null The max length of a line. */
|
||||||
protected $lineLength = null;
|
protected $lineLength = null;
|
||||||
|
|
||||||
|
/** @var bool Separate tag groups. */
|
||||||
|
protected $separateTags = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a Serializer instance.
|
* Create a Serializer instance.
|
||||||
*
|
*
|
||||||
@@ -45,17 +48,20 @@ class Serializer
|
|||||||
* @param bool $indentFirstLine Whether to indent the first line.
|
* @param bool $indentFirstLine Whether to indent the first line.
|
||||||
* @param int|null $lineLength The max length of a line or NULL to
|
* @param int|null $lineLength The max length of a line or NULL to
|
||||||
* disable line wrapping.
|
* disable line wrapping.
|
||||||
|
* @param bool $separateTags Separate tag groups.
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
$indent = 0,
|
$indent = 0,
|
||||||
$indentString = ' ',
|
$indentString = ' ',
|
||||||
$indentFirstLine = true,
|
$indentFirstLine = true,
|
||||||
$lineLength = null
|
$lineLength = null,
|
||||||
|
$separateTags = false
|
||||||
) {
|
) {
|
||||||
$this->setIndentationString($indentString);
|
$this->setIndentationString($indentString);
|
||||||
$this->setIndent($indent);
|
$this->setIndent($indent);
|
||||||
$this->setIsFirstLineIndented($indentFirstLine);
|
$this->setIsFirstLineIndented($indentFirstLine);
|
||||||
$this->setLineLength($lineLength);
|
$this->setLineLength($lineLength);
|
||||||
|
$this->setSeparateTags($separateTags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -158,6 +164,29 @@ class Serializer
|
|||||||
return $this->lineLength;
|
return $this->lineLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether there should be an empty line between tag groups.
|
||||||
|
*
|
||||||
|
* @param bool $separateTags The new value for this setting.
|
||||||
|
*
|
||||||
|
* @return $this This serializer object.
|
||||||
|
*/
|
||||||
|
public function setSeparateTags($separateTags)
|
||||||
|
{
|
||||||
|
$this->separateTags = (bool)$separateTags;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether there should be an empty line between tag groups.
|
||||||
|
*
|
||||||
|
* @return bool Whether there should be an empty line between tag groups.
|
||||||
|
*/
|
||||||
|
public function getSeparateTags()
|
||||||
|
{
|
||||||
|
return $this->separateTags;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a DocBlock comment.
|
* Generate a DocBlock comment.
|
||||||
*
|
*
|
||||||
@@ -180,8 +209,12 @@ class Serializer
|
|||||||
|
|
||||||
$comment = "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n";
|
$comment = "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n";
|
||||||
|
|
||||||
|
$tags = array_values($docblock->getTags());
|
||||||
|
|
||||||
/** @var Tag $tag */
|
/** @var Tag $tag */
|
||||||
foreach ($docblock->getTags() as $tag) {
|
foreach ($tags as $key => $tag) {
|
||||||
|
$nextTag = isset($tags[$key + 1]) ? $tags[$key + 1] : null;
|
||||||
|
|
||||||
$tagText = (string) $tag;
|
$tagText = (string) $tag;
|
||||||
if ($this->lineLength) {
|
if ($this->lineLength) {
|
||||||
$tagText = wordwrap($tagText, $wrapLength);
|
$tagText = wordwrap($tagText, $wrapLength);
|
||||||
@@ -189,6 +222,10 @@ class Serializer
|
|||||||
$tagText = str_replace("\n", "\n{$indent} * ", $tagText);
|
$tagText = str_replace("\n", "\n{$indent} * ", $tagText);
|
||||||
|
|
||||||
$comment .= "{$indent} * {$tagText}\n";
|
$comment .= "{$indent} * {$tagText}\n";
|
||||||
|
|
||||||
|
if ($this->separateTags && $nextTag !== null && ! $tag->inSameGroup($nextTag)) {
|
||||||
|
$comment .= "{$indent} *\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$comment .= $indent . ' */';
|
$comment .= $indent . ' */';
|
||||||
|
|||||||
@@ -95,7 +95,11 @@ class Tag implements \Reflector
|
|||||||
'var'
|
'var'
|
||||||
=> '\Barryvdh\Reflection\DocBlock\Tag\VarTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\VarTag',
|
||||||
'version'
|
'version'
|
||||||
=> '\Barryvdh\Reflection\DocBlock\Tag\VersionTag'
|
=> '\Barryvdh\Reflection\DocBlock\Tag\VersionTag',
|
||||||
|
'SuppressWarnings'
|
||||||
|
=> '\Barryvdh\Reflection\DocBlock\Tag\SuppressWarningsTag',
|
||||||
|
'template'
|
||||||
|
=> '\Barryvdh\Reflection\DocBlock\Tag\TemplateTag'
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,8 +115,8 @@ class Tag implements \Reflector
|
|||||||
*/
|
*/
|
||||||
final public static function createInstance(
|
final public static function createInstance(
|
||||||
$tag_line,
|
$tag_line,
|
||||||
DocBlock $docblock = null,
|
?DocBlock $docblock = null,
|
||||||
Location $location = null
|
?Location $location = null
|
||||||
) {
|
) {
|
||||||
if (!preg_match(
|
if (!preg_match(
|
||||||
'/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us',
|
'/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us',
|
||||||
@@ -192,8 +196,8 @@ class Tag implements \Reflector
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
$name,
|
$name,
|
||||||
$content,
|
$content,
|
||||||
DocBlock $docblock = null,
|
?DocBlock $docblock = null,
|
||||||
Location $location = null
|
?Location $location = null
|
||||||
) {
|
) {
|
||||||
$this
|
$this
|
||||||
->setName($name)
|
->setName($name)
|
||||||
@@ -321,7 +325,7 @@ class Tag implements \Reflector
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setDocBlock(DocBlock $docblock = null)
|
public function setDocBlock(?DocBlock $docblock = null)
|
||||||
{
|
{
|
||||||
$this->docblock = $docblock;
|
$this->docblock = $docblock;
|
||||||
|
|
||||||
@@ -345,13 +349,46 @@ class Tag implements \Reflector
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setLocation(Location $location = null)
|
public function setLocation(?Location $location = null)
|
||||||
{
|
{
|
||||||
$this->location = $location;
|
$this->location = $location;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the given tags should be together or apart.
|
||||||
|
*
|
||||||
|
* @param Tag $tag
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function inSameGroup(Tag $tag)
|
||||||
|
{
|
||||||
|
$firstName = $this->getName();
|
||||||
|
$secondName = $tag->getName();
|
||||||
|
|
||||||
|
if ($firstName === $secondName) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$groups = array(
|
||||||
|
array('deprecated', 'link', 'see', 'since'),
|
||||||
|
array('author', 'copyright', 'license'),
|
||||||
|
array('category', 'package', 'subpackage'),
|
||||||
|
array('property', 'property-read', 'property-write'),
|
||||||
|
array('param', 'return'),
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($groups as $group) {
|
||||||
|
if (in_array($firstName, $group, true) && in_array($secondName, $group, true)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds a string representation of this object.
|
* Builds a string representation of this object.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -76,7 +76,17 @@ class MethodTag extends ReturnTag
|
|||||||
)?
|
)?
|
||||||
# Return type
|
# Return type
|
||||||
(?:
|
(?:
|
||||||
([\w\|_\\\\]+)
|
(
|
||||||
|
(?:[\w\|_\\\\]*\$this[\w\|_\\\\]*)
|
||||||
|
|
|
||||||
|
(?:
|
||||||
|
(?:[\w\|_\\\\]+(?:<[\s\S]*>)?)
|
||||||
|
# array notation
|
||||||
|
(?:\[\])*
|
||||||
|
)*
|
||||||
|
|
|
||||||
|
(?:\([\s\S]*\))?
|
||||||
|
)
|
||||||
\s+
|
\s+
|
||||||
)?
|
)?
|
||||||
# Legacy method name (not captured)
|
# Legacy method name (not captured)
|
||||||
|
|||||||
@@ -46,12 +46,37 @@ class ParamTag extends ReturnTag
|
|||||||
public function setContent($content)
|
public function setContent($content)
|
||||||
{
|
{
|
||||||
Tag::setContent($content);
|
Tag::setContent($content);
|
||||||
$parts = preg_split(
|
|
||||||
'/(\s+)/Su',
|
$parts = [];
|
||||||
$this->description,
|
$rest = $this->description;
|
||||||
3,
|
|
||||||
PREG_SPLIT_DELIM_CAPTURE
|
// parsing generics and closures to detect types
|
||||||
);
|
for($pos = 0, $stacks = []; $pos < strlen($rest); $pos++) {
|
||||||
|
$char = $rest[$pos];
|
||||||
|
|
||||||
|
if($char === '<') {
|
||||||
|
array_unshift($stacks, $char);
|
||||||
|
}
|
||||||
|
if($char === '(') {
|
||||||
|
array_unshift($stacks, $char);
|
||||||
|
}
|
||||||
|
if($char === '>' && isset($stacks[0]) && $stacks[0] === '<') {
|
||||||
|
array_shift($stacks);
|
||||||
|
}
|
||||||
|
if($char === ')' && isset($stacks[0]) && $stacks[0] === '(') {
|
||||||
|
array_shift($stacks);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$stacks && preg_match('/\A(\s+)(.*)/su', substr($rest, $pos), $matches)) {
|
||||||
|
$parts[0] = substr($rest, 0, $pos);
|
||||||
|
$parts[1] = $matches[1];
|
||||||
|
$rest = $matches[2];
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
array_push($parts, ...preg_split('/(\s+)/u', $rest, 2, PREG_SPLIT_DELIM_CAPTURE));
|
||||||
|
|
||||||
// if the first item that is encountered is not a variable; it is a type
|
// if the first item that is encountered is not a variable; it is a type
|
||||||
if (isset($parts[0])
|
if (isset($parts[0])
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class ReturnTag extends Tag
|
|||||||
{
|
{
|
||||||
/** @var string The raw type component. */
|
/** @var string The raw type component. */
|
||||||
protected $type = '';
|
protected $type = '';
|
||||||
|
|
||||||
/** @var Collection The parsed type component. */
|
/** @var Collection The parsed type component. */
|
||||||
protected $types = null;
|
protected $types = null;
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class ReturnTag extends Tag
|
|||||||
{
|
{
|
||||||
parent::setContent($content);
|
parent::setContent($content);
|
||||||
|
|
||||||
$parts = preg_split('/\s+/Su', $this->description, 2);
|
$parts = preg_split('/(?<!,)\s+/Su', $this->description, 2);
|
||||||
|
|
||||||
// any output is considered a type
|
// any output is considered a type
|
||||||
$this->type = $parts[0];
|
$this->type = $parts[0];
|
||||||
@@ -112,7 +112,7 @@ class ReturnTag extends Tag
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type collection.
|
* Returns the type collection.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function getTypesCollection()
|
protected function getTypesCollection()
|
||||||
@@ -120,7 +120,8 @@ class ReturnTag extends Tag
|
|||||||
if (null === $this->types) {
|
if (null === $this->types) {
|
||||||
$this->types = new Collection(
|
$this->types = new Collection(
|
||||||
array($this->type),
|
array($this->type),
|
||||||
$this->docblock ? $this->docblock->getContext() : null
|
$this->docblock ? $this->docblock->getContext() : null,
|
||||||
|
$this->docblock ? $this->docblock->getGenerics() : array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $this->types;
|
return $this->types;
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* phpDocumentor
|
||||||
|
*
|
||||||
|
* PHP Version 5.3
|
||||||
|
*
|
||||||
|
* @author Andrew Smith <[email protected]>
|
||||||
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reflection class for a @SuppressWarnings tag in a Docblock.
|
||||||
|
*
|
||||||
|
* @author Andrew Smith <[email protected]>
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
class SuppressWarningsTag extends Tag
|
||||||
|
{
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return "@{$this->getName()}{$this->getContent()}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* phpDocumentor
|
||||||
|
*
|
||||||
|
* PHP Version 5.3
|
||||||
|
*
|
||||||
|
* @author Mike van Riel <[email protected]>
|
||||||
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reflection class for a @template tag in a Docblock.
|
||||||
|
*
|
||||||
|
* @author chack1172 <[email protected]>
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
class TemplateTag extends ParamTag
|
||||||
|
{
|
||||||
|
/** @var string */
|
||||||
|
protected $templateName = null;
|
||||||
|
|
||||||
|
/** @var string|null */
|
||||||
|
protected $bound = null;
|
||||||
|
|
||||||
|
public function getContent()
|
||||||
|
{
|
||||||
|
if (null === $this->content) {
|
||||||
|
$this->content = $this->templateName;
|
||||||
|
if (null !== $this->bound) {
|
||||||
|
$this->content .= ' of ' . $this->bound;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
public function setContent($content)
|
||||||
|
{
|
||||||
|
$parts = explode(' of ', $content);
|
||||||
|
$this->templateName = $parts[0];
|
||||||
|
if (isset($parts[1])) {
|
||||||
|
$this->bound = $parts[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->setDescription('');
|
||||||
|
$this->content = $content;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the template name
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getTemplateName()
|
||||||
|
{
|
||||||
|
return $this->templateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the template name
|
||||||
|
*
|
||||||
|
* @param string $templateName
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setTemplateName($templateName)
|
||||||
|
{
|
||||||
|
$this->templateName = $templateName;
|
||||||
|
$this->content = null;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the bound type
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getBound()
|
||||||
|
{
|
||||||
|
return $this->bound;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the bound type
|
||||||
|
* @param string|null $bound
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setBound($bound)
|
||||||
|
{
|
||||||
|
$this->bound = $bound;
|
||||||
|
$this->content = null;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,7 +37,14 @@ class Collection extends \ArrayObject
|
|||||||
protected static $keywords = array(
|
protected static $keywords = array(
|
||||||
'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double',
|
'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double',
|
||||||
'object', 'mixed', 'array', 'resource', 'void', 'null', 'scalar',
|
'object', 'mixed', 'array', 'resource', 'void', 'null', 'scalar',
|
||||||
'callback', 'callable', 'false', 'true', 'self', '$this', 'static'
|
'callback', 'callable', 'false', 'true', 'self', '$this', 'static',
|
||||||
|
'array-key', 'number', 'iterable', 'pure-callable', 'closed-resource',
|
||||||
|
'open-resource', 'positive-int', 'negative-int', 'non-positive-int',
|
||||||
|
'non-negative-int', 'non-zero-int', 'non-empty-array', 'list',
|
||||||
|
'non-empty-list', 'key-of', 'value-of', 'template-type', 'class-string',
|
||||||
|
'callable-string', 'numeric-string', 'non-empty-string',
|
||||||
|
'non-falsy-string', 'literal-string', 'lowercase-string', 'never',
|
||||||
|
'never-return', 'never-returns', 'no-return', 'int-mask', 'int-mask-of'
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,6 +57,13 @@ class Collection extends \ArrayObject
|
|||||||
*/
|
*/
|
||||||
protected $context = null;
|
protected $context = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of generics types
|
||||||
|
*
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
protected $generics = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers the namespace and aliases; uses that to add and expand the
|
* Registers the namespace and aliases; uses that to add and expand the
|
||||||
* given types.
|
* given types.
|
||||||
@@ -60,9 +74,11 @@ class Collection extends \ArrayObject
|
|||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
array $types = array(),
|
array $types = array(),
|
||||||
Context $context = null
|
?Context $context = null,
|
||||||
|
array $generics = array()
|
||||||
) {
|
) {
|
||||||
$this->context = null === $context ? new Context() : $context;
|
$this->context = null === $context ? new Context() : $context;
|
||||||
|
$this->generics = array_merge($this->context->getGenerics(), $generics);
|
||||||
|
|
||||||
foreach ($types as $type) {
|
foreach ($types as $type) {
|
||||||
$this->add($type);
|
$this->add($type);
|
||||||
@@ -106,7 +122,7 @@ class Collection extends \ArrayObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// separate the type by the OR operator
|
// separate the type by the OR operator
|
||||||
$type_parts = explode(self::OPERATOR_OR, $type);
|
$type_parts = $this->explode($type);
|
||||||
foreach ($type_parts as $part) {
|
foreach ($type_parts as $part) {
|
||||||
$expanded_type = $this->expand($part);
|
$expanded_type = $this->expand($part);
|
||||||
if ($expanded_type) {
|
if ($expanded_type) {
|
||||||
@@ -114,10 +130,10 @@ class Collection extends \ArrayObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string representation of the collection.
|
* Returns a string representation of the collection.
|
||||||
*
|
*
|
||||||
* @return string The resolved types across the collection, separated with
|
* @return string The resolved types across the collection, separated with
|
||||||
* {@link self::OPERATOR_OR}.
|
* {@link self::OPERATOR_OR}.
|
||||||
*/
|
*/
|
||||||
@@ -126,6 +142,40 @@ class Collection extends \ArrayObject
|
|||||||
return implode(self::OPERATOR_OR, $this->getArrayCopy());
|
return implode(self::OPERATOR_OR, $this->getArrayCopy());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Analyzes the given union of types and returns separated by OR operator
|
||||||
|
* single types.
|
||||||
|
*
|
||||||
|
* @param string $type The type or union of types
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected function explode($type)
|
||||||
|
{
|
||||||
|
$type_parts = [];
|
||||||
|
$curr_type = '';
|
||||||
|
$nest_level = 0;
|
||||||
|
|
||||||
|
foreach (str_split($type) as $char) {
|
||||||
|
if ($char === self::OPERATOR_OR && $nest_level === 0) {
|
||||||
|
$type_parts[] = $curr_type;
|
||||||
|
$curr_type = '';
|
||||||
|
} else {
|
||||||
|
if ($char === '<' || $char === '(') {
|
||||||
|
$nest_level++;
|
||||||
|
} else if ($char === '>' || $char === ')') {
|
||||||
|
$nest_level--;
|
||||||
|
}
|
||||||
|
|
||||||
|
$curr_type .= $char;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$type_parts[] = $curr_type;
|
||||||
|
|
||||||
|
return $type_parts;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Analyzes the given type and returns the FQCN variant.
|
* Analyzes the given type and returns the FQCN variant.
|
||||||
*
|
*
|
||||||
@@ -151,11 +201,19 @@ class Collection extends \ArrayObject
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (preg_match('/^[\w-]+<.*>$/', $type)) {
|
||||||
|
return $type;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($type[0] === '(') {
|
||||||
|
return $type;
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isTypeAnArray($type)) {
|
if ($this->isTypeAnArray($type)) {
|
||||||
return $this->expand(substr($type, 0, -2)) . self::OPERATOR_ARRAY;
|
return $this->expand(substr($type, 0, -2)) . self::OPERATOR_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->isRelativeType($type) && !$this->isTypeAKeyword($type)) {
|
if ($this->isRelativeType($type) && !$this->isTypeAKeyword($type) && !$this->isTypeAGeneric($type)) {
|
||||||
|
|
||||||
if($this->shouldBeAbsolute($type)){
|
if($this->shouldBeAbsolute($type)){
|
||||||
return self::OPERATOR_NAMESPACE . $type;
|
return self::OPERATOR_NAMESPACE . $type;
|
||||||
@@ -231,6 +289,19 @@ class Collection extends \ArrayObject
|
|||||||
|| $this->isTypeAKeyword($type);
|
|| $this->isTypeAKeyword($type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detects whether the given type represents a generic.
|
||||||
|
*
|
||||||
|
* @param string $type A relative or absolute type as defined in the
|
||||||
|
* phpDocumentor documentation.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function isTypeAGeneric($type)
|
||||||
|
{
|
||||||
|
return in_array($type, $this->generics, true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detects if the type should actually be absolute, by checking if it exists.
|
* Detects if the type should actually be absolute, by checking if it exists.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock;
|
namespace Barryvdh\Reflection\DocBlock;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Description
|
* Test class for \Barryvdh\Reflection\DocBlock\Description
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class DescriptionTest extends \PHPUnit_Framework_TestCase
|
class DescriptionTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testConstruct()
|
public function testConstruct()
|
||||||
{
|
{
|
||||||
@@ -106,7 +108,7 @@ LONGDESC;
|
|||||||
|
|
||||||
$parsedDescription = $parsedContents[1]->getParsedDescription();
|
$parsedDescription = $parsedContents[1]->getParsedDescription();
|
||||||
$this->assertCount(3, $parsedDescription);
|
$this->assertCount(3, $parsedDescription);
|
||||||
$this->assertSame("inline tag with\n", $parsedDescription[0]);
|
$this->assertSame("inline tag with", trim($parsedDescription[0]));
|
||||||
$this->assertInstanceOf(
|
$this->assertInstanceOf(
|
||||||
__NAMESPACE__ . '\Tag\LinkTag',
|
__NAMESPACE__ . '\Tag\LinkTag',
|
||||||
$parsedDescription[1]
|
$parsedDescription[1]
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\CoversTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\CoversTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class CoversTagTest extends \PHPUnit_Framework_TestCase
|
class CoversTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\CoversTag can create
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\CoversTag can create
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\DeprecatedTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\DeprecatedTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class DeprecatedTagTest extends \PHPUnit_Framework_TestCase
|
class DeprecatedTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\ExampleTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\ExampleTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class ExampleTagTest extends \PHPUnit_Framework_TestCase
|
class ExampleTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\SourceTag can
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\SourceTag can
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\LinkTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\LinkTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class LinkTagTest extends \PHPUnit_Framework_TestCase
|
class LinkTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\MethodTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\MethodTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class MethodTagTest extends \PHPUnit_Framework_TestCase
|
class MethodTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param string $signature The signature to test.
|
* @param string $signature The signature to test.
|
||||||
@@ -140,7 +142,25 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase
|
|||||||
array(
|
array(
|
||||||
'static static foo()',
|
'static static foo()',
|
||||||
true, 'foo', 'static', true, 0, ''
|
true, 'foo', 'static', true, 0, ''
|
||||||
)
|
),
|
||||||
|
|
||||||
|
// generic array
|
||||||
|
array(
|
||||||
|
'array<int, string> foo()',
|
||||||
|
true, 'foo', 'array<int, string>', false, 0, ''
|
||||||
|
),
|
||||||
|
|
||||||
|
// nested generics
|
||||||
|
array(
|
||||||
|
'array<int, array<string, mixed>> foo()',
|
||||||
|
true, 'foo', 'array<int, array<string, mixed>>', false, 0, ''
|
||||||
|
),
|
||||||
|
|
||||||
|
// closure
|
||||||
|
array(
|
||||||
|
'(\Closure(int, string): bool) foo()',
|
||||||
|
true, 'foo', '(\Closure(int, string): bool)', false, 0, ''
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\ParamTag
|
* Test class for \Barryvdh\Reflection\DocBlock\ParamTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class ParamTagTest extends \PHPUnit_Framework_TestCase
|
class ParamTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\ParamTag can
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\ParamTag can
|
||||||
@@ -112,7 +114,75 @@ class ParamTagTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('int'),
|
array('int'),
|
||||||
'$bob',
|
'$bob',
|
||||||
"Type on a new line"
|
"Type on a new line"
|
||||||
)
|
),
|
||||||
|
|
||||||
|
// generic array
|
||||||
|
array(
|
||||||
|
'param',
|
||||||
|
'array<int, string> $names',
|
||||||
|
'array<int, string>',
|
||||||
|
array('array<int, string>'),
|
||||||
|
'$names',
|
||||||
|
''
|
||||||
|
),
|
||||||
|
|
||||||
|
// nested generics
|
||||||
|
array(
|
||||||
|
'param',
|
||||||
|
'array<int, array<string, mixed>> $arrays',
|
||||||
|
'array<int, array<string, mixed>>',
|
||||||
|
array('array<int, array<string, mixed>>'),
|
||||||
|
'$arrays',
|
||||||
|
''
|
||||||
|
),
|
||||||
|
|
||||||
|
// closure
|
||||||
|
array(
|
||||||
|
'param',
|
||||||
|
'(\Closure(int, string): bool) $callback',
|
||||||
|
'(\Closure(int, string): bool)',
|
||||||
|
array('(\Closure(int, string): bool)'),
|
||||||
|
'$callback',
|
||||||
|
''
|
||||||
|
),
|
||||||
|
|
||||||
|
// generic array in closure
|
||||||
|
array(
|
||||||
|
'param',
|
||||||
|
'(\Closure(array<int, string>): bool) $callback',
|
||||||
|
'(\Closure(array<int, string>): bool)',
|
||||||
|
array('(\Closure(array<int, string>): bool)'),
|
||||||
|
'$callback',
|
||||||
|
''
|
||||||
|
),
|
||||||
|
|
||||||
|
// union types in closure
|
||||||
|
array(
|
||||||
|
'param',
|
||||||
|
'(\Closure(int|string): bool)|bool $callback',
|
||||||
|
'(\Closure(int|string): bool)|bool',
|
||||||
|
array('(\Closure(int|string): bool)', 'bool'),
|
||||||
|
'$callback',
|
||||||
|
''
|
||||||
|
),
|
||||||
|
|
||||||
|
// example from Laravel Framework - Eloquent Builder)
|
||||||
|
array(
|
||||||
|
'param',
|
||||||
|
'array<array-key, array|(\Closure(\Illuminate\Database\Eloquent\Relations\Relation<*,*,*>): mixed)|string>|string $relations',
|
||||||
|
'array<array-key, array|(\Closure(\Illuminate\Database\Eloquent\Relations\Relation<*,*,*>): mixed)|string>|string',
|
||||||
|
array('array<array-key, array|(\Closure(\Illuminate\Database\Eloquent\Relations\Relation<*,*,*>): mixed)|string>', 'string'),
|
||||||
|
'$relations',
|
||||||
|
''
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'param',
|
||||||
|
'(\Closure(\Illuminate\Database\Eloquent\Relations\Relation<*,*,*>): mixed)|string|null $callback',
|
||||||
|
'(\Closure(\Illuminate\Database\Eloquent\Relations\Relation<*,*,*>): mixed)|string|null',
|
||||||
|
array('(\Closure(\Illuminate\Database\Eloquent\Relations\Relation<*,*,*>): mixed)', 'string', 'null'),
|
||||||
|
'$callback',
|
||||||
|
''
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* phpDocumentor Return tag test.
|
* phpDocumentor Return tag test.
|
||||||
*
|
*
|
||||||
* PHP version 5.3
|
* PHP version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\ReturnTag
|
* Test class for \Barryvdh\Reflection\DocBlock\ReturnTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class ReturnTagTest extends \PHPUnit_Framework_TestCase
|
class ReturnTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\ReturnTag can
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\ReturnTag can
|
||||||
@@ -96,6 +98,27 @@ class ReturnTagTest extends \PHPUnit_Framework_TestCase
|
|||||||
'int',
|
'int',
|
||||||
array('int'),
|
array('int'),
|
||||||
"Number of Bobs"
|
"Number of Bobs"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'return',
|
||||||
|
'array<int, string> Types of Bobs',
|
||||||
|
'array<int, string>',
|
||||||
|
array('array<int, string>'),
|
||||||
|
'Types of Bobs'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'return',
|
||||||
|
'array<int, string>|string Types of Bobs',
|
||||||
|
'array<int, string>|string',
|
||||||
|
array('array<int, string>', 'string'),
|
||||||
|
'Types of Bobs'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'return',
|
||||||
|
'array<int, string|bool>|string Types of Bobs',
|
||||||
|
'array<int, string|bool>|string',
|
||||||
|
array('array<int, string|bool>', 'string'),
|
||||||
|
'Types of Bobs'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\SeeTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\SeeTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class SeeTagTest extends \PHPUnit_Framework_TestCase
|
class SeeTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the phpDocumentor_Reflection_DocBlock_Tag_See can create a link
|
* Test that the phpDocumentor_Reflection_DocBlock_Tag_See can create a link
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\SinceTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\SinceTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class SinceTagTest extends \PHPUnit_Framework_TestCase
|
class SinceTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\SourceTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\SourceTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class SourceTagTest extends \PHPUnit_Framework_TestCase
|
class SourceTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\SourceTag can
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\SourceTag can
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* phpDocumentor SuppressWarnings Tag Test
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
|
*
|
||||||
|
* @author Andrew Smith <[email protected]>
|
||||||
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\Test;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\SuppressWarningsTag
|
||||||
|
*
|
||||||
|
* @author Andrew Smith <[email protected]>
|
||||||
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
class SuppressWarningsTagTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\SuppressWarningsTag can
|
||||||
|
* understand the @SuppressWarnings doc block.
|
||||||
|
*
|
||||||
|
* @param string $type
|
||||||
|
* @param string $content
|
||||||
|
* @param string $exType
|
||||||
|
* @param string $exVariable
|
||||||
|
* @param string $exDescription
|
||||||
|
*
|
||||||
|
* @covers \Barryvdh\Reflection\DocBlock\Tag\SuppressWarningsTag
|
||||||
|
* @dataProvider provideDataForConstuctor
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testConstructorParesInputsIntoCorrectFields(
|
||||||
|
$type,
|
||||||
|
$content,
|
||||||
|
$description
|
||||||
|
) {
|
||||||
|
$tag = new SuppressWarningsTag($type, $content);
|
||||||
|
|
||||||
|
$this->assertEquals($type, $tag->getName());
|
||||||
|
$this->assertEquals($description, $tag->getDescription());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data provider for testConstructorParesInputsIntoCorrectFields
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function provideDataForConstuctor()
|
||||||
|
{
|
||||||
|
// $type, $content, $description
|
||||||
|
return array(
|
||||||
|
array(
|
||||||
|
'SuppressWarnings',
|
||||||
|
'SuppressWarnings(PHPMD)',
|
||||||
|
'SuppressWarnings(PHPMD)',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'SuppressWarnings',
|
||||||
|
'SuppressWarnings(PHPMD.TooManyMethods)',
|
||||||
|
'SuppressWarnings(PHPMD.TooManyMethods)',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* phpDocumentor Template Tag Test
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
|
*
|
||||||
|
* @author Daniel O'Connor <[email protected]>
|
||||||
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\TemplateTag
|
||||||
|
*
|
||||||
|
* @author Daniel O'Connor <[email protected]>
|
||||||
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
class TemplateTagTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Test that the phpDocumentor_Reflection_DocBlock_Tag_See can create a link
|
||||||
|
* for the @see doc block.
|
||||||
|
*
|
||||||
|
* @param string $type
|
||||||
|
* @param string $content
|
||||||
|
* @param string $exContent
|
||||||
|
* @param string $exReference
|
||||||
|
*
|
||||||
|
* @covers \Barryvdh\Reflection\DocBlock\Tag\SeeTag
|
||||||
|
* @dataProvider provideDataForConstuctor
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testConstructorParesInputsIntoCorrectFields(
|
||||||
|
$type,
|
||||||
|
$content,
|
||||||
|
$exContent,
|
||||||
|
$exDescription,
|
||||||
|
$exTemplateName,
|
||||||
|
$exBound
|
||||||
|
) {
|
||||||
|
$tag = new TemplateTag($type, $content);
|
||||||
|
|
||||||
|
$this->assertEquals($type, $tag->getName());
|
||||||
|
$this->assertEquals($exContent, $tag->getContent());
|
||||||
|
$this->assertEquals($exDescription, $tag->getDescription());
|
||||||
|
$this->assertEquals($exTemplateName, $tag->getTemplateName());
|
||||||
|
$this->assertEquals($exBound, $tag->getBound());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data provider for testConstructorParesInputsIntoCorrectFields
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function provideDataForConstuctor()
|
||||||
|
{
|
||||||
|
// $type, $content, $exContent, $exDescription, $exTemplateName, $exBound
|
||||||
|
return array(
|
||||||
|
array(
|
||||||
|
'template',
|
||||||
|
'TValue',
|
||||||
|
'TValue',
|
||||||
|
'',
|
||||||
|
'TValue',
|
||||||
|
null,
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'template',
|
||||||
|
'TValue of string',
|
||||||
|
'TValue of string',
|
||||||
|
'',
|
||||||
|
'TValue',
|
||||||
|
'string',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\ThrowsTag
|
* Test class for \Barryvdh\Reflection\DocBlock\ThrowsTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class ThrowsTagTest extends \PHPUnit_Framework_TestCase
|
class ThrowsTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\ThrowsTag can
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\ThrowsTag can
|
||||||
|
|||||||
@@ -12,6 +12,9 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\Test;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\UsesTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\UsesTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +23,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class UsesTagTest extends \PHPUnit_Framework_TestCase
|
class UsesTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\UsesTag can create
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\UsesTag can create
|
||||||
|
|||||||
@@ -12,6 +12,9 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\Test;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\VarTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\VarTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +23,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class VarTagTest extends \PHPUnit_Framework_TestCase
|
class VarTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\VarTag can
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\VarTag can
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\VersionTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\VersionTag
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class VersionTagTest extends \PHPUnit_Framework_TestCase
|
class VersionTagTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create
|
* Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace Barryvdh\Reflection\DocBlock;
|
|||||||
|
|
||||||
use Barryvdh\Reflection\DocBlock;
|
use Barryvdh\Reflection\DocBlock;
|
||||||
use Barryvdh\Reflection\DocBlock\Context;
|
use Barryvdh\Reflection\DocBlock\Context;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Tag\VarTag
|
* Test class for \Barryvdh\Reflection\DocBlock\Tag\VarTag
|
||||||
@@ -23,16 +24,16 @@ use Barryvdh\Reflection\DocBlock\Context;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class TagTest extends \PHPUnit_Framework_TestCase
|
class TagTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \InvalidArgumentException
|
*
|
||||||
*
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testInvalidTagLine()
|
public function testInvalidTagLine()
|
||||||
{
|
{
|
||||||
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
Tag::createInstance('Invalid tag line');
|
Tag::createInstance('Invalid tag line');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +77,7 @@ class TagTest extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testTagHandlerCorrectRegistration()
|
public function testTagHandlerCorrectRegistration()
|
||||||
{
|
{
|
||||||
if (0 == ini_get('allow_url_include')) {
|
if (!ini_get('allow_url_include')) {
|
||||||
$this->markTestSkipped('"data" URIs for includes are required.');
|
$this->markTestSkipped('"data" URIs for includes are required.');
|
||||||
}
|
}
|
||||||
$currentHandler = __NAMESPACE__ . '\Tag\VarTag';
|
$currentHandler = __NAMESPACE__ . '\Tag\VarTag';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* phpDocumentor Collection Test
|
* phpDocumentor Collection Test
|
||||||
*
|
*
|
||||||
* PHP version 5.3
|
* PHP version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
@@ -13,10 +13,11 @@
|
|||||||
namespace Barryvdh\Reflection\DocBlock\Type;
|
namespace Barryvdh\Reflection\DocBlock\Type;
|
||||||
|
|
||||||
use Barryvdh\Reflection\DocBlock\Context;
|
use Barryvdh\Reflection\DocBlock\Context;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for \Barryvdh\Reflection\DocBlock\Type\Collection
|
* Test class for \Barryvdh\Reflection\DocBlock\Type\Collection
|
||||||
*
|
*
|
||||||
* @covers Barryvdh\Reflection\DocBlock\Type\Collection
|
* @covers Barryvdh\Reflection\DocBlock\Type\Collection
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
@@ -24,12 +25,12 @@ use Barryvdh\Reflection\DocBlock\Context;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class CollectionTest extends \PHPUnit_Framework_TestCase
|
class CollectionTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
|
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
|
||||||
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::getContext
|
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::getContext
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testConstruct()
|
public function testConstruct()
|
||||||
@@ -42,7 +43,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
|
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testConstructWithTypes()
|
public function testConstructWithTypes()
|
||||||
@@ -53,7 +54,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
|
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testConstructWithNamespace()
|
public function testConstructWithNamespace()
|
||||||
@@ -70,7 +71,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
|
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testConstructWithNamespaceAliases()
|
public function testConstructWithNamespaceAliases()
|
||||||
@@ -89,7 +90,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
*
|
*
|
||||||
* @dataProvider provideTypesToExpand
|
* @dataProvider provideTypesToExpand
|
||||||
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
|
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testAdd($fixture, $expected)
|
public function testAdd($fixture, $expected)
|
||||||
@@ -109,7 +110,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
*
|
*
|
||||||
* @dataProvider provideTypesToExpandWithoutNamespace
|
* @dataProvider provideTypesToExpandWithoutNamespace
|
||||||
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
|
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testAddWithoutNamespace($fixture, $expected)
|
public function testAddWithoutNamespace($fixture, $expected)
|
||||||
@@ -144,13 +145,34 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param string $fixture
|
||||||
|
* @param array $expected
|
||||||
|
*
|
||||||
|
* @dataProvider provideTypesToExpandWithGenerics
|
||||||
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
|
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
|
||||||
* @expectedException InvalidArgumentException
|
*
|
||||||
*
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testAddWithGenerics($fixture, $expected)
|
||||||
|
{
|
||||||
|
$collection = new Collection(
|
||||||
|
array(),
|
||||||
|
new Context('\My\Space', array('Alias' => '\My\Space\Aliasing'), '', array('TParent')),
|
||||||
|
array('TValue')
|
||||||
|
);
|
||||||
|
$collection->add($fixture);
|
||||||
|
|
||||||
|
$this->assertSame($expected, $collection->getArrayCopy());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testAddWithInvalidArgument()
|
public function testAddWithInvalidArgument()
|
||||||
{
|
{
|
||||||
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$collection = new Collection();
|
$collection = new Collection();
|
||||||
$collection->add(array());
|
$collection->add(array());
|
||||||
}
|
}
|
||||||
@@ -197,6 +219,26 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
'DocBlock[]|int[]',
|
'DocBlock[]|int[]',
|
||||||
array($namespace.'DocBlock[]', 'int[]')
|
array($namespace.'DocBlock[]', 'int[]')
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'array<string>',
|
||||||
|
array('array<string>')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'array<int, string>',
|
||||||
|
array('array<int, string>')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'array<int, string>|string',
|
||||||
|
array('array<int, string>', 'string')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'array<int, float|bool>|string',
|
||||||
|
array('array<int, float|bool>', 'string')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'array<int, string|array<int, bool>>|array<int, float>|string',
|
||||||
|
array('array<int, string|array<int, bool>>', 'array<int, float>', 'string')
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'LinkDescriptor::setLink()',
|
'LinkDescriptor::setLink()',
|
||||||
array($namespace.'LinkDescriptor::setLink()')
|
array($namespace.'LinkDescriptor::setLink()')
|
||||||
@@ -205,6 +247,42 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
'Alias\LinkDescriptor::setLink()',
|
'Alias\LinkDescriptor::setLink()',
|
||||||
array('\My\Space\Aliasing\LinkDescriptor::setLink()')
|
array('\My\Space\Aliasing\LinkDescriptor::setLink()')
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'int<0, 100>',
|
||||||
|
array('int<0, 100>')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'non-empty-array<string>',
|
||||||
|
array('non-empty-array<string>')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'non-empty-array<int, string>',
|
||||||
|
array('non-empty-array<int, string>')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'list<string>',
|
||||||
|
array('list<string>')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'non-empty-list<string>',
|
||||||
|
array('non-empty-list<string>')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'key-of<MyClass::ARRAY_CONST>',
|
||||||
|
array('key-of<MyClass::ARRAY_CONST>')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'value-of<MyClass::ARRAY_CONST>',
|
||||||
|
array('value-of<MyClass::ARRAY_CONST>')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'value-of<MyBackedEnum>',
|
||||||
|
array('value-of<MyBackedEnum>')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'iterable<string>',
|
||||||
|
array('iterable<string>')
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,4 +328,23 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the types and their expected values to test the retrieval of
|
||||||
|
* types including generics.
|
||||||
|
*
|
||||||
|
* @param string $method Name of the method consuming this data provider.
|
||||||
|
* @param string $namespace Name of the namespace to user as basis.
|
||||||
|
*
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public function provideTypesToExpandWithGenerics($method, $namespace = '\My\Space\\')
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array('TValue', array('TValue')),
|
||||||
|
array('TValue[]', array('TValue[]')),
|
||||||
|
array('TValue|DocBlock', array('TValue', $namespace . 'DocBlock')),
|
||||||
|
array('TParent', array('TParent')),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace Barryvdh\Reflection;
|
|||||||
use Barryvdh\Reflection\DocBlock\Context;
|
use Barryvdh\Reflection\DocBlock\Context;
|
||||||
use Barryvdh\Reflection\DocBlock\Location;
|
use Barryvdh\Reflection\DocBlock\Location;
|
||||||
use Barryvdh\Reflection\DocBlock\Tag\ReturnTag;
|
use Barryvdh\Reflection\DocBlock\Tag\ReturnTag;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for Barryvdh\Reflection\DocBlock
|
* Test class for Barryvdh\Reflection\DocBlock
|
||||||
@@ -24,7 +25,7 @@ use Barryvdh\Reflection\DocBlock\Tag\ReturnTag;
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class DocBlockTest extends \PHPUnit_Framework_TestCase
|
class DocBlockTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @covers \Barryvdh\Reflection\DocBlock
|
* @covers \Barryvdh\Reflection\DocBlock
|
||||||
@@ -165,12 +166,12 @@ DOCBLOCK;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \InvalidArgumentException
|
*
|
||||||
*
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testExceptionOnInvalidObject()
|
public function testExceptionOnInvalidObject()
|
||||||
{
|
{
|
||||||
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
new DocBlock($this);
|
new DocBlock($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,8 +204,9 @@ DOCBLOCK;
|
|||||||
*/
|
*/
|
||||||
public function testInvalidTagBlock()
|
public function testInvalidTagBlock()
|
||||||
{
|
{
|
||||||
if (0 == ini_get('allow_url_include')) {
|
if (!ini_get('allow_url_include')) {
|
||||||
$this->markTestSkipped('"data" URIs for includes are required.');
|
$this->markTestSkipped('"data" URIs for includes are required.');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
include 'data:text/plain;base64,'. base64_encode(
|
include 'data:text/plain;base64,'. base64_encode(
|
||||||
@@ -334,4 +336,22 @@ DOCBLOCK;
|
|||||||
$this->assertCount(1, $object->getTagsByName('return'));
|
$this->assertCount(1, $object->getTagsByName('return'));
|
||||||
$this->assertCount(2, $object->getTagsByName('param'));
|
$this->assertCount(2, $object->getTagsByName('param'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers \Barryvdh\Reflection\DocBlock::parseTags
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testGenericsAreParsed()
|
||||||
|
{
|
||||||
|
$fixture = <<<DOCBLOCK
|
||||||
|
/**
|
||||||
|
* @template TValue
|
||||||
|
* @param TValue
|
||||||
|
* @return TValue
|
||||||
|
*/
|
||||||
|
DOCBLOCK;
|
||||||
|
$object = new DocBlock($fixture);
|
||||||
|
$this->assertSame(array('TValue'), $object->getGenerics());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user