| @@ -27,38 +27,18 @@ | ||
| 27 | 27 | |
| 28 | 28 | /** @var array<string, FollowUpAdapterInterface> */ |
| 29 | 29 | private $adapters = array(); |
| 30 | 30 | |
| 31 | - /** @var array<string, GlobalFollowUpAdapterInterface> */ | |
| 32 | - private $globals = array(); | |
| 33 | - | |
| 34 | 31 | /** @var bool */ |
| 35 | 32 | private $hookFired = false; |
| 36 | 33 | |
| 37 | 34 | public function register( FollowUpAdapterInterface $adapter ): void { |
| 38 | - if ( $adapter instanceof GlobalFollowUpAdapterInterface ) { | |
| 39 | - $this->globals[ $adapter->getIntegration() ] = $adapter; | |
| 40 | - return; | |
| 41 | - } | |
| 42 | 35 | $this->adapters[ $adapter->getIntegration() ] = $adapter; |
| 43 | 36 | } |
| 44 | 37 | |
| 45 | - /** | |
| 46 | - * Form or global adapter by the integration stored on a row. | |
| 47 | - */ | |
| 48 | 38 | public function get( string $integration ): ?FollowUpAdapterInterface { |
| 49 | 39 | $this->fireHookOnce(); |
| 50 | - return $this->adapters[ $integration ] ?? $this->globals[ $integration ] ?? null; | |
| 51 | - } | |
| 52 | - | |
| 53 | - /** | |
| 54 | - * Adapters that follow up every opt-in (since 5.8.0). | |
| 55 | - * | |
| 56 | - * @return array<string, GlobalFollowUpAdapterInterface> | |
| 57 | - */ | |
| 58 | - public function globals(): array { | |
| 59 | - $this->fireHookOnce(); | |
| 60 | - return $this->globals; | |
| 40 | + return $this->adapters[ $integration ] ?? null; | |
| 61 | 41 | } |
| 62 | 42 | |
| 63 | 43 | /** |
| 64 | 44 | * Find the adapter responsible for an opt-in. |