Skip to main content

Questions tagged [phpdoc]

phpDocumentor (phpdoc) is an automatic code-documentation tool for PHP, based on Javadoc.

0 votes
0 answers
21 views

How to typehint an intermediate value in chained code using PHPDoc

I have the following code: $id = $ui->getWidget('import_id')->value; I know the class type of $ui. The getWidget() method can return one or more types of widget classes based on the parameter ...
Colin's user avatar
  • 2,189
0 votes
1 answer
19 views

PhpDocumentor Guide links missing

I am trying to create a link from one page in the documentation to another in a .rst file: Link to another page :doc:`Another Page` However when I run PHPDocumentor php phpDocumentor.phar -c .\...
vogomatix's user avatar
  • 4,958
0 votes
0 answers
17 views

How to generate a "front" or "introduction" page for PHPDocumentor

The default front page for a project documented using PHPDocumentor seems to be just labelled "Documentation". I'd like to put some sort of project overview page either as the front page or ...
vogomatix's user avatar
  • 4,958
1 vote
0 answers
32 views

PHP doc doesn't respect indentation in code example in VSCode

I've added roughly the following PHPDoc to document a class, using markdown style backticks to add an example of the classes usage /** * This is some documentation for a class * * usage: * * ``...
Patrick Benjamin's user avatar
0 votes
0 answers
38 views

Keeping PHPDoc comments in blade templates up to date with Laravel Controllers

My project has a number of Controllers with $data arrays that are then passed to \Illuminate\Contracts\Routing\ResponseFactory::view::getResponse. Other developers on my team will often add new keys ...
Tyler V.'s user avatar
  • 2,531
0 votes
0 answers
56 views

IDE phpdoc type hints for properties with attributes

I'm working with PHP and I've encountered a challenge with IDE support for typed arrays. Here's a snippet of my code: <?php class User extends BaseData { public function __construct( ...
underwear's user avatar
0 votes
0 answers
19 views

How to ignore/exclude dot files, dot folder in phpDocumentor 3?

I have folders and files like this. index.php System aa.php .backup anything-in-dot-backup.php .ignoreme.php I would like to ignore/exclude those dot folders and dot files in phpDocumentor 3 but ...
vee's user avatar
  • 4,677
1 vote
1 answer
84 views

PHPDOC Abstract class does not insert extended class type <T> into methods returns

I've got following code: <?php /** * @template T */ abstract class A { /** * @return T */ public function read() { // return statement } } class C {} /** * @...
M-Zoldak's user avatar
  • 131
0 votes
0 answers
37 views

How can PHPDoc comments be used with contracovariance return types?

I have a table that stores encrypted json values for some sensitive data. The issue is that the json properties may alter slightly based on the type of record. To overcome this, I created data ...
Jaquarh's user avatar
  • 6,613
0 votes
0 answers
274 views

Access to an undefined property trait larastan

I´m trying to solve errors in my proyect with larastan. One error that this library, returned it´s: Access to an undefined property App\Cargador\Prevalidaciones\PrevalidarCodificacionUTF8::$tarea ...
scorpions77's user avatar
2 votes
1 answer
89 views

PHP - PHPDoc typehint when trying to iterate over integer

I have this code /** @var array{total: integer, records: array} $response */ $response = $this->getResponse(); foreach($response['total'] as $value) { $this->saveRecord($value); } Shouldn'...
ononononon's user avatar
  • 1,063
1 vote
0 answers
49 views

Is it possible define param type from class variable with phpdoc in PHP

now I have this: class UserProvider { protected string $className = User::class; /** * @param User $entity */ public function getData($entity): array { $data['name'] ...
fico7489's user avatar
  • 8,389
0 votes
0 answers
147 views

PhpDoc: <static> in trait methods refers to trait instance

I'm having an issue in type-checking some methods of a trait. I'm using a sort of facade-pattern and my aim would be to inject some methods of a facade in other classes through a trait that has ...
Andrea's user avatar
  • 1
0 votes
0 answers
878 views

phpstan array shape definition using a class constant

Is there a way to use class constants to define array shapes in phpstan? The purpose is to enable the definition to be used by PHP code, otherwise we have to repeat the definition (once for phpstan ...
caponica's user avatar
  • 3,878
1 vote
1 answer
649 views

How to document a Laravel model attribute as deprecated?

I have an eloquent model in Laravel that I would like to mark an user_id attribute as deprecated using the @deprectated tag in PHPDoc. I can add the @property tag to my model to document user_id but ...
Jamie Woods's user avatar

15 30 50 per page
1
2 3 4 5
61