<?php

/**
 * Simple autoloader
 */
final class Flex_Autoloader
{
    public static function load()
    {
        //require abstract
        self::require_abstract();

        //register classes
       self::register();

        //enable metaboxes
        (new Stylekit)->action();
        (new Preloadfonts)->action();

    }

    public static function register()
    {
        $classes = [
          'stylekit',
          'preloadfonts'
        ];
        foreach ($classes as $class) {
            $file = plugin_dir_path(__FILE__) .  "/$class.php";
            if (file_exists($file)) {
                require $file;
            }
        }
    }

    private static function require_abstract() {
        require_once plugin_dir_path(dirname(__FILE__)) . '/abstracts/metabox.php';
    }
}
