Completed
Pull Request — master (#27)
by Robbie
01:23
created

ComposerUpdateExtension::getJobName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace BringYourOwnIdeas\UpdateChecker\Extensions;
4
5
use CheckComposerUpdatesJob;
6
use DataExtension;
7
use Injector;
8
use QueuedJobService;
9
10
/**
11
 * Describes any available updates to an installed Composer package
12
 *
13
 * Originally from https://github.com/XploreNet/silverstripe-composerupdates
14
 */
15
class ComposerUpdateExtension extends DataExtension
16
{
17
    /**
18
     * @var string
19
     */
20
    protected $jobName = 'CheckComposerUpdatesJob';
21
22
    private static $db = [
0 ignored issues
show
Unused Code introduced by
The property $db is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
23
        'LatestVersion' => 'Varchar',
24
    ];
25
26
    private static $summary_fields = [
0 ignored issues
show
Unused Code introduced by
The property $summary_fields is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
27
        'LatestVersion',
28
    ];
29
30
    /**
31
     * Automatically schedule a self update job on dev/build
32
     */
33
    public function requireDefaultRecords()
34
    {
35
        Injector::inst()
36
            ->get(QueuedJobService::class)
37
            ->queueJob(new CheckComposerUpdatesJob());
38
    }
39
40
    /**
41
     * Return the name of the related job
42
     *
43
     * @return string
44
     */
45
    public function getJobName()
46
    {
47
        return $this->jobName;
48
    }
49
}
50