Questions tagged [docblocks]

A DocBlock is a specially formatted PHP comment which allows external document generators to generate documentation of APIs and helps some IDEs to interpret variable types, provide improved code completion, type hinting and debugging.

96 questions
0
votes
0 answers

VS Code Show Where Potential Unhandled Exceptions Could Be Thrown

In VS Code, doc block info can be automatically generated that looks something like this: /** * Some sample function. * @param Request $request * @return JsonResponse * @throws BadRequestException * @throws BindingResolutionException …
Josh
  • 196
  • 2
  • 10
0
votes
0 answers

PHPDocumentor, phpdoc - missing file-level and global variable comments; 'alse' and 'rue'

I am a newbie to phpDocumentor, although I have extensively used JavaDoc in the past. To start, I created the following test file a.php:
Leszek Pachura
  • 159
  • 2
  • 7
0
votes
0 answers

phpDocumentor doesn't find TODO markers in my code?

When I generate API docs with phpDocumentor, the page Reports -> Markers always says No markers have been found in this project, despite I have several TODO markers in my PHP code. I have phpDocumentor v3.0.0. I run it with: php phpDocumentor.phar…
Leszek Pachura
  • 159
  • 2
  • 7
0
votes
0 answers

PhpStorm changing a specific reformat code option

$new_class = new NewClass; /** @var NewClass $new_class */ When I use PhpStorm's code format the above code becomes: $new_class = new NewClass; /** @var NewClass $new_class */ Is there anyway to make it keep these @var comments on the same line…
user12097954
0
votes
0 answers

What version to put in @since docblock?

Let's imagine a module that is version 1.2.3. You are requested to make a fix, so you create a branch of the project, you add your changes which needed a new function / method / variable / whatever, and you are asked to follow the coding standards…
StR
  • 508
  • 5
  • 16
0
votes
2 answers

PHP docblock for json_decode-d objects

I'm getting objects from JSON string in my PHP code. I want my IDE (NetBeans) to know the parameters of the objects without creating special class for them. Can I do it? It would look something like: $obj = json_decode($string); /** * @var $obj {…
Yevgeniy Afanasyev
  • 27,544
  • 16
  • 134
  • 147
0
votes
2 answers

How to maintain DocBlock comments for aliased property?

I'm having an interface from a 3rd party library (A). I'm creating an alias bar for a property foo in my project. This works fine, but I also want my alias to inherit the DocBlock comment of the property. interface A { /** * It's a number …
wintercounter
  • 7,021
  • 5
  • 28
  • 42
0
votes
0 answers

DocBlock how to right documented associative array

I try to find best way for documentation associative array (may be with sub arrays). I found some ways, but all that displaying in PHPStorm help window too bad. I tried: /** * @param array $params { * * @key key_name
Serg
  • 22
  • 6
0
votes
1 answer

Write in a DocBlock programmaticaly Matlab Simulink

I have a Simulink model with a DocBlock inside and i would like to create a script to write inside this DocBlock. I already have this code : A = find_system('MyModel', 'BlockType', 'SubSystem', 'Mask', 'on', 'MaskType', 'DocBlock'); B =…
Lucas
  • 187
  • 10
0
votes
0 answers

What is the correct way to indent multiline example codes in DocBlock in TypeScript file?

I have this code: /** * Title of function * * @param data JSON data * @param rules Your rules * @example * ``` * rules = { * id: ['integer', 'required'], * date_of_birth: ['iso_date', 'required'], * passport:…
netdjw
  • 3,842
  • 11
  • 50
  • 101
0
votes
1 answer

Inherit documentation from interface

I use docblocks for documenting function methods, classes... the usual. I found myself using the adapter pattern, as such, all my adapters implement a common interface and return the same things. The common interface has all the functions documented…
Alex
  • 8,769
  • 7
  • 33
  • 77
0
votes
1 answer

adding phpdoc to new files

im looking for a way to add some docblocks to a new .php file, so i can have it add the description, package name, author , etc to a new file. i have been searching for a couple days and I dont see any results on how to add just to 1 .php file,…
chris mccoy
  • 317
  • 1
  • 4
  • 10
0
votes
0 answers

Best practice on using @package and @since in a forked project

My project uses FoundationPress, a WordPress starter theme. I use Github and update my project from the parent repository with an upstream remote when the community improves the code. For the record, I've programmed a long time but almost always…
digiacom
  • 50
  • 1
  • 6
0
votes
1 answer

Python equivelent to PHPDoc Blocks?

I am new to Python coming from PHP, I know Python has Docstrings, but how can I do this on class variables? Let's say in PHP I have: class Animal { /** * @var Noise */ public $noise } Now how would I implement this is python?…
superdee
  • 457
  • 4
  • 14
0
votes
1 answer

PHP Docbloc: change inherited method to standard link @inheritDoc - best practice?

I have a ton of lines of PHP. Many methods contain docblocks that are actually inherited from the method they override. Example: MyBaseClass { /** * @param string $first - first name * @param string $last - last name */ …