for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Lincable\Eloquent\Subscribers;
class UploadSubscriber
{
/**
* Listen when the upload has been executed with success.
*
* @return void
*/
public function onSuccess($model)
$model
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function onSuccess(/** @scrutinizer ignore-unused */ $model)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
//
}
* Listen when the upload has failed.
public function onFailure($model)
// Delete the model from database once the file could not be stored.
$model->delete();
* Register the listeners for the subscriber.
* @param \Illuminate\Events\Dispatcher $events
public function subscribe($events)
$events->listen(
'Lincable\Eloquent\Events\UploadSuccess',
'Lincable\Eloquent\Subscribers\UploadSubscriber@onSuccess'
);
'Lincable\Eloquent\Events\UploadFailure',
'Lincable\Eloquent\Subscribers\UploadSubscriber@onFailure'
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.