Completed
Push — master ( 77b50b...7ba73a )
by Steve
46s
created

FlexibleContentLayout   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 10 1
1
<?php
2
3
namespace StoutLogic\AcfBuilder\Transform;
4
5
/**
6
 * Change the keys of a Builder to be consistent with an
7
 * ACF Flexible Content Layout:
8
 *     fields => sub_fields
9
 *     title => label
10
 */
11
class FlexibleContentLayout extends Transform
12
{
13
    public function transform($config)
14
    {
15
        $config['sub_fields'] = $config['fields'];
16
        unset($config['fields']);
17
18
        $config['label'] = $config['title'];
19
        unset($config['title']);
20
21
        return $config;
22
    }
23
}
24