| Total Complexity | 3 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 20 | class TrackHooks { |
||
| 21 | private TrackBusinessLayer $trackBusinessLayer; |
||
| 22 | |||
| 23 | private ScrobblerService $scrobblerService; |
||
| 24 | |||
| 25 | public function __construct(TrackBusinessLayer $trackBusinessLayer, ScrobblerService $scrobblerService) { |
||
| 28 | } |
||
| 29 | |||
| 30 | public function register() : void { |
||
| 31 | $this->trackBusinessLayer->listen( |
||
| 32 | TrackBusinessLayer::class, |
||
| 33 | 'recordTrackPlayed', |
||
| 34 | fn (int $trackId, string $userId, \DateTime $timeOfPlay) => $this->scrobble($trackId, $userId, $timeOfPlay) |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | private function scrobble(int $trackId, string $userId, \DateTime $timeOfPlay) : void { |
||
| 40 | } |
||
| 41 | } |
||
| 42 |