JobHolderCollectionExtensionTest_Object   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCollectionForm() 0 5 1
A getCollectionItems() 0 5 1
A getCollectionFilters() 0 5 1
1
<?php
2
3
namespace Dynamic\Jobs\Tests\Extensions;
4
5
use Dynamic\Jobs\Extensions\JobCollectionExtension;
6
use SilverStripe\Dev\TestOnly;
7
use SilverStripe\Forms\Form;
8
use SilverStripe\ORM\ArrayList;
9
use SilverStripe\ORM\DataObject;
10
11
/**
12
 * Class JobHolderCollectionExtensionTest_Object
13
 * @package Dynamic\Jobs\Tests\Extensions
14
 */
15
class JobHolderCollectionExtensionTest_Object extends DataObject implements TestOnly
16
{
17
    /**
18
     * Needs its own table (table too long otherwise)
19
     *
20
     * @var string
21
     */
22
    private static $table_name = 'JobHolderCollectionExtension';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
23
24
    /**
25
     * @var array
26
     */
27
    private static $extensions = [
0 ignored issues
show
introduced by
The private property $extensions is not used, and could be removed.
Loading history...
28
        JobCollectionExtension::class,
29
    ];
30
31
    /**
32
     * @param $filter
33
     *
34
     * @return mixed
35
     */
36
    public function getCollectionFilters($filter)
37
    {
38
        $this->extend('updateCollectionFilters', $filter);
39
40
        return $filter;
41
    }
42
43
    /**
44
     * @param Form $form
45
     *
46
     * @return Form
47
     */
48
    public function getCollectionForm(Form $form)
49
    {
50
        $this->extend('updateCollectionForm', $form);
51
52
        return $form;
53
    }
54
55
    /**
56
     * @param ArrayList $collection
57
     *
58
     * @return ArrayList
59
     */
60
    public function getCollectionItems(ArrayList $collection)
61
    {
62
        $this->extend('updateCollectionItems', $collection);
63
64
        return $collection;
65
    }
66
}
67