for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Fi\CoreBundle\Controller;
use Fi\CoreBundle\Utils\PermessiUtils;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
class FiController extends FiTabellaController
{
public function __construct(ObjectManager $em, TokenStorageInterface $user)
$matches = array();
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.
$controllo = new \ReflectionClass(get_class($this));
preg_match('/(.*)\\\(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches);
if (count($matches) == 0) {
preg_match('/(.*)(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches);
}
$this->bundle = ($matches[count($matches) - 2] ? $matches[count($matches) - 2] : $matches[count($matches) - 3]);
$this->controller = $matches[count($matches) - 1];
$this->permessi = new PermessiUtils($em, $this->getController(), $user->getToken()->getUser());
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.