for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WebTheory\Collection\Access\Abstracts;
trait AutoKeyedMapTrait
{
public function insert(array &$array, object $item, $offset = null): bool
$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 insert(array &$array, object $item, /** @scrutinizer ignore-unused */ $offset = null): bool
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$key = $this->getObjectAsKey($item);
if (isset($array[$key])) {
return false;
}
$array[$key] = $item;
return true;
abstract protected function getObjectAsKey(object $item): string;
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.