| 1 | <?php |
||
| 7 | class BulbFactory |
||
| 8 | { |
||
| 9 | const LOCATION = 'Location'; |
||
| 10 | const ID = 'id'; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var Factory |
||
| 14 | */ |
||
| 15 | private $socketFactory; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * BulbFactory constructor. |
||
| 19 | * |
||
| 20 | * @param Factory $socketFactory |
||
| 21 | */ |
||
| 22 | public function __construct(Factory $socketFactory) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param array $data |
||
| 29 | * |
||
| 30 | * @return Bulb |
||
| 31 | */ |
||
| 32 | public function create(array $data): Bulb |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param string $location |
||
| 46 | * |
||
| 47 | * @return array |
||
| 48 | */ |
||
| 49 | private function extractIpAndPort(string $location): array |
||
| 55 | } |
||
| 56 |