for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Modules\Script\Listeners;
use Modules\Script\Contracts\ScriptServiceContract;
use Modules\Script\Entities\ScriptRelease;
use Modules\Script\Events\ScriptWasCreatedEvent;
use Foundation\Abstracts\Listeners\Listener;
use Modules\Script\Support\Version;
class PublishInitialScriptRelease extends Listener
{
protected $service;
/**
* Create the event listener.
*
* @return void
*/
public function __construct(ScriptServiceContract $service)
$this->service = $service;
}
* Handle the event.
* @param ScriptWasCreatedEvent $event
public function handle(ScriptWasCreatedEvent $event): void
$this->service->releaseVersion($event->script,[
ScriptRelease::TYPE => "MINOR",
ScriptRelease::CHANGELOG => "Initial script release"
]);
* @param \Exception $exception
public function failed(ScriptWasCreatedEvent $event, $exception): void
$event
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function failed(/** @scrutinizer ignore-unused */ ScriptWasCreatedEvent $event, $exception): void
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$exception
public function failed(ScriptWasCreatedEvent $event, /** @scrutinizer ignore-unused */ $exception): void
//
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.