public function get (Asset $asset) : Asset
    {
        $cache = $this->locator->get(AssetsCache::class);
        $cachedAsset = $cache->get($asset);

        if (null !== $cachedAsset)
        {
            return $cachedAsset;
        }

        return $this->addAsset($asset);
    }
public function get (Asset $asset) : Asset
    {
        $cache = $this->locator->get(AssetsCache::class);
        $cachedAsset = $cache->get($asset);

        if (null !== $cachedAsset)
        {
            return $cachedAsset;
        }

        return $this->addAsset($asset);
    }
public function get ( Asset $ asset ) : Asset { $ cache = $ this -> locator -> get ( AssetsCache :: class ) ; $ cachedAsset = $ cache -> get ( $ asset ) ; if ( null !== $ cachedAsset ) { return $ cachedAsset ; } return $ this -> addAsset ( $ asset ) ; }
Gets the asset from the cache and adds it, if it is missing

@param string $assetPath
@return Asset
@throws AssetsException
Gets the asset from the cache and adds it if it is missing