for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: device
* Date: 04.03.16
* Time: 15:50
*/
namespace AppBundle\Services;
use AppBundle\Traits\GenerateOutput;
use Symfony\Bridge\Doctrine\RegistryInterface;
class PassControl
{
use GenerateOutput;
private $doctrine;
private $checkAnswers;
private $deactivation;
public function __construct(RegistryInterface $registryInterface, $checkAnswers, DeactivationPassModule $deactivationPassModule)
$this->doctrine = $registryInterface;
$this->checkAnswers = $checkAnswers;
$this->deactivation = $deactivationPassModule;
}
public function process(array $data)
$rating = $this->checkAnswers->checkAnswers($data);
$passModule = $this->doctrine->getRepository('AppBundle:PassModule')
findOneById()
Doctrine\Common\Persistence\ObjectRepository
findOneBy()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
->findOneById($data['idPassModule']);
$passModule->addAnsweredQuestionId($passModule->getCurrentQuestion()->getId());
$nextQuestionForPass = $this->doctrine->getRepository('AppBundle:Question')
->getNextQuestionForPass($passModule);
$passModule->addRating($rating);
if($nextQuestionForPass === null) {
$this->deactivation->deactivation($passModule, new \DateTime());
return $this->generateOutput('redirect_to_result', 301, $data['idPassModule']);
$passModule->setCurrentQuestion($nextQuestionForPass);
$this->doctrine->getManager()->flush();
return $this->generateOutput('redirect_to_pass', 301, $data['idPassModule']);
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.