for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ps2alerts\Api\Controller\Endpoint;
use League\Fractal\Manager;
use Ps2alerts\Api\Controller\Endpoint\AbstractEndpointController;
use Ps2alerts\Api\Repository\AlertRepository;
use Ps2alerts\Api\Transformer\AlertTransformer;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class AlertEndpointController extends AbstractEndpointController
{
public function __construct(
AlertRepository $repository,
AlertTransformer $transformer,
Manager $fractal
) {
$this->repository = $repository;
$this->transformer = $transformer;
$this->fractal = $fractal;
$fractal
object<League\Fractal\Manager>
object<League\Fractal>
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
}
/**
* Returns a single alert's information
*
* @see AbstractEndpointController::respondWithItem
* @param Symfony\Component\HttpFoundation\Request $request
* @param Symfony\Component\HttpFoundation\Response $response
* @param array
* @return array
*/
public function getSingle(Request $request, Response $response, array $args)
$alert = $this->repository->readSingle($args['id']);
if (empty($alert)) {
return $this->errorEmpty($response);
return $this->respond('item', $alert, $this->transformer, $request, $response);
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..