for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace BoneMvc\Module\Test\Controller;
use Bone\Mvc\View\ViewEngine;
use BoneMvc\Mail\EmailMessage;
use BoneMvc\Mail\Service\MailService;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\HtmlResponse;
class TestController
{
/** @var ViewEngine $view */
private $view;
/** @var MailService $mailService */
private $mailService;
public function __construct(ViewEngine $view, MailService $mailService)
$this->view = $view;
$this->mailService = $mailService;
}
/**
* @param ServerRequestInterface $request
* @param array $args
* @return ResponseInterface $response
* @throws \Exception
*/
public function indexAction(ServerRequestInterface $request, array $args): ResponseInterface
$request
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$args
$msg = new EmailMessage();
$msg->setFrom('[email protected]');
$msg->setTo('[email protected]');
$msg->setSubject('Purest clickbait');
$msg->setTemplate('testemails::hello');
$msg->setViewData([
'name' => 'John',
]);
$this->mailService->sendEmail($msg);
$body = $this->view->render('test::index', []);
return new HtmlResponse($body);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.