for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ZfcDatagrid\Column\DataPopulation\Object;
use ZfcDatagrid\Column\DataPopulation\ObjectAwareInterface;
class Gravatar implements ObjectAwareInterface
{
/** @var string */
protected $email;
/**
* @param string $name
* @param mixed $value
*
* @throws \Exception
*/
private function setParameter($name, $value)
switch ($name) {
case 'email':
$this->email = (string) $value;
break;
default:
throw new \InvalidArgumentException('Not allowed parameter: '.$name);
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.
return
die
exit
function fx() { try { doSomething(); return true; } catch (\Exception $e) { return false; } return false; }
In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.
return false
}
* (non-PHPdoc).
* @see \ZfcDatagrid\Column\DataPopulation\ObjectAwareInterface::setParameterFromColumn()
public function setParameterFromColumn($name, $value)
$this->setParameter($name, $value);
* @see \ZfcDatagrid\Column\DataPopulation\ObjectAwareInterface::toString()
public function toString()
$hash = '';
if ($this->email != '') {
$hash = md5($this->email);
return 'http://www.gravatar.com/avatar/'.$hash;
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return,dieorexitstatements that have been added for debug purposes.In the above example, the last
return falsewill never be executed, because a return statement has already been met in every possible execution path.