for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ribs\RibsAdminBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class NavigationBuilderController extends Controller
{
public function getLeftNavigationAction()
$navigation = json_decode(file_get_contents($this->em->get('kernel')->getRootDir() . "/../src/Ribs/RibsAdminBundle/Resources/json/navigation.json"));
em
Ribs\RibsAdminBundle\Con...gationBuilderController
$menu = null;
foreach ($navigation["items"] as $item) {
if ($this->get("ribs_admin.acess_rights")->testRight($item["right"])) {
$menu = [
"url" => $item["url"]
];
}
dump($menu);
dump
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
return new Response();
return $menu;
return $menu
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