Passed
Push — dev ( 72f23d...60923c )
by Paweł
02:14 queued 14s
created

AbstractComponent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
c 1
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createAndShow() 0 6 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
}