Code Duplication    Length = 11-12 lines in 5 locations

classes/fields/email.php 1 location

@@ 79-90 (lines=12) @@
76
	/**
77
	 * {@inheritdoc}
78
	 */
79
	public function schema( $options = null ) {
80
81
		$length = (int) pods_v( static::$type . '_max_length', $options, 255 );
82
83
		$schema = 'VARCHAR(' . $length . ')';
84
85
		if ( 255 < $length || $length < 1 ) {
86
			$schema = 'LONGTEXT';
87
		}
88
89
		return $schema;
90
	}
91
92
	/**
93
	 * {@inheritdoc}

classes/fields/password.php 1 location

@@ 65-76 (lines=12) @@
62
	/**
63
	 * {@inheritdoc}
64
	 */
65
	public function schema( $options = null ) {
66
67
		$length = (int) pods_v( static::$type . '_max_length', $options, 255 );
68
69
		$schema = 'VARCHAR(' . $length . ')';
70
71
		if ( 255 < $length || $length < 1 ) {
72
			$schema = 'LONGTEXT';
73
		}
74
75
		return $schema;
76
	}
77
78
	/**
79
	 * {@inheritdoc}

classes/fields/phone.php 1 location

@@ 104-115 (lines=12) @@
101
	/**
102
	 * {@inheritdoc}
103
	 */
104
	public function schema( $options = null ) {
105
106
		$length = (int) pods_v( static::$type . '_max_length', $options, 25, true );
107
108
		$schema = 'VARCHAR(' . $length . ')';
109
110
		if ( 255 < $length || $length < 1 ) {
111
			$schema = 'LONGTEXT';
112
		}
113
114
		return $schema;
115
	}
116
117
	/**
118
	 * {@inheritdoc}

classes/fields/text.php 1 location

@@ 97-108 (lines=12) @@
94
	/**
95
	 * {@inheritdoc}
96
	 */
97
	public function schema( $options = null ) {
98
99
		$length = (int) pods_v( static::$type . '_max_length', $options, 255 );
100
101
		$schema = 'VARCHAR(' . $length . ')';
102
103
		if ( 255 < $length || $length < 1 ) {
104
			$schema = 'LONGTEXT';
105
		}
106
107
		return $schema;
108
	}
109
110
	/**
111
	 * {@inheritdoc}

classes/fields/website.php 1 location

@@ 111-121 (lines=11) @@
108
	/**
109
	 * {@inheritdoc}
110
	 */
111
	public function schema( $options = null ) {
112
		$length = (int) pods_v( static::$type . '_max_length', $options, 255 );
113
114
		$schema = 'VARCHAR(' . $length . ')';
115
116
		if ( 255 < $length || $length < 1 ) {
117
			$schema = 'LONGTEXT';
118
		}
119
120
		return $schema;
121
	}
122
123
	/**
124
	 * {@inheritdoc}