Skip to content

Commit

Permalink
Fix PHPDoc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubboucek committed Sep 3, 2018
1 parent 2e21c1f commit fdb28fd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 26 deletions.
11 changes: 7 additions & 4 deletions includes/class.ssc_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
26 changes: 14 additions & 12 deletions includes/class.ssc_rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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();
}
Expand Down
21 changes: 12 additions & 9 deletions includes/class.ssc_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SSC_Settings{
/**
* Holds an instance of the object
*
* @var Myprefix_Admin
* @var self
*/
protected static $instance;

Expand Down Expand Up @@ -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){
Expand Down Expand Up @@ -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)){
Expand All @@ -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();
Expand Down
5 changes: 4 additions & 1 deletion includes/ssc_helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 )
{
Expand Down

0 comments on commit fdb28fd

Please sign in to comment.