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

Acf   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
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