for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TomPHP\ConfigServiceProvider;
final class ServiceDefinition
{
/**
* @var string
*/
private $name;
private $class;
* @var bool
private $singleton;
* @var array
private $arguments;
private $methods;
* @param string $name
* @param array $config
public function __construct($name, array $config)
$this->name = $name;
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
$this->class = isset($config['class']) ? $config['class'] : $name;
$this->singleton = isset($config['singleton']) ? $config['singleton'] : false;
$this->arguments = isset($config['arguments']) ? $config['arguments'] : [];
$this->methods = isset($config['methods']) ? $config['methods'] : [];
}
* @return string
public function getName()
return $this->name;
public function getClass()
return $this->class;
* @return boolean
public function isSingleton()
return $this->singleton;
* @return array
public function getArguments()
return $this->arguments;
public function getMethods()
return $this->methods;
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.