Code Duplication    Length = 8-9 lines in 2 locations

projects/packages/sync/src/modules/class-module.php 1 location

@@ 505-512 (lines=8) @@
502
		}
503
504
		$objects = array();
505
		foreach ( (array) $ids as $id ) {
506
			$object = $this->get_object_by_id( $object_type, $id );
507
508
			// Only add object if we have the object.
509
			if ( $object ) {
510
				$objects[ $id ] = $object;
511
			}
512
		}
513
514
		return $objects;
515
	}

projects/packages/sync/src/modules/class-updates.php 1 location

@@ 542-550 (lines=9) @@
539
		}
540
541
		$objects = array();
542
		foreach ( (array) $ids as $id ) {
543
			$object = $this->get_object_by_id( $object_type, $id );
544
545
			if ( 'all' === $id ) {
546
				// If all was requested it contains all updates and can simply be returned.
547
				return $object;
548
			}
549
			$objects[ $id ] = $object;
550
		}
551
552
		return $objects;
553
	}