M
M
mitaichik2016-10-27 16:20:17
PHP
mitaichik, 2016-10-27 16:20:17

How to make docblock for someone else's library?

We use someone else's library (via composer). For its objects, all access to the fields goes through __get, while the classes do not have any doc blocks, respectively, code hints do not work, code inspections scream that such fields do not exist (we use PhpStorm).
I want to add @property myself, but I can't change their code. I tried to make the same classes with the same namespace and register them there - but then the inspectors complain that there are 2 identical classes.
Is there any way out of this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2016-10-27
@Sanasol

I tried to make the same classes with the same namespace and write there

extends

D
dmitriy, 2016-10-27
@dmitriylanets

create your own class that will be inherited from that library, write in it:

/**
 * Base class that represents a query for the 'tasks' table.
 *
 * @method     ChildTaskQuery groupById() Group by the id column
 * @method     ChildTaskQuery groupByCreatedAt() Group by the created_at column
 * @method     ChildTaskQuery groupByUpdatedAt() Group by the updated_at column
 *
 * @method     ChildTaskQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method     ChildTaskQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method     ChildTaskQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 */
class MyClass extends \Core\Class
{

Methods after that should be picked up when working with this class

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question