*/ private const ENGINES = array( 'bing' => array( 'label' => 'Microsoft Bing', 'endpoint' => 'https://www.bing.com/indexnow', ), 'yandex' => array( 'label' => 'Yandex', 'endpoint' => 'https://yandex.com/indexnow', ), 'seznam' => array( 'label' => 'Seznam.cz', 'endpoint' => 'https://search.seznam.cz/indexnow', ), 'naver' => array( 'label' => 'Naver', 'endpoint' => 'https://searchadvisor.naver.com/indexnow', ), 'yep' => array( 'label' => 'Yep (Ahrefs)', 'endpoint' => 'https://indexnow.yep.com/indexnow', ), ); /** * Retrieve engine descriptors as value objects. * * @return array */ public static function all(): array { $engines = array(); foreach ( self::ENGINES as $slug => $data ) { $engines[ $slug ] = new Engine( $slug, $data['label'], $data['endpoint'] ); } return $engines; } /** * Fetch engine descriptor by slug. * * @param string $slug Engine identifier. * @return Engine|null */ public static function get( string $slug ): ?Engine { $all = self::all(); return $all[ $slug ] ?? null; } /** * Default endpoint map keyed by slug. * * @return array */ public static function default_endpoints(): array { $defaults = array(); foreach ( self::ENGINES as $slug => $data ) { $defaults[ $slug ] = $data['endpoint']; } return $defaults; } }