GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (32)

src/Models/Traits/Postable.php (3 issues)

1
<?php
2
3
namespace AloiaCms\Models\Traits;
4
5
use Carbon\Carbon;
6
7
trait Postable
8
{
9
    /**
10
     * Set the post date
11
     *
12
     * @param Carbon $post_date
13
     * @return $this
14
     */
15 2
    public function setPostDate(Carbon $post_date)
16
    {
17 2
        $this->matter['post_date'] = $post_date->toDateString();
0 ignored issues
show
Bug Best Practice introduced by
The property matter does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
18
        $this->has_changes = true;
0 ignored issues
show
Bug Best Practice introduced by
The property has_changes does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
19 2
20
        return $this;
21
    }
22
23
    /**
24
     * Get the post date
25
     *
26
     * @return Carbon|null
27 2
     */
28
    public function getPostDate(): ?Carbon
29 2
    {
30 1
        if (!isset($this->matter['post_date']) || empty($this->matter['post_date'])) {
31
            return null;
32
        }
33 1
34
        return Carbon::createFromFormat('Y-m-d', $this->matter['post_date']);
0 ignored issues
show
Bug Best Practice introduced by
The expression return Carbon\Carbon::cr...s->matter['post_date']) could return the type false which is incompatible with the type-hinted return Carbon\Carbon|null. Consider adding an additional type-check to rule them out.
Loading history...
35
    }
36
}
37