Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| AssetManager | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| assetManager | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| styles | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| scripts | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Hyde\Framework\Concerns\Internal; |
| 4 | |
| 5 | use Hyde\Framework\Contracts\AssetServiceContract; |
| 6 | |
| 7 | /** |
| 8 | * Offloads asset related methods for the Hyde Facade. |
| 9 | * |
| 10 | * @see \Hyde\Framework\Hyde |
| 11 | */ |
| 12 | trait AssetManager |
| 13 | { |
| 14 | /** |
| 15 | * Get the asset service instance. |
| 16 | * |
| 17 | * @return \Hyde\Framework\Contracts\AssetServiceContract |
| 18 | */ |
| 19 | public static function assetManager(): AssetServiceContract |
| 20 | { |
| 21 | return app(AssetServiceContract::class); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Return the Hyde stylesheet. |
| 26 | */ |
| 27 | public static function styles(): string |
| 28 | { |
| 29 | return static::assetManager()->stylePath(); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Return the Hyde scripts. |
| 34 | */ |
| 35 | public static function scripts(): string |
| 36 | { |
| 37 | return static::assetManager()->scriptPath(); |
| 38 | } |
| 39 | } |