| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class BackgroundTypeWallpaper extends BackgroundType |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'backgroundTypeWallpaper'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12. |
||
| 20 | * |
||
| 21 | * @var bool |
||
| 22 | */ |
||
| 23 | protected bool $isBlurred; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * True, if the background needs to be slightly moved when device is tilted. |
||
| 27 | * |
||
| 28 | * @var bool |
||
| 29 | */ |
||
| 30 | protected bool $isMoving; |
||
| 31 | |||
| 32 | public function __construct(bool $isBlurred, bool $isMoving) |
||
| 38 | } |
||
| 39 | |||
| 40 | public static function fromArray(array $array): BackgroundTypeWallpaper |
||
| 41 | { |
||
| 42 | return new static( |
||
| 43 | $array['is_blurred'], |
||
| 44 | $array['is_moving'], |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function typeSerialize(): array |
||
| 49 | { |
||
| 50 | return [ |
||
| 51 | '@type' => static::TYPE_NAME, |
||
| 52 | 'is_blurred' => $this->isBlurred, |
||
| 53 | 'is_moving' => $this->isMoving, |
||
| 54 | ]; |
||
| 55 | } |
||
| 56 | |||
| 57 | public function getIsBlurred(): bool |
||
| 60 | } |
||
| 61 | |||
| 62 | public function getIsMoving(): bool |
||
| 67 |