for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Prophecy\Argument\Token;
class DateTimeDeltaToken implements TokenInterface
{
/** @var \DateTime */
private $value;
/** @var integer */
private $delta;
public function __construct(\DateTimeInterface $value, $delta)
$this->value = $value;
$value
object<DateTimeInterface>
object<DateTime>
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..
$this->delta = $delta;
}
/**
* Calculates token match score for provided argument.
*
* @param $argument
* @return bool|int
*/
public function scoreArgument($argument)
if (!$argument instanceof \DateTimeInterface) {
return false;
return abs($argument->getTimestamp() - $this->value->getTimestamp()) < $this->delta;
* Returns true if this token prevents check of other tokens (is last one).
public function isLast()
* Returns string representation for token.
* @return string
public function __toString()
return sprintf('Date{%s}~%d', $this->value->format('Y-m-d H:i:s'), $this->delta);
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..