Completed
Push — master ( 979731...d0541a )
by Robbie
01:29
created

code/models/ComposerUpdate.php (5 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Describes an available update to an installed Composer package
4
 *
5
 * Originally from https://github.com/XploreNet/silverstripe-composerupdates
6
 *
7
 * @author Matt Dwen
8
 * @license MIT
9
 */
10
class ComposerUpdate extends DataObject
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
11
{
12
    /**
13
     * @var array
14
     */
15
    private static $db = array(
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
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...
16
        'Name' => 'Varchar(255)',
17
        'Installed' => 'Varchar(255)',
18
        'Available' => 'Varchar(255)',
19
    );
20
21
    /**
22
     * @var array
23
     */
24
    private static $summary_fields = array(
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
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...
25
        'Name' => 'Package',
26
        'Installed',
27
        'Available',
28
    );
29
30
    /**
31
     * name of the related job
32
     *
33
     * @var string
34
     */
35
    public $jobName = 'CheckComposerUpdatesJob';
36
37
    /**
38
     * self update on dev/build
39
     */
40
    public function requireDefaultRecords()
41
    {
42
        parent::requireDefaultRecords();
43
44
        // add a queuedjob on dev/build
45
        singleton('QueuedJobService')->queueJob(new CheckComposerUpdatesJob());
46
    }
47
}
48