Completed
Push — master ( f36b72...9937e5 )
by Simon
01:41
created

src/models/PartialFieldSubmission.php (8 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
namespace Firesphere\PartialUserforms\Models;
4
5
use SilverStripe\UserForms\Model\Submission\SubmittedFormField;
6
7
/**
8
 * Class \Firesphere\PartialUserforms\Models\PartialFieldSubmission
9
 *
10
 * @property int $SubmittedFormID
11
 * @method \Firesphere\PartialUserforms\Models\PartialFormSubmission SubmittedForm()
12
 */
13
class PartialFieldSubmission extends SubmittedFormField
14
{
15
    private static $table_name = 'PartialFieldSubmission';
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 $table_name 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
17
    private static $has_one = [
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 $has_one 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...
18
        'SubmittedForm' => PartialFormSubmission::class,
19
    ];
20
21
    /**
22
     * @param Member $member
23
     * @param array $context
24
     * @return boolean|string
25
     */
26
    public function canCreate($member = null, $context = [])
27
    {
28
        return $this->SubmittedForm()->canCreate();
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->SubmittedForm()->canCreate(); of type boolean|string adds the type string to the return on line 28 which is incompatible with the return type of the parent method SilverStripe\UserForms\M...tedFormField::canCreate of type boolean.
Loading history...
29
    }
30
31
    /**
32
     * @param Member $member
33
     *
34
     * @return boolean|string
35
     */
36
    public function canView($member = null)
37
    {
38
        return $this->SubmittedForm()->canView();
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->SubmittedForm()->canView(); of type boolean|string adds the type string to the return on line 38 which is incompatible with the return type of the parent method SilverStripe\UserForms\M...ittedFormField::canView of type boolean.
Loading history...
39
    }
40
41
    /**
42
     * @param Member $member
43
     *
44
     * @return boolean|string
45
     */
46
    public function canEdit($member = null)
47
    {
48
        return $this->SubmittedForm()->canEdit();
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->SubmittedForm()->canEdit(); of type boolean|string adds the type string to the return on line 48 which is incompatible with the return type of the parent method SilverStripe\UserForms\M...ittedFormField::canEdit of type boolean.
Loading history...
49
    }
50
51
    /**
52
     * @param Member $member
53
     *
54
     * @return boolean|string
55
     */
56
    public function canDelete($member = null)
57
    {
58
        return $this->SubmittedForm()->canDelete();
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->SubmittedForm()->canDelete(); of type boolean|string adds the type string to the return on line 58 which is incompatible with the return type of the parent method SilverStripe\UserForms\M...tedFormField::canDelete of type boolean.
Loading history...
59
    }
60
}
61