Code Duplication    Length = 12-13 lines in 2 locations

wp-includes/class-wp-network.php 1 location

@@ 201-213 (lines=13) @@
198
	 * @param string $key   Property to set.
199
	 * @param mixed  $value Value to assign to the property.
200
	 */
201
	public function __set( $key, $value ) {
202
		switch ( $key ) {
203
			case 'id':
204
				$this->id = (int) $value;
205
				break;
206
			case 'blog_id':
207
			case 'site_id':
208
				$this->blog_id = (string) $value;
209
				break;
210
			default:
211
				$this->$key = $value;
212
		}
213
	}
214
215
	/**
216
	 * Set the site name assigned to the network if one has not been populated.

wp-includes/class-wp-site.php 1 location

@@ 290-301 (lines=12) @@
287
	 * @param string $key   Property to set.
288
	 * @param mixed  $value Value to assign to the property.
289
	 */
290
	public function __set( $key, $value ) {
291
		switch ( $key ) {
292
			case 'id':
293
				$this->blog_id = (string) $value;
294
				break;
295
			case 'network_id':
296
				$this->site_id = (string) $value;
297
				break;
298
			default:
299
				$this->$key = $value;
300
		}
301
	}
302
303
	/**
304
	 * Retrieves the details for this site.