Conform to new rules
This commit is contained in:
@@ -7,28 +7,29 @@ use Roots\Sage\Assets\ManifestInterface;
|
||||
* @package Roots\Sage
|
||||
* @author QWp6t
|
||||
*/
|
||||
class Asset {
|
||||
public static $dist = '/dist';
|
||||
class Asset
|
||||
{
|
||||
public static $dist = '/dist';
|
||||
|
||||
/** @var ManifestInterface Currently used manifest */
|
||||
protected $manifest;
|
||||
/** @var ManifestInterface Currently used manifest */
|
||||
protected $manifest;
|
||||
|
||||
protected $asset;
|
||||
protected $asset;
|
||||
|
||||
protected $dir;
|
||||
protected $dir;
|
||||
|
||||
public function __construct($file, ManifestInterface $manifest = null) {
|
||||
$this->manifest = $manifest;
|
||||
$this->asset = basename($file);
|
||||
$this->dir = dirname($file) != '.' ? dirname($file) : '';
|
||||
}
|
||||
public function __construct($file, ManifestInterface $manifest = null) {
|
||||
$this->manifest = $manifest;
|
||||
$this->asset = basename($file);
|
||||
$this->dir = dirname($file) != '.' ? dirname($file) : '';
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
return $this->getUri();
|
||||
}
|
||||
public function __toString() {
|
||||
return $this->getUri();
|
||||
}
|
||||
|
||||
public function getUri() {
|
||||
$file = self::$dist . '/' . $this->dir . '/' . ($this->manifest ? $this->manifest->get($this->asset) : $this->asset);
|
||||
return get_template_directory_uri() . $file;
|
||||
}
|
||||
public function getUri() {
|
||||
$file = ($this->manifest ? $this->manifest->get($this->asset) : $this->asset);
|
||||
return get_template_directory_uri() . self::$dist . '/' . $this->dir . '/' . $file;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user