Issues (76)

inc/options.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Flynt;
4
5
use Flynt\Utils\Options;
6
7
add_filter(
8
    'Flynt/addComponentData',
9
    'Flynt\\addOptionsToComponent',
10
    9,
11
    2
12
);
13
14
function addOptionsToComponent($data, $componentName)
15
{
16
    // get fields for this component
17
    $options = array_reduce(array_keys(Options::OPTION_TYPES), function ($carry, $optionType) use ($componentName) {
18
        return array_merge($carry, Options::get($optionType, $componentName));
0 ignored issues
show
It seems like Flynt\Utils\Options::get...onType, $componentName) can also be of type false; however, parameter $arrays of array_merge() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

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

18
        return array_merge($carry, /** @scrutinizer ignore-type */ Options::get($optionType, $componentName));
Loading history...
19
    }, []);
20
    // don't overwrite existing data
21
    return array_merge($options, $data);
22
}
23