for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace pjpawel\Magis\Helper;
abstract class AbstractComponent implements ComponentInterface
{
abstract public function show(): string;
/**
* @param mixed ...$args
* @return string
* @throws \ReflectionException
*/
public static function createAndShow(mixed ...$args): string
/** @var array<int,mixed> $args */
$component = new \ReflectionClass(static::class);
$componentObject = $component->newInstanceArgs($args);
/** @var static $componentObject */
return $componentObject->show();
}