for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NoaaCapAlerts;
use NoaaCapAlerts\Model\NoaaAlertFactory;
use NoaaCapAlerts\Model\Polygon\PolygonFactory;
use NoaaCapAlerts\Parser\NoaaIndexParser;
use NoaaCapAlerts\Parser\XmlParser;
use NoaaCapAlerts\XmlProvider\XmlProviderFactory;
use Pimple\Container;
class Dependencies extends Container
{
public function __construct()
parent::__construct();
$this['LocalFile'] = getenv("NoaaLocalFilePath");
$this['NoaaAlertManager'] = function ($c) {
return new NoaaAlertFactory($c['XmlProvider'], $c['IndexParser'], $c['PolygonFactory']);
};
$this['XmlProvider'] = function ($c) {
return $c['XmlProviderFactory']->getXmlProvider();
$this['XmlProviderFactory'] = function ($c) {
return new XmlProviderFactory($c['LocalFile']);
$this['PolygonFactory'] = function ($c) {
$c
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
$this['PolygonFactory'] = function (/** @scrutinizer ignore-unused */ $c) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return new PolygonFactory();
$this['IndexParser'] = function ($c) {
return new NoaaIndexParser($c['XmlParser']);
$this['XmlParser'] = function ($c) {
$this['XmlParser'] = function (/** @scrutinizer ignore-unused */ $c) {
return new XmlParser();
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.