phpdoc

PHPDocumentor 2 and PHP 7 with opcache issues in Doctrine

痴心易碎 提交于 2019-11-27 03:53:27
问题 Hopefully someone here knows a thing or 2 about this. Short Question I am running into an error using phpdoc on the command line, installed via pear on PHP 7.0.2. The error is: #> phpdoc PHP Fatal error: Uncaught Doctrine\Common\Annotations\AnnotationException: You have to enable opcache.load_comments=1 or zend_optimizerplus.load_comments=1. in /usr/local/php5-7.0.2-20160108-102134/lib/php/phpDocumentor/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:193

phpDoc class constants documentation

给你一囗甜甜゛ 提交于 2019-11-27 03:05:36
问题 How do I document class constants for phpDoc? I've read the manual but I can't find anything about them. 回答1: I'm fairly sure that you can use @const , though I can't find any English documentation. There's a German example here. It shows define statements rather than class constants, but IIRC the syntax is the same. Nine years later, an edit... It is clear now that the above is bad advice as @const has not appeared in the docs and it seems it will not. Using @var seems to work, though I

Variable type hinting in Netbeans (PHP)

与世无争的帅哥 提交于 2019-11-27 02:47:59
Just curious if there's a way in netbeans to give type hints for regular variables, so that intellisense picks it up. I know you can do it for class properties, function parameters, return types, etc. but I can't figure out how to do it for regular variables. It's something that would really help in situations where you have a method that can return different object types (like a service locator). ex something like: /** * @var Some_Service $someService */ $someService = ServiceLocator::locate('someService'); Where using $someService afterward, netbeans would provide all available methods

PHPDoc: @return void necessary?

耗尽温柔 提交于 2019-11-27 00:14:39
问题 Is it really necessary do something like this: /** * ... * * @return void */ I have quite a few methods that don't have a return value, and it seems really redundant to put something like this in the comment. Would it be considered bad form to leave it out? 回答1: If it makes it clear for the documentation, then leave it in, but it isn't strictly necessary. It's an entirely subjective decision. Personally, I would leave it out. EDIT I stand corrected. After a little googling, the wikipedia page

A tool to add and complete PHP source code documentation [closed]

大城市里の小女人 提交于 2019-11-26 15:19:48
问题 I have several finished, older PHP projects with a lot of includes that I would like to document in javadoc/phpDocumentor style. While working through each file manually and being forced to do a code review alongside the documenting would be the best thing, I am, simply out of time constraints, interested in tools to help me automate the task as much as possible. The tool I am thinking about would ideally have the following features: Parse a PHP project tree and tell me where there are

PHPDoc type hinting for array of objects?

拥有回忆 提交于 2019-11-26 03:25:57
问题 So, in PHPDoc one can specify @var above the member variable declaration to hint at its type. Then an IDE, for ex. PHPEd, will know what type of object it\'s working with and will be able to provide a code insight for that variable. <?php class Test { /** @var SomeObj */ private $someObjInstance; } ?> This works great until I need to do the same to an array of objects to be able to get a proper hint when I iterate through those objects later on. So, is there a way to declare a PHPDoc tag to