<commit_before><?php
declare(strict_types=1);

namespace Tomaj\Hermes;

use Ramsey\Uuid\Uuid;

class Message implements MessageInterface
{
    /**
     * @var string
     */
    private $type;

    /**
     * @var array
     */
    private $payload;

    /**
     * @var string
     */
    private $messageId;

    /**
     * @var float
     */
    private $created;

    /**
     * @var string
     */
    private $executeAt;

    /**
     * @var int
     */
    private $retries;

    /**
     * Native implementation of message.
     *
     * @param string $type
     * @param array|null $payload
     * @param string|null $messageId
     * @param float|null $created timestamp (microtime(true))
     * @param float|null $executeAt timestamp (microtime(true))
     * @param int $retries
     */
    public function __construct(string $type, array $payload = null, string $messageId = null, float $created = null, float $executeAt = null, int $retries = 0)
    {
        $this->messageId = $messageId;
        if (!$messageId) {
            try {
                $this->messageId = Uuid::uuid4()->toString();
            } catch (\Exception $e) {
                $this->messageId = rand(10000, 99999999);
            }
        }
        $this->created = $created;
        if (!$created) {
            $this->created = microtime(true);
        }
        $this->type = $type;
        $this->payload = $payload;
        $this->executeAt = $executeAt;
        $this->retries = $retries;
    }
<commit_msg>Fixed Message hints from Scrutinizier<commit_after><?php
declare(strict_types=1);

namespace Tomaj\Hermes;

use Ramsey\Uuid\Uuid;

class Message implements MessageInterface
{
    /**
     * @var string
     */
    private $type;

    /**
     * @var array|null
     */
    private $payload;

    /**
     * @var string
     */
    private $messageId;

    /**
     * @var float
     */
    private $created;

    /**
     * @var float|null
     */
    private $executeAt;

    /**
     * @var int
     */
    private $retries;

    /**
     * Native implementation of message.
     *
     * @param string $type
     * @param array|null $payload
     * @param string|null $messageId
     * @param float|null $created timestamp (microtime(true))
     * @param float|null $executeAt timestamp (microtime(true))
     * @param int $retries
     */
    public function __construct(string $type, array $payload = null, string $messageId = null, float $created = null, float $executeAt = null, int $retries = 0)
    {
        $this->messageId = $messageId;
        if ($messageId === null || $messageId == "") {
            try {
                $this->messageId = Uuid::uuid4()->toString();
            } catch (\Exception $e) {
                $this->messageId = (string) rand(10000, 99999999);
            }
        }
        $this->created = $created;
        if (!$created) {
            $this->created = microtime(true);
        }
        $this->type = $type;
        $this->payload = $payload;
        $this->executeAt = $executeAt;
        $this->retries = $retries;
    }

{'fraction_non_alphanumeric': 0.14141742522756828, 'fraction_numerical': 0.010403120936280884, 'mean_word_length': 1.8919172932330828, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4353398', 'n_tokens_mistral': 967, 'n_tokens_neox': 923, 'n_words': 219}