912 questions
0
votes
0
answers
44
views
How can I prevent Eclipse PHP "MyClass cannot be resolved to a type" error?
I have a bunch of common reusable classes stored in a "repo" folder hierarchy.
Each class has its own file, each file has a namespace coherent with its place in the folder hierarchy.
I ...
2
votes
2
answers
138
views
What's the purpose of using a @method phpdoc annotation for an interface instead of a method signature
I'm looking at the code of Laravel Fortify. In the service provider, you can register Action classes to perform specific jobs like this:
Fortify::createUsersUsing(CreateNewUser::class);
Fortify::...
0
votes
0
answers
16
views
Permission denied", while attempting to create directory ".phpdoc/cache" [duplicate]
I have a compose.yml and Dockerfile in the same directory. compose.yml contains:
services:
documentation:
build:
context: .
args:
GID: 1000
GROUP: my-name
...
1
vote
1
answer
102
views
How to describe anonymous classes and methods?
I need to run tests on a certain class, but adding a method that was not originally present.
Previously this need could be satisfied using MockBuilder::addMethods(), but this method has been ...
0
votes
1
answer
73
views
How to type hint a property on $this in php?
Assume that in a template.phtml, there is a property someInstance of the class SomeClass defined on $this.
So in the file, one has access to:
$this->someInstance
yet the developer has no immediate ...
1
vote
1
answer
142
views
Expanding the PHPDoc of a PHP class what found in a Composer package
There is a Illuminate\Database\Schema\ColumnDefinition class in the laravel/framework package. How can I extend its PHPDoc @method annotations externally? This is a special class by Fluent, for ...
0
votes
0
answers
78
views
PhpStorm can't find object declaration to go to, has no suggestions for properties
This is old PHP 5 code and is probably coded wrong (it doesn't use typical autoloading), but I'm flummoxed as to how to get the editor to know which class an object in a call is using, like this:
$...
0
votes
0
answers
67
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
42
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 .\phpdoc....
3
votes
0
answers
92
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
74
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
121
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(
...
1
vote
1
answer
257
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
43
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
661
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
...