ACFComposer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A registerFieldGroup() 0 4 1
1
<?php
2
3
namespace ACFComposer;
4
5
class ACFComposer
6
{
7
    /**
8
     * Registers a local field group in Advanced Custom Fields based on a config array.
9
     *
10
     * Included fields, subfields, etc. can either contain another array defining them, or a string that stands for a WordPress filter. This filter will be applied and its result used as the field, subfield, etc.
11
     *
12
     * @param array $config Configuration array for the local field group.
13
     *
14
     * @return boolean Was the field group added or not.
15
     */
16
    public static function registerFieldGroup($config)
17
    {
18
        $fieldGroup = ResolveConfig::forFieldGroup($config);
19
        return acf_add_local_field_group($fieldGroup);
0 ignored issues
show
Bug introduced by
The function acf_add_local_field_group was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

19
        return /** @scrutinizer ignore-call */ acf_add_local_field_group($fieldGroup);
Loading history...
20
    }
21
}
22