Completed
Pull Request — develop (#603)
by Zack
09:26 queued 04:53
created
includes/fields/class-gravityview-fields.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
 	 *
24 24
 	 * @return void
25 25
 	 */
26
-	public static function register( $field ) {
27
-		if ( ! is_subclass_of( $field, 'GravityView_Field' ) ) {
28
-			throw new Exception( 'Must be a subclass of GravityView_Field' );
26
+	public static function register($field) {
27
+		if (!is_subclass_of($field, 'GravityView_Field')) {
28
+			throw new Exception('Must be a subclass of GravityView_Field');
29 29
 		}
30
-		if ( empty( $field->name ) ) {
31
-			throw new Exception( 'The name must be set' );
30
+		if (empty($field->name)) {
31
+			throw new Exception('The name must be set');
32 32
 		}
33
-		if ( isset( self::$_fields[ $field->name ] ) ) {
34
-			throw new Exception( 'Field type already registered: ' . $field->name );
33
+		if (isset(self::$_fields[$field->name])) {
34
+			throw new Exception('Field type already registered: '.$field->name);
35 35
 		}
36
-		self::$_fields[ $field->name ] = $field;
36
+		self::$_fields[$field->name] = $field;
37 37
 	}
38 38
 
39 39
 	/**
@@ -41,15 +41,15 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @return GravityView_Field | bool
43 43
 	 */
44
-	public static function create( $properties ) {
45
-		$type = isset( $properties['type'] ) ? $properties['type'] : '';
46
-		$type = empty( $properties['inputType'] ) ? $type : $properties['inputType'];
47
-		if ( empty( $type ) || ! isset( self::$_fields[ $type ] ) ) {
48
-			return new GravityView_Field( $properties );
44
+	public static function create($properties) {
45
+		$type = isset($properties['type']) ? $properties['type'] : '';
46
+		$type = empty($properties['inputType']) ? $type : $properties['inputType'];
47
+		if (empty($type) || !isset(self::$_fields[$type])) {
48
+			return new GravityView_Field($properties);
49 49
 		}
50
-		$class      = self::$_fields[ $type ];
51
-		$class_name = get_class( $class );
52
-		$field      = new $class_name( $properties );
50
+		$class      = self::$_fields[$type];
51
+		$class_name = get_class($class);
52
+		$field      = new $class_name($properties);
53 53
 
54 54
 		return $field;
55 55
 	}
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 	 *
62 62
 	 * @return bool True: yes, it exists; False: nope
63 63
 	 */
64
-	public static function exists( $field_name ) {
65
-		return isset( self::$_fields["{$field_name}"] );
64
+	public static function exists($field_name) {
65
+		return isset(self::$_fields["{$field_name}"]);
66 66
 	}
67 67
 
68 68
 	/**
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 	 *
71 71
 	 * @return GravityView_Field
72 72
 	 */
73
-	public static function get_instance( $field_name ) {
74
-		return isset( self::$_fields[ $field_name ] ) ? self::$_fields[ $field_name ] : false;
73
+	public static function get_instance($field_name) {
74
+		return isset(self::$_fields[$field_name]) ? self::$_fields[$field_name] : false;
75 75
 	}
76 76
 
77 77
 	/**
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 	 *
82 82
 	 * @return GravityView_Field
83 83
 	 */
84
-	public static function get( $field_name ) {
85
-		return self::get_instance( $field_name );
84
+	public static function get($field_name) {
85
+		return self::get_instance($field_name);
86 86
 	}
87 87
 
88 88
 	/**
Please login to merge, or discard this patch.
templates/fields/payment_amount.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,6 +9,6 @@
 block discarded – undo
9 9
 
10 10
 $entry = GravityView_View::getInstance()->getCurrentEntry();
11 11
 
12
-$value = rgar( $entry, 'payment_amount' );
12
+$value = rgar($entry, 'payment_amount');
13 13
 
14
-echo GFCommon::to_money( $value, rgar( $entry, 'currency' ) );
14
+echo GFCommon::to_money($value, rgar($entry, 'currency'));
Please login to merge, or discard this patch.