for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Formularium\Frontend\Bootstrap\Renderable;
use Formularium\Field;
use Formularium\Frontend\Bootstrap\RenderableBootstrapInputTrait;
use Formularium\Frontend\Bootstrap\RenderableBootstrapTrait;
use Formularium\HTMLElement;
class Renderable_file extends \Formularium\Renderable
{
use RenderableBootstrapTrait;
public function viewable($value, Field $field, HTMLElement $previous): HTMLElement
return $previous;
}
public function _editable($value, Field $field, HTMLElement $previous): HTMLElement
$value
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function _editable(/** @scrutinizer ignore-unused */ $value, Field $field, HTMLElement $previous): HTMLElement
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$field
public function _editable($value, /** @scrutinizer ignore-unused */ Field $field, HTMLElement $previous): HTMLElement
// add extra classes
$input = $previous->get('input')[0];
$input->addAttribute('class', 'custom-file-input');
$label = $previous->get('label')[0];
return HTMLElement::factory(
'div',
[],
[
$label,
HTMLElement::factory(
['class' => "input-group mb-3"],
['class' => "input-group-prepend"],
'span',
['class' => "input-group-text"],
'Upload'
)
),
['class' => "custom-file"],
$input,
'label',
['class' => "custom-file-label"],
'Choose file'
]
);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.