Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update phpDocs #1095

Merged
merged 2 commits into from
Oct 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions includes/admin/welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function changelog_screen() {
* Render Getting Started Screen
*
* @access public
* @since 1.9
* @since 1.0
* @return void
*/
public function getting_started_screen() {
Expand Down Expand Up @@ -486,7 +486,7 @@ public function credits_screen() {
/**
* Parse the GIVE readme.txt file
*
* @since 2.0.3
* @since 1.0
* @return string $readme HTML formatted readme file
*/
public function parse_readme() {
Expand Down
10 changes: 9 additions & 1 deletion includes/class-give-customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -998,8 +998,11 @@ private function sanitize_columns( $data ) {
* Attach an email to the donor
*
* @since 1.7
* @access public
*
* @param string $email The email address to attach to the customer
* @param bool $primary Allows setting the email added as the primary
*
* @return bool If the email was added successfully
*/
public function add_email( $email = '', $primary = false ) {
Expand Down Expand Up @@ -1034,12 +1037,14 @@ public function add_email( $email = '', $primary = false ) {
return $ret;
}


/**
* Remove an email from the customer
*
* @since 1.7
* @access public
*
* @param string $email The email address to remove from the customer
*
* @return bool If the email was removeed successfully
*/
public function remove_email( $email = '' ) {
Expand All @@ -1062,7 +1067,10 @@ public function remove_email( $email = '' ) {
* This will move the customer's previous primary email to an additional email
*
* @since 1.7
* @access public
*
* @param string $new_primary_email The email address to remove from the customer
*
* @return bool If the email was set as primary successfully
*/
public function set_primary_email( $new_primary_email = '' ) {
Expand Down
41 changes: 25 additions & 16 deletions includes/class-give-db-customer-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/**
* Customer Meta DB class
*
* This class is for interacting with the customer meta database table
*
* @package Give
* @subpackage Classes/DB Customer Meta
* @copyright Copyright (c) 2016, WordImpress
Expand All @@ -18,6 +16,10 @@

/**
* Class Give_DB_Customer_Meta
*
* This class is for interacting with the customer meta database table
*
* @since 1.6
*/
class Give_DB_Customer_Meta extends Give_DB {

Expand All @@ -44,6 +46,8 @@ public function __construct() {
*
* @access public
* @since 1.6
*
* @return array Columns and formats.
*/
public function get_columns() {
return array(
Expand All @@ -59,6 +63,8 @@ public function get_columns() {
*
* @access public
* @since 1.6
*
* @return void
*/
public function register_table() {
global $wpdb;
Expand All @@ -70,14 +76,14 @@ public function register_table() {
*
* For internal use only. Use Give_Customer->get_meta() for public usage.
*
* @access private
* @since 1.6
*
* @param int $customer_id Customer ID.
* @param string $meta_key The meta key to retrieve.
* @param bool $single Whether to return a single value.
*
* @return mixed Will be an array if $single is false. Will be value of meta data field if $single is true.
*
* @access private
* @since 1.6
*/
public function get_meta( $customer_id = 0, $meta_key = '', $single = false ) {
$customer_id = $this->sanitize_customer_id( $customer_id );
Expand All @@ -93,15 +99,15 @@ public function get_meta( $customer_id = 0, $meta_key = '', $single = false ) {
*
* For internal use only. Use Give_Customer->add_meta() for public usage.
*
* @access private
* @since 1.6
*
* @param int $customer_id Customer ID.
* @param string $meta_key Metadata name.
* @param mixed $meta_value Metadata value.
* @param bool $unique Optional, default is false. Whether the same key should not be added.
*
* @return bool False for failure. True for success.
*
* @access private
* @since 1.6
*/
public function add_meta( $customer_id = 0, $meta_key = '', $meta_value, $unique = false ) {
$customer_id = $this->sanitize_customer_id( $customer_id );
Expand All @@ -122,15 +128,15 @@ public function add_meta( $customer_id = 0, $meta_key = '', $meta_value, $unique
*
* If the meta field for the customer does not exist, it will be added.
*
* @access private
* @since 1.6
*
* @param int $customer_id Customer ID.
* @param string $meta_key Metadata key.
* @param mixed $meta_value Metadata value.
* @param mixed $prev_value Optional. Previous value to check before removing.
*
* @return bool False on failure, true if success.
*
* @access private
* @since 1.6
*/
public function update_meta( $customer_id = 0, $meta_key = '', $meta_value, $prev_value = '' ) {
$customer_id = $this->sanitize_customer_id( $customer_id );
Expand All @@ -150,14 +156,14 @@ public function update_meta( $customer_id = 0, $meta_key = '', $meta_value, $pre
* value, will keep from removing duplicate metadata with the same key. It also
* allows removing all metadata matching key, if needed.
*
* @access private
* @since 1.6
*
* @param int $customer_id Customer ID.
* @param string $meta_key Metadata name.
* @param mixed $meta_value Optional. Metadata value.
*
* @return bool False for failure. True for success.
*
* @access private
* @since 1.6
*/
public function delete_meta( $customer_id = 0, $meta_key = '', $meta_value = '' ) {
return delete_metadata( 'customer', $customer_id, $meta_key, $meta_value );
Expand All @@ -166,8 +172,10 @@ public function delete_meta( $customer_id = 0, $meta_key = '', $meta_value = ''
/**
* Create the table
*
* @access public
* @since 1.6
* @access public
* @since 1.6
*
* @return void
*/
public function create_table() {

Expand All @@ -191,6 +199,7 @@ public function create_table() {
/**
* Given a customer ID, make sure it's a positive number, greater than zero before inserting or adding.
*
* @access private
* @since 1.6
*
* @param int|stripe $customer_id A passed customer ID.
Expand Down
3 changes: 1 addition & 2 deletions includes/class-give-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __construct() {
* @since 1.0
* @access public
*
* @return array Columns
* @return array Columns and formats.
*/
public function get_columns() {
return array();
Expand Down Expand Up @@ -326,4 +326,3 @@ public function installed() {
}

}

2 changes: 1 addition & 1 deletion includes/class-give-donate-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public function __get( $key ) {
*
* @param array $data Array of attributes for a donation form.
*
* @return mixed False if data isn't passed and class not instantiated for creation, or New Form ID.
* @return bool|int False if data isn't passed and class not instantiated for creation, or New Form ID.
*/
public function create( $data = array() ) {

Expand Down
2 changes: 0 additions & 2 deletions includes/class-give-gravatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ public function register_widget() {
* @param string $content Shortcode content.
*
* @return string
*
* @todo Set the ID to get_the_ID() if ID parameter is not passed through. Otherwise it will incorrectly get other gravatars
*/
public function shortcode( $atts, $content = null ) {

Expand Down
1 change: 0 additions & 1 deletion includes/class-give-html-elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function transactions_dropdown( $args = array() ) {

$args = wp_parse_args( $args, $defaults );


$payments = new Give_Payments_Query( array(
'number' => $args['number']
) );
Expand Down
Loading