Passed
Branch develop (b26cb2)
by Steve
03:37
created

Transform   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getBuilder() 0 4 1
transform() 0 1 ?
1
<?php
2
3
namespace StoutLogic\AcfBuilder\Transform;
4
5
use StoutLogic\AcfBuilder\Builder;
6
7
abstract class Transform
8
{
9
    protected $bulider;
10
11
    public function __construct(Builder $builder)
12
    {
13
        $this->builder = $builder;
0 ignored issues
show
Bug introduced by
The property builder does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
14
    }
15
16
    public function getBuilder()
17
    {
18
        return $this->builder;
19
    }
20
21
    /**
22
     * Impelment in all discrete classes
23
     * @param  array $config input
24
     * @return array output config
25
     */
26
    abstract public function transform($config);
27
}
28