PluginProbe
Simple Analytics / 1.98
Simple Analytics v1.98
1.109 1.108 1.107 1.106 1.73 1.74 1.75 1.76 1.77 1.78 1.79 1.8 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.9 1.90 1.91 All 98 releases
simpleanalytics / src / PluginLifecycle.php

PluginLifecycle.php in Simple Analytics 1.98, at src/PluginLifecycle.php

27 lines 685 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SimpleAnalytics;
4
5 trait PluginLifecycle
6 {
7 public function boot(): void
8 {
9 $this->onBoot();
10 add_action('init', \Closure::fromCallable([$this, 'onInit']));
11 register_activation_hook(ENTRYPOINT_FILE, \Closure::fromCallable([$this, 'onActivation']));
12 register_deactivation_hook(ENTRYPOINT_FILE, \Closure::fromCallable([$this, 'onUninstall']));
13 }
14
15 /** @internal */
16 abstract protected function onBoot(): void;
17
18 /** @internal */
19 abstract public function onInit(): void;
20
21 /** @internal */
22 abstract public function onActivation(): void;
23
24 /** @internal */
25 abstract public function onUninstall(): void;
26 }
27