<?php

namespace SmashBalloon\YoutubeFeed\Vendor\Smashballoon\Framework\Utilities\PlatformTracking\Platforms;

class WPEngine implements PlatformInterface
{
    /**
     * @inheritDoc
     */
    public function register()
    {
        add_filter('sb_hosting_platform', [$this, 'filter_sb_hosting_platform']);
    }
    /**
     * @inheritDoc
     */
    public function filter_sb_hosting_platform($platform)
    {
        if (method_exists('SmashBalloon\YoutubeFeed\Vendor\WpeCommon', 'get_wpe_auth_cookie_value') && !empty(\SmashBalloon\YoutubeFeed\Vendor\WpeCommon::get_wpe_auth_cookie_value())) {
            $platform = 'wpengine';
        }
        return $platform;
    }
}
