use Maslosoft\Manganel\Interfaces\MaxScoreAwareInterface;
16
use UnexpectedValueException;
17
18
/**
19
* MaxScoreAwareTrait
20
*
21
* @see MaxScoreAwareInterface
22
* @author Piotr Maselkowski <pmaselkowski at gmail.com>
23
*/
24
trait MaxScoreAwareTrait
25
{
26
27
private $maxScore = 0.0;
28
29
1
public function getMaxScore()
30
{
31
1
if (!$this instanceof MaxScoreAwareInterface)
32
{
33
throw new UnexpectedValueException(sprintf('Class `%s` using `%s` must implement `%s`', get_class($this), __CLASS__, MaxScoreAwareInterface::class)); // @codeCoverageIgnore
34
}
35
1
return $this->maxScore;
36
}
37
38
1
public function setMaxScore($score)
39
{
40
1
if (!$this instanceof MaxScoreAwareInterface)
41
{
42
throw new UnexpectedValueException(sprintf('Class `%s` using `%s` must implement `%s`', get_class($this), __CLASS__, MaxScoreAwareInterface::class)); // @codeCoverageIgnore