From fdb28fde5ae8ce77b4c2bc6aa71ff003078ba705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Mon, 3 Sep 2018 04:01:27 +0200 Subject: [PATCH] Fix PHPDoc errors --- includes/class.ssc_admin.php | 11 +++++++---- includes/class.ssc_rest.php | 26 ++++++++++++++------------ includes/class.ssc_settings.php | 21 ++++++++++++--------- includes/ssc_helpers.php | 5 ++++- 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/includes/class.ssc_admin.php b/includes/class.ssc_admin.php index d9f56c1..259019a 100644 --- a/includes/class.ssc_admin.php +++ b/includes/class.ssc_admin.php @@ -108,10 +108,13 @@ function tiny_mce_add_buttons($plugins){ return $plugins; } - /** - * Register the new TinyMCE Button - * @return mixed - */ + /** + * Register the new TinyMCE Button + * + * @param $buttons + * + * @return mixed + */ function tiny_mce_register_buttons($buttons){ $newBtns = array( 'sscaddformbutton', diff --git a/includes/class.ssc_rest.php b/includes/class.ssc_rest.php index c159d08..7f1bef7 100644 --- a/includes/class.ssc_rest.php +++ b/includes/class.ssc_rest.php @@ -43,12 +43,13 @@ function get_groups(){ return new \WP_REST_Response($ssc_group->get_groups(),200); } - /** - * Create one item from the collection - * - * @param \WP_REST_Request $request Full data about the request. - * @return \WP_Error|\WP_REST_Request - */ + /** + * Create one item from the collection + * + * @param \WP_REST_Request $request Full data about the request. + * + * @return \WP_REST_Response + */ public function create_item($request){ // Check if we got all the needed params $params_to_validate = array('email'); @@ -198,12 +199,13 @@ public function create_item_permissions_check($request){ return $ssc->validate_secure_key($request->get_param('hash')); } - /** - * Prepare the item for create or update operation - * - * @param \WP_REST_Request $request Request object - * @return \WP_Error|object $prepared_item - */ + /** + * Prepare the item for create or update operation + * + * @param \WP_REST_Request $request Request object + * + * @return array $prepared_item + */ protected function prepare_item_for_database($request){ return array(); } diff --git a/includes/class.ssc_settings.php b/includes/class.ssc_settings.php index 18d8cec..88e3efa 100644 --- a/includes/class.ssc_settings.php +++ b/includes/class.ssc_settings.php @@ -14,7 +14,7 @@ class SSC_Settings{ /** * Holds an instance of the object * - * @var Myprefix_Admin + * @var self */ protected static $instance; @@ -54,7 +54,7 @@ protected function __construct(){ /** * Returns the running object * - * @return Myprefix_Admin + * @return self */ public static function get_instance(){ if(null === self::$instance){ @@ -260,12 +260,15 @@ function is_valid_api_keys(){ } - /** - * Public getter method for retrieving protected/private variables - * @since 0.1.0 - * @param string $field Field to retrieve - * @return mixed Field value or exception is thrown - */ + /** + * Public getter method for retrieving protected/private variables + * @since 0.1.0 + * + * @param string $field Field to retrieve + * + * @return mixed Field value or exception is thrown + * @throws Exception + */ public function __get($field){ // Allowed fields to retrieve if(in_array($field,array('key','metabox_id','title','options_page'),true)){ @@ -280,7 +283,7 @@ public function __get($field){ /** * Helper function to get/return the Myprefix_Admin object * @since 0.1.0 - * @return Myprefix_Admin object + * @return SSC_Settings object */ function ssc_admin(){ return SSC_Settings::get_instance(); diff --git a/includes/ssc_helpers.php b/includes/ssc_helpers.php index 9937857..9fc8479 100644 --- a/includes/ssc_helpers.php +++ b/includes/ssc_helpers.php @@ -2,8 +2,11 @@ /** * Utiity function to list hooks that are connected to actions / filters * Great for debugging the actions and filters + * * @param string $hook + * * @return array + * @throws ReflectionException */ function ssc_list_hooks( $hook = '' ) { global $wp_filter; @@ -62,7 +65,7 @@ function ssc_list_hooks( $hook = '' ) { * @param $tag * @param $class * @param $method - * @return array|bool|void + * @return array|bool|null */ function ssc_remove_anonymous_object_filter( $tag, $class, $method ) {