Component   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A onBuild() 0 2 1
A onCreate() 0 2 1
1
<?php
2
3
namespace Lagdo\UiBuilder\Component\Base;
4
5
use Lagdo\UiBuilder\Component\Base\HtmlComponent;
6
7
/**
8
 * The common base class for all components, virtual or real.
9
 */
10
abstract class Component
11
{
12
    /**
13
     * Callback on component creation.
14
     *
15
     * @return void
16
     */
17
    protected function onCreate(): void
18
    {}
19
20
    /**
21
     * Callback on component parent-child relation.
22
     *
23
     * @param HtmlComponent $parent
24
     *
25
     * @return void
26
     */
27
    protected function onBuild(HtmlComponent $parent): void
0 ignored issues
show
Unused Code introduced by
The parameter $parent is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

27
    protected function onBuild(/** @scrutinizer ignore-unused */ HtmlComponent $parent): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {}
29
}
30