JFIF  x x C         C     "        } !1AQa "q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz        w !1AQ aq"2B #3Rbr{ gilour

File "DefaultValue.php"

Full Path: /home/palsarh/web/palsarh.in/public_html/vendor/kreait/firebase-php/src/Firebase/RemoteConfig/DefaultValue.php
File size: 1.1 KB
MIME-type: text/x-php
Charset: utf-8

<?php

declare(strict_types=1);

namespace Kreait\Firebase\RemoteConfig;

use JsonSerializable;

/**
 * @phpstan-import-type RemoteConfigParameterValueShape from ParameterValue
 *
 * @todo Deprecate/Remove in 8.0
 *
 * @see ParameterValue
 */
class DefaultValue implements JsonSerializable
{
    private function __construct(private readonly ParameterValue $value)
    {
    }

    public static function useInAppDefault(): self
    {
        return new self(ParameterValue::inAppDefault());
    }

    public static function with(string $value): self
    {
        return new self(ParameterValue::withValue($value));
    }

    /**
     * @param RemoteConfigParameterValueShape $data
     */
    public static function fromArray(array $data): self
    {
        return new self(ParameterValue::fromArray($data));
    }

    /**
     * @return RemoteConfigParameterValueShape
     */
    public function toArray(): array
    {
        return $this->value->toArray();
    }

    /**
     * @return RemoteConfigParameterValueShape
     */
    public function jsonSerialize(): array
    {
        return $this->toArray();
    }
}