1 | <?php |
||
17 | class TimeToRead extends ComponentBase |
||
18 | { |
||
19 | const NAME = 'timeToRead'; |
||
20 | |||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | private $readingSpeed; |
||
25 | |||
26 | /** |
||
27 | * @var bool |
||
28 | */ |
||
29 | private $isRoundingUpEnabled; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $postSlug; |
||
35 | |||
36 | /** |
||
37 | * @var int |
||
38 | */ |
||
39 | public $minutes; |
||
40 | |||
41 | /** |
||
42 | * Returns information about this component, including name and description. |
||
43 | */ |
||
44 | public function componentDetails() |
||
51 | |||
52 | /** |
||
53 | * Component Properties |
||
54 | * @return array |
||
|
|||
55 | */ |
||
56 | public function defineProperties() |
||
84 | |||
85 | /** |
||
86 | * Query the tag and posts belonging to it |
||
87 | */ |
||
88 | public function onRun() |
||
94 | |||
95 | /** |
||
96 | * Prepare variables |
||
97 | * |
||
98 | * @return void |
||
99 | */ |
||
100 | private function prepareVars() |
||
106 | |||
107 | /** |
||
108 | * @return void |
||
109 | */ |
||
110 | private function calculateReadingTime() |
||
127 | } |
||
128 |
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.