Completed
Push — trunk ( 1b3e25...df6be1 )
by Justin
04:48
created
includes/CMB2.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 	 * @param  mixed  $field_id     Field (or group field) ID
867 867
 	 * @param  mixed  $field_args   Array of field arguments
868 868
 	 * @param  mixed  $sub_field_id Sub field ID (if field_group exists)
869
-	 * @param  mixed  $field_group  If a sub-field, will be the parent group CMB2_Field object
869
+	 * @param  CMB2_Field|null  $field_group  If a sub-field, will be the parent group CMB2_Field object
870 870
 	 * @return array                Array of CMB2_Field arguments
871 871
 	 */
872 872
 	public function get_field_args( $field_id, $field_args, $sub_field_id, $field_group ) {
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
 	 * @since  2.0.0
926 926
 	 * @param  array  $field           Metabox field config array
927 927
 	 * @param  int    $position        (optional) Position of metabox. 1 for first, etc
928
-	 * @return mixed                   Field id or false
928
+	 * @return string                   Field id or false
929 929
 	 */
930 930
 	public function add_field( array $field, $position = 0 ) {
931 931
 		if ( ! is_array( $field ) || ! array_key_exists( 'id', $field ) ) {
Please login to merge, or discard this patch.
includes/CMB2_hookup.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -267,7 +267,7 @@
 block discarded – undo
267 267
 	 * Add 'closed' class to metabox
268 268
 	 * @since  2.0.0
269 269
 	 * @param  array  $classes Array of classes
270
-	 * @return array           Modified array of classes
270
+	 * @return string[]           Modified array of classes
271 271
 	 */
272 272
 	public function close_metabox_class( $classes ) {
273 273
 		$classes[] = 'closed';
Please login to merge, or discard this patch.
includes/CMB2_Sanitize.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -357,6 +357,7 @@  discard block
 block discarded – undo
357 357
 	/**
358 358
 	 * Gets the values for the `file` field type from the data being saved.
359 359
 	 * @since  2.2.0
360
+	 * @param string $id_key
360 361
 	 */
361 362
 	public function _get_group_file_value_array( $id_key ) {
362 363
 		$alldata = $this->field->group->data_to_save;
@@ -378,6 +379,7 @@  discard block
 block discarded – undo
378 379
 	/**
379 380
 	 * Peforms saving of `file` attachement's ID
380 381
 	 * @since  1.1.0
382
+	 * @param string $file_id_key
381 383
 	 */
382 384
 	public function _save_file_id_value( $file_id_key ) {
383 385
 		$id_field = $this->_new_supporting_field( $file_id_key );
@@ -398,6 +400,7 @@  discard block
 block discarded – undo
398 400
 	/**
399 401
 	 * Peforms saving of `text_datetime_timestamp_timezone` utc timestamp
400 402
 	 * @since  2.2.0
403
+	 * @param string $utc_key
401 404
 	 */
402 405
 	public function _save_utc_value( $utc_key, $utc_stamp ) {
403 406
 		return $this->_new_supporting_field( $utc_key )->save_field( $utc_stamp );
Please login to merge, or discard this patch.
example-functions.php 1 patch
Braces   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
  * Get the bootstrap! If using the plugin from wordpress.org, REMOVE THIS!
16 16
  */
17 17
 
18
-if ( file_exists( dirname( __FILE__ ) . '/cmb2/init.php' ) ) {
18
+if ( file_exists( dirname( __FILE__ ) . '/cmb2/init.php' ) ) {
19 19
 	require_once dirname( __FILE__ ) . '/cmb2/init.php';
20
-} elseif ( file_exists( dirname( __FILE__ ) . '/CMB2/init.php' ) ) {
20
+} elseif ( file_exists( dirname( __FILE__ ) . '/CMB2/init.php' ) ) {
21 21
 	require_once dirname( __FILE__ ) . '/CMB2/init.php';
22 22
 }
23 23
 
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
  *
29 29
  * @return bool             True if metabox should show
30 30
  */
31
-function yourprefix_show_if_front_page( $cmb ) {
31
+function yourprefix_show_if_front_page( $cmb ) {
32 32
 	// Don't show this metabox if it's not the front page template
33
-	if ( $cmb->object_id !== get_option( 'page_on_front' ) ) {
33
+	if ( $cmb->object_id !== get_option( 'page_on_front' ) ) {
34 34
 		return false;
35 35
 	}
36 36
 	return true;
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
  *
44 44
  * @return bool                     True if metabox should show
45 45
  */
46
-function yourprefix_hide_if_no_cats( $field ) {
46
+function yourprefix_hide_if_no_cats( $field ) {
47 47
 	// Don't show this field if not in the cats category
48
-	if ( ! has_tag( 'cats', $field->object_id ) ) {
48
+	if ( ! has_tag( 'cats', $field->object_id ) ) {
49 49
 		return false;
50 50
 	}
51 51
 	return true;
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
  * @param  array             $field_args Array of field parameters
58 58
  * @param  CMB2_Field object $field      Field object
59 59
  */
60
-function yourprefix_before_row_if_2( $field_args, $field ) {
61
-	if ( 2 == $field->object_id ) {
60
+function yourprefix_before_row_if_2( $field_args, $field ) {
61
+	if ( 2 == $field->object_id ) {
62 62
 		echo '<p>Testing <b>"before_row"</b> parameter (on $post_id 2)</p>';
63
-	} else {
63
+	} else {
64 64
 		echo '<p>Testing <b>"before_row"</b> parameter (<b>NOT</b> on $post_id 2)</p>';
65 65
 	}
66 66
 }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 /**
70 70
  * Hook in and add a demo metabox. Can only happen on the 'cmb2_admin_init' or 'cmb2_init' hook.
71 71
  */
72
-function yourprefix_register_demo_metabox() {
72
+function yourprefix_register_demo_metabox() {
73 73
 	$prefix = 'yourprefix_demo_';
74 74
 
75 75
 	/**
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 /**
373 373
  * Hook in and add a metabox that only appears on the 'About' page
374 374
  */
375
-function yourprefix_register_about_page_metabox() {
375
+function yourprefix_register_about_page_metabox() {
376 376
 	$prefix = 'yourprefix_about_';
377 377
 
378 378
 	/**
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 /**
402 402
  * Hook in and add a metabox to demonstrate repeatable grouped fields
403 403
  */
404
-function yourprefix_register_repeatable_group_field_metabox() {
404
+function yourprefix_register_repeatable_group_field_metabox() {
405 405
 	$prefix = 'yourprefix_group_';
406 406
 
407 407
 	/**
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 /**
466 466
  * Hook in and add a metabox to add fields to the user profile pages
467 467
  */
468
-function yourprefix_register_user_profile_metabox() {
468
+function yourprefix_register_user_profile_metabox() {
469 469
 	$prefix = 'yourprefix_user_';
470 470
 
471 471
 	/**
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 /**
536 536
  * Hook in and add a metabox to add fields to taxonomy terms
537 537
  */
538
-function yourprefix_register_taxonomy_metabox() {
538
+function yourprefix_register_taxonomy_metabox() {
539 539
 	$prefix = 'yourprefix_term_';
540 540
 
541 541
 	/**
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 /**
578 578
  * Hook in and register a metabox to handle a theme options page
579 579
  */
580
-function yourprefix_register_theme_options_metabox() {
580
+function yourprefix_register_theme_options_metabox() {
581 581
 
582 582
 	$option_key = 'yourprefix_theme_options';
583 583
 
Please login to merge, or discard this patch.
includes/CMB2_Utils.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,8 @@
 block discarded – undo
110 110
 		$current_offset = get_option( 'gmt_offset' );
111 111
 		$tzstring       = get_option( 'timezone_string' );
112 112
 
113
-		if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
113
+		if ( empty( $tzstring ) ) {
114
+// Create a UTC+- zone if no timezone string exists
114 115
 			if ( 0 == $current_offset ) {
115 116
 				$tzstring = 'UTC+0';
116 117
 			} elseif ( $current_offset < 0 ) {
Please login to merge, or discard this patch.
includes/CMB2_Ajax.php 1 patch
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	/**
31 31
 	 * Get the singleton instance of this class
32 32
 	 * @since 2.2.2
33
-	 * @return object
33
+	 * @return CMB2_Ajax
34 34
 	 */
35 35
 	public static function get_instance() {
36 36
 		if ( ! ( self::$instance instanceof self ) ) {
@@ -221,7 +221,6 @@  discard block
 block discarded – undo
221 221
 	 *
222 222
 	 * @since  1.3.0
223 223
 	 * @param  string  $meta_key   Postmeta's key
224
-	 * @param  mixed   $meta_value (Optional) value of the postmeta to be saved
225 224
 	 */
226 225
 	protected function cache_action( $meta_key ) {
227 226
 		$func_args = func_get_args();
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Base.php 1 patch
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,6 @@  discard block
 block discarded – undo
84 84
 
85 85
 	/**
86 86
 	 * Fall back to CMB2_Types methods
87
-	 * @param string $field
88 87
 	 * @throws Exception Throws an exception if the field is invalid.
89 88
 	 * @return mixed
90 89
 	 */
@@ -105,7 +104,7 @@  discard block
 block discarded – undo
105 104
 	 * Magic getter for our object.
106 105
 	 * @param string $field
107 106
 	 * @throws Exception Throws an exception if the field is invalid.
108
-	 * @return mixed
107
+	 * @return CMB2_Field
109 108
 	 */
110 109
 	public function __get( $field ) {
111 110
 		switch ( $field ) {
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Text_Datetime_Timestamp.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -38,6 +38,9 @@  discard block
 block discarded – undo
38 38
 		return $date_input . "\n" . $time_input;
39 39
 	}
40 40
 
41
+	/**
42
+	 * @param boolean $has_good_value
43
+	 */
41 44
 	public function date_args( $args, $has_good_value ) {
42 45
 		$date_args = wp_parse_args( $args['datepicker'], array(
43 46
 			'class' => 'cmb2-text-small cmb2-datepicker',
@@ -51,6 +54,9 @@  discard block
 block discarded – undo
51 54
 		return $this->parse_picker_options( 'date', $date_args );
52 55
 	}
53 56
 
57
+	/**
58
+	 * @param boolean $has_good_value
59
+	 */
54 60
 	public function time_args( $args, $has_good_value ) {
55 61
 		$time_args = wp_parse_args( $args['timepicker'], array(
56 62
 			'class' => 'cmb2-timepicker text-time',
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Wysiwyg.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
 	/**
16 16
 	 * Handles outputting a 'wysiwyg' element
17 17
 	 * @since  1.1.0
18
-	 * @param  array  $args Override arguments
19 18
 	 * @return string       Form wysiwyg element
20 19
 	 */
21 20
 	public function render() {
Please login to merge, or discard this patch.