diff --git a/laps.php b/laps.php index 08589e6..5272e6e 100644 --- a/laps.php +++ b/laps.php @@ -15,6 +15,6 @@ if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { require __DIR__ . '/vendor/autoload.php'; } -$laps = new \Rarst\Laps\Laps(); +$laps = new \Rarst\Laps\Plugin(); -$laps->on_load(); +$laps->run(); diff --git a/src/Manager/Toolbar_Manager.php b/src/Manager/Toolbar_Manager.php index cdfafe7..79f5eb7 100644 --- a/src/Manager/Toolbar_Manager.php +++ b/src/Manager/Toolbar_Manager.php @@ -3,15 +3,15 @@ namespace Rarst\Laps\Manager; use Rarst\Laps\Record\Recursive_Record_Iterator; -use Rarst\Laps\Laps; +use Rarst\Laps\Plugin; use Rarst\Laps\Record\Timeline_Iterator; class Toolbar_Manager { - /** @var Laps $laps */ + /** @var Plugin $laps */ protected $laps; - public function __construct( Laps $laps ) { + public function __construct( Plugin $laps ) { $this->laps = $laps; diff --git a/src/Laps.php b/src/Plugin.php similarity index 95% rename from src/Laps.php rename to src/Plugin.php index ed2487b..a02e0c6 100644 --- a/src/Laps.php +++ b/src/Plugin.php @@ -12,7 +12,7 @@ use Rarst\Laps\Provider\Record_Provider; /** * Main plugin's class. */ -class Laps extends Container { +class Plugin extends Container { protected $providers = []; @@ -50,7 +50,7 @@ class Laps extends Container { /** * Start Stopwatch and timing plugin load immediately, then set up core events and needed hooks. */ - public function on_load() { + public function run() { if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { return; diff --git a/src/Provider/Bootable_Provider_Interface.php b/src/Provider/Bootable_Provider_Interface.php index 4fc1aac..6e38124 100644 --- a/src/Provider/Bootable_Provider_Interface.php +++ b/src/Provider/Bootable_Provider_Interface.php @@ -2,9 +2,9 @@ namespace Rarst\Laps\Provider; -use Rarst\Laps\Laps; +use Rarst\Laps\Plugin; interface Bootable_Provider_Interface { - public function boot( Laps $laps ); + public function boot( Plugin $laps ); } diff --git a/src/Provider/Manager_Provider.php b/src/Provider/Manager_Provider.php index 4315ad2..5aa9054 100644 --- a/src/Provider/Manager_Provider.php +++ b/src/Provider/Manager_Provider.php @@ -4,7 +4,7 @@ namespace Rarst\Laps\Provider; use Pimple\Container; use Pimple\ServiceProviderInterface; -use Rarst\Laps\Laps; +use Rarst\Laps\Plugin; use Rarst\Laps\Manager\Asset_Manager; use Rarst\Laps\Manager\Load_Order_Manager; use Rarst\Laps\Manager\Toolbar_Manager; @@ -13,7 +13,7 @@ class Manager_Provider implements ServiceProviderInterface, Bootable_Provider_In public function register( Container $pimple ) { - $pimple['managers'] = function ( Laps $laps ) { + $pimple['managers'] = function ( Plugin $laps ) { return [ new Load_Order_Manager(), new Asset_Manager(), @@ -22,7 +22,7 @@ class Manager_Provider implements ServiceProviderInterface, Bootable_Provider_In }; } - public function boot( Laps $laps ) { + public function boot( Plugin $laps ) { $laps['managers']; } } diff --git a/src/Provider/Record_Provider.php b/src/Provider/Record_Provider.php index 2802132..478d065 100644 --- a/src/Provider/Record_Provider.php +++ b/src/Provider/Record_Provider.php @@ -4,7 +4,7 @@ namespace Rarst\Laps\Provider; use Pimple\Container; use Pimple\ServiceProviderInterface; -use Rarst\Laps\Laps; +use Rarst\Laps\Plugin; use Rarst\Laps\Record\Hook_Record_Collector; use Rarst\Laps\Record\Http_Record_Collector; use Rarst\Laps\Record\Record_Collector_Interface; @@ -19,7 +19,7 @@ class Record_Provider implements ServiceProviderInterface, Bootable_Provider_Int return new Stopwatch(); } ); - $pimple['collectors'] = function ( Laps $laps ) { + $pimple['collectors'] = function ( Plugin $laps ) { return [ 'hook' => new Hook_Record_Collector( $laps['hook.events'], $laps['stopwatch'] ), 'http' => new Http_Record_Collector( $laps['stopwatch'] ), @@ -27,7 +27,7 @@ class Record_Provider implements ServiceProviderInterface, Bootable_Provider_Int ]; }; - $pimple['records'] = function ( Laps $laps ) { + $pimple['records'] = function ( Plugin $laps ) { $records = []; @@ -40,7 +40,7 @@ class Record_Provider implements ServiceProviderInterface, Bootable_Provider_Int }; } - public function boot( Laps $laps ) { + public function boot( Plugin $laps ) { $laps['collectors']; } }