new CheckboxType(), 'choice' => new ChoiceType(), 'text' => new TextType(), 'tip' => new TipType(), ); } /** * Filters the registered extra types. * * Hook: `extrova_register_extra_types` ( array $types ): array — `slug => ExtraTypeInterface`. * * @since 1.0.0 */ protected function filter_name(): string { return 'extrova_register_extra_types'; } /** * {@inheritDoc} * * @param mixed $item Item. */ protected function accepts( mixed $item ): bool { return $item instanceof ExtraTypeInterface; } /** * Type by slug. * * @param string $slug Slug. */ public function get( string $slug ): ?ExtraTypeInterface { return $this->all()[ $slug ] ?? null; } }