Questions tagged [phpdoc]
phpDocumentor (phpdoc) is an automatic code-documentation tool for PHP, based on Javadoc.
phpdoc
908
questions
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 ...
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 .\...
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 ...
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:
*
* ``...
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 ...
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(
...
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 ...
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 {}
/**
* @...
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 ...
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
...
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'...
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'] ...
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 ...
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 ...
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 ...