Completed
Branch master (b13b1d)
by Michael
19:31
created
development/factory/_abstract/form/AdminPageFramework_Form_Base.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,18 +57,18 @@  discard block
 block discarded – undo
57 57
         }
58 58
         
59 59
         // If the section ID is not registered, return false.
60
-        if ( ! array_key_exists( $sID, $this->aSectionsets ) ) { 
60
+        if ( !array_key_exists( $sID, $this->aSectionsets ) ) { 
61 61
             return false; 
62 62
         }
63 63
         
64 64
         // the fields array's first dimension is also filled with the keys of section ids.
65
-        if ( ! array_key_exists( $sID, $this->aFieldsets ) ) { 
65
+        if ( !array_key_exists( $sID, $this->aFieldsets ) ) { 
66 66
             return false; 
67 67
         }
68 68
         
69 69
         // Since numeric IDs are denied at the beginning of the method, the elements will not be sub-sections.
70 70
         $_bIsSeciton = false;
71
-        foreach( $this->aFieldsets as $_sSectionID => $_aFields ) {    
71
+        foreach ( $this->aFieldsets as $_sSectionID => $_aFields ) {    
72 72
         
73 73
             if ( $_sSectionID == $sID ) { 
74 74
                 $_bIsSeciton = true; 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      * @return      boolean
95 95
      */
96 96
     public function canUserView( $sCapability ) {
97
-        if ( ! $sCapability  ) {
97
+        if ( !$sCapability ) {
98 98
             return true;
99 99
         }
100 100
         return ( boolean ) current_user_can( $sCapability );
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      * @since       DEVVER
140 140
      */
141 141
     public function callBack( $oCallable, $asParameters ) {
142
-        $_aParameters   = self::getAsArray( 
142
+        $_aParameters = self::getAsArray( 
143 143
             $asParameters, 
144 144
             true // preserve empty
145 145
         );
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,25 +57,25 @@
 block discarded – undo
57 57
         }
58 58
         
59 59
         // If the section ID is not registered, return false.
60
-        if ( ! array_key_exists( $sID, $this->aSectionsets ) ) { 
60
+        if ( ! array_key_exists( $sID, $this->aSectionsets ) ) {
61 61
             return false; 
62 62
         }
63 63
         
64 64
         // the fields array's first dimension is also filled with the keys of section ids.
65
-        if ( ! array_key_exists( $sID, $this->aFieldsets ) ) { 
65
+        if ( ! array_key_exists( $sID, $this->aFieldsets ) ) {
66 66
             return false; 
67 67
         }
68 68
         
69 69
         // Since numeric IDs are denied at the beginning of the method, the elements will not be sub-sections.
70 70
         $_bIsSeciton = false;
71
-        foreach( $this->aFieldsets as $_sSectionID => $_aFields ) {    
71
+        foreach( $this->aFieldsets as $_sSectionID => $_aFields ) {
72 72
         
73
-            if ( $_sSectionID == $sID ) { 
73
+            if ( $_sSectionID == $sID ) {
74 74
                 $_bIsSeciton = true; 
75 75
             }
76 76
             
77 77
             // a field using the ID is found, and it precedes a section match.     
78
-            if ( array_key_exists( $sID, $_aFields ) ) { 
78
+            if ( array_key_exists( $sID, $_aFields ) ) {
79 79
                 return false; 
80 80
             }
81 81
             
Please login to merge, or discard this patch.
development/factory/_abstract/form/AdminPageFramework_Form_Meta.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
                 
85 85
                 // The first element is the option key; the section or field dimensional keys follow.
86 86
                 if ( '__dummy_option_key' === $_aDimensionalKeys[ 0 ] ) {
87
-                     array_shift( $_aDimensionalKeys );
87
+                        array_shift( $_aDimensionalKeys );
88 88
                 }
89 89
                 
90 90
                 $this->unsetDimensionalArrayElement( 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
      * @param       string      $sStructureType    The type of object. Currently 'post_meta_box' or 'user_meta' is accepted.
32 32
      * @return      void
33 33
      */
34
-    public function updateMetaDataByType( $iObjectID, array $aInput, array $aSavedMeta, $sStructureType='post_meta_box' ) {
34
+    public function updateMetaDataByType( $iObjectID, array $aInput, array $aSavedMeta, $sStructureType = 'post_meta_box' ) {
35 35
         
36
-        if ( ! $iObjectID ) {
36
+        if ( !$iObjectID ) {
37 37
             return;
38 38
         }
39 39
            
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             'post_meta_box'     => 'update_post_meta',
42 42
             'user_meta'         => 'update_user_meta',               
43 43
         );
44
-        if ( ! in_array( $sStructureType, array_keys( $_aFunctionNameMapByFieldsType ) ) ) {
44
+        if ( !in_array( $sStructureType, array_keys( $_aFunctionNameMapByFieldsType ) ) ) {
45 45
             return;
46 46
         }
47 47
         $_sFunctionName = $this->getElement( $_aFunctionNameMapByFieldsType, $sStructureType );
@@ -69,16 +69,16 @@  discard block
 block discarded – undo
69 69
          */
70 70
         private function _getInputByUnset( array $aInput ) {
71 71
             
72
-            $_sUnsetKey = '__unset_' . $this->sStructureType;
73
-            if ( ! isset( $_POST[ $_sUnsetKey ] ) ) {
72
+            $_sUnsetKey = '__unset_'.$this->sStructureType;
73
+            if ( !isset( $_POST[ $_sUnsetKey ] ) ) {
74 74
                 return $aInput;
75 75
             }
76 76
             
77 77
             $_aUnsetElements = array_unique( $_POST[ $_sUnsetKey ] );
78
-            foreach( $_aUnsetElements as $_sFlatInputName ) {
78
+            foreach ( $_aUnsetElements as $_sFlatInputName ) {
79 79
                 
80 80
                 $_aDimensionalKeys = explode( '|', $_sFlatInputName );
81
-                if ( ! isset( $_aDimensionalKeys[ 0 ] ) ) {
81
+                if ( !isset( $_aDimensionalKeys[ 0 ] ) ) {
82 82
                     continue;
83 83
                 }
84 84
                 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
             $_vSavedValue = $this->getElement(
115 115
                 $aSavedMeta, // subject
116
-                $_sSectionOrFieldID,    // dimensional keys
116
+                $_sSectionOrFieldID, // dimensional keys
117 117
                 null   // default value
118 118
             );
119 119
                 
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
          */
108 108
         private function _updateMetaDatumByFuncitonName( $iObjectID, $_vValue, array $aSavedMeta, $_sSectionOrFieldID, $_sFunctionName ) {
109 109
             
110
-            if ( is_null( $_vValue ) ) { 
110
+            if ( is_null( $_vValue ) ) {
111 111
                 return;
112 112
             }
113 113
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                 
120 120
             // PHP can compare even array contents with the == operator. See http://www.php.net/manual/en/language.operators.array.php
121 121
             // if the input value and the saved meta value are the same, no need to update it.
122
-            if ( $_vValue == $_vSavedValue ) { 
122
+            if ( $_vValue == $_vSavedValue ) {
123 123
                 return; 
124 124
             }
125 125
             
Please login to merge, or discard this patch.
form/_model/AdminPageFramework_Form_Model___BuiltInFieldTypeDefinitions.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         'posttype',
43 43
         'size',
44 44
         'section_title', // 3.0.0+
45
-        'system',        // 3.3.0+
45
+        'system', // 3.3.0+
46 46
     );    
47 47
     
48 48
     public $sCallerID = '';
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
     public function get() {
73 73
         
74 74
         $_aFieldTypeDefinitions = array();
75
-        foreach( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) {
75
+        foreach ( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) {
76 76
             
77 77
             $_sFieldTypeClassName = "AdminPageFramework_FieldType_{$_sFieldTypeSlug}";
78
-            if ( ! class_exists( $_sFieldTypeClassName ) ) { 
78
+            if ( !class_exists( $_sFieldTypeClassName ) ) { 
79 79
                 continue; 
80 80
             }
81 81
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                 $this->oMsg, 
86 86
                 false           // `false` to disable auto-registering.     
87 87
             );    
88
-            foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) {     
88
+            foreach ( $_oFieldType->aFieldTypeSlugs as $_sSlug ) {     
89 89
                 $_aFieldTypeDefinitions[ $_sSlug ] = $_oFieldType->getDefinitionArray();
90 90
             }
91 91
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         foreach( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) {
76 76
             
77 77
             $_sFieldTypeClassName = "AdminPageFramework_FieldType_{$_sFieldTypeSlug}";
78
-            if ( ! class_exists( $_sFieldTypeClassName ) ) { 
78
+            if ( ! class_exists( $_sFieldTypeClassName ) ) {
79 79
                 continue; 
80 80
             }
81 81
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                 $this->oMsg, 
86 86
                 false           // `false` to disable auto-registering.     
87 87
             );    
88
-            foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) {     
88
+            foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) {
89 89
                 $_aFieldTypeDefinitions[ $_sSlug ] = $_oFieldType->getDefinitionArray();
90 90
             }
91 91
         }
Please login to merge, or discard this patch.
_abstract/form/_model/AdminPageFramework_Form_Model___DefaultValues.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
     /**
110 110
      * @deprecated
111 111
      */
112
-  /*   public function _get() {
112
+    /*   public function _get() {
113 113
         
114 114
         $_aDefaultOptions = array();
115 115
         foreach( $this->aFieldsets as $_sSectionID => $_aFieldsetsPerSection ) {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class AdminPageFramework_Form_Model___DefaultValues extends AdminPageFramework_Form_Base {
19 19
     
20
-    public $aFieldsets  = array();
20
+    public $aFieldsets = array();
21 21
 
22 22
     /**
23 23
      * Sets up hooks.
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $_aParameters = func_get_args() + array( 
29 29
             $this->aFieldsets, 
30 30
         );
31
-        $this->aFieldsets  = $_aParameters[ 0 ];                    
31
+        $this->aFieldsets = $_aParameters[ 0 ];                    
32 32
         
33 33
     }
34 34
 
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
          */
87 87
         private function _getDefaultValues( $aFieldsets, $aDefaultOptions ) {
88 88
             
89
-            foreach( $aFieldsets as $_sSectionPath => $_aItems ) {
89
+            foreach ( $aFieldsets as $_sSectionPath => $_aItems ) {
90 90
                 
91 91
                 $_aSectionPath   = explode( '|', $_sSectionPath );
92
-                foreach( $_aItems as $_sFieldPath => $_aFieldset ) {
92
+                foreach ( $_aItems as $_sFieldPath => $_aFieldset ) {
93 93
                     $_aFieldPath = explode( '|', $_sFieldPath );
94 94
                     $this->setMultiDimensionalArray( 
95
-                        $aDefaultOptions,  // by reference
95
+                        $aDefaultOptions, // by reference
96 96
                         '_default' === $_sSectionPath
97 97
                             ? array( $_sFieldPath )
98 98
                             : array_merge( $_aSectionPath, $_aFieldPath ), // key address
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
             // If there are no sub-fields     
149 149
             if ( count( $_aSubFields ) == 0 ) {
150 150
                 return $this->getElement(
151
-                    $aFieldset,     // subject
152
-                    'value',        // key
151
+                    $aFieldset, // subject
152
+                    'value', // key
153 153
                     $this->getElement(   // default value
154
-                        $aFieldset,      // subject  
155
-                        'default',       // key
154
+                        $aFieldset, // subject  
155
+                        'default', // key
156 156
                         null             // default value
157 157
                     )
158 158
                 );
@@ -161,13 +161,13 @@  discard block
 block discarded – undo
161 161
             // Otherwise, there are sub-fields
162 162
             $_aDefault = array();
163 163
             array_unshift( $_aSubFields, $aFieldset ); // insert the main field into the very first index.
164
-            foreach( $_aSubFields as $_iIndex => $_aField ) {
164
+            foreach ( $_aSubFields as $_iIndex => $_aField ) {
165 165
                 $_aDefault[ $_iIndex ] = $this->getElement( 
166
-                    $_aField,   // subject
167
-                    'value',    // key
166
+                    $_aField, // subject
167
+                    'value', // key
168 168
                     $this->getElement(   // default value
169
-                        $_aField,   // subject  
170
-                        'default',  // key
169
+                        $_aField, // subject  
170
+                        'default', // key
171 171
                         null        // default value
172 172
                     )
173 173
                 ); 
Please login to merge, or discard this patch.
form/_model/AdminPageFramework_Form_Model___FieldTypeRegistration.php 1 patch
Indentation   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@  discard block
 block discarded – undo
9 9
 
10 10
 /**
11 11
  * Provides methods to retrieve field type resources.
12
- 
13 12
  * @package     AdminPageFramework
14 13
  * @subpackage  Form
15 14
  * @since       DEVVER
@@ -42,7 +41,7 @@  discard block
 block discarded – undo
42 41
                 call_user_func_array( 
43 42
                     $aFieldTypeDefinition[ 'hfFieldSetTypeSetter' ], 
44 43
                     array( $sStructureType ) 
45
-               );
44
+                );
46 45
             }
47 46
             
48 47
             if ( is_callable( $aFieldTypeDefinition[ 'hfFieldLoader' ] ) ) {
Please login to merge, or discard this patch.
_abstract/form/_model/AdminPageFramework_Form_Model___FieldTypeResource.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -55,23 +55,23 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function get() {
57 57
 
58
-        $this->aResources[ 'inline_scripts' ]      = $this->_getUpdatedInlineItemsByCallback( 
58
+        $this->aResources[ 'inline_scripts' ] = $this->_getUpdatedInlineItemsByCallback( 
59 59
             $this->aResources[ 'inline_scripts' ], 
60 60
             'hfGetScripts' 
61 61
         );
62
-        $this->aResources[ 'inline_styles' ]       = $this->_getUpdatedInlineItemsByCallback( 
62
+        $this->aResources[ 'inline_styles' ] = $this->_getUpdatedInlineItemsByCallback( 
63 63
             $this->aResources[ 'inline_styles' ], 
64 64
             'hfGetStyles'
65 65
         );
66
-        $this->aResources[ 'inline_styles_ie' ]    = $this->_getUpdatedInlineItemsByCallback( 
66
+        $this->aResources[ 'inline_styles_ie' ] = $this->_getUpdatedInlineItemsByCallback( 
67 67
             $this->aResources[ 'inline_styles_ie' ], 
68 68
             'hfGetIEStyles'
69 69
         );        
70
-        $this->aResources[ 'src_styles' ]          = $this->_getUpdatedEnqueuingItemsByCallback( 
70
+        $this->aResources[ 'src_styles' ] = $this->_getUpdatedEnqueuingItemsByCallback( 
71 71
             $this->aResources[ 'src_styles' ], 
72 72
             'aEnqueueStyles' 
73 73
         );
74
-        $this->aResources[ 'src_scripts' ]         = $this->_getUpdatedEnqueuingItemsByCallback( 
74
+        $this->aResources[ 'src_scripts' ] = $this->_getUpdatedEnqueuingItemsByCallback( 
75 75
             $this->aResources[ 'src_scripts' ], 
76 76
             'aEnqueueScripts' 
77 77
         );
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
          */
85 85
         private function _getUpdatedInlineItemsByCallback( array $aSubject, $sKey ) {
86 86
             $_oCallable = $this->getElement( $this->aFieldTypeDefinition, $sKey );
87
-            if ( ! is_callable( $_oCallable ) ) {
87
+            if ( !is_callable( $_oCallable ) ) {
88 88
                 return $aSubject;
89 89
             }
90
-            $aSubject[] = call_user_func_array( 
90
+            $aSubject[ ] = call_user_func_array( 
91 91
                 $_oCallable, 
92 92
                 array() 
93 93
             );            
Please login to merge, or discard this patch.
_abstract/form/_model/AdminPageFramework_Form_Model___SetFieldResources.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -89,16 +89,16 @@  discard block
 block discarded – undo
89 89
                 'AdminPageFramework_Form_View___CSS_CollapsibleSection',
90 90
                 'AdminPageFramework_Form_View___CSS_FieldError',
91 91
             );
92
-            foreach( $_aClassNames as $_sClassName ) {
92
+            foreach ( $_aClassNames as $_sClassName ) {
93 93
                 $_oCSS = new $_sClassName;
94
-                $this->aResources[ 'inline_styles' ][] = $_oCSS->get();
94
+                $this->aResources[ 'inline_styles' ][ ] = $_oCSS->get();
95 95
             }
96 96
             $_aClassNamesForIE = array(
97 97
                 'AdminPageFramework_Form_View___CSS_CollapsibleSectionIE',
98 98
             );
99
-            foreach( $_aClassNames as $_sClassName ) {
99
+            foreach ( $_aClassNames as $_sClassName ) {
100 100
                 $_oCSS = new $_sClassName;
101
-                $this->aResources[ 'inline_styles_ie' ][] = $_oCSS->get();
101
+                $this->aResources[ 'inline_styles_ie' ][ ] = $_oCSS->get();
102 102
             }
103 103
             
104 104
         }
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 
119 119
             // Parse all added fieldsets and check associated resources.
120 120
 // @todo Find a way to retrieve the section id for nested sections and fields.            
121
-            foreach( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) {
121
+            foreach ( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) {
122 122
                 
123 123
                 $_bIsSubSectionLoaded = false;
124
-                foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField )  {
124
+                foreach ( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) {
125 125
 // @todo Examine if this structure is correct or not. 
126 126
 // It may not be necessary to check the sub-section dimensions as this is not the saved options array.
127 127
                     // if it's a sub-section
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                             continue;
133 133
                         }
134 134
                         $_bIsSubSectionLoaded = true;
135
-                        foreach( $_aSubSectionOrField as $_aField ) {
135
+                        foreach ( $_aSubSectionOrField as $_aField ) {
136 136
                             $this->_setFieldResources( $_aField );     
137 137
                         }
138 138
                         continue;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             private function _setFieldResources( array $aFieldset ) {
158 158
                                 
159 159
                 // Check the field conditions here.
160
-                if ( ! $this->_isFieldsetAllowed( $aFieldset ) ) {
160
+                if ( !$this->_isFieldsetAllowed( $aFieldset ) ) {
161 161
                     return;
162 162
                 }
163 163
                 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                 $this->callBack(
186 186
                     $this->aCallbacks[ 'load_fieldset_resource' ], 
187 187
                     array(
188
-                        $aFieldset,   // 1st parameter 
188
+                        $aFieldset, // 1st parameter 
189 189
                     )
190 190
                 );
191 191
                 
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
                  * @return      boolean
219 219
                  */
220 220
                 private function _isAlreadyRegistered( $sFieldtype, $sStructureType ) {
221
-                    if ( isset( self::$_aRegisteredFieldTypes[ $sFieldtype . '_' .$sStructureType ] ) ) {
221
+                    if ( isset( self::$_aRegisteredFieldTypes[ $sFieldtype.'_'.$sStructureType ] ) ) {
222 222
                         return true;
223 223
                     }
224
-                    self::$_aRegisteredFieldTypes[ $sFieldtype . '_' .$sStructureType ] = true;
224
+                    self::$_aRegisteredFieldTypes[ $sFieldtype.'_'.$sStructureType ] = true;
225 225
                     return false;
226 226
                 }
227 227
                     /**
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             return $this->callBack(
241 241
                 $this->aCallbacks[ 'is_fieldset_registration_allowed' ], 
242 242
                 array(
243
-                    true,   // 1st parameter 
243
+                    true, // 1st parameter 
244 244
                     $aFieldset, // 2nd parameter
245 245
                 )
246 246
             );
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,14 +121,14 @@
 block discarded – undo
121 121
             foreach( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) {
122 122
                 
123 123
                 $_bIsSubSectionLoaded = false;
124
-                foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField )  {
124
+                foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) {
125 125
 // @todo Examine if this structure is correct or not. 
126 126
 // It may not be necessary to check the sub-section dimensions as this is not the saved options array.
127 127
                     // if it's a sub-section
128 128
                     if ( $this->isNumericInteger( $_iSubSectionIndexOrFieldID ) ) {
129 129
 
130 130
                         // no need to repeat the same set of fields
131
-                        if ( $_bIsSubSectionLoaded ) { 
131
+                        if ( $_bIsSubSectionLoaded ) {
132 132
                             continue;
133 133
                         }
134 134
                         $_bIsSubSectionLoaded = true;
Please login to merge, or discard this patch.
element_definition/AdminPageFramework_Form_Model___FieldConditioner.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -60,18 +60,18 @@  discard block
 block discarded – undo
60 60
 
61 61
             // Drop keys of fields-array which do not exist in the sections-array. 
62 62
             // For this reasons, the sections-array should be conditioned first before applying this method.
63
-            $aFields    = $this->castArrayContents( $aSections, $aFields );
63
+            $aFields = $this->castArrayContents( $aSections, $aFields );
64 64
 
65 65
             $_aNewFields = array();
66
-            foreach( $aFields as $_sSectionID => $_aSubSectionOrFields ) {
66
+            foreach ( $aFields as $_sSectionID => $_aSubSectionOrFields ) {
67 67
                 
68 68
                 // This type check is important as the parsing field array is content-cast, which can set null value to elements.
69
-                if ( ! is_array( $_aSubSectionOrFields ) ) { 
69
+                if ( !is_array( $_aSubSectionOrFields ) ) { 
70 70
                     continue; 
71 71
                 }
72 72
                             
73 73
                 $this->_setConditionedFields( 
74
-                    $_aNewFields,   // by reference - gets updated in the method.
74
+                    $_aNewFields, // by reference - gets updated in the method.
75 75
                     $_aSubSectionOrFields, 
76 76
                     $_sSectionID
77 77
                 );
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
              */
92 92
             private function _setConditionedFields( array &$_aNewFields, $_aSubSectionOrFields, $_sSectionID ) {
93 93
                 
94
-                foreach( $_aSubSectionOrFields as $_sIndexOrFieldID => $_aSubSectionOrField ) {
94
+                foreach ( $_aSubSectionOrFields as $_sIndexOrFieldID => $_aSubSectionOrField ) {
95 95
                     
96 96
                     // If it is a sub-section array.
97 97
                     if ( $this->isNumericInteger( $_sIndexOrFieldID ) ) {
98 98
                         $_sSubSectionIndex  = $_sIndexOrFieldID;
99 99
                         $_aFields           = $_aSubSectionOrField;
100
-                        foreach( $_aFields as $_aField ) {
101
-                            if ( ! $this->_isAllowed( $_aField ) ) {
100
+                        foreach ( $_aFields as $_aField ) {
101
+                            if ( !$this->_isAllowed( $_aField ) ) {
102 102
                                 continue;
103 103
                             }
104 104
                             $_aNewFields[ $_sSectionID ][ $_sSubSectionIndex ][ $_aField[ 'field_id' ] ] = $_aField;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                     
110 110
                     // Otherwise, insert the formatted field definition array.
111 111
                     $_aField = $_aSubSectionOrField;
112
-                    if ( ! $this->_isAllowed( $_aField ) ) {
112
+                    if ( !$this->_isAllowed( $_aField ) ) {
113 113
                         continue;
114 114
                     }
115 115
                     $_aNewFields[ $_sSectionID ][ $_aField[ 'field_id' ] ] = $_aField;
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
             foreach( $aFields as $_sSectionID => $_aSubSectionOrFields ) {
67 67
                 
68 68
                 // This type check is important as the parsing field array is content-cast, which can set null value to elements.
69
-                if ( ! is_array( $_aSubSectionOrFields ) ) { 
69
+                if ( ! is_array( $_aSubSectionOrFields ) ) {
70 70
                     continue; 
71 71
                 }
72 72
                             
Please login to merge, or discard this patch.
element_definition/AdminPageFramework_Form_Model___SectionConditioner.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class AdminPageFramework_Form_Model___SectionConditioner extends AdminPageFramework_WPUtility {
19 19
     
20
-    public $aSectionsets  = array();
20
+    public $aSectionsets = array();
21 21
 
22 22
     /**
23 23
      * Sets up hooks.
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $_aParameters = func_get_args() + array( 
29 29
             $this->aSectionsets, 
30 30
         );
31
-        $this->aSectionsets  = $_aParameters[ 0 ];                    
31
+        $this->aSectionsets = $_aParameters[ 0 ];                    
32 32
         
33 33
     }
34 34
 
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
      * @since       DEVVER      Moved from `AdminPageFramework_FormDefinition`. Changed the name from `getConditionedSections()`.
51 51
      * @return      array       The conditioned sectionsets array.
52 52
      */
53
-    private function _getSectionsConditioned( array $aSections=array() ) {
53
+    private function _getSectionsConditioned( array $aSections = array() ) {
54 54
         
55
-        $_aNewSections  = array();
56
-        foreach( $aSections as $_sSectionID => $_aSection ) {
57
-            if ( ! $this->_isAllowed( $_aSection ) ) {
55
+        $_aNewSections = array();
56
+        foreach ( $aSections as $_sSectionID => $_aSection ) {
57
+            if ( !$this->_isAllowed( $_aSection ) ) {
58 58
                 continue;                
59 59
             }
60 60
             $_aNewSections[ $_sSectionID ] = $_aSection;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     protected function _isAllowed( array $aDefinition ) {
74 74
         
75 75
         // Check capability. If the access level is not sufficient, skip.
76
-        if ( ! current_user_can( $aDefinition[ 'capability' ] ) ) { 
76
+        if ( !current_user_can( $aDefinition[ 'capability' ] ) ) { 
77 77
             return false;
78 78
         }
79 79
         return ( boolean ) $aDefinition[ 'if' ];
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
     protected function _isAllowed( array $aDefinition ) {
74 74
         
75 75
         // Check capability. If the access level is not sufficient, skip.
76
-        if ( ! current_user_can( $aDefinition[ 'capability' ] ) ) { 
76
+        if ( ! current_user_can( $aDefinition[ 'capability' ] ) ) {
77 77
             return false;
78 78
         }
79 79
         return ( boolean ) $aDefinition[ 'if' ];
Please login to merge, or discard this patch.