src/Asset/Factory.php
public function add(string $handle, string $path, array $dependencies = [], $version = null, $arg = null)
    {
        if (empty($handle) || empty($path)) {
            throw new \InvalidArgumentException('The asset instance expects a handle name and a path or URL.');
        }

        return (new Asset($this->finder->find($path), $this->action, $this->filter, $this->html))
            ->setHandle($handle)
            ->setDependencies($dependencies)
            ->setVersion($version)
            ->setArgument($arg);
    }
public function add(string $handle, string $path, array $dependencies = [], $version = null, $arg = null)
    {
        if (empty($handle) || empty($path)) {
            throw new \InvalidArgumentException('The asset instance expects a handle name and a path or URL.');
        }

        return (new Asset($this->finder->find($path), $this->action, $this->filter, $this->html))
            ->setHandle($handle)
            ->setDependencies($dependencies)
            ->setVersion($version)
            ->setArgument($arg);
    }
public function add ( string $ handle , string $ path , array $ dependencies = [ ] , $ version = null , $ arg = null ) { if ( empty ( $ handle ) || empty ( $ path ) ) { throw new \ InvalidArgumentException ( 'The asset instance expects a handle name and a path or URL.' ) ; } return ( new Asset ( $ this -> finder -> find ( $ path ) , $ this -> action , $ this -> filter , $ this -> html ) ) -> setHandle ( $ handle ) -> setDependencies ( $ dependencies ) -> setVersion ( $ version ) -> setArgument ( $ arg ) ; }
Create and return an Asset instance.

@param string           $handle
@param string           $path
@param array            $dependencies
@param null|string|bool $version
@param null|string|bool $arg

@throws AssetException

@return AssetInterface
Create and return an Asset instance .