Completed
Push — master ( 261499...3196a9 )
by Beñat
07:26
created

Theme   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A acf() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the WPFoundation library.
5
 *
6
 * Copyright (c) 2015 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\Theme;
13
14
use LIN3S\WPFoundation\Configuration\Acf\Wysiwyg;
15
16
/**
17
 * Abstract class of theme that implements the interface.
18
 * This class avoids the use of callbacks in the constructor.
19
 *
20
 * @author Beñat Espiña <[email protected]>
21
 */
22
abstract class Theme implements ThemeInterface
23
{
24
    /**
25
     * Constructor.
26
     */
27
    public function __construct()
28
    {
29
        $this->acf();
30
        $this->classes();
31
        add_theme_support('post-thumbnails');
0 ignored issues
show
Unused Code introduced by
The call to the function add_theme_support() seems unnecessary as the function has no side-effects.
Loading history...
32
        add_filter('timber_context', [$this, 'context']);
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...
33
        add_filter('template_selector_available', [$this, 'templates']);
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...
34
    }
35
36
    /**
37
     * All about ACF configuration should be instantiated here.
38
     */
39
    protected function acf()
40
    {
41
        new Wysiwyg([
42
            'lin3s' => [1 => ['bold', 'italic', 'bullist', 'numlist', 'link', 'unlink']]
43
        ]);
44
    }
45
}
46