src/Utility/AssetsCreator.php
public function create()
    {
        $File = new File($this->path());

        if (!$File->readable()) {
            $minifier = $this->type === 'css' ? new Minify\CSS() : new Minify\JS();
            array_map([$minifier, 'add'], $this->paths);

            //Writes the file
            $success = $File->write($minifier->minify());
            is_true_or_fail($success, __d('assets', 'Failed to create file {0}', rtr($this->path())));
        }

        return $this->filename();
    }
public function create()
    {
        $File = new File($this->path());

        if (!$File->readable()) {
            $minifier = $this->type === 'css' ? new Minify\CSS() : new Minify\JS();
            array_map([$minifier, 'add'], $this->paths);

            //Writes the file
            $success = $File->write($minifier->minify());
            is_true_or_fail($success, __d('assets', 'Failed to create file {0}', rtr($this->path())));
        }

        return $this->filename();
    }
public function create ( ) { $ File = new File ( $ this -> path ( ) ) ; if ( ! $ File -> readable ( ) ) { $ minifier = $ this -> type === 'css' ? new Minify \ CSS ( ) : new Minify \ JS ( ) ; array_map ( [ $ minifier , 'add' ] , $ this -> paths ) ; //Writes the file $ success = $ File -> write ( $ minifier -> minify ( ) ) ; is_true_or_fail ( $ success , __d ( 'assets' , 'Failed to create file {0}' , rtr ( $ this -> path ( ) ) ) ) ; } return $ this -> filename ( ) ; }
Creates the asset
@return string
@throws RuntimeException
@uses filename()
@uses path()
@uses $paths
@uses $type
Creates the asset