Total Complexity | 6 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class FontPickerField extends SingleSelectField |
||
9 | { |
||
10 | /** |
||
11 | * Defines the default font |
||
12 | * |
||
13 | * @config |
||
14 | * @var array |
||
15 | */ |
||
16 | protected static $default_font = 'nunito-sans'; |
||
17 | |||
18 | public function getDefaultFont() |
||
19 | { |
||
20 | return $this->owner->config()->get('default_font'); |
||
21 | } |
||
22 | |||
23 | public function __construct($name, $title = null, $source = array(), $value = null) |
||
24 | { |
||
25 | parent::__construct($name, $title, $source, $value); |
||
26 | |||
27 | $this->addExtraClass('font-picker-field'); |
||
28 | } |
||
29 | |||
30 | public function getSchemaDataDefaults() |
||
31 | { |
||
32 | $schemaData = parent::getSchemaDataDefaults(); |
||
33 | |||
34 | $fonts = []; |
||
35 | foreach ($this->getSource() as $css => $title) { |
||
36 | $fonts[] = [ |
||
37 | 'CSSClass' => $css, |
||
38 | 'Title' => $title, |
||
39 | ]; |
||
40 | } |
||
41 | |||
42 | $schemaData['source'] = $fonts; |
||
43 | $schemaData['name'] = $this->getName(); |
||
44 | $schemaData['value'] = $this->Value(); |
||
45 | |||
46 | return $schemaData; |
||
47 | } |
||
48 | |||
49 | public function Value() |
||
52 | } |
||
53 | } |
||
54 |
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.