Completed
Push — master ( 835330...e4ec87 )
by Jolita
02:59 queued 55s
created

HELP.php (2 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
  class NewsItem extends ModuleModel implements FeedItem
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...
4
  {
5
  ...
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_ELLIPSIS, expecting T_FUNCTION
Loading history...
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