<commit_before><?php

namespace Aphet;

use Assetic\AssetWriter;
use Assetic\Factory\LazyAssetManager;
use Assetic\Factory\AssetFactory;
use Assetic\Asset\AssetCollection;

class Manager
{

    private $cache = null;
    private $cache_updated = false;
    private $loader;
    public $settings = array();


    private function __construct(array $settings)
    {

        $this->settings = array_merge(array(
            'modes' => Modes::DEV,
            'assets_paths' => array(),
            'compiled_dir' => 'assets',
            'web_path' => ''
        ), $settings);

        if(substr($this->settings['web_path'],0,1) === '/') {
            $this->settings['web_path'] = substr($this->settings['web_path'], 1);
        }

        if(isset($settings['public_path'])) $this->settings['public_path'] = $settings['public_path'];

        if( !isset($settings['public_path']) || !file_exists($settings['public_path']) ) {
            throw new Exceptions\PublicPathNotFoundException("public path {$settings['public_path']} not found");
        }
        if( !is_writable($settings['public_path']) && !is_writable($settings['public_path'] .'/'. $this->settings['web_path'])) {
            throw new Exceptions\PublicPathNotWritableException("Can't write in public path {$settings['public_path']}");
        }

        if( !isset($this->settings['cache_file']) ) {
            $this->settings['cache_file'] = implode( DIRECTORY_SEPARATOR, array(
                $this->settings['public_path'],
                $this->settings['web_path'],
                'cache.php'
            ));<commit_msg>fix test writable<commit_after><?php

namespace Aphet;

use Assetic\AssetWriter;
use Assetic\Factory\LazyAssetManager;
use Assetic\Factory\AssetFactory;
use Assetic\Asset\AssetCollection;

class Manager
{

    private $cache = null;
    private $cache_updated = false;
    private $loader;
    public $settings = array();


    private function __construct(array $settings)
    {

        $this->settings = array_merge(array(
            'modes' => Modes::DEV,
            'assets_paths' => array(),
            'compiled_dir' => 'assets',
            'web_path' => ''
        ), $settings);

        if(substr($this->settings['web_path'],0,1) === '/') {
            $this->settings['web_path'] = substr($this->settings['web_path'], 1);
        }

        if(isset($settings['public_path'])) $this->settings['public_path'] = $settings['public_path'];

        if( !isset($settings['public_path']) || !file_exists($settings['public_path']) ) {
            throw new Exceptions\PublicPathNotFoundException("public path {$settings['public_path']} not found");
        }
        if( !is_writable($settings['public_path']) && !is_writable($settings['public_path'] .'/'. $this->settings['compiled_dir'])) {
            throw new Exceptions\PublicPathNotWritableException("Can't write in public path {$settings['public_path']}");
        }

        if( !isset($this->settings['cache_file']) ) {
            $this->settings['cache_file'] = implode( DIRECTORY_SEPARATOR, array(
                $this->settings['public_path'],
                $this->settings['web_path'],
                'cache.php'
            ));
{'fraction_non_alphanumeric': 0.1655215490318551, 'fraction_numerical': 0.0018738288569643974, 'mean_word_length': 2.9887920298879203, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '3898204', 'n_tokens_mistral': 943, 'n_tokens_neox': 901, 'n_words': 154}