Test Failed
Pull Request — dev (#1)
by Paweł
02:00
created

AbstractComponent::createAndShow()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace pjpawel\Magis\Helper;
4
5
abstract class AbstractComponent implements ComponentInterface
6
{
7
8
    abstract public function show(): string;
9
10
    public static function createAndShow(...$args): string
11
    {
12
        //$args = func_get_args();
13
        $component = new \ReflectionClass(static::class);
14
        $componentObject = $component->newInstanceArgs($args);
15
        return $component->getMethod('show')->invoke($componentObject);
16
    }
17
}