Code Duplication    Length = 10-10 lines in 5 locations

classes/fields/website.php 1 location

@@ 144-153 (lines=10) @@
141
	 * @return array
142
	 * @since 2.0
143
	 */
144
	public function schema ( $options = null ) {
145
		$length = (int) pods_var( self::$type . '_max_length', $options, 255 );
146
147
		$schema = 'VARCHAR(' . $length . ')';
148
149
		if ( 255 < $length || $length < 1 )
150
			$schema = 'LONGTEXT';
151
152
		return $schema;
153
	}
154
155
	/**
156
	 * Change the way the value of the field is displayed with Pods::get

classes/fields/email.php 1 location

@@ 113-122 (lines=10) @@
110
	 * @return array
111
	 * @since 2.0
112
	 */
113
	public function schema( $options = null ) {
114
115
		$length = (int) pods_var( self::$type . '_max_length', $options, 255 );
116
117
		$schema = 'VARCHAR(' . $length . ')';
118
119
		if ( 255 < $length || $length < 1 ) {
120
			$schema = 'LONGTEXT';
121
		}
122
123
		return $schema;
124
	}
125

classes/fields/password.php 1 location

@@ 100-109 (lines=10) @@
97
	 * @return array
98
	 * @since 2.0
99
	 */
100
	public function schema( $options = null ) {
101
102
		$length = (int) pods_var( self::$type . '_max_length', $options, 255 );
103
104
		$schema = 'VARCHAR(' . $length . ')';
105
106
		if ( 255 < $length || $length < 1 ) {
107
			$schema = 'LONGTEXT';
108
		}
109
110
		return $schema;
111
	}
112

classes/fields/phone.php 1 location

@@ 139-148 (lines=10) @@
136
	 * @return array
137
	 * @since 2.0
138
	 */
139
	public function schema( $options = null ) {
140
141
		$length = (int) pods_var( self::$type . '_max_length', $options, 25, null, true );
142
143
		$schema = 'VARCHAR(' . $length . ')';
144
145
		if ( 255 < $length || $length < 1 ) {
146
			$schema = 'LONGTEXT';
147
		}
148
149
		return $schema;
150
	}
151

classes/fields/text.php 1 location

@@ 130-139 (lines=10) @@
127
	 * @return array
128
	 * @since 2.0
129
	 */
130
	public function schema( $options = null ) {
131
132
		$length = (int) pods_var( self::$type . '_max_length', $options, 255 );
133
134
		$schema = 'VARCHAR(' . $length . ')';
135
136
		if ( 255 < $length || $length < 1 ) {
137
			$schema = 'LONGTEXT';
138
		}
139
140
		return $schema;
141
	}
142