Hi,
I found this issue related to the class-string implementation:
<?php
namespace Devsense\Common;
abstract class AbstractTest
{
public static function factory(): static
{
return new static();
}
public function test(): void
{
}
}
final class TestA extends AbstractTest
{
}
final class TestB extends AbstractTest
{
}
/**
* @var class-string<AbstractTest> $class
*/
$class = 'TestB';
/**
* No definition found for factory
*/
$object = $class::factory();
$object->test();
The factory method is unknown for the call $object = $class::factory(); but the test call seems ok.
Thank you for the fix.
Regards,