phpdoc

Aptana won't generate phpdoc blocks for functions within classes

别说谁变了你拦得住时间么 提交于 2019-12-01 23:02:34
In Aptana, I have somehow broken the functionality to auto-generate phpdoc comments for functions within classes. It appears to only affect my current project. Normally I can type /** on the line before a function and press enter, and Aptana will create a phpdoc comment with the correct @param values, etc. For some reason when I do this now Aptana creates 2 comments, one within the other. e.g. /** * /** * */ */ public static function getByLogin($loginID, $ip, $userAgent) { } It works normally if I try this for global functions. It also works for class variables and classes themselves. I fixed

phpdoc: What's the proper way to document a constant

Deadly 提交于 2019-12-01 18:19:35
Is there a proper way to document a constant defined using define() ? @var doesn't really make sense. The only thing I can think of is to omit the tag, and just write the description in the PHPdoc comment. phpDocumentor does not recognize or utilize a @const tag. phpDocumentor recognizes a constant when it sees the "define" keyword in the code. Its output templates will show all constants in the output documentation, listed as constants. The only thing needed in the constant's docblock is a description, although many other "standard" tags are allowed if you feel like you need them [1]. [1] --

How to get intellisense for PHP associative array index? [duplicate]

半城伤御伤魂 提交于 2019-12-01 18:18:07
Possible Duplicate: PHPDoc for variable-length arrays of arguments Whenever I type $_SERVER[''] and hit Ctrl + Space it gives me the list of possible indexes. How can I make it possible to array's I've created? The code completion for $_SERVER gives you hints on the typical values people get out of that associative array. It is hard-coded somewhere in the NetBeans source code. For an arbitrary array, NetBeans has no idea of the keys that are used in any array, and thus does not provide hints there. It is even possible to proof that it is impossible to reliably implement such a feature, so I

phpdoc: What's the proper way to document a constant

时光怂恿深爱的人放手 提交于 2019-12-01 17:54:28
问题 Is there a proper way to document a constant defined using define() ? @var doesn't really make sense. The only thing I can think of is to omit the tag, and just write the description in the PHPdoc comment. 回答1: phpDocumentor does not recognize or utilize a @const tag. phpDocumentor recognizes a constant when it sees the "define" keyword in the code. Its output templates will show all constants in the output documentation, listed as constants. The only thing needed in the constant's docblock

How can I specify array of objects in PhpDoc [duplicate]

妖精的绣舞 提交于 2019-12-01 17:33:54
Possible Duplicate: PHPDoc type hinting for array of objects? I use PhpDocumentor2 for generating documentation. I searched for this subject but I can't find specific rule for it. For Example I have class which name is AddressField and I want to specify my $addressFields as array of AddressField objects. /** * @var AddressField[] */ private $addressFields; phpdoc themselves describe the use of arrays here : 1.4.4. Arrays undefined: @return array single type: @return int[] multi type: @return (int|string)[] The same should apply to variable definitions: /* @var $arr Type[] */ 来源: https:/

How to get intellisense for PHP associative array index? [duplicate]

只愿长相守 提交于 2019-12-01 17:20:02
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: PHPDoc for variable-length arrays of arguments Whenever I type $_SERVER[''] and hit Ctrl + Space it gives me the list of possible indexes. How can I make it possible to array's I've created? 回答1: The code completion for $_SERVER gives you hints on the typical values people get out of that associative array. It is hard-coded somewhere in the NetBeans source code. For an arbitrary array, NetBeans has no idea of

How can I specify array of objects in PhpDoc [duplicate]

假如想象 提交于 2019-12-01 17:07:11
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: PHPDoc type hinting for array of objects? I use PhpDocumentor2 for generating documentation. I searched for this subject but I can't find specific rule for it. For Example I have class which name is AddressField and I want to specify my $addressFields as array of AddressField objects. /** * @var AddressField[] */ private $addressFields; 回答1: phpdoc themselves describe the use of arrays here : 1.4.4. Arrays

Unable to exclude directories from PHPDocumentor

佐手、 提交于 2019-12-01 05:56:06
I'm trying to run PHPDocumentor on my WAMPServer setup. It runs fine, but I'd like to exclude certain directories, such as \sqlbuddy\ which don't contain my own code. Ironically, PHPDocumentor appears to be ignoring my --ignore switch. I've tried several ways of expressing the same thing, but with the same result. Below is the command I'm running it with: php.exe "C:\Users\username\Documents\PhpDocumentor\phpdoc" -t "C:\Program Files\wamp\www\docs" -o HTML:default:default -d "C:\Program Files\wamp\www" --ignore sqlbuddy\ --ignore docs\ Many thanks. Which version of phpDocumentor are you using?

Proper Way to Document Class in Netbeans PHP

泄露秘密 提交于 2019-12-01 05:29:49
For reasons of ease of maintenance AND IDE class auto-completion and member hinting, I've used PHPDoc in my project. Given this example class: class my_class { public $id; public $name; public $number; public function __construct() { //Do something } public function Rename($name) { $this->name = $name; } } I would prefer to document all properties ( $id , $name and $number ) with the class documentation itself, which is above the class declaration, and then place documentation for methods (if necessary) above each method. Here is what I ultimately want my class to look like: /** * Represents

PHP: Variable function name (function pointer) called ; How to tell IDE my function is called?

那年仲夏 提交于 2019-11-30 14:37:18
问题 I'm currently trying to remove all errors and warnings I have in my project the Inspection tool from my PHPStorm give to me. I encounter a snippet PHPStorm says "Unused private method _xxx" while it's actually used, but in a dynamical way. Here is a simplifyed snippet: <?php class A { private function _iAmUsed() { //Do Stuff... } public function run($whoAreYou) { $methodName = '_iAm' . $whoAreYou; if (method_exists($this, $methodName)) { $this->$methodName(); } } } $a = new A(); $a->run('Used