Navigation | Overlay |
---|---|
t Navigate files | h Toggle hits |
y Change url to tip of branch | m Toggle misses |
b / v Jump to prev/next hit line | p Toggle partial |
z / x Jump to prev/next missed or partial line | 1..9 Toggle flags |
shift + o Open current page in GitHub | a Toggle all on |
/ or ? Show keyboard shortcuts dialog | c Toggle context lines or commits |
1 |
<?php
|
|
2 |
|
|
3 |
declare(strict_types=1); |
|
4 |
|
|
5 |
namespace Kreait\Firebase\Messaging; |
|
6 |
|
|
7 |
use JsonSerializable; |
|
8 |
|
|
9 |
final class AndroidConfig implements JsonSerializable |
|
10 |
{
|
|
11 |
/** @var array<string, mixed> */
|
|
12 |
private $rawConfig; |
|
13 |
|
|
14 | 12 |
private function __construct() |
15 |
{
|
|
16 |
}
|
|
17 |
|
|
18 |
/**
|
|
19 |
* @param array<string, mixed> $data
|
|
20 |
*/
|
|
21 | 12 |
public static function fromArray(array $data): self |
22 |
{
|
|
23 | 12 |
$config = new self(); |
24 | 12 |
$config->rawConfig = $data; |
25 |
|
|
26 | 12 |
return $config; |
27 |
}
|
|
28 |
|
|
29 |
/**
|
|
30 |
* @return array<string, mixed>
|
|
31 |
*/
|
|
32 | 12 |
public function jsonSerialize(): array |
33 |
{
|
|
34 |
return \array_filter($this->rawConfig, static function ($value) { |
|
35 | 12 |
return $value !== null; |
36 | 12 |
});
|
37 |
}
|
|
38 |
}
|
Read our documentation on viewing source code .