Code Duplication    Length = 12-12 lines in 3 locations

classes/fields/paragraph.php 1 location

@@ 231-242 (lines=12) @@
228
	/**
229
	 * {@inheritdoc}
230
	 */
231
	public function pre_save( $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) {
232
233
		$value = $this->strip_html( $value, $options );
234
235
		$length = (int) pods_v( static::$type . '_max_length', $options, 0 );
236
237
		if ( 0 < $length && $length < pods_mb_strlen( $value ) ) {
238
			$value = pods_mb_substr( $value, 0, $length );
239
		}
240
241
		return $value;
242
	}
243
244
	/**
245
	 * {@inheritdoc}

classes/fields/text.php 1 location

@@ 178-189 (lines=12) @@
175
	/**
176
	 * {@inheritdoc}
177
	 */
178
	public function pre_save( $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) {
179
180
		$value = $this->strip_html( $value, $options );
181
182
		$length = (int) pods_v( static::$type . '_max_length', $options, 255 );
183
184
		if ( 0 < $length && $length < pods_mb_strlen( $value ) ) {
185
			$value = pods_mb_substr( $value, 0, $length );
186
		}
187
188
		return $value;
189
	}
190
191
	/**
192
	 * {@inheritdoc}

classes/fields/wysiwyg.php 1 location

@@ 255-266 (lines=12) @@
252
	/**
253
	 * {@inheritdoc}
254
	 */
255
	public function pre_save( $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) {
256
257
		$value = $this->strip_html( $value, $options );
258
259
		$length = (int) pods_v( static::$type . '_max_length', $options, 0 );
260
261
		if ( 0 < $length && $length < pods_mb_strlen( $value ) ) {
262
			$value = pods_mb_substr( $value, 0, $length );
263
		}
264
265
		return $value;
266
	}
267
268
	/**
269
	 * {@inheritdoc}