silverstripe /
silverstripe-akismet
| 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
|
|||
| 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 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.