for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bdf\Form\View;
use ArrayIterator;
use BadMethodCallException;
/**
* Implements @see FieldSetViewInterface
*/
trait FieldSetViewTrait
{
* @var array<string, ElementViewInterface>
private $elements = [];
* {@inheritdoc}
public function offsetExists($offset): bool
return isset($this->elements[$offset]);
}
public function offsetGet($offset)
return $this->elements[$offset];
public function offsetSet($offset, $value)
$offset
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function offsetSet(/** @scrutinizer ignore-unused */ $offset, $value)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$value
public function offsetSet($offset, /** @scrutinizer ignore-unused */ $value)
throw new BadMethodCallException('FormView is read only');
public function offsetUnset($offset)
public function offsetUnset(/** @scrutinizer ignore-unused */ $offset)
public function hasError(): bool
if ($this->error() !== null) {
error()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
if ($this->/** @scrutinizer ignore-call */ error() !== null) {
return true;
foreach ($this->elements as $element) {
if ($element->hasError()) {
return false;
*
* @return \Iterator<string, ElementViewInterface>
* @psalm-suppress ImplementedReturnTypeMismatch
public function getIterator()
return new ArrayIterator($this->elements);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.