phpdoc

How I can make variables autocomplete in the PhpStorm 9 for Blade templates?

旧时模样 提交于 2019-11-30 13:10:29
I want PHPdoc blocks were considered within the blade template. PhpStorm 9, Laravel 5.1, blade template file: <?php /* @var App\Models\User $user */ ?> ... <?= $user->email ?> <- autocomplete for the word "email" is working ... {{ $user->email }} <- autocomplete not working I tried different variants: {{ /** * @var App\Models\User $user **/ }} {{ /* @var App\Models\User $user */ }} ... {{ $user->email }} <- autocomplete not working... ... In such variant autocomplete works, but only within that block: {{ /* @var App\Models\User $user */ $user->email }} ... {{ $user->email }} <- here does not

Fill @version tag with subversion in Eclipse

倖福魔咒の 提交于 2019-11-30 13:09:58
I would like to fill the comment tag @version with Subclipse or Subversion in Eclipse. CVS has done this automatically but Subversion isn't. This would be very helpful. I tried to google "@version" but it seems impossible. Example what CVS did: <?php /* * @author Spankmaster * @version $Id: file.php,v 1.47 2009-09-21 09:28:49 sp Exp $ * @package mysoftware */ Example with SVN: <?php /* * @author Spankmaster * @version $Id: $ -> stays empty * @package mysoftware */ Please help..... in svn it is $Revision$ /** * Last changed: $LastChangedDate$ * @author $Author$ * @version $Revision$ */ also you

Should I use @return self, this or the current class? [closed]

好久不见. 提交于 2019-11-30 10:44:32
I have a method that return the current object, how do I document this? /** * set something * * @return this */ public function setSomething(){ // ... return $this; } Or should I do @return self or @return Current_Class_Name ? Reason why this question is not "primarily opinion-based" (and should be reopened): conformance to standards and IDE type hinting support. RiaD @return Current_Class_Name will definitely work and is what I prefer. @return self may work ok with some programs too. @return this is bad because this is not a typename. g . There is a PHP Standards Recommendation (PSR)

Syntax of Closure in PHPDoc

烂漫一生 提交于 2019-11-30 08:14:12
I cant find any documentation on the Closure type in PHPDoc. So my question is how do I define the parameter of the parameters sent to the closure and its return value ? Example: How do i describe that the "callback" will get a "MyCustomClass", a Number and a String, and return a "MyOtherCustomClass" ? /** * @param MyCustomClass $cls * @param Closure $callback this isn't really explaining what this is * * @return MyOtherCustomClass */ function changer($cls, $callback){ return $callback($cls, 2, "a string"); } changer($aCustomeClass, function($cls, $int, $string){ return new MyOtherCustomClass(

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

独自空忆成欢 提交于 2019-11-30 08:01:24
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 DocBlock: /** * This is a test DocBlock * * <pre> * <?php * echo('hi'); * ?> * </pre> * * @return object[]

How to document class properties in PHP 5 with phpDocumentor

风格不统一 提交于 2019-11-30 08:00:11
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 (variable?). Thanks! /** * This is what the variable does. The var line contains the type stored in this

What is the correct way to write PHPDocs for constants?

时光毁灭记忆、已成空白 提交于 2019-11-30 07:47:44
I have this code: /** * Days to parse * @var int */ const DAYS_TO_PARSE = 10; ... I don't think that using @var is correct for a constant and I don't see any @constant PHPDoc tag. What is the correct way to do this? To get them into phpDoc, use: @const THING Usual construct: @const[ant] label [description] user2983026 The PHP-FIG suggests using @var for constants. 7.22. @var You may use the @var tag to document the "Type" of the following "Structural Elements": Constants, both class and global scope Properties Variables, both global and local scope Syntax @var ["Type"] [element_name] [

Anything better than PHPDoc out there? [closed]

倖福魔咒の 提交于 2019-11-30 01:43:31
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? I´ll go for doxygen too. Here are several reasons : compatible with phpdoc tags and other popular ones : it´s interoperable works with various programming languages : a better time investment there is alternative syntaxes : can choose the commenting style that suit you very efficient with advanced formating / tagging / metadata there is a GUI that is not linked to any IDE and an eclipse plugin as well And still free, multiplatform, and open

Best way to document Array options in PHPDoc?

时光怂恿深爱的人放手 提交于 2019-11-29 20:16:05
I'm struggling to write readable and easy to understand documentation that describes the multi-tree structure for Array options that are passed to a function. Here is an example array structure. $arr = array( 'fields'=>array( 'title'=>array('name'=>'Document.title','format'=>'string','readonly'=>true) ) ); There are many possible options for the above array, but this is used as a parameter to a function that understands that structure. function doSomething(array $arr) {...} I'd like to document how the array should be structured in PHPDoc, but I'm not sure what the correct approach is. Here is

Syntax of Closure in PHPDoc

我是研究僧i 提交于 2019-11-29 11:19:32
问题 I cant find any documentation on the Closure type in PHPDoc. So my question is how do I define the parameter of the parameters sent to the closure and its return value ? Example: How do i describe that the "callback" will get a "MyCustomClass", a Number and a String, and return a "MyOtherCustomClass" ? /** * @param MyCustomClass $cls * @param Closure $callback this isn't really explaining what this is * * @return MyOtherCustomClass */ function changer($cls, $callback){ return $callback($cls,