allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
101
vendor/kreait/firebase-php/src/Firebase/RemoteConfig/ParameterGroup.php
vendored
Normal file
101
vendor/kreait/firebase-php/src/Firebase/RemoteConfig/ParameterGroup.php
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Kreait\Firebase\RemoteConfig;
|
||||
|
||||
use JsonSerializable;
|
||||
|
||||
/**
|
||||
* @phpstan-import-type RemoteConfigParameterShape from Parameter
|
||||
*
|
||||
* @phpstan-type RemoteConfigParameterGroupShape array{
|
||||
* description?: string|null,
|
||||
* parameters: array<non-empty-string, RemoteConfigParameterShape>}
|
||||
*/
|
||||
final class ParameterGroup implements JsonSerializable
|
||||
{
|
||||
private string $description = '';
|
||||
|
||||
/**
|
||||
* @var array<non-empty-string, Parameter>
|
||||
*/
|
||||
private array $parameters = [];
|
||||
|
||||
/**
|
||||
* @param non-empty-string $name
|
||||
*/
|
||||
private function __construct(private readonly string $name)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param non-empty-string $name
|
||||
*/
|
||||
public static function named(string $name): self
|
||||
{
|
||||
return new self($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return non-empty-string
|
||||
*/
|
||||
public function name(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function description(): string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<non-empty-string, Parameter>
|
||||
*/
|
||||
public function parameters(): array
|
||||
{
|
||||
return $this->parameters;
|
||||
}
|
||||
|
||||
public function withDescription(string $description): self
|
||||
{
|
||||
$group = clone $this;
|
||||
$group->description = $description;
|
||||
|
||||
return $group;
|
||||
}
|
||||
|
||||
public function withParameter(Parameter $parameter): self
|
||||
{
|
||||
$group = clone $this;
|
||||
$group->parameters[$parameter->name()] = $parameter;
|
||||
|
||||
return $group;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RemoteConfigParameterGroupShape
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
$parameters = [];
|
||||
|
||||
foreach ($this->parameters as $parameter) {
|
||||
$parameters[$parameter->name()] = $parameter->toArray();
|
||||
}
|
||||
|
||||
return [
|
||||
'description' => $this->description,
|
||||
'parameters' => $parameters,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RemoteConfigParameterGroupShape
|
||||
*/
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return $this->toArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user