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

FlexibleContentLayout::transform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 6
nc 1
nop 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