for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
/*
* This file is part of the KleijnWeb\SwaggerBundle package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace KleijnWeb\SwaggerBundle\Tests\Functional\PetStore\Controller;
/**
* @author John Kleijn <[email protected]>
class EntityController
{
* @return \stdClass
public function getStatus()
return (object)[
'overall' => 'ok'
];
}
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @param string $type
* @param \DateTime $lastModified
* @return array
public function find(string $type, \DateTime $lastModified)
$lastModified
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
return [
(object)[
'id' => 2,
'type' => $type,
'foo' => 'bar'
]
* @param array $criteria
public function findByCriteria(string $type, array $criteria)
$entities = [];
foreach ($criteria as $i => $criterion) {
$entities[] = (object)[
'id' => $i + 3,
return $entities;
* @param int $id
public function get(string $type, int $id)
'id' => $id,
* @param \stdClass $data
public function put(string $type, int $id, \stdClass $data)
$data->id = $id;
$data->type = $type;
return $data;
public function post(string $type, \stdClass $data)
$data->id = rand();
* @return null
public function delete(string $type, int $id)
$type
$id
return null;
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.