GroupEditorConfig   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 2
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getHtmlEditorConfig() 0 9 3
1
<?php
2
3
namespace Sunnysideup\CleanerTinyMCEConfig\Extensions;
4
5
use SilverStripe\Core\Config\Config;
6
use SilverStripe\Core\Extension;
7
use Sunnysideup\CleanerTinyMCEConfig\Config\HTMLEditorConfigOptions;
8
9
/**
10
 * Class \Sunnysideup\CleanerTinyMCEConfig\Extensions\GroupEditorConfig
11
 *
12
 * @property Group|GroupEditorConfig $owner
13
 */
14
class GroupEditorConfig extends Extension
15
{
16
    public function getHtmlEditorConfig()
17
    {
18
        $originalConfig = $this->owner->getField('HtmlEditorConfig');
0 ignored issues
show
Bug introduced by
The method getField() does not exist on Sunnysideup\CleanerTinyM...sions\GroupEditorConfig. ( Ignorable by Annotation )

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

18
        /** @scrutinizer ignore-call */ 
19
        $originalConfig = $this->owner->getField('HtmlEditorConfig');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
19
20
        if ($originalConfig) {
21
            return $originalConfig;
22
        }
23
24
        return Config::inst()->get(HTMLEditorConfigOptions::class, 'main_editor') ?: 'cms';
25
    }
26
}
27