PluginProbe
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution / 1.5.0
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution v1.5.0
2.0.1 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.9.0 2.0.0
solid-performance / src / Performance / Assets / Provider.php

Provider.php in Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution 1.5.0, at src/Performance/Assets/Provider.php

36 lines 811 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Registers asset related functionality in the container.
4 *
5 * @package SolidWP\Performance
6 */
7
8 declare( strict_types=1 );
9
10 namespace SolidWP\Performance\Assets;
11
12 use SolidWP\Performance\Contracts\Service_Provider;
13 use SolidWP\Performance\Core;
14
15 /**
16 * Registers asset related functionality in the container.
17 *
18 * @package SolidWP\Performance
19 */
20 final class Provider extends Service_Provider {
21
22 /**
23 * @inheritDoc
24 */
25 public function register(): void {
26 $this->container->when( Asset::class )
27 ->needs( '$plugin_url' )
28 ->give( static fn( $c ) => $c->get( Core::PLUGIN_URL ) );
29 $this->container->when( Asset::class )
30 ->needs( '$plugin_dir' )
31 ->give( static fn( $c ) => $c->get( Core::PLUGIN_DIR ) );
32
33 $this->container->singleton( Asset::class, Asset::class );
34 }
35 }
36