From addc80de152709901e0e7d9854b42b8e9898c721 Mon Sep 17 00:00:00 2001 From: Cesar Rodas Date: Wed, 31 May 2017 09:39:13 -0400 Subject: [PATCH] Fixed coding styles --- includes/class-wc-meta-data.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-meta-data.php b/includes/class-wc-meta-data.php index 94473bc45ec..cae977849ea 100644 --- a/includes/class-wc-meta-data.php +++ b/includes/class-wc-meta-data.php @@ -49,14 +49,34 @@ class WC_Meta_Data { $this->data = $this->current_data; } + /** + * Creates or updates a property in the metadata object. + * + * @param string $key + * @param mixed $value + * + */ public function __set( $key, $value ) { $this->current_data[ $key ] = $value; } + /** + * Checks if a given key exists in our data. This is called internally + * by `empty` and `isset`. + * + * @param string $key + */ public function __isset( $key ) { return array_key_exists( $key, $this->current_data ); } + /** + * Returns the value of any property. + * + * @param string $key + * + * @return mixed Property value or NULL if it does not exists + */ public function __get( $key ) { if ( array_key_exists( $key, $this->current_data )) { return $this->current_data[ $key ]; @@ -70,7 +90,6 @@ class WC_Meta_Data { * @return array */ public function get_changes() { - $changes = array(); foreach ( $this->current_data as $id => $value) { if ( ! array_key_exists( $id, $this->data ) || $value !== $this->data[ $id ] ) {