@@ -22,11 +22,11 @@ discard block |
||
| 22 | 22 | private $cat_data; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * Constructor. |
|
| 26 | - * |
|
| 27 | - * @param \phpbb\config\config $config Config object |
|
| 28 | - * @param \ernadoo\phpbbdirectory\core\cron $directory_cron PhpBB Directory extension link object |
|
| 29 | - */ |
|
| 25 | + * Constructor. |
|
| 26 | + * |
|
| 27 | + * @param \phpbb\config\config $config Config object |
|
| 28 | + * @param \ernadoo\phpbbdirectory\core\cron $directory_cron PhpBB Directory extension link object |
|
| 29 | + */ |
|
| 30 | 30 | public function __construct(\phpbb\config\config $config, \ernadoo\phpbbdirectory\core\cron $directory_cron) |
| 31 | 31 | { |
| 32 | 32 | $this->config = $config; |
@@ -34,66 +34,66 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * Manually set categorie data. |
|
| 38 | - * |
|
| 39 | - * @param array $cat_data Information about a category to be pruned. |
|
| 40 | - */ |
|
| 37 | + * Manually set categorie data. |
|
| 38 | + * |
|
| 39 | + * @param array $cat_data Information about a category to be pruned. |
|
| 40 | + */ |
|
| 41 | 41 | public function set_categorie_data($cat_data) |
| 42 | 42 | { |
| 43 | 43 | $this->cat_data = $cat_data; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | - * Runs this cron task. |
|
| 48 | - * |
|
| 49 | - * @return null |
|
| 50 | - */ |
|
| 47 | + * Runs this cron task. |
|
| 48 | + * |
|
| 49 | + * @return null |
|
| 50 | + */ |
|
| 51 | 51 | public function run() |
| 52 | 52 | { |
| 53 | 53 | $this->dir_cron->auto_check($this->cat_data); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * Returns whether this cron task can run, given current board configuration. |
|
| 58 | - * |
|
| 59 | - * @return bool |
|
| 60 | - */ |
|
| 57 | + * Returns whether this cron task can run, given current board configuration. |
|
| 58 | + * |
|
| 59 | + * @return bool |
|
| 60 | + */ |
|
| 61 | 61 | public function is_runnable() |
| 62 | 62 | { |
| 63 | 63 | return !$this->config['use_system_cron'] && !empty($this->cat_data); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | - * Returns whether this cron task should run now, because enough time |
|
| 68 | - * has passed since it was last run. |
|
| 69 | - * |
|
| 70 | - * @return bool |
|
| 71 | - */ |
|
| 67 | + * Returns whether this cron task should run now, because enough time |
|
| 68 | + * has passed since it was last run. |
|
| 69 | + * |
|
| 70 | + * @return bool |
|
| 71 | + */ |
|
| 72 | 72 | public function should_run() |
| 73 | 73 | { |
| 74 | 74 | return $this->cat_data['cat_cron_enable'] && $this->cat_data['cat_cron_next'] < time(); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | - * Returns parameters of this cron task as an array. |
|
| 79 | - * The array has one key, c, whose value is id of the category to be pruned. |
|
| 80 | - * |
|
| 81 | - * @return array |
|
| 82 | - */ |
|
| 78 | + * Returns parameters of this cron task as an array. |
|
| 79 | + * The array has one key, c, whose value is id of the category to be pruned. |
|
| 80 | + * |
|
| 81 | + * @return array |
|
| 82 | + */ |
|
| 83 | 83 | public function get_parameters() |
| 84 | 84 | { |
| 85 | 85 | return array('c' => $this->cat_data['cat_id']); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | - * Parses parameters found in $request, which is an instance of |
|
| 90 | - * \phpbb\request\request_interface. |
|
| 91 | - * |
|
| 92 | - * It is expected to have a key f whose value is id of the forum to be pruned. |
|
| 93 | - * |
|
| 94 | - * @param \phpbb\request\request_interface $request Request object. |
|
| 95 | - * @return null |
|
| 96 | - */ |
|
| 89 | + * Parses parameters found in $request, which is an instance of |
|
| 90 | + * \phpbb\request\request_interface. |
|
| 91 | + * |
|
| 92 | + * It is expected to have a key f whose value is id of the forum to be pruned. |
|
| 93 | + * |
|
| 94 | + * @param \phpbb\request\request_interface $request Request object. |
|
| 95 | + * @return null |
|
| 96 | + */ |
|
| 97 | 97 | public function parse_parameters(\phpbb\request\request_interface $request) |
| 98 | 98 | { |
| 99 | 99 | $this->cat_data = array(); |