Completed
Push — master ( 9de5ff...fc4463 )
by Beñat
03:57
created

FieldComponent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the WPFoundation library.
5
 *
6
 * Copyright (c) 2015 LIN3S <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace LIN3S\WPFoundation\PostTypes\Fields\Components;
13
14
/**
15
 * Abstract class of base custom fields components.
16
 * This class enforces that all the field components need to
17
 * construct by register method.
18
 *
19
 * @author Beñat Espiña <[email protected]>
20
 */
21
abstract class FieldComponent
22
{
23
    /**
24
     * Static naming constructor.
25
     *
26
     * @param string $aName      The name
27
     * @param mixed  $aConnector The connector
28
     */
29
    public static function register($aName, $aConnector)
30
    {
31
        new static($aName, $aConnector);
0 ignored issues
show
Unused Code introduced by
The call to FieldComponent::__construct() has too many arguments starting with $aName.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
32
    }
33
34
    /**
35
     * Constructor.
36
     */
37
    protected function __construct()
38
    {
39
    }
40
}
41