<commit_before><?php namespace System\Libraries;

use File;
use Html;
use System\Traits\CombinesAssets;

/**
 * Assets Class
 **
 * Within controllers, widgets, components and views, use facade:
 *   Assets::addCss($path, $options);
 *   Assets::addJs($path, $options);
 * @package System
 */
class Assets
{
    use CombinesAssets;

    protected static $registeredPaths = [];

    protected static $registeredCallback = [];

    protected $assets = ['icon' => [], 'meta' => [], 'js' => [], 'css' => []];

    public function __construct()
    {
        $this->initialize();
    }

    public function initialize()
    {
        static::$registeredPaths[] = base_path();

        $this->initCombiner();

        foreach (self::$registeredCallback as $callback) {
            $callback($this);
        }
    }

    public static function registerCallback(callable $callback)
    {
        static::$registeredCallback[] = $callback;
    }

    /**
     * Set the default assets paths.
     *
     * @param  string $path
     *
     * @return void
     */
    public function registerSourcePath($path)
    {
        static::$registeredPaths[] = $path;
    }

    public function addFromManifest($path)
    {
        $assetsConfigPath = base_path().$this->getAssetPath($path);
        $content = json_decode(File::get($assetsConfigPath), TRUE);
        if ($bundles = array_get($content, 'bundles')) {
            foreach ($bundles as $bundle) {
                $this->registerBundle(
                    array_get($bundle, 'type'),
                    array_get($bundle, 'files'),
                    array_get($bundle, 'destination')
                );
            }
        }

        $this->addTags(array_except($content, 'bundles'));
    }

    public function addTags(array $tags = [])<commit_msg>Fix issue where theme assets manifest file doesn’t exist<commit_after><?php namespace System\Libraries;

use File;
use Html;
use System\Traits\CombinesAssets;

/**
 * Assets Class
 **
 * Within controllers, widgets, components and views, use facade:
 *   Assets::addCss($path, $options);
 *   Assets::addJs($path, $options);
 * @package System
 */
class Assets
{
    use CombinesAssets;

    protected static $registeredPaths = [];

    protected static $registeredCallback = [];

    protected $assets = ['icon' => [], 'meta' => [], 'js' => [], 'css' => []];

    public function __construct()
    {
        $this->initialize();
    }

    public function initialize()
    {
        static::$registeredPaths[] = base_path();

        $this->initCombiner();

        foreach (self::$registeredCallback as $callback) {
            $callback($this);
        }
    }

    public static function registerCallback(callable $callback)
    {
        static::$registeredCallback[] = $callback;
    }

    /**
     * Set the default assets paths.
     *
     * @param  string $path
     *
     * @return void
     */
    public function registerSourcePath($path)
    {
        static::$registeredPaths[] = $path;
    }

    public function addFromManifest($path)
    {
        $assetsConfigPath = base_path().$this->getAssetPath($path);
        if (!File::exists($assetsConfigPath))
            return FALSE;

        $content = json_decode(File::get($assetsConfigPath), TRUE);
        if ($bundles = array_get($content, 'bundles')) {
            foreach ($bundles as $bundle) {
                $this->registerBundle(
                    array_get($bundle, 'type'),
                    array_get($bundle, 'files'),
                    array_get($bundle, 'destination')
                );
            }
        }

        $this->addTags(array_except($content, 'bundles'));
    }

    public function addTags(array $tags = [])
{'fraction_non_alphanumeric': 0.14324178782983307, 'fraction_numerical': 0.0, 'mean_word_length': 2.3468468468468466, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2466351', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1025, 'n_words': 226}