B
B
BonBon Slick2020-10-25 17:55:58
PHP
BonBon Slick, 2020-10-25 17:55:58

Disable type hinting for typed parameters?

/**
     * @var array  - смысла нет, только пред глазами моячит
     */
  private array $test;

  /**
     * @var array  - полезно в старых версиях РнР, все еще полезно при мульти тайп int[]|string[]|Collection<User>
     */
  private  $test;

But when generating documentation, it generates the same for the first variable.

The same with methods, it makes sense to sculpt a type hint in the dock block when it is already in the body of the method.
/**
* @var TestClass $test - смысла нет, только пред глазами моячит
* @return TestClass -  смысла нет, только пред глазами моячит
**/
public function test(TestClass $test) : TestClass

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question