<?php
interface A {
}
interface ITest {
/**
* Desc
* @template T of A
* @param class-string<T>|class-string[]|0|1|'other' $class
* @return void
*/
public function test(string|array $class);
}
class Test implements ITest {
/**
* Desc
* @template T
*
* @param class-string<T>|class-string[]|int|string $class
* @return void
*/
public function test(array|string $class) {
// The comments of ITest::test() and Test::test() are different.
}
}
Instead of trying to create docblocks similar to interface class, I thought we could use something like @inheritDoc:
<?php
interface A {
}
interface ITest {
/**
* Desc
* @template T of A
* @param class-string<T>|class-string[]|0|1|'other' $class
* @return void
*/
public function test(string|array $class);
}
class Test implements ITest {
/**
* @inheritDoc
*/
public function test(array|string $class) {
// Having problems because the parameter does not use the type provided by docblock, but uses the native type hint
}
}
Instead of trying to create docblocks similar to interface class, I thought we could use something like
@inheritDoc
: