These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | class NewsItem extends ModuleModel implements FeedItem |
||
0 ignored issues
–
show
|
|||
4 | { |
||
5 | ... |
||
0 ignored issues
–
show
|
|||
6 | public function getFeedData() : array |
||
7 | { |
||
8 | return [ |
||
9 | 'title' => $this->getFeedItemTitle(), |
||
10 | 'id' => $this->getFeedItemId(), |
||
11 | 'updated' => $this->getFeedItemUpdated(), |
||
12 | 'summary' => $this->getFeedItemSummary(), |
||
13 | 'link' => $this->getFeedItemLink(), |
||
14 | ]; |
||
15 | } |
||
16 | |||
17 | public function getFeedItemId() |
||
18 | { |
||
19 | return $this->id; |
||
20 | } |
||
21 | |||
22 | public function getFeedItemTitle() : string |
||
23 | { |
||
24 | return $this->name; |
||
25 | } |
||
26 | |||
27 | public function getFeedItemSummary() : string |
||
28 | { |
||
29 | return $this->present()->excerpt; |
||
30 | } |
||
31 | |||
32 | public function getFeedItemUpdated() : Carbon |
||
33 | { |
||
34 | return $this->updated_at; |
||
35 | } |
||
36 | |||
37 | public function getFeedItemLink() : string |
||
38 | { |
||
39 | return action('Front\NewsItemController@detail', [$this->url]); |
||
40 | } |
||
41 | } |
||
42 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.