Completed
Push — master ( d9b834...4d880d )
by Askupa
01:25
created

Component_button   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A default_model() 0 15 1
A required_arguments() 0 4 1
A get_template_path() 0 4 1
1
<?php
2
3
namespace Amarkal\UI;
4
5
/**
6
 * Implements a Button UI component.
7
 */
8
class Component_button
9
extends AbstractComponent
0 ignored issues
show
Coding Style introduced by
The extends keyword must be on the same line as the class name
Loading history...
10
implements DisableableComponentInterface
0 ignored issues
show
Coding Style introduced by
The implements keyword must be on the same line as the class name
Loading history...
11
{
12
    public $component_type = 'button';
13
    
14
    public function default_model() 
15
    {
16
        return array(
17
            'id'             => '',
18
            'disabled'       => false,
19
            'readonly'       => false,
20
            'label_start'    => null,
21
            'label_doing'    => 'Processing...',
22
            'label_done'     => 'Done',
23
            'label_error'    => 'Error',
24
            'request_url'    => null,
25
            'request_data'   => array(),
26
            'request_method' => 'POST'
27
        );
28
    }
29
    
30
    public function required_arguments()
31
    {
32
        return array('request_url','label_start');
33
    }
34
    
35
    public function get_template_path() 
36
    {
37
        return __DIR__.'/template.phtml';
38
    }
39
}