<?php


namespace MeadSteve\DiceApi;

class BasicDice implements Dice
{

    private $size;

    public function __construct($size)
    {
        $this->size = $size;
    }

    public function size()
    {
        return $this->size;
    }

    public function jsonSerialize()
    {
        return [
            "value" => $this->roll(),
            "size" => "d" . $this->size()
        ];
    }

    public function roll()
    {
        return (int) rand(1, $this->size);
    }
}

<?php


namespace MeadSteve\DiceApi;

class BasicDice implements Dice
{

    private $size;

    public function __construct($size)
    {
        $this->size = $size;
    }

    public function size()
    {
        return $this->size;
    }

    public function jsonSerialize()
    {
        return [
            "value" => $this->roll(),
            "size" => "d" . $this->size()
        ];
    }

    public function roll()
    {
        return mt_rand(1, $this->size);
    }
}

Move from `rand` to `mt_rand` ;)
Move from `rand` to `mt_rand` ;)