Code Duplication    Length = 8-9 lines in 2 locations

core/Field/Group_Field.php 1 location

@@ 157-164 (lines=8) @@
154
	 * @param  string $label If null, the label will be generated from the group name
155
	 * @return self   $this
156
	 */
157
	public function set_label( $label ) {
158
		if ( is_null( $label ) ) {
159
			// Try to guess field label from its name
160
			$label = Helper::normalize_label( $this->get_name() );
161
		}
162
		$this->label = $label;
163
		return $this;
164
	}
165
166
	/**
167
	 * Label attribute getter.

core/Field/Field.php 1 location

@@ 699-707 (lines=9) @@
696
	 * @param  string $label If null, the label will be generated from the field name
697
	 * @return self   $this
698
	 */
699
	public function set_label( $label ) {
700
		if ( is_null( $label ) ) {
701
			// Try to guess field label from its name
702
			$label = Helper::normalize_label( $this->get_name() );
703
		}
704
705
		$this->label = $label;
706
		return $this;
707
	}
708
709
	/**
710
	 * Get a key-value array of attributes