Code Duplication    Length = 10-10 lines in 2 locations

classes/fields/password.php 1 location

@@ 132-141 (lines=10) @@
129
	/**
130
	 * {@inheritdoc}
131
	 */
132
	public function pre_save( $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) {
133
134
		$length = (int) pods_v( static::$type . '_max_length', $options, 255 );
135
136
		if ( 0 < $length && $length < pods_mb_strlen( $value ) ) {
137
			$value = pods_mb_substr( $value, 0, $length );
138
		}
139
140
		return $value;
141
	}
142
}
143

classes/fields/code.php 1 location

@@ 126-135 (lines=10) @@
123
	/**
124
	 * {@inheritdoc}
125
	 */
126
	public function pre_save( $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) {
127
128
		$length = (int) pods_v( static::$type . '_max_length', $options, 0 );
129
130
		if ( 0 < $length && $length < pods_mb_strlen( $value ) ) {
131
			$value = pods_mb_substr( $value, 0, $length );
132
		}
133
134
		return $value;
135
	}
136
}
137