Completed
Push — master ( 43b774...ec4329 )
by Beñat
06:42 queued 03:18
created

Acf::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the WPFoundation library.
5
 *
6
 * Copyright (c) 2015-2016 LIN3S <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace LIN3S\WPFoundation\Configuration\Acf;
13
14
/**
15
 * Abstract class of ACF class that implements the interface.
16
 * This class avoids the use of callbacks in the constructor.
17
 *
18
 * @author Beñat Espiña <[email protected]>
19
 * @author Jon Torrado <[email protected]>
20
 */
21
abstract class Acf implements AcfInterface
22
{
23
    /**
24
     * Constructor.
25
     */
26
    public function __construct()
27
    {
28
        $customToolbars = $this->wyswygToolbars();
29
        add_filter('acf/fields/wysiwyg/toolbars', function (array $toolbars) use ($customToolbars) {
0 ignored issues
show
Unused Code introduced by
The call to the function add_filter() seems unnecessary as the function has no side-effects.
Loading history...
30
            return array_merge($toolbars, $customToolbars);
31
        });
32
    }
33
}
34