for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Germania\PathServiceProvider;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
class PathServiceProvider implements ServiceProviderInterface
{
/**
* @var Callable
*/
public $prefixer;
* @var array
public $paths = [];
* @var Container
public $dic;
* @param array $paths Optional array with paths
* @param Callable|null $prefixer Optional callable that prefixes the paths.
public function __construct ( $paths = array(), Callable $prefixer = null)
$this->paths = $paths;
$this->prefixer = $prefixer ?: function( $p ) { return $p; } ;
}
* @implements ServiceProviderInterface
public function register(Container $dic)
* @return array
$dic['Paths'] = function($dic) {
$dic
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
return $this->paths;
};
* @return Callable
$dic['Paths.Prefixer'] = function($dic) {
return $this->prefixer;
$dic['Paths.absolute'] = function ($dic) {
$paths = $dic['Paths'];
$prefixer = $dic['Paths.Prefixer'];
return $prefixer( $paths );
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.