File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -307,7 +307,7 @@ public function get_post( $id ) {
307307 *
308308 * @param array $params The parameters to filter by ([ 'provider' => 'provider_id' ] etc).
309309 *
310- * @return array< \Progress_Planner\Suggested_Tasks\Task>
310+ * @return \Progress_Planner\Suggested_Tasks\Task[]
311311 */
312312 public function get_tasks_by ( $ params ) {
313313 $ args = [];
@@ -353,7 +353,7 @@ public function get_tasks_by( $params ) {
353353 *
354354 * @param array $args The arguments.
355355 *
356- * @return array< \Progress_Planner\Suggested_Tasks\Task>
356+ * @return \Progress_Planner\Suggested_Tasks\Task[]
357357 */
358358 public function get ( $ args = [] ) {
359359 $ args = \wp_parse_args (
Original file line number Diff line number Diff line change @@ -351,11 +351,7 @@ public function register_post_type() {
351351 * @return int
352352 */
353353 public function change_trashed_posts_lifetime ( $ days , $ post ) {
354- if ( 'prpl_recommendations ' === $ post ->post_type ) {
355- return 60 ;
356- }
357-
358- return $ days ;
354+ return 'prpl_recommendations ' === $ post ->post_type ? 60 : $ days ;
359355 }
360356
361357 /**
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ public function inject_tasks() {
210210 /**
211211 * Evaluate tasks stored in the option.
212212 *
213- * @return array< \Progress_Planner\Suggested_Tasks\Task>
213+ * @return \Progress_Planner\Suggested_Tasks\Task[]
214214 */
215215 public function evaluate_tasks (): array {
216216 $ tasks = (array ) \progress_planner ()->get_suggested_tasks_db ()->get_tasks_by ( [ 'post_status ' => 'publish ' ] );
Original file line number Diff line number Diff line change @@ -67,11 +67,9 @@ protected function is_specific_task_completed( $task_id ) {
6767
6868 $ task_data = $ tasks [0 ]->get_data ();
6969
70- if ( isset ( $ task_data ['is_completed_callback ' ] ) && is_callable ( $ task_data ['is_completed_callback ' ] ) ) {
71- return call_user_func ( $ task_data ['is_completed_callback ' ], $ task_id );
72- }
73-
74- return false ;
70+ return isset ( $ task_data ['is_completed_callback ' ] ) && is_callable ( $ task_data ['is_completed_callback ' ] )
71+ ? call_user_func ( $ task_data ['is_completed_callback ' ], $ task_id )
72+ : false ;
7573 }
7674
7775 /**
@@ -82,7 +80,6 @@ protected function is_specific_task_completed( $task_id ) {
8280 * @return array
8381 */
8482 public function get_task_details ( $ task_data = [] ) {
85-
8683 $ tasks = \progress_planner ()->get_settings ()->get ( 'tasks ' , [] );
8784
8885 foreach ( $ tasks as $ task ) {
You can’t perform that action at this time.
0 commit comments