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.
Completed
Push — master ( 23cb2d...2cff12 )
by Brent
08:16
created

src/Reporters/MailBrokenLinks.php (1 issue)

Labels
Severity

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 Spatie\LinkChecker\Reporters;
4
5
use Spatie\Crawler\Url;
6
use Illuminate\Contracts\Mail\Mailer;
7
8
class MailBrokenLinks extends BaseReporter
9
{
10
    /**
11
     * @var Mailer
12
     */
13
    protected $mail;
14
15
    /**
16
     * MailBrokenLinks constructor.
17
     *
18
     * @param \Illuminate\Contracts\Mail\Mailer $mail
19
     */
20
    public function __construct(Mailer $mail)
21
    {
22
        $this->mail = $mail;
23
    }
24
25
    /**
26
     * Called when the crawler has crawled the given url.
27
     *
28
     * @param \Spatie\Crawler\Url                      $url
29
     * @param \Psr\Http\Message\ResponseInterface|null $response
30
     * @param \Spatie\Crawler\Url $foundOnUrl
31
     *
32
     * @return string
33
     */
34
    public function hasBeenCrawled(Url $url, $response, Url $foundOnUrl = null)
35
    {
36
        $url->foundOnUrl = $foundOnUrl;
0 ignored issues
show
The property foundOnUrl does not seem to exist in Spatie\Crawler\Url.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
37
38
        return parent::hasBeenCrawled($url, $response, $foundOnUrl);
39
    }
40
41
    /**
42
     * Called when the crawl has ended.
43
     */
44
    public function finishedCrawling()
45
    {
46
        if (!$this->crawledBadUrls()) {
47
            return;
48
        }
49
50
        $urlsGroupedByStatusCode = $this->urlsGroupedByStatusCode;
51
52
        $this->mail->send('laravel-link-checker::crawlReport', compact('urlsGroupedByStatusCode'), function ($message) {
53
            $message->from(config('laravel-link-checker.reporters.mail.from_address'));
54
            $message->to(config('laravel-link-checker.reporters.mail.to_address'));
55
            $message->subject(config('laravel-link-checker.reporters.mail.subject'));
56
        });
57
    }
58
}
59