Lines n/a 0 / 0
Functions and Methods n/a 0 / 0
Classes and Traits n/a 0 / 0
Name Lines Functions and Methods CRAP Classes and Traits
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Contracts\Exposure;
6
7use Stewart\Contracts\EventStream;
8use Stewart\Contracts\Exception\ExposureException;
9use Stewart\Contracts\Exposure\Command\SwitchCommand;
10
11/** @phpstan-import-type ExposedAttributes from ExposedEntity */
12interface ExposedSwitch extends ExposedEntity
13{
14    public function getConfig(): SwitchConfig;
15
16    /** @throws ExposureException */
17    public function updateConfig(SwitchConfig $config): void;
18
19    public function getValue(): ?bool;
20
21    /**
22     * @param ExposedAttributes|null $attributes
23     * @throws ExposureException
24     */
25    public function setOn(?array $attributes = null): void;
26
27    /**
28     * @param ExposedAttributes|null $attributes
29     * @throws ExposureException
30     */
31    public function setOff(?array $attributes = null): void;
32
33    /** @return EventStream<SwitchCommand> */
34    public function watchCommands(): EventStream;
35}