phpdoc

How to document class properties in PHP 5 with phpDocumentor

≯℡__Kan透↙ 提交于 2019-11-29 10:53:04
问题 Take in consideration the following PHP 5 class: class SomeClass { //I want to document this property... private $foo; function __construct() { } public function SetFoo($value) { $this->foo = $value; } public function GetFoo() { return $this->foo; } } How in phpDocumentor will I document the $foo property? I'm not even sure it need to be documented but I would like to know how if if needs to... I know how to document SetFoo() and GetFoo(), I'm just not sure about the private property

How do I put blocks of PHP code into a PHPDoc DocBlock

此生再无相见时 提交于 2019-11-29 10:49:06
问题 I'm playing around with PHPDoc and have realised that you can use markdown to add some formatting to a DocBlock. In particular, I notice that you can use back ticks to highlight inline code. However, I can't seem to figure out how to add blocks of code to a DocBlock, as using 4 spaces doesn't seem to work. I've tried using <code> and <pre> too, and whilst those tags do appear in the generated documentation, the code inside them becomes commented out with HTML comments. For example, this

How to do multi-line comments in NetBeans without auto DocBlock formatting?

穿精又带淫゛_ 提交于 2019-11-29 07:16:55
Sometimes in my code I like to comment out a block of code for temporary use/reference etc eg: /* blah */ But it's a minor annoyance that if I then want to go and insert a line inside that block, when I click enter, it will automatically put a * on the next line as though I were doing a DocBlock. This happens on every enter key: /* blah<enter pressed here> * */ Now I would have thought this 'auto-formatting' should only take place if the opening comment is using the format /** (two stars). Multi line comments were around a long time before DocBlocks, so I'm not sure why it forces these "old

Is there a way for phpDoc to document an array of objects as a parameter?

烂漫一生 提交于 2019-11-29 05:32:12
In phpDoc-generated documentation I can cause phpDoc to generate a link to a custom type definition for a given param using @param CustomType $variablename and that works great. However, the code I'm currently documenting requires CustomType[] parameters, i.e. an array of said CustomType. I want the documentation to be clear that an array is required, but when I use @param CustomType[] $variablename phpDoc no longer recognizes the type, and thus can't link to it's definition. This is pretty important in this case - I'm documenting an API that has some fairly complex types that need to be

Anything better than PHPDoc out there? [closed]

末鹿安然 提交于 2019-11-28 22:29:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Does anybody use anything else to document their PHP code than PHPDoc? Are there any tools that read the same documentation syntax but give richer output? 回答1: I´ll go for doxygen too. Here are several reasons : compatible with phpdoc tags and other popular ones : it´s interoperable works with various

php.ini - command line PHP and WAMP server access different files

流过昼夜 提交于 2019-11-28 11:51:26
I don't know if this is default behavior or not, but it seems weird to me. I installed WAMP server v2.2e from scratch, with PHP 5.4.3, on a windows 7 machine. I get these minor bugs that i don't really care about (when I activate an extension I sometimes need to exit WAMP and start it again to see the changes), but that's not why I'm here. When I click on the WAMP icon -> PHP -> php.ini, the file I open is the one in the apache directory ( <WAMP dir>\apache\apache2.4.2\bin\php.ini ) The output from the windows cmd command php -i | find /i "Configuration File" outputs <WAMP dir>bin\php\php5.4.3

PHPDocumentor 2 and PHP 7 with opcache issues in Doctrine

試著忘記壹切 提交于 2019-11-28 10:55:03
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 How do I fix this error? Details Opcache is enabled and opcache.load_comments=1 is in my opcache.ini file

Is there a standard for documenting GET/POST parameters?

亡梦爱人 提交于 2019-11-28 10:50:44
In a PHP project, even when front controller logic is used for the main application, there can be many stand-alone scripts, ajax snippets and so on. Is there a standardized way - either PHPDoc or something else - to define in the first comment block of the script what GET and/or POST parameters the script will accept / require and of which type they are? I usually help myself by just adding @param s as if the file were a function, and a @return explanation for what the script does and returns, but maybe there is a more specialized way I do not know of. phpDocumentor won't like @param and

phpDoc class constants documentation

喜欢而已 提交于 2019-11-28 10:43:51
How do I document class constants for phpDoc? I've read the manual but I can't find anything about them. 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 cannot see it explicitly specified anywhere. ashnazg Constants only need a docblock that contains the

Is there a way to indicate that a class has magic methods defined for every method on another class?

心已入冬 提交于 2019-11-28 09:06:44
问题 Is there a way to document that a certain class has magic methods for every method defined in another class? I am using PhpStorm, so I would be happy with any solution that will get autocomplete to work properly for that. class A { // a bunch of functions go here... } /** * Class B * What should go here to make it work??? */ class B { private $aInstance; public function __construct() { $this->aInstance = new A(); } public function __call($name, $arguments) { // TODO: Implement __call() method