for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the ReportBundle package
*
* (c) symball <http://simonball.me>
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*/
/**
* Set the width of a given cell
* @author Simon Ball <simonball at simonball dot me>
namespace Symball\ReportBundle\Styles;
use Symball\ReportBundle\Service\ReportBuilder;
use Symball\ReportBundle\Interfaces\StyleInterface;
class Width implements StyleInterface
{
public function run(ReportBuilder &$context, $coordString, $options) {
switch ($options['type']) {
case 'auto':
$context->sheet()
->getColumnDimension($coordString)
->setAutoSize(true);
break;
default:
throw new \Exception('Unrecognised style width option: '.$options['type']);
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
}
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
orexit
statements that have been added for debug purposes.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.