ArchiveMeta   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getDefaultGroup() 0 3 1
A get() 0 3 1
1
<?php
2
3
namespace GeminiLabs\Castor\Helpers;
4
5
/**
6
 * ArchiveMeta::all();
7
 * ArchiveMeta::group();
8
 * ArchiveMeta::group('option','fallback');
9
 * ArchiveMeta::get('group');
10
 * ArchiveMeta::get('group','option','fallback');.
11
 *
12
 * @property object all
13
 */
14
class ArchiveMeta extends SiteMeta
15
{
16
    protected $options;
17
18
    public function __construct()
19
    {
20
        $option = apply_filters('pollux/archives/id', 'pollux_archives');
21
        $this->options = (array) get_option($option, []);
22
    }
23
24
    /**
25
     * @param string|null $key
26
     * @param mixed $fallback
27
     * @param string $group
28
     * @return mixed
29
     */
30
    public function get($key = '', $fallback = null, $group = '')
31
    {
32
        return parent::get($group, $key, $fallback);
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    protected function getDefaultGroup()
39
    {
40
        return (string) get_post_type();
41
    }
42
}
43