Compare commits

...
25 Commits
Author SHA1 Message Date
Barry vd. Heuvel bf44b757fe Merge pull request #12 from barryvdh/fix-deprecated
Fix deprecated messages
2022-10-31 16:35:43 +01:00
Barry vd. Heuvel e6526132ee Fix deprecated messages 2022-10-31 16:34:24 +01:00
Barry vd. Heuvel 6b7c110b33 Merge pull request #10 from barryvdh/test-ghactions
Create run-tests.yml
2022-10-31 16:22:38 +01:00
Barry vd. Heuvel ad1e63e15c Fix tests 2022-10-31 16:20:50 +01:00
Barry vd. Heuvel 6eafab0ff3 Revert "Check namespace + class to see if it exists"
This reverts commit 7f729dc9a7.
2022-10-31 16:13:13 +01:00
Barry vd. Heuvel fe49c3d9ee Update tests 2022-10-31 16:13:07 +01:00
Barry vd. Heuvel 3f6ec1c280 Merge pull request #8 from Kerigard/feat/separate-tags
feat: add separation of tags into groups
2022-10-31 16:06:25 +01:00
Barry vd. Heuvel 72df918400 Create run-tests.yml 2022-10-31 16:05:08 +01:00
Barry vd. Heuvel c10c41e932 Merge pull request #7 from angeljqv/patch-2
Create .gitattributes
2022-10-31 16:01:16 +01:00
Barry vd. Heuvel 977da00f0f Merge pull request #6 from Stevemoretz/patch-2
Check namespace + class to see if it exists
2022-10-31 16:01:03 +01:00
Barry vd. Heuvel 7e5538a638 Merge pull request #9 from bbprojectnet/generic-types-fix
Generic types recognitions bug fix
2022-10-31 16:00:41 +01:00
M@ster 295d2fba38 Generic types bug fix 2022-10-19 23:16:04 +02:00
Kerigard ef9f04dd59 feat: add separation of tags into groups 2022-09-17 20:54:33 +03:00
angeljqv 6171834fde Create .gitattributes 2022-06-13 16:05:10 -05:00
Steve Moretz 7f729dc9a7 Check namespace + class to see if it exists
main issue : https://github.com/barryvdh/laravel-ide-helper/issues/1273

Adds support for psaml and php-stan specific params and other possible problems.
2021-10-27 00:08:57 +03:30
Barry vd. Heuvel 144140cd39 Merge pull request #5 from GrahamCampbell/patch-2
Drop HHVM and support PHP 7
2020-01-08 14:36:02 +01:00
Graham Campbell be72a2d318 Update .gitignore 2020-01-08 10:29:51 +00:00
Graham Campbell 6d03fa81d9 Delete composer.lock 2020-01-08 10:28:55 +00:00
Graham Campbell 3e7bb6e171 Drop HHVM and support PHP 7 2020-01-08 10:28:32 +00:00
Barry vd. Heuvel 0f32bd0e61 Merge pull request #4 from liquid207/fix-annotation-error-about-typed-array
Fix annotation error about typed array like array<mixed> or array<int…
2020-01-08 10:55:58 +01:00
Shuai Yang b0b90f44f0 Fix annotation error about typed array like array<mixed> or array<int> ... 2020-01-08 15:09:57 +08:00
Barry vd. Heuvel 6b69015d83 Merge pull request #2 from JeppeKnockaert/add-brackets-for-parsing-return-types
feature - Improve method tag parsing
2018-12-13 11:34:14 +01:00
Jeppe Knockaert 053005ed4e feature - Improve method tag parsing
This is an update based on the original repository, I just cherry-picked
some code.

https://github.com/phpDocumentor/ReflectionDocBlock/blob/master/src/DocBlock/Tags/Method.php

This includes:
- https://github.com/phpDocumentor/ReflectionDocBlock/commit/e9454d844db9d8fd2f276a2069647c3c4fb15085
- https://github.com/phpDocumentor/ReflectionDocBlock/commit/e9454d844db9d8fd2f276a2069647c3c4fb15085
2018-12-13 10:13:22 +01:00
Barry vd. Heuvel 64165bd4ba Merge pull request #1 from JeppeKnockaert/allow-deleting-tags-in-docblocks
Allow deleting tags in DocBlocks
2018-10-25 21:09:52 +02:00
Jeppe Knockaert 9b08619fbd Allow deleting tags in DocBlocks 2018-10-23 15:38:27 +02:00
32 changed files with 313 additions and 950 deletions
+10
View File
@@ -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
+43
View File
@@ -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.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@v2
- 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
View File
@@ -1,2 +1,3 @@
.idea .idea
composer.lock
vendor vendor
-32
View File
@@ -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]
+1 -1
View File
@@ -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",
Generated
-864
View File
@@ -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
View File
@@ -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>
+17
View File
@@ -439,6 +439,23 @@ 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;
}
/** /**
* Builds a string representation of this object. * Builds a string representation of this object.
@@ -109,7 +109,7 @@ class Description implements \Reflector
) )
\}/Sux', \}/Sux',
$this->contents, $this->contents,
null, -1,
PREG_SPLIT_DELIM_CAPTURE PREG_SPLIT_DELIM_CAPTURE
); );
@@ -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 . ' */';
+33
View File
@@ -352,6 +352,39 @@ class Tag implements \Reflector
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,15 @@ class MethodTag extends ReturnTag
)? )?
# Return type # Return type
(?: (?:
([\w\|_\\\\]+) (
(?:[\w\|_\\\\]*\$this[\w\|_\\\\]*)
|
(?:
(?:[\w\|_\\\\]+)
# array notation
(?:\[\])*
)*
)
\s+ \s+
)? )?
# Legacy method name (not captured) # Legacy method name (not captured)
@@ -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()
@@ -106,7 +106,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 +114,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 +126,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 === '<') {
$nest_level++;
} else if ($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,6 +185,10 @@ class Collection extends \ArrayObject
return ''; return '';
} }
if (substr($type, 0, 6) === 'array<' && substr($type, -1) === '>') {
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;
} }
@@ -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.
@@ -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
@@ -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
@@ -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)
@@ -145,12 +146,12 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add * @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
* @expectedException InvalidArgumentException *
*
* @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 +198,22 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
'DocBlock[]|int[]', 'DocBlock[]|int[]',
array($namespace.'DocBlock[]', 'int[]') array($namespace.'DocBlock[]', 'int[]')
), ),
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()')
+6 -4
View File
@@ -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(