GridFieldFormAction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setExtraAttributes() 0 4 1
A getAttributes() 0 9 1
1
<?php
2
3
namespace SilverStripe\Blog\Admin;
4
5
use SilverStripe\Forms\GridField\GridField_FormAction;
6
7
class GridFieldFormAction extends GridField_FormAction
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $extraAttributes = [];
13
14
    /**
15
     * @param array $attributes
16
     */
17
    public function setExtraAttributes(array $attributes)
18
    {
19
        $this->extraAttributes = $attributes;
20
    }
21
22
    /**
23
     * @return array
24
     */
25
    public function getAttributes()
26
    {
27
        $attributes = parent::getAttributes();
28
29
        return array_merge(
30
            $attributes,
31
            $this->extraAttributes
32
        );
33
    }
34
}
35