Commit Graph
231 Commits
Author SHA1 Message Date
Remi Collet e8384e45fa don't rely on 'args' in trace, not available in 7.4 2020-02-12 13:46:34 +01:00
Mike van Riel 50e77ace68 Change unit testing to match phpDocumentor itself 2020-02-12 08:18:08 +01:00
Andreas Prucha - Abexto 1070e666aa Make getter for bodyTemplate public in order to make conversion of existig Description to custom Description class easier (e.g. new MyDescriptionClass($origionalDescription->getBodyTemplate(), $origionalDescription->getTags();) 2020-02-12 07:52:22 +01:00
Daniel Rotter 51b773933d Make regex for method more performant to avoid catastrophic backtracking 2020-02-12 07:28:49 +01:00
Pol Dellaiera 91307e3009 Fix previous erroneous assignment. 2020-02-10 21:04:24 +01:00
Pol Dellaiera 1c6203a9f7 PHP 7.4 fix - Create a temporary variable to prevent Fatal error. 2020-02-10 13:22:22 +01:00
Pol Dellaiera adcffd685b PHP 7.4 fix - Check if 'args' key exists, if not, use an empty array. 2020-02-10 11:52:42 +01:00
Pol Dellaiera e6166a8b40 PHP 7.4 fix - Ensure the existence of the 'args' key. 2020-02-10 11:19:17 +01:00
Jaapio 1e5bd86da1 Fix invalid void type default for arguments 2020-02-09 09:31:53 +01:00
Jaapio 264bd1fff7 Handle tag specialization correctly 2020-02-09 09:05:22 +01:00
Jaapio ed7b7919e3 Limit characters after tag name
Previously we allowed all characters after a tag name which made
it a bit fuzzy how tags are handled. Psr-5 is more strict about
the characters that are allowed in tags and those that are part of
the body. A tag name can now be followed by `(`, <space> and `{` all
other characters are forbidden. The first character of the body is
not restricted anymore.

fixes #165
2020-02-09 08:52:29 +01:00
Jaapio 93919e334b Fix code style 2020-01-27 21:01:09 +01:00
Jaapio 31fd6db84f Return invalid tag when factory returned null 2020-01-25 15:52:34 +01:00
Jaapio cf16f630f2 Fix code style 2020-01-16 09:49:07 +01:00
Jaapio ce65c06bb6 Fix serialization issue of InvalidTag 2020-01-16 09:38:58 +01:00
Jaapio bb629f6469 Improvements to code 2020-01-12 13:19:45 +01:00
Jaapio bdecc2d3bf Fix issue when processing invalid tags
When invalid tags are processed a null was returned causing all kind
of issues in the normal behavior of this libary. As a solution a generic tag
could be created. But that would just drop the error information in.
Therefore a new tag was introduced, `invalidTag` the tag is just like the
generic tag but does contain the error triggered during the creation of the
tag. Which might help applications like phpdocumentor to display validation issues.
2020-01-03 13:33:06 +01:00
Mike van Riel c5a39003d5 Fixes #181: Example did not implement interface 2019-12-27 21:42:04 +01:00
Mike van Riel b668892da4 Fix tests and linting errors after merging in release 4.x 2019-12-27 21:38:28 +01:00
Mike van Riel 1a5d9a2dbc Add braces support to Property, Property-Read, Property-Write and Var 2019-12-27 21:07:05 +01:00
Mike van Riel bb19583948 Support braces in types for @param 2019-12-27 21:02:14 +01:00
Mike van Riel 506fd89d43 Move type extraction to base class and re-use in Throws 2019-12-27 20:59:58 +01:00
Mike van Riel 19dd184a2b Support braces in types for @return
In this change, I have introduced a miniature automaton-light to parse
the type from the @return body. This will prevent issues with people
using generics and other unsupported forms of types.

This change does _not_ allow for the use of Generics or similar; the
TypeResolver will still fail to resolve this type. This will remove a
breaking issue in consuming applications where a runtime exception used
to be thrown.

Please note that this change is only for @return; other tags still need
to be done. This will resolve issue #186
2019-12-27 20:18:32 +01:00
Corey Taylor 97b796040a Fixed @method annotations with an empty argument list and description 2019-12-19 08:41:51 -06:00
Jaapio c14c01875a Make static anlisys pass 2019-12-10 23:46:06 +01:00
Jaapio 50ec1362de Psalm fixes 2019-09-26 21:09:37 +02:00
Jaapio 19a1f3a91f Phpstan to max level 2019-09-20 16:52:17 +02:00
Jaapio aee984014b Apply new code style 2019-09-20 10:54:12 +02:00
Mike van Riel 8fcadfe5f8 No longer bubble tag exceptions to the top
When a tag has an invalid component to it it would cause a whole file to fail
to parse. Instead we should consider invalid tags a nuisance but not worth
breaking the whole parsing over.

In this change I have added a try..catch that will prevent invalid tags from
breaking the whole parsing process.
2019-06-15 22:45:01 +02:00
Michael Knappe 095cf6d37a fixed generic tag to parse description with 0 as expected 2019-04-30 13:21:57 +02:00
Chuck Burgess a29cd5c528 initialize line count to an int; 2018-06-20 09:34:23 -05:00
Chuck Burgess cc0998e471 add self return type; 2018-01-31 08:58:25 -06:00
Chuck Burgess ff287a453f remove unused imports; 2018-01-31 08:58:03 -06:00
Chuck Burgess 5ea3cbf8cf add missing typehints and return types; 2018-01-31 08:57:30 -06:00
Chuck Burgess fb948e8a52 regex fix for ellipsis in summary text; 2018-01-07 08:51:10 -06:00
TomasVotruba 1c8f795c0e apply coding standard to code 2018-01-02 13:40:57 +01:00
Gabriel Caruso a1e6160b99 Welcome 2018 🎉 2018-01-02 04:52:36 -02:00
Tomáš Votruba bab88701ea Add PHPStan and bump to max level (#139)
* composer: put require- together

* add phpstan

* add phpstan to travis

* phpstan fixes

* phpstan fixes

* phpstan fixes

* drop null defaults since every property is null by default

* DescriptionFactory: fix parse nullable type

* travis: add phpstan max

* travis: fix phpstan config
2017-12-02 19:12:29 +01:00
TomasVotruba c19b4d170c [cs] remove value-less docblocks 2017-11-30 10:27:01 +01:00
TomasVotruba c664d2866d fix cs 2017-11-30 10:27:01 +01:00
TomasVotruba f8d4fda4f3 fix cs 2017-11-30 10:27:01 +01:00
TomasVotruba 51122cfa1d improve comment 2017-11-30 10:27:01 +01:00
TomasVotruba 082c811880 remove unused docblocks 2017-11-30 10:27:01 +01:00
TomasVotruba 4a9675841b add PHP 7.1 typehints 2017-11-30 10:27:01 +01:00
TomasVotruba 0bac84ee68 remove unused docblocks 2017-11-30 10:27:01 +01:00
TomasVotruba 154c85b680 remove unused namespaces 2017-11-30 10:27:01 +01:00
TomasVotruba b2e816c8ad fix tests 2017-11-30 10:27:01 +01:00
TomasVotruba 5e1bad3628 drop asserts where not needed 2017-11-30 10:27:01 +01:00
TomasVotruba 193731a153 remove tests and validation that are now covered by typehints 2017-11-30 10:27:01 +01:00
TomasVotruba d874c4d14a add strict_types and typehints 2017-11-30 10:27:01 +01:00