Code Duplication    Length = 10-11 lines in 3 locations

wp-includes/class-wp-user.php 3 locations

@@ 279-288 (lines=10) @@
276
	 * @return bool Whether the given user meta key is set.
277
	 */
278
	public function __isset( $key ) {
279
		if ( 'id' == $key ) {
280
			_deprecated_argument( 'WP_User->id', '2.1.0',
281
				sprintf(
282
					/* translators: %s: WP_User->ID */
283
					__( 'Use %s instead.' ),
284
					'<code>WP_User->ID</code>'
285
				)
286
			);
287
			$key = 'ID';
288
		}
289
290
		if ( isset( $this->data->$key ) )
291
			return true;
@@ 309-318 (lines=10) @@
306
	 * @return mixed Value of the given user meta key (if set). If `$key` is 'id', the user ID.
307
	 */
308
	public function __get( $key ) {
309
		if ( 'id' == $key ) {
310
			_deprecated_argument( 'WP_User->id', '2.1.0',
311
				sprintf(
312
					/* translators: %s: WP_User->ID */
313
					__( 'Use %s instead.' ),
314
					'<code>WP_User->ID</code>'
315
				)
316
			);
317
			return $this->ID;
318
		}
319
320
		if ( isset( $this->data->$key ) ) {
321
			$value = $this->data->$key;
@@ 348-358 (lines=11) @@
345
	 * @param mixed  $value User meta value.
346
	 */
347
	public function __set( $key, $value ) {
348
		if ( 'id' == $key ) {
349
			_deprecated_argument( 'WP_User->id', '2.1.0',
350
				sprintf(
351
					/* translators: %s: WP_User->ID */
352
					__( 'Use %s instead.' ),
353
					'<code>WP_User->ID</code>'
354
				)
355
			);
356
			$this->ID = $value;
357
			return;
358
		}
359
360
		$this->data->$key = $value;
361
	}