<?php

if (! defined('ABSPATH')) {
    exit;
}

use PluginsNameSpaces\App;

if (! function_exists('__SNAKE_NAME___app')) {
    /**
     * Resolve something out of the container, or get the container.
     *
     * @param string|null $abstract
     * @return mixed
     */
    function __SNAKE_NAME___app($abstract = null)
    {
        return App::make($abstract);
    }
}

if (! function_exists('__SNAKE_NAME___config')) {
    /**
     * Get a configuration value using dot notation.
     *
     * @param string|null $key
     * @param mixed       $default
     * @return mixed
     */
    function __SNAKE_NAME___config($key = null, $default = null)
    {
        return App::config($key, $default);
    }
}

if (! function_exists('__SNAKE_NAME___view')) {
    /**
     * Render a view file from app/Views.
     *
     * @param string $name View name without extension.
     * @param array  $data Variables made available to the view.
     * @return void
     */
    function __SNAKE_NAME___view($name, array $data = [])
    {
        $path = __CONST_PREFIX___PATH . 'app/Views/' . $name . '.php';

        if (file_exists($path)) {
            extract($data, EXTR_SKIP);
            include $path;
        }
    }
}
