Completed
Branch dev (69a0d4)
by
unknown
33:44
created
factory/_abstract/utility/base_utility/AdminPageFramework_Utility.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      * @since       3.6.3
45 45
      * @return      string      The captured output buffer.
46 46
      */
47
-    static public function getOutputBuffer( $oCallable, array $aParameters=array() ) {
47
+    static public function getOutputBuffer( $oCallable, array $aParameters = array() ) {
48 48
         
49 49
         ob_start(); 
50 50
         echo call_user_func_array( $oCallable, $aParameters );
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         
66 66
         $_iCount     = count( get_object_vars( $oInstance ) );
67 67
         $_sClassName = get_class( $oInstance );
68
-        return '(object) ' . $_sClassName . ': ' . $_iCount . ' properties.';
68
+        return '(object) '.$_sClassName.': '.$_iCount.' properties.';
69 69
         
70 70
     }
71 71
                    
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * @param       boolean|integer|double|string|array|object|resource|NULL        $mTrue      The value to return when the first parameter value yields false.
83 83
      * @return      mixed
84 84
      */
85
-    static public function getAOrB( $mValue, $mTrue=null, $mFalse=null ) {
85
+    static public function getAOrB( $mValue, $mTrue = null, $mFalse = null ) {
86 86
         return $mValue ? $mTrue : $mFalse;
87 87
     }    
88 88
     
Please login to merge, or discard this patch.
factory/_abstract/utility/base_utility/AdminPageFramework_Utility_Array.php 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      * @return      boolean
25 25
      */
26 26
     static public function isAssociative( array $aArray ) {
27
-        return array_keys ( $aArray ) !== range( 0, count( $aArray ) - 1 );
27
+        return array_keys( $aArray ) !== range( 0, count( $aArray ) - 1 );
28 28
     }      
29 29
                
30 30
     /**
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
      */
58 58
     static public function getReadableListOfArray( array $aArray ) {
59 59
         
60
-        $_aOutput   = array();
61
-        foreach( $aArray as $_sKey => $_vValue ) {        
62
-            $_aOutput[] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ) . PHP_EOL;
60
+        $_aOutput = array();
61
+        foreach ( $aArray as $_sKey => $_vValue ) {        
62
+            $_aOutput[ ] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ).PHP_EOL;
63 63
         }
64 64
         return implode( PHP_EOL, $_aOutput );
65 65
         
@@ -70,37 +70,37 @@  discard block
 block discarded – undo
70 70
      * @since       3.3.0
71 71
      * @return      string      The generated human readable array contents.
72 72
      */
73
-    static public function getReadableArrayContents( $sKey, $vValue, $sLabelCharLengths=16, $iOffset=0 ) {
73
+    static public function getReadableArrayContents( $sKey, $vValue, $sLabelCharLengths = 16, $iOffset = 0 ) {
74 74
         
75 75
         $_aOutput   = array();
76
-        $_aOutput[] = ( $iOffset 
77
-                ? str_pad( ' ', $iOffset  ) 
76
+        $_aOutput[ ] = ( $iOffset 
77
+                ? str_pad( ' ', $iOffset ) 
78 78
                 : '' 
79 79
             ) 
80 80
             . ( $sKey 
81
-                ? '[' . $sKey . ']' 
81
+                ? '['.$sKey.']' 
82 82
                 : '' 
83 83
             );
84 84
         
85
-        if ( ! in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) {
86
-            $_aOutput[] = $vValue;
85
+        if ( !in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) {
86
+            $_aOutput[ ] = $vValue;
87 87
             return implode( PHP_EOL, $_aOutput );                
88 88
         }
89 89
         
90 90
         foreach ( $vValue as $_sTitle => $_asDescription ) {
91
-            if ( ! in_array( gettype( $_asDescription ), array( 'array', 'object' ) ) ) {
92
-                $_aOutput[] = str_pad( ' ', $iOffset )
91
+            if ( !in_array( gettype( $_asDescription ), array( 'array', 'object' ) ) ) {
92
+                $_aOutput[ ] = str_pad( ' ', $iOffset )
93 93
                     . $_sTitle 
94 94
                     . str_pad( ':', $sLabelCharLengths - self::getStringLength( $_sTitle ) )
95 95
                     . $_asDescription;
96 96
                 continue;
97 97
             }
98
-            $_aOutput[] = str_pad( ' ', $iOffset )
98
+            $_aOutput[ ] = str_pad( ' ', $iOffset )
99 99
                 . $_sTitle 
100 100
                 . ": {" 
101 101
                 . self::getReadableArrayContents( '', $_asDescription, 16, $iOffset + 4 )
102 102
                 . PHP_EOL
103
-                . str_pad( ' ', $iOffset ) . "}";
103
+                . str_pad( ' ', $iOffset )."}";
104 104
         }
105 105
         return implode( PHP_EOL, $_aOutput );    
106 106
         
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
      */
114 114
     static public function getReadableListOfArrayAsHTML( array $aArray ) {
115 115
 
116
-        $_aOutput   = array();
117
-        foreach( $aArray as $_sKey => $_vValue ) {        
118
-            $_aOutput[] = "<ul class='array-contents'>" 
116
+        $_aOutput = array();
117
+        foreach ( $aArray as $_sKey => $_vValue ) {        
118
+            $_aOutput[ ] = "<ul class='array-contents'>" 
119 119
                     .  self::getReadableArrayContentsHTML( $_sKey, $_vValue )
120
-                . "</ul>" . PHP_EOL;
120
+                . "</ul>".PHP_EOL;
121 121
         }
122 122
         return implode( PHP_EOL, $_aOutput );    
123 123
         
@@ -134,25 +134,25 @@  discard block
 block discarded – undo
134 134
             $_aOutput   = array();
135 135
             
136 136
             // Title - array key
137
-            $_aOutput[] = $sKey 
138
-                ? "<h3 class='array-key'>" . $sKey . "</h3>"
137
+            $_aOutput[ ] = $sKey 
138
+                ? "<h3 class='array-key'>".$sKey."</h3>"
139 139
                 : "";
140 140
                 
141 141
             // If it does not have a nested array or object, 
142
-            if ( ! in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) {
143
-                $_aOutput[] = "<div class='array-value'>" 
142
+            if ( !in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) {
143
+                $_aOutput[ ] = "<div class='array-value'>" 
144 144
                         . html_entity_decode( nl2br( str_replace( ' ', '&nbsp;', $vValue ) ), ENT_QUOTES )
145 145
                     . "</div>";
146
-                return "<li>" . implode( PHP_EOL, $_aOutput ) . "</li>";    
146
+                return "<li>".implode( PHP_EOL, $_aOutput )."</li>";    
147 147
             }
148 148
             
149 149
             // Now it is a nested item.
150 150
             foreach ( $vValue as $_sKey => $_vValue ) {   
151
-                $_aOutput[] =  "<ul class='array-contents'>" 
151
+                $_aOutput[ ] = "<ul class='array-contents'>" 
152 152
                         . self::getReadableArrayContentsHTML( $_sKey, $_vValue ) 
153 153
                     . "</ul>";
154 154
             }
155
-            return implode( PHP_EOL, $_aOutput ) ;
155
+            return implode( PHP_EOL, $_aOutput );
156 156
             
157 157
         }
158 158
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     static public function getReadableListOfArray( array $aArray ) {
59 59
         
60 60
         $_aOutput   = array();
61
-        foreach( $aArray as $_sKey => $_vValue ) {        
61
+        foreach( $aArray as $_sKey => $_vValue ) {
62 62
             $_aOutput[] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ) . PHP_EOL;
63 63
         }
64 64
         return implode( PHP_EOL, $_aOutput );
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     static public function getReadableListOfArrayAsHTML( array $aArray ) {
115 115
 
116 116
         $_aOutput   = array();
117
-        foreach( $aArray as $_sKey => $_vValue ) {        
117
+        foreach( $aArray as $_sKey => $_vValue ) {
118 118
             $_aOutput[] = "<ul class='array-contents'>" 
119 119
                     .  self::getReadableArrayContentsHTML( $_sKey, $_vValue )
120 120
                 . "</ul>" . PHP_EOL;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
             }
148 148
             
149 149
             // Now it is a nested item.
150
-            foreach ( $vValue as $_sKey => $_vValue ) {   
150
+            foreach ( $vValue as $_sKey => $_vValue ) {
151 151
                 $_aOutput[] =  "<ul class='array-contents'>" 
152 152
                         . self::getReadableArrayContentsHTML( $_sKey, $_vValue ) 
153 153
                     . "</ul>";
Please login to merge, or discard this patch.
_abstract/utility/base_utility/AdminPageFramework_Utility_ArrayGetter.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * @since       DVVER       Moved from `AdminPageFramework_Utility_Array`.
27 27
      */
28 28
     static public function getFirstElement( array $aArray ) {
29
-        foreach( $aArray as $_mElement ) {
29
+        foreach ( $aArray as $_mElement ) {
30 30
             return $_mElement;
31 31
         }
32 32
     }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      * @param       string|array                $asToDefault    When the returning value matches oen of the set values here, the value(s) will be discarded and the default value will be applied.
46 46
      * @return      mixed       The set value or the default value.
47 47
      */
48
-    static public function getElement( $aSubject, $aisKey, $mDefault=null, $asToDefault=array( null ) ) {
48
+    static public function getElement( $aSubject, $aisKey, $mDefault = null, $asToDefault = array( null ) ) {
49 49
         
50 50
         $_aToDefault = is_null( $asToDefault )
51 51
             ? array( null )
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * @since       DVVER       Moved from `AdminPageFramework_Utility_Array`.
73 73
      * @return      array       The cast retrieved element value.
74 74
      */
75
-    static public function getElementAsArray( $aSubject, $aisKey, $mDefault=null, $asToDefault=array( null ) ) {
75
+    static public function getElementAsArray( $aSubject, $aisKey, $mDefault = null, $asToDefault = array( null ) ) {
76 76
         return self::getAsArray( 
77 77
             self::getElement( $aSubject, $aisKey, $mDefault, $asToDefault ),
78 78
             true       // preserve an empty value
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         
92 92
         foreach ( $aParse as $_isKey => $_v ) {
93 93
             
94
-            if ( ! is_numeric( $_isKey ) ) {
94
+            if ( !is_numeric( $_isKey ) ) {
95 95
                 unset( $aParse[ $_isKey ] );
96 96
                 continue;
97 97
             }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             // Convert string numeric value to integer or float.
100 100
             $_isKey = $_isKey + 0; 
101 101
             
102
-            if ( ! is_int( $_isKey ) ) {
102
+            if ( !is_int( $_isKey ) ) {
103 103
                 unset( $aParse[ $_isKey ] );
104 104
             }
105 105
                 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     static public function getNonIntegerKeyElements( array $aParse ) {
119 119
         
120 120
         foreach ( $aParse as $_isKey => $_v ) {
121
-            if ( is_numeric( $_isKey ) && is_int( $_isKey+ 0 ) ) {
121
+            if ( is_numeric( $_isKey ) && is_int( $_isKey + 0 ) ) {
122 122
                 unset( $aParse[ $_isKey ] );     
123 123
             }
124 124
         }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      * @since       DVVER       Moved from `AdminPageFramework_Utility_Array`.
152 152
      * @return      mixed
153 153
      */
154
-    static public function getArrayValueByArrayKeys( $aArray, $aKeys, $vDefault=null ) {
154
+    static public function getArrayValueByArrayKeys( $aArray, $aKeys, $vDefault = null ) {
155 155
         
156 156
         $_sKey = array_shift( $aKeys );
157 157
  
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      * @param       boolean     bPreserveEmpty      If `false` is given, a value that yields `false` such as `false`, an empty sttring `''`, or `0` will not create an element such as `array( false )`. It will be just `array()`.
191 191
      * @return      array       The cast array.
192 192
      */
193
-    static public function getAsArray( $mValue, $bPreserveEmpty=false ) {
193
+    static public function getAsArray( $mValue, $bPreserveEmpty = false ) {
194 194
         
195 195
         if ( is_array( $mValue ) ) {
196 196
             return $mValue; 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -158,7 +158,8 @@
 block discarded – undo
158 158
         // array_key_exists( $_sKey, $aArray ) caused warnings in some occasions
159 159
         if ( isset( $aArray[ $_sKey ] ) ) {
160 160
             
161
-            if ( empty( $aKeys ) ) { // no more keys 
161
+            if ( empty( $aKeys ) ) {
162
+// no more keys 
162 163
                 return $aArray[ $_sKey ];
163 164
             }
164 165
             
Please login to merge, or discard this patch.
_abstract/utility/base_utility/AdminPageFramework_Utility_ArraySetter.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * @return      integer
35 35
      * @internal
36 36
      */        
37
-    static public function sortArrayByKey( $a, $b, $sKey='order' ) {
37
+    static public function sortArrayByKey( $a, $b, $sKey = 'order' ) {
38 38
         return isset( $a[ $sKey ], $b[ $sKey ] )
39 39
             ? $a[ $sKey ] - $b[ $sKey ]
40 40
             : 1;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     static public function unsetDimensionalArrayElement( &$mSubject, array $aKeys ) {
78 78
         
79 79
         $_sKey = array_shift( $aKeys );
80
-        if ( ! empty( $aKeys ) ) {
80
+        if ( !empty( $aKeys ) ) {
81 81
             if ( isset( $mSubject[ $_sKey ] ) && is_array( $mSubject[ $_sKey ] ) ) {
82 82
                 self::unsetDimensionalArrayElement( $mSubject[ $_sKey ], $aKeys );
83 83
             }
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
     static public function setMultiDimensionalArray( &$mSubject, array $aKeys, $mValue ) {
99 99
 
100 100
         $_sKey = array_shift( $aKeys );
101
-        if ( ! empty( $aKeys ) ) {
102
-            if( ! isset( $mSubject[ $_sKey ] ) || ! is_array( $mSubject[ $_sKey ] ) ) {
101
+        if ( !empty( $aKeys ) ) {
102
+            if ( !isset( $mSubject[ $_sKey ] ) || !is_array( $mSubject[ $_sKey ] ) ) {
103 103
                 $mSubject[ $_sKey ] = array();
104 104
             }
105 105
             self::setMultiDimensionalArray( $mSubject[ $_sKey ], $aKeys, $mValue );
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
 
154 154
         $_aNumeric      = self::getIntegerKeyElements( $aSubject );
155 155
         $_aAssociative  = self::invertCastArrayContents( $aSubject, $_aNumeric );
156
-        foreach( $_aNumeric as &$_aElem ) {
156
+        foreach ( $_aNumeric as &$_aElem ) {
157 157
             $_aElem = self::uniteArrays( $_aElem, $_aAssociative );
158 158
         }
159
-        if ( ! empty( $_aAssociative ) ) {
159
+        if ( !empty( $_aAssociative ) ) {
160 160
             array_unshift( $_aNumeric, $_aAssociative ); // insert the main section to the beginning of the array.
161 161
         }
162 162
         return $_aNumeric;
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
     public static function castArrayContents( array $aModel, array $aSubject ) {
180 180
         
181 181
         $_aCast = array();
182
-        foreach( $aModel as $_isKey => $_v ) {
182
+        foreach ( $aModel as $_isKey => $_v ) {
183 183
             $_aCast[ $_isKey ] = self::getElement(
184
-                $aSubject,  // subject array
185
-                $_isKey,    // key
184
+                $aSubject, // subject array
185
+                $_isKey, // key
186 186
                 null        // default
187 187
             );                 
188 188
         }
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     public static function invertCastArrayContents( array $aModel, array $aSubject ) {
204 204
         
205 205
         $_aInvert = array();
206
-        foreach( $aModel as $_isKey => $_v ) {
206
+        foreach ( $aModel as $_isKey => $_v ) {
207 207
             if ( array_key_exists( $_isKey, $aSubject ) ) { 
208 208
                 continue; 
209 209
             }
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     public static function uniteArrays( /* $aPrecedence, $aArray1, $aArray2, ... */ ) {
230 230
                 
231 231
         $_aArray = array();
232
-        foreach( array_reverse( func_get_args() ) as $_aArg ) {
232
+        foreach ( array_reverse( func_get_args() ) as $_aArg ) {
233 233
             $_aArray = self::uniteArraysRecursive( 
234 234
                 self::getAsArray( $_aArg ), 
235 235
                 $_aArray 
@@ -260,14 +260,14 @@  discard block
 block discarded – undo
260 260
             $aPrecedence = array(); 
261 261
         }
262 262
         
263
-        if ( ! is_array( $aDefault ) || ! is_array( $aPrecedence ) ) { 
263
+        if ( !is_array( $aDefault ) || !is_array( $aPrecedence ) ) { 
264 264
             return $aPrecedence; 
265 265
         }
266 266
             
267
-        foreach( $aDefault as $sKey => $v ) {
267
+        foreach ( $aDefault as $sKey => $v ) {
268 268
             
269 269
             // If the precedence does not have the key, assign the default's value.
270
-            if ( ! array_key_exists( $sKey, $aPrecedence ) || is_null( $aPrecedence[ $sKey ] ) ) {
270
+            if ( !array_key_exists( $sKey, $aPrecedence ) || is_null( $aPrecedence[ $sKey ] ) ) {
271 271
                 $aPrecedence[ $sKey ] = $v;
272 272
             } else {
273 273
                 
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
      *  - NULL
299 299
      * @return      array       The modified array.
300 300
      */
301
-    static public function dropElementsByType( array $aArray, $aTypes=array( 'array' ) ) {
301
+    static public function dropElementsByType( array $aArray, $aTypes = array( 'array' ) ) {
302 302
         
303
-        foreach( $aArray as $isKey => $vValue ) {
303
+        foreach ( $aArray as $isKey => $vValue ) {
304 304
             if ( in_array( gettype( $vValue ), $aTypes ) ) {
305 305
                 unset( $aArray[ $isKey ] );
306 306
             }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
      */
317 317
     static public function dropElementByValue( array $aArray, $vValue ) {
318 318
          
319
-        foreach( self::getAsArray( $vValue, true ) as $_vValue ) {
319
+        foreach ( self::getAsArray( $vValue, true ) as $_vValue ) {
320 320
             $_sKey = array_search( $_vValue, $aArray, true );
321 321
             if ( $_sKey === false ) {
322 322
                 continue;
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
      */
339 339
     static public function dropElementsByKey( array $aArray, $asKeys ) {
340 340
         
341
-        foreach( self::getAsArray( $asKeys, true ) as $_isKey ) {
341
+        foreach ( self::getAsArray( $asKeys, true ) as $_isKey ) {
342 342
             unset( $aArray[ $_isKey ] );
343 343
         }
344 344
         return $aArray;
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         
205 205
         $_aInvert = array();
206 206
         foreach( $aModel as $_isKey => $_v ) {
207
-            if ( array_key_exists( $_isKey, $aSubject ) ) { 
207
+            if ( array_key_exists( $_isKey, $aSubject ) ) {
208 208
                 continue; 
209 209
             }
210 210
             $_aInvert[ $_isKey ] = $_v;
@@ -256,11 +256,11 @@  discard block
 block discarded – undo
256 256
      */ 
257 257
     public static function uniteArraysRecursive( $aPrecedence, $aDefault ) {
258 258
                 
259
-        if ( is_null( $aPrecedence ) ) { 
259
+        if ( is_null( $aPrecedence ) ) {
260 260
             $aPrecedence = array(); 
261 261
         }
262 262
         
263
-        if ( ! is_array( $aDefault ) || ! is_array( $aPrecedence ) ) { 
263
+        if ( ! is_array( $aDefault ) || ! is_array( $aPrecedence ) ) {
264 264
             return $aPrecedence; 
265 265
         }
266 266
             
Please login to merge, or discard this patch.
_abstract/utility/base_utility/AdminPageFramework_Utility_HTMLAttribute.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
      */
37 37
     static public function getInlineCSS( array $aCSSRules ) {
38 38
         $_aOutput = array();
39
-        foreach( $aCSSRules as $_sProperty => $_sValue ) {
40
-            $_aOutput[] = $_sProperty . ': ' . $_sValue;
39
+        foreach ( $aCSSRules as $_sProperty => $_sValue ) {
40
+            $_aOutput[ ] = $_sProperty.': '.$_sValue;
41 41
         }
42 42
         return implode( '; ', $_aOutput );
43 43
     }    
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     static public function getStyleAttribute( $asInlineCSSes ) {
69 69
         
70 70
         $_aCSSRules = array();
71
-        foreach( array_reverse( func_get_args() ) as $_asCSSRules ) {
71
+        foreach ( array_reverse( func_get_args() ) as $_asCSSRules ) {
72 72
             
73 73
             // For array, store in the container.
74 74
             if ( is_array( $_asCSSRules ) ) {
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
             
79 79
             // At this point, it is a string. Break them down to array elements.
80 80
             $__aCSSRules = explode( ';', $_asCSSRules );
81
-            foreach( $__aCSSRules as $_sPair ) {
81
+            foreach ( $__aCSSRules as $_sPair ) {
82 82
                 $_aCSSPair = explode( ':', $_sPair );
83
-                if ( ! isset( $_aCSSPair[ 0 ], $_aCSSPair[ 1 ] ) ) {
83
+                if ( !isset( $_aCSSPair[ 0 ], $_aCSSPair[ 1 ] ) ) {
84 84
                     continue;
85 85
                 }
86 86
                 $_aCSSRules[ $_aCSSPair[ 0 ] ] = $_aCSSPair[ 1 ];
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
      */
118 118
     static public function getClassAttribute( /* $asClassSelectors1, $asClassSelectors12, ... */ ) {
119 119
         
120
-        $_aClasses  = array();
121
-        foreach( func_get_args() as $_asClasses ) {
122
-            if ( ! in_array( gettype( $_asClasses ), array( 'array', 'string' ) ) ) {
120
+        $_aClasses = array();
121
+        foreach ( func_get_args() as $_asClasses ) {
122
+            if ( !in_array( gettype( $_asClasses ), array( 'array', 'string' ) ) ) {
123 123
                 continue;
124 124
             }            
125 125
             $_aClasses = array_merge( 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
                     : explode( ' ', $_asClasses )
130 130
             );
131 131
         }
132
-        $_aClasses  = array_unique( array_filter( $_aClasses ) );
132
+        $_aClasses = array_unique( array_filter( $_aClasses ) );
133 133
         
134 134
         // @todo examine if it is okay to remove the trim() function below.
135 135
         return trim( implode( ' ', $_aClasses ) );
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         static public function generateClassAttribute( /* $asClassSelectors1, $asClassSelectors12 ... */ ) {
146 146
             $_aParams = func_get_args();
147 147
             return call_user_func_array(
148
-                array( __CLASS__ , 'getClassAttribute' ), 
148
+                array( __CLASS__, 'getClassAttribute' ), 
149 149
                 $_aParams
150 150
             );        
151 151
         }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     static public function getDataAttributeArray( array $aArray ) {
160 160
         
161 161
         $_aNewArray = array();
162
-        foreach( $aArray as $sKey => $v ) {
162
+        foreach ( $aArray as $sKey => $v ) {
163 163
             if ( in_array( gettype( $v ), array( 'array', 'object' ) ) ) {
164 164
                 continue;
165 165
             }            
Please login to merge, or discard this patch.
development/factory/widget/_model/AdminPageFramework_Property_Widget.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,9 +104,9 @@
 block discarded – undo
104 104
      * Sets up properties.
105 105
      * @since       DEVVER
106 106
      */
107
-    public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType ) {
107
+    public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework', $sStructureType ) {
108 108
 
109
-        $this->_sFormRegistrationHook = 'load_' . $sClassName; // DEVVER+
109
+        $this->_sFormRegistrationHook = 'load_'.$sClassName; // DEVVER+
110 110
         // $this->_sFormRegistrationHook = 'current_screen';
111 111
 
112 112
         parent::__construct(
Please login to merge, or discard this patch.
class/admin/admin-page-framework/AdminPageFrameworkLoader_AdminPage.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -18,16 +18,16 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function start() {
20 20
   
21
-        if ( ! $this->oProp->bIsAdmin ) {
21
+        if ( !$this->oProp->bIsAdmin ) {
22 22
             return;
23 23
         }
24 24
       
25 25
         // Allows the user to switch the menu visibility.
26
-        if ( isset( $_GET['enable_apfl_admin_pages'] ) ) {
26
+        if ( isset( $_GET[ 'enable_apfl_admin_pages' ] ) ) {
27 27
             
28 28
             // Update the options and reload the page
29
-            $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys['main'] );
30
-            $_oOption->update( 'enable_admin_pages', $_GET['enable_apfl_admin_pages'] );
29
+            $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] );
30
+            $_oOption->update( 'enable_admin_pages', $_GET[ 'enable_apfl_admin_pages' ] );
31 31
             
32 32
             $this->oUtil->goToLocalURL( 
33 33
                 remove_query_arg( 'enable_apfl_admin_pages' ),
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
         }
38 38
         
39 39
         // Enable / disable the demo pages
40
-        if ( isset( $_GET['enable_apfl_demo_pages'] ) ) {
40
+        if ( isset( $_GET[ 'enable_apfl_demo_pages' ] ) ) {
41 41
             
42 42
             // Update the options and reload the page
43
-            $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys['main'] );
44
-            $_oOption->update( 'enable_demo', $_GET['enable_apfl_demo_pages'] );            
43
+            $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] );
44
+            $_oOption->update( 'enable_demo', $_GET[ 'enable_apfl_demo_pages' ] );            
45 45
              
46 46
             if ( $_GET[ 'enable_apfl_demo_pages' ] ) {
47 47
                 $this->setSettingNotice( 
@@ -67,15 +67,15 @@  discard block
 block discarded – undo
67 67
     public function setUp() {
68 68
 
69 69
         $_aOptions          = $this->oProp->aOptions;
70
-        $_bAdminPageEnabled = ! is_array( $_aOptions )  // for the first time of loading, the option is not set and it is not an array. 
71
-            || ( isset( $_aOptions['enable_admin_pages'] ) && $_aOptions['enable_admin_pages'] );    
70
+        $_bAdminPageEnabled = !is_array( $_aOptions )  // for the first time of loading, the option is not set and it is not an array. 
71
+            || ( isset( $_aOptions[ 'enable_admin_pages' ] ) && $_aOptions[ 'enable_admin_pages' ] );    
72 72
     
73 73
         // Set up pages
74 74
         if ( $_bAdminPageEnabled ) {
75 75
             
76 76
             $this->setRootMenuPage( 
77
-                AdminPageFrameworkLoader_Registry::SHORTNAME,     // menu slug
78
-                AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/image/wp-logo_16x16.png', // menu icon
77
+                AdminPageFrameworkLoader_Registry::SHORTNAME, // menu slug
78
+                AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/image/wp-logo_16x16.png', // menu icon
79 79
                 4  // menu position
80 80
             ); 
81 81
                         
@@ -83,21 +83,21 @@  discard block
 block discarded – undo
83 83
             new AdminPageFrameworkLoader_AdminPage_Tool( 
84 84
                 $this,
85 85
                 array(
86
-                    'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages['tool'],
86
+                    'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ],
87 87
                     'title'     => __( 'Tools', 'admin-page-framework-loader' ),
88 88
                 )
89 89
             );
90 90
             new AdminPageFrameworkLoader_AdminPage_Addon(
91 91
                 $this,
92 92
                 array(
93
-                    'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages['addon'],    // page slug
93
+                    'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], // page slug
94 94
                     'title'     => __( 'Add Ons', 'admin-page-framework-loader' ),
95 95
                 )                
96 96
             );
97 97
             new AdminPageFrameworkLoader_AdminPage_Help( 
98 98
                 $this,
99 99
                 array(
100
-                    'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages['help'],
100
+                    'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'help' ],
101 101
                     'title'     => __( 'Help', 'admin-page-framework-loader' ),
102 102
                     'order'     => 1000, // to be the last menu item
103 103
                 )                
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
             $this->setPluginSettingsLinkLabel( '' ); // pass an empty string to disable it.
121 121
        
122 122
             // Styles
123
-            $this->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css' );
124
-            $this->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' );
123
+            $this->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css' );
124
+            $this->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' );
125 125
            
126 126
             // Action Links (plugin.php)
127 127
             $this->addLinkToPluginTitle(
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                 $this->_getDemoSwitcherLink( $_bAdminPageEnabled, $_aOptions )
131 131
             );
132 132
             $this->addLinkToPluginDescription(
133
-                "<a href='https://wordpress.org/support/plugin/admin-page-framework' target='_blank'>" . __( 'Support', 'admin-page-framework-loader' ) . "</a>"
133
+                "<a href='https://wordpress.org/support/plugin/admin-page-framework' target='_blank'>".__( 'Support', 'admin-page-framework-loader' )."</a>"
134 134
             );            
135 135
             
136 136
         }
@@ -138,24 +138,24 @@  discard block
 block discarded – undo
138 138
          * Returns the Tools admin page link.
139 139
          */
140 140
         private function _getAdminURLTools( $_bAdminPageEnabled ) {
141
-            if ( ! $_bAdminPageEnabled ) {
141
+            if ( !$_bAdminPageEnabled ) {
142 142
                 return;
143 143
             }
144
-            $_sLink    = esc_url(
144
+            $_sLink = esc_url(
145 145
                 add_query_arg( 
146 146
                     array( 
147
-                        'page' => AdminPageFrameworkLoader_Registry::$aAdminPages['tool'],
147
+                        'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ],
148 148
                     ),
149 149
                     admin_url( 'admin.php' )
150 150
                 )
151 151
             );                
152
-            return "<a href='{$_sLink}'>" . __( 'Tools', 'admin-page-framework-loader' ) . "</a>";
152
+            return "<a href='{$_sLink}'>".__( 'Tools', 'admin-page-framework-loader' )."</a>";
153 153
         }
154 154
         /**
155 155
          * Returns the Enable /Disable Admin Pages link.
156 156
          */
157 157
         private function _getAdminPageSwitchLink( $bEnabled ) {
158
-            $_sLink    = esc_url( 
158
+            $_sLink = esc_url( 
159 159
                 add_query_arg( 
160 160
                     array( 
161 161
                         'enable_apfl_admin_pages' => $bEnabled ? 0 : 1,
@@ -163,19 +163,19 @@  discard block
 block discarded – undo
163 163
                 )
164 164
             );            
165 165
             return $bEnabled
166
-                ? "<a href='{$_sLink}'>" . __( 'Disable Admin Pages', 'admin-page-framework-loader' ) . "</a>"
167
-                : "<a href='{$_sLink}'>" . __( 'Enable Admin Pages', 'admin-page-framework-loader' ) . "</a>";                     
166
+                ? "<a href='{$_sLink}'>".__( 'Disable Admin Pages', 'admin-page-framework-loader' )."</a>"
167
+                : "<a href='{$_sLink}'>".__( 'Enable Admin Pages', 'admin-page-framework-loader' )."</a>";                     
168 168
         }
169 169
         /**
170 170
          * Returns the switch link of the demo pages.
171 171
          */
172
-        private function _getDemoSwitcherLink( $_bAdminPageEnabled, $mOptions=array() ) {
172
+        private function _getDemoSwitcherLink( $_bAdminPageEnabled, $mOptions = array() ) {
173 173
             
174
-            if ( ! $_bAdminPageEnabled ) {
174
+            if ( !$_bAdminPageEnabled ) {
175 175
                 return '';
176 176
             }
177
-            $_bEnabled  = isset( $mOptions['enable_demo'] ) && $mOptions['enable_demo'];
178
-            $_sLink    = esc_url( 
177
+            $_bEnabled = isset( $mOptions[ 'enable_demo' ] ) && $mOptions[ 'enable_demo' ];
178
+            $_sLink = esc_url( 
179 179
                 add_query_arg( 
180 180
                     array( 
181 181
                         'enable_apfl_demo_pages' => $_bEnabled ? 0 : 1,
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
                 )
184 184
             );        
185 185
             return $_bEnabled
186
-                ? "<a href='{$_sLink}'>" . __( 'Disable Demo', 'admin-page-framework-loader' ) . "</a>"
187
-                : "<a href='{$_sLink}'><strong id='activate-demo-action-link' style='font-size: 1em;'>" . __( 'Enable Demo', 'admin-page-framework-loader' ) . "</strong></a>";
186
+                ? "<a href='{$_sLink}'>".__( 'Disable Demo', 'admin-page-framework-loader' )."</a>"
187
+                : "<a href='{$_sLink}'><strong id='activate-demo-action-link' style='font-size: 1em;'>".__( 'Enable Demo', 'admin-page-framework-loader' )."</strong></a>";
188 188
             
189 189
         }            
190 190
 
Please login to merge, or discard this patch.