1 | <?php |
||||||
2 | |||||||
3 | namespace SilverStripe\CommentNotifications\Tests\Model; |
||||||
4 | |||||||
5 | use SilverStripe\ORM\DataObject; |
||||||
6 | use SilverStripe\Dev\TestOnly; |
||||||
7 | use SilverStripe\Control\Controller; |
||||||
8 | use SilverStripe\Control\Director; |
||||||
9 | use SilverStripe\CommentNotifications\Extensions\CommentNotifiable; |
||||||
10 | use SilverStripe\Comments\Extensions\CommentsExtension; |
||||||
11 | |||||||
12 | class CommentNotifiableTestDataObject extends DataObject implements TestOnly |
||||||
13 | { |
||||||
14 | private static $db = [ |
||||||
0 ignored issues
–
show
introduced
by
![]() |
|||||||
15 | "Title" => "Varchar(255)", |
||||||
16 | "URLSegment" => "Varchar(255)", |
||||||
17 | ]; |
||||||
18 | |||||||
19 | private static $has_one = [ |
||||||
0 ignored issues
–
show
|
|||||||
20 | 'Author' => 'SilverStripe\Security\Member' |
||||||
21 | ]; |
||||||
22 | |||||||
23 | private static $extensions = [ |
||||||
0 ignored issues
–
show
|
|||||||
24 | CommentNotifiable::class, |
||||||
25 | CommentsExtension::class |
||||||
26 | ]; |
||||||
27 | |||||||
28 | private static $table_name = 'CommentNotifiableTestDataObject'; |
||||||
0 ignored issues
–
show
|
|||||||
29 | |||||||
30 | public function updateNotificationRecipients(&$list, $comment) |
||||||
0 ignored issues
–
show
The parameter
$comment is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
31 | { |
||||||
32 | $author = $this->Author(); |
||||||
0 ignored issues
–
show
The method
Author() does not exist on SilverStripe\CommentNoti...otifiableTestDataObject . 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
![]() |
|||||||
33 | |||||||
34 | if ($author && $author->exists()) { |
||||||
35 | $list[] = $author->Email; |
||||||
36 | } |
||||||
37 | } |
||||||
38 | |||||||
39 | public function Link($action = false) |
||||||
0 ignored issues
–
show
The parameter
$action is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
40 | { |
||||||
41 | return Controller::join_links( |
||||||
42 | Director::baseURL(), |
||||||
43 | $this->URLSegment |
||||||
0 ignored issues
–
show
The property
URLSegment does not exist on SilverStripe\CommentNoti...otifiableTestDataObject . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||||
44 | ); |
||||||
45 | } |
||||||
46 | } |
||||||
47 |