<?php

/**
 * The theme info module.
 *
 * @package northmill-online-shared
 *
 * @phpcs:disable Squiz.Commenting.FunctionComment.MissingParamTag
 */
declare (strict_types=1);
namespace Northmill_Online_Shared_Sync\Northmill_Online_Shared\Modules\Info;

use Northmill_Online_Shared_Sync\Northmill_Online_Shared\Abstract_Shared_Base;
use Northmill_Online_Shared_Sync\Northmill_Online_Shared\Modules\Info\Models\Info_Paths_Model;
defined('ABSPATH') || exit;
/**
 * The theme info module.
 */
class Theme_Info_Module extends Abstract_Package_Info_Module
{
    /**
     * {@inheritDoc}
     */
    protected function create_paths_model(string $package_file_path): Info_Paths_Model
    {
        return new Info_Paths_Model(get_stylesheet_directory_uri() . '/', get_stylesheet_directory() . '/');
    }
    /**
     * {@inheritDoc}
     */
    public function get_slug(): string
    {
        if (!isset($this->slug)) {
            $this->slug = get_stylesheet();
        }
        return $this->slug;
    }
    /**
     * {@inheritDoc}
     */
    public function is_plugin(): bool
    {
        return \false;
    }
    /**
     * {@inheritDoc}
     */
    public static function get_package_data(string $file_path, bool $should_translate = \false): array
    {
        return get_file_data($file_path, array('Version' => 'Version', 'Name' => 'Theme Name'));
    }
    /**
     * {@inheritDoc}
     */
    protected static function get_package_name(): string
    {
        $theme_data = self::get_package_data(Abstract_Shared_Base::base_instance()->get_package_file_path());
        return $theme_data['Name'];
    }
}
