1 | <?php |
||
19 | class FixedConfig implements ConfigInterface, LoggerAwareInterface |
||
20 | { |
||
21 | /** |
||
22 | * Machine ID. |
||
23 | * |
||
24 | * @var int |
||
25 | */ |
||
26 | private $machineId; |
||
27 | |||
28 | /** |
||
29 | * Logger. |
||
30 | * |
||
31 | * @var LoggerInterface |
||
32 | */ |
||
33 | private $logger; |
||
34 | |||
35 | /** |
||
36 | * Constructor. |
||
37 | * |
||
38 | * @param int $machineId Fixed machine ID. |
||
39 | * @param LoggerInterface $logger Logger class |
||
40 | */ |
||
41 | 5 | public function __construct($machineId, LoggerInterface $logger = null) |
|
50 | |||
51 | /** |
||
52 | * Get machine identifier. |
||
53 | * |
||
54 | * @return int Should be a 10-bit int (decimal 0 to 1023) |
||
55 | */ |
||
56 | 5 | public function getMachine() |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | * |
||
66 | * This function will always return false, as fixed config does not resync machine ID. |
||
67 | */ |
||
68 | 1 | public function heartbeat() |
|
72 | |||
73 | /** |
||
74 | * Set logger. |
||
75 | * |
||
76 | * @param LoggerInterface $logger |
||
77 | */ |
||
78 | 1 | public function setLogger(LoggerInterface $logger) |
|
82 | } |
||
83 |