for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';
use Nexus\StandardListenerProvider;
use Nexus\SynchronousNotifier;
use Psr\EventDispatcher\MessageInterface;
class SomeMessage implements MessageInterface
{
}
class SomeOtherMessage implements MessageInterface
$provider = new StandardListenerProvider();
$notifier = new SynchronousNotifier($provider);
$provider->addListener(function (SomeMessage $someMessage) {
$someMessage
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
$provider->addListener(function (/** @scrutinizer ignore-unused */ SomeMessage $someMessage) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
echo "some cool message reaction code goes here\n";
});
echo "this message seems worth logging!\n";
$provider->addListener(function (SomeOtherMessage $someOtherMessage) {
$someOtherMessage
$provider->addListener(function (/** @scrutinizer ignore-unused */ SomeOtherMessage $someOtherMessage) {
echo "oh, the other message was dispatched!\n";
$testMessage = new SomeMessage();
$notifier->notify($testMessage);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.