X

Create New Item

File Folder

X

Search Results

File "RawMessageFromArray.php"

Full path: /home/orbitecv/orbite-school.orbit.et/vendor/kreait/firebase-php/src/Firebase/Messaging/RawMessageFromArray.php
File size: 508 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Edit   Back

<?php

declare(strict_types=1);

namespace Kreait\Firebase\Messaging;

use Beste\Json;

/**
 * @phpstan-import-type MessageInputShape from Message
 * @phpstan-import-type MessageOutputShape from Message
 */
final class RawMessageFromArray implements Message
{
    /**
     * @param MessageInputShape $data
     */
    public function __construct(private readonly array $data)
    {
    }

    public function jsonSerialize(): array
    {
        return Json::decode(Json::encode($this->data), true);
    }
}