for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ByTIC\MediaLibrary\Exceptions\FileCannotBeAdded;
use ByTIC\MediaLibrary\Collections\Collection;
use ByTIC\MediaLibrary\Exceptions\FileCannotBeAdded;
use ByTIC\MediaLibrary\Media\Media;
use ByTIC\MediaLibrary\Validation\Violations\ViolationsBag;
/**
* Class FileUnacceptableForCollection.
*/
class FileUnacceptableForCollection extends FileCannotBeAdded
{
public $violations;
* @param mixed $media
* @param Collection $collection
* @param ViolationsBag $bag
*
* @return FileUnacceptableForCollection
public static function createFromViolationsBag($file, Collection $collection, ViolationsBag $bag)
$collection
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public static function createFromViolationsBag($file, /** @scrutinizer ignore-unused */ Collection $collection, ViolationsBag $bag)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$file
public static function createFromViolationsBag(/** @scrutinizer ignore-unused */ $file, Collection $collection, ViolationsBag $bag)
$exception = new static(
'The media was not accepted into the collection'
);
$exception->violations = $bag;
return $exception;
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.