Issues (41)

src/Models/CSPViolation.php (7 issues)

1
<?php
2
3
namespace Signify\Models;
4
5
use SilverStripe\ORM\DataObject;
6
use SilverStripe\ORM\FieldType\DBField;
7
8
class CSPViolation extends DataObject
9
{
10
    private static $plural_name = 'CSP Violations';
0 ignored issues
show
The private property $plural_name is not used, and could be removed.
Loading history...
11
12
    private static $table_name = 'Signify_CSPViolation';
0 ignored issues
show
The private property $table_name is not used, and could be removed.
Loading history...
13
14
    private static $db = [
0 ignored issues
show
The private property $db is not used, and could be removed.
Loading history...
15
        'ReportedTime' => 'Datetime',
16
        'Disposition' => 'Varchar(7)',
17
        'BlockedURI' => 'Varchar(255)',
18
        'EffectiveDirective' => 'Varchar(255)',
19
        'Violations' => 'Int',
20
    ];
21
22
    private static $many_many = [
0 ignored issues
show
The private property $many_many is not used, and could be removed.
Loading history...
23
        'Documents' => CSPDocument::class,
24
    ];
25
26
    private static $summary_fields = [
0 ignored issues
show
The private property $summary_fields is not used, and could be removed.
Loading history...
27
        'ReportedTime' => 'Latest Report',
28
        'Disposition',
29
        'BlockedURI',
30
        'DocumentURIs',
31
        'EffectiveDirective',
32
        'Violations',
33
    ];
34
35
    private static $default_sort = 'ReportedTime DESC';
0 ignored issues
show
The private property $default_sort is not used, and could be removed.
Loading history...
36
37
    public function getDocumentURIs()
38
    {
39
        return DBField::create_field('Text', implode(', ', $this->Documents()->Column('URI')));
0 ignored issues
show
The method Documents() does not exist on Signify\Models\CSPViolation. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

39
        return DBField::create_field('Text', implode(', ', $this->/** @scrutinizer ignore-call */ Documents()->Column('URI')));
Loading history...
40
    }
41
}
42