for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dtc\QueueBundle\Manager;
use Dtc\QueueBundle\Exception\UnsupportedException;
class JobTimingManager
{
/** @var string */
protected $jobTimingClass;
/** @var bool */
protected $recordTimings;
public function __construct($jobTimingClass, $recordTimings)
$this->jobTimingClass = $jobTimingClass;
$this->recordTimings = $recordTimings;
}
/**
* @throws UnsupportedException
*
* @return int Number of archived runs pruned
*/
public function pruneJobTimings(\DateTime $olderThan)
$olderThan
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function pruneJobTimings(/** @scrutinizer ignore-unused */ \DateTime $olderThan)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
throw new UnsupportedException('not supported');
* Subclasses should overrride this function instead of recordTiming.
* @param $status
protected function performRecording($status, \DateTime $dateTime = null)
$status
protected function performRecording(/** @scrutinizer ignore-unused */ $status, \DateTime $dateTime = null)
$dateTime
protected function performRecording($status, /** @scrutinizer ignore-unused */ \DateTime $dateTime = null)
public function recordTiming($status, \DateTime $dateTime = null)
if (!$this->recordTimings) {
return;
$this->performRecording($status, $dateTime);
* @return string
public function getJobTimingClass()
return $this->jobTimingClass;
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.