for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpSchool\CliMenu\Style;
class StaticStyle implements ItemStyleInterface
{
use ItemStyleTrait;
protected const DEFAULT_STYLES = [
'markerOn' => '',
'markerOff' => '',
'itemExtra' => '',
'displaysExtra' => false,
];
public function __construct()
$this->fromArray([]);
}
public function setMarkerOn(string $marker) : self
return $this;
public function setMarkerOff(string $marker) : self
public function setItemExtra(string $itemExtra) : self
public function setDisplaysExtra(bool $displaysExtra) : self
public function toArray(): array
return [
'markerOn' => $this->markerOn,
'markerOff' => $this->markerOff,
'itemExtra' => $this->itemExtra,
'displaysExtra' => $this->displaysExtra,
public function fromArray(array $style) : self
$style
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function fromArray(/** @scrutinizer ignore-unused */ array $style) : self
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$this->markerOn = self::DEFAULT_STYLES['markerOn'];
$this->markerOff = self::DEFAULT_STYLES['markerOff'];
$this->itemExtra = self::DEFAULT_STYLES['itemExtra'];
$this->displaysExtra = self::DEFAULT_STYLES['displaysExtra'];
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.