Issues (4)

tests/AkismetTestService.php (1 issue)

Severity
1
<?php
2
3
namespace SilverStripe\Akismet\Tests;
4
5
use Exception;
6
use SilverStripe\Dev\TestOnly;
7
use SilverStripe\Akismet\Service\AkismetService;
8
9
class AkismetTestService implements TestOnly, AkismetService
10
{
11
    public function __construct($apiKey, $url)
0 ignored issues
show
The parameter $url 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 ignore-unused  annotation

11
    public function __construct($apiKey, /** @scrutinizer ignore-unused */ $url)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
12
    {
13
        if ($apiKey !== 'dummykey') {
14
            throw new Exception("Invalid key");
15
        }
16
    }
17
    
18
    public function isSpam($content, $author = null, $email = null, $url = null, $permalink = null, $type = null)
19
    {
20
        // This dummy service only checks the content
21
        return $content === 'spam';
22
    }
23
}
24