public function add(array $assets)
    {
        if (! file_exists($this->file)) {
            throw new RuntimeException("Could not add assets, `app.json` file do not exists.");
        }

        $packages = json_decode(file_get_contents($this->file), true);

        $packages['assets'] = $assets + $packages['assets'];

        ksort($packages['assets']);

        file_put_contents($this->file, json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL);
    }
public function add(array $assets)
    {
        if (! file_exists($this->file)) {
            throw new RuntimeException("Could not add assets, `app.json` file do not exists.");
        }

        $packages = json_decode(file_get_contents($this->file), true);

        $packages['assets'] = $assets + $packages['assets'];

        ksort($packages['assets']);

        file_put_contents($this->file, json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL);
    }
public function add ( array $ assets ) { if ( ! file_exists ( $ this -> file ) ) { throw new RuntimeException ( "Could not add assets, `app.json` file do not exists." ) ; } $ packages = json_decode ( file_get_contents ( $ this -> file ) , true ) ; $ packages [ 'assets' ] = $ assets + $ packages [ 'assets' ] ; ksort ( $ packages [ 'assets' ] ) ; file_put_contents ( $ this -> file , json_encode ( $ packages , JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT ) . PHP_EOL ) ; }
Adds additional entries to the `assets` option.

@param array $assets
@return void
Adds additional entries to the assets option .