for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TomPHP\ConfigServiceProvider\League;
use League\Container\ServiceProvider\AbstractServiceProvider;
use League\Container\ServiceProvider\BootableServiceProviderInterface;
use TomPHP\ConfigServiceProvider\InflectorConfig;
use TomPHP\ConfigServiceProvider\InflectorDefinition;
final class InflectorServiceProvider extends AbstractServiceProvider implements
BootableServiceProviderInterface
{
/**
* @var InflectorConfig
*/
private $config;
* @api
*
* @param InflectorConfig $config
public function __construct(InflectorConfig $config)
$this->config = $config;
}
public function register()
public function boot()
foreach ($this->config as $definition) {
$this->configureInterface($definition);
* @param string $interface
$interface
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @param array $config
$config
private function configureInterface(InflectorDefinition $definition)
foreach ($definition->getMethods() as $method => $args) {
$this->addInflectorMethod(
$definition->getInterface(),
$method,
$args
);
* @param string $method
* @param array $args
private function addInflectorMethod($interface, $method, array $args)
$this->getContainer()
->inflector($interface)
->invokeMethod($method, $args);
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.