<commit_before><?php

namespace Neptune\Assets;

use Neptune\Service\AbstractModule;

use Neptune\Routing\Router;
use Neptune\Core\Neptune;
use Neptune\Controller\AssetsController;

/**
 * AssetsModule
 *
 * @author <NAME> <<EMAIL>>
 **/
class AssetsModule extends AbstractModule
{

    public function register(Neptune $neptune)
    {
        $neptune['assets.url'] = function ($neptune) {
            $url =  $neptune['config']->getRequired('assets.url');
            //add a slash if the given url doesn't end with one
            if (substr($url, -1, 1) !== '/') {
                $url .= '/';
            }

            return $url;
        };

        $neptune['assets'] = function ($neptune) {
            $url = $neptune['url']->to($neptune['assets.url']);
            $cache_bust = $neptune['config']->getRequired('assets.cache_bust');

            return new AssetManager($neptune['config.manager'], new TagGenerator($url, $cache_bust));
        };

        $neptune['controller.assets'] = function ($neptune) {
            return new AssetsController($neptune);
        };<commit_msg>Removing requirement of cache_bust in assets config.<commit_after><?php

namespace Neptune\Assets;

use Neptune\Service\AbstractModule;

use Neptune\Routing\Router;
use Neptune\Core\Neptune;
use Neptune\Controller\AssetsController;

/**
 * AssetsModule
 *
 * @author <NAME> <<EMAIL>>
 **/
class AssetsModule extends AbstractModule
{

    public function register(Neptune $neptune)
    {
        $neptune['assets.url'] = function ($neptune) {
            $url =  $neptune['config']->getRequired('assets.url');
            //add a slash if the given url doesn't end with one
            if (substr($url, -1, 1) !== '/') {
                $url .= '/';
            }

            return $url;
        };

        $neptune['assets'] = function ($neptune) {
            $url = $neptune['url']->to($neptune['assets.url']);
            $cache_bust = $neptune['config']->get('assets.cache_bust', false);

            return new AssetManager($neptune['config.manager'], new TagGenerator($url, $cache_bust));
        };

        $neptune['controller.assets'] = function ($neptune) {
            return new AssetsController($neptune);
        };
{'fraction_non_alphanumeric': 0.1561938958707361, 'fraction_numerical': 0.0017953321364452424, 'mean_word_length': 2.555023923444976, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '3934758', 'n_tokens_mistral': 708, 'n_tokens_neox': 691, 'n_words': 137}