for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Thinktomorrow\Chief\Fields\ValidationRules;
use Thinktomorrow\Chief\Media\Application\MediaRequest;
class FileFieldRequiredRule extends AbstractMediaFieldRule
{
public function validate($attribute, $value, $params, $validator): bool
$params
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function validate($attribute, $value, /** @scrutinizer ignore-unused */ $params, $validator): bool
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$value = $this->normalizePayload($value);
foreach([MediaRequest::NEW, MediaRequest::REPLACE] as $type) {
if(is_array($value[$type]) && !empty($value[$type])) {
return true;
}
$validator->setCustomMessages([
'filefield_required' => 'De :attribute is verplicht.',
]);
if(!isset($validator->customAttributes[$attribute])) {
$validator->addCustomAttributes([
$attribute => 'afbeelding',
return false;
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.