1 | <?php |
||
16 | class Plugin extends PluginBase |
||
17 | { |
||
18 | const DEFAULT_ICON = 'icon-clock-o'; |
||
19 | |||
20 | const LOCALIZATION_KEY = 'ginopane.blogtimetoread::lang.'; |
||
21 | |||
22 | /** |
||
23 | * @var array Require some plugins |
||
24 | */ |
||
25 | public $require = [ |
||
26 | 'RainLab.Blog', |
||
27 | 'RainLab.Translate' |
||
28 | ]; |
||
29 | |||
30 | /** @var TimeToRead */ |
||
31 | private $helper; |
||
32 | |||
33 | /** |
||
34 | * Returns information about this plugin |
||
35 | * |
||
36 | * @return array |
||
|
|||
37 | */ |
||
38 | public function pluginDetails() |
||
48 | |||
49 | /** |
||
50 | * Boot method, called right before the request route |
||
51 | */ |
||
52 | public function boot() |
||
59 | |||
60 | /** |
||
61 | * Register components |
||
62 | * |
||
63 | * @return array |
||
64 | */ |
||
65 | public function registerComponents() |
||
71 | |||
72 | /** |
||
73 | * Register plugin settings |
||
74 | * |
||
75 | * @return array |
||
76 | */ |
||
77 | public function registerSettings(){ |
||
89 | |||
90 | /** |
||
91 | * @return array |
||
92 | */ |
||
93 | public function registerMarkupTags() |
||
101 | |||
102 | /** |
||
103 | * @param $text |
||
104 | * @param null $speed |
||
105 | * @param null $roundingEnabled |
||
106 | * |
||
107 | * @return int |
||
108 | */ |
||
109 | public function getTimeToRead($text, $speed = null, $roundingEnabled = null) |
||
119 | |||
120 | /** |
||
121 | * Extend RainLab Post model |
||
122 | */ |
||
123 | private function extendModel() |
||
131 | } |
||
132 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.