Completed
Branch dev (acf3d0)
by Michael
05:39
created
factory/admin_page/_model/format/AdminPageFramework_Format_InPageTab.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@
 block discarded – undo
31 31
         'page_slug'         => null,
32 32
         'tab_slug'          => null,
33 33
         'title'             => null,
34
-        'order'             => 10,      // (integer)
35
-        'show_in_page_tab'  => true,    // 3.6.0+ (boolean)
36
-        'parent_tab_slug'   => null,    // this needs to be set if the above show_in_page_tab is false so that the framework can mark the parent tab to be active when the hidden page is accessed.
37
-        'url'               => null,    // 3.5.0+ This allows the user set custom link.
38
-        'disabled'          => null,    // 3.5.10+ (boolean) If true, the link will be unlinked.
39
-        'attributes'        => null,    // 3.5.10+ (array) Applies to the navigation tab bar element.    
40
-        'capability'        => null,    // 3.6.0+ (string)
41
-        'if'                => true,    // 3.6.0+ (boolean)
42
-        'show_debug_info'   => null,    // 3.8.8+ (boolean, optional) Whether to show debug information. If not set, the existent `bShowDebugInfo` property value will be used. The initial value here is `null` as the default value will be assigned in the formatting method.
34
+        'order'             => 10, // (integer)
35
+        'show_in_page_tab'  => true, // 3.6.0+ (boolean)
36
+        'parent_tab_slug'   => null, // this needs to be set if the above show_in_page_tab is false so that the framework can mark the parent tab to be active when the hidden page is accessed.
37
+        'url'               => null, // 3.5.0+ This allows the user set custom link.
38
+        'disabled'          => null, // 3.5.10+ (boolean) If true, the link will be unlinked.
39
+        'attributes'        => null, // 3.5.10+ (array) Applies to the navigation tab bar element.    
40
+        'capability'        => null, // 3.6.0+ (string)
41
+        'if'                => true, // 3.6.0+ (boolean)
42
+        'show_debug_info'   => null, // 3.8.8+ (boolean, optional) Whether to show debug information. If not set, the existent `bShowDebugInfo` property value will be used. The initial value here is `null` as the default value will be assigned in the formatting method.
43 43
     );
44 44
     
45 45
     /**
Please login to merge, or discard this patch.
development/factory/page_meta_box/AdminPageFramework_MetaBox_Page.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@
 block discarded – undo
24 24
      * @since       3.0.0
25 25
      * @deprecated  3.7.0      Use     `AdminPageFramework_PageMetaBox` instead.
26 26
      */
27
-    public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) {
27
+    public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) {
28 28
                         
29 29
         parent::__construct( $sMetaBoxID, $sTitle, $asPageSlugs, $sContext, $sPriority, $sCapability, $sTextDomain );
30 30
         
31 31
         $this->oUtil->showDeprecationNotice( 
32
-            'The class, ' . __CLASS__ . ',', // deprecated item
32
+            'The class, '.__CLASS__.',', // deprecated item
33 33
             'AdminPageFramework_PageMetaBox' // alternative
34 34
         );
35 35
         
Please login to merge, or discard this patch.
development/factory/_common/utility/AdminPageFramework_Debug.php 3 patches
Doc Comments   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,6 +177,7 @@  discard block
 block discarded – undo
177 177
          * Determines the log file path.
178 178
          * @since       3.5.3 
179 179
          * @internal    
180
+         * @param string|null $bsFilePath
180 181
          * @return      string      The path of the file to log the contents.
181 182
          */
182 183
         static private function _getLogFilePath( $bsFilePath, $sCallerClass ) {
@@ -213,6 +214,8 @@  discard block
 block discarded – undo
213 214
          * Returns the heading part of a log item.
214 215
          * @since       3.5.3
215 216
          * @internal
217
+         * @param double $fCurrentTimeStamp
218
+         * @param double $nElapsed
216 219
          * @return      string      the heading part of a log item.
217 220
          */
218 221
         static private function _getLogHeadingLine( $fCurrentTimeStamp, $nElapsed, $sCallerClass, $sCallerFunction ) {
@@ -411,7 +414,6 @@  discard block
 block discarded – undo
411 414
                 /**
412 415
                  * @return      string
413 416
                  * @param       scalar      $sScalar        
414
-                 * @param       integer     $iCharLimit     Character length limit to truncate.
415 417
                  * @since       3.8.9
416 418
                  */
417 419
                 static private function _getLegibleScalar( $sScalar ) {
@@ -441,6 +443,7 @@  discard block
 block discarded – undo
441 443
                         
442 444
                     }                
443 445
                     /**
446
+                     * @param string $sString
444 447
                      * @return      string
445 448
                      */
446 449
                     static private function _getLegibleString( $sString, $iCharLimit=200 ) {
@@ -485,6 +488,7 @@  discard block
 block discarded – undo
485 488
     
486 489
         /**
487 490
          * Performs `array_map()` recursively.
491
+         * @param string[] $oCallable
488 492
          * @return      array.
489 493
          * @since       3.8.9
490 494
          */
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @param       string          $sFilePath      The file path for a log file.
34 34
      * @return      void
35 35
      */
36
-    static public function dump( $asArray, $sFilePath=null ) {
36
+    static public function dump( $asArray, $sFilePath = null ) {
37 37
         echo self::get( $asArray, $sFilePath );
38 38
     }    
39 39
         /**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
          * @since unknown
45 45
          * @deprecated      3.2.0
46 46
          */
47
-        static public function dumpArray( $asArray, $sFilePath=null ) {
47
+        static public function dumpArray( $asArray, $sFilePath = null ) {
48 48
             self::dump( $asArray, $sFilePath );
49 49
         }    
50 50
     
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @since       3.8.9
54 54
      * @return      string
55 55
      */
56
-    static public function getDetails( $mValue, $bEscape=true ) {    
56
+    static public function getDetails( $mValue, $bEscape = true ) {    
57 57
         $_sValueWithDetails = self::_getArrayRepresentationSanitized(
58 58
             self::_getLegible( $mValue )
59 59
         );
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      * @param       string          $sFilePath      The file path for a log file.
97 97
      * @param       boolean         $bEscape        Whether to escape characters.
98 98
      */
99
-    static public function get( $asArray, $sFilePath=null, $bEscape=true ) {
99
+    static public function get( $asArray, $sFilePath = null, $bEscape = true ) {
100 100
 
101 101
         if ( $sFilePath ) {
102 102
             self::log( $asArray, $sFilePath );     
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
          * @since       3.0.0 Changed the $bEncloseInTag parameter to bEscape.
119 119
          * @deprecated  3.2.0
120 120
          */
121
-        static public function getArray( $asArray, $sFilePath=null, $bEscape=true ) {
122
-            self::showDeprecationNotice( __CLASS__ .'::' . __FUNCTION__,  __CLASS__ .'::get()' );
121
+        static public function getArray( $asArray, $sFilePath = null, $bEscape = true ) {
122
+            self::showDeprecationNotice( __CLASS__.'::'.__FUNCTION__, __CLASS__.'::get()' );
123 123
             return self::get( $asArray, $sFilePath, $bEscape );
124 124
         }      
125 125
             
@@ -141,18 +141,18 @@  discard block
 block discarded – undo
141 141
      * @param       string      $sFilePath      The log file path.
142 142
      * @return      void
143 143
      **/
144
-    static public function log( $mValue, $sFilePath=null ) {
144
+    static public function log( $mValue, $sFilePath = null ) {
145 145
                 
146 146
         static $_fPreviousTimeStamp = 0;
147 147
         
148 148
         $_oCallerInfo       = debug_backtrace();
149 149
         $_sCallerFunction   = self::getElement(
150
-            $_oCallerInfo,  // subject array
150
+            $_oCallerInfo, // subject array
151 151
             array( 1, 'function' ), // key
152 152
             ''      // default
153 153
         );                        
154
-        $_sCallerClass      = self::getElement(
155
-            $_oCallerInfo,  // subject array
154
+        $_sCallerClass = self::getElement(
155
+            $_oCallerInfo, // subject array
156 156
             array( 1, 'class' ), // key
157 157
             ''      // default
158 158
         );           
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
             self::_getLogFilePath( $sFilePath, $_sCallerClass ), 
163 163
             self::_getLogHeadingLine( 
164 164
                 $_fCurrentTimeStamp,
165
-                round( $_fCurrentTimeStamp - $_fPreviousTimeStamp, 3 ),     // elapsed time
165
+                round( $_fCurrentTimeStamp - $_fPreviousTimeStamp, 3 ), // elapsed time
166 166
                 $_sCallerClass,
167 167
                 $_sCallerFunction
168
-            ) . PHP_EOL
169
-            . self::_getLegible( $mValue ) . PHP_EOL . PHP_EOL,
168
+            ).PHP_EOL
169
+            . self::_getLegible( $mValue ).PHP_EOL.PHP_EOL,
170 170
             FILE_APPEND 
171 171
         );     
172 172
         
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
             }
188 188
             // Return a generated default log path.
189 189
             if ( true === $bsFilePath ) {
190
-                return WP_CONTENT_DIR . DIRECTORY_SEPARATOR . basename( get_class() ) . '_' . date( "Ymd" ) . '.log';
190
+                return WP_CONTENT_DIR.DIRECTORY_SEPARATOR.basename( get_class() ).'_'.date( "Ymd" ).'.log';
191 191
             }
192
-            return WP_CONTENT_DIR . DIRECTORY_SEPARATOR . basename( get_class() ) . '_' . basename( $sCallerClass ) . '_' . date( "Ymd" ) . '.log';
192
+            return WP_CONTENT_DIR.DIRECTORY_SEPARATOR.basename( get_class() ).'_'.basename( $sCallerClass ).'_'.date( "Ymd" ).'.log';
193 193
             
194 194
         }
195 195
             /**
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
              * @internal
199 199
              */
200 200
             static private function _createFile( $sFilePath ) {
201
-                if ( ! $sFilePath || true === $sFilePath ) {
201
+                if ( !$sFilePath || true === $sFilePath ) {
202 202
                     return false;
203 203
                 }
204 204
                 if ( file_exists( $sFilePath ) ) {
@@ -230,11 +230,11 @@  discard block
 block discarded – undo
230 230
             $_nMicroseconds     = str_pad( round( ( $_nNow - floor( $_nNow ) ) * 10000 ), 4, '0' );
231 231
             
232 232
             $_aOutput           = array(
233
-                date( "Y/m/d H:i:s", $_nNow ) . '.' . $_nMicroseconds,
233
+                date( "Y/m/d H:i:s", $_nNow ).'.'.$_nMicroseconds,
234 234
                 self::_getFormattedElapsedTime( $nElapsed ),
235 235
                 $_iPageLoadID,
236 236
                 AdminPageFramework_Registry::getVersion(),
237
-                $sCallerClass . '::' . $sCallerFunction,
237
+                $sCallerClass.'::'.$sCallerFunction,
238 238
                 current_filter(),
239 239
                 self::getCurrentURL(),
240 240
             );
@@ -252,22 +252,22 @@  discard block
 block discarded – undo
252 252
                 $_aElapsedParts     = explode( ".", ( string ) $nElapsed );
253 253
                 $_sElapsedFloat     = str_pad(
254 254
                     self::getElement(
255
-                        $_aElapsedParts,  // subject array
255
+                        $_aElapsedParts, // subject array
256 256
                         1, // key
257 257
                         0      // default
258 258
                     ),      
259 259
                     3, 
260 260
                     '0'
261 261
                 );
262
-                $_sElapsed          = self::getElement(
263
-                    $_aElapsedParts,  // subject array
264
-                    0,  // key
262
+                $_sElapsed = self::getElement(
263
+                    $_aElapsedParts, // subject array
264
+                    0, // key
265 265
                     0   // default
266 266
                 );                                   
267
-                $_sElapsed          = strlen( $_sElapsed ) > 1 
268
-                    ? '+' . substr( $_sElapsed, -1, 2 ) 
269
-                    : ' ' . $_sElapsed;
270
-                return $_sElapsed . '.' . $_sElapsedFloat;
267
+                $_sElapsed = strlen( $_sElapsed ) > 1 
268
+                    ? '+'.substr( $_sElapsed, -1, 2 ) 
269
+                    : ' '.$_sElapsed;
270
+                return $_sElapsed.'.'.$_sElapsedFloat;
271 271
             
272 272
             }
273 273
         /**
@@ -277,8 +277,8 @@  discard block
 block discarded – undo
277 277
          * @since       3.0.3   Changed the default log location and file name.
278 278
          * @deprecated  3.1.0   Use the `log()` method instead.
279 279
          */
280
-        static public function logArray( $asArray, $sFilePath=null ) {
281
-            self::showDeprecationNotice( __CLASS__ .'::' . __FUNCTION__,  __CLASS__ .'::log()' );
280
+        static public function logArray( $asArray, $sFilePath = null ) {
281
+            self::showDeprecationNotice( __CLASS__.'::'.__FUNCTION__, __CLASS__.'::log()' );
282 282
             self::log( $asArray, $sFilePath );     
283 283
         }      
284 284
         
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
          */
314 314
         static private function _getObjectName( $mItem ) {
315 315
             if ( is_object( $mItem ) ) {
316
-                return '(object) ' . get_class( $mItem );
316
+                return '(object) '.get_class( $mItem );
317 317
             }
318 318
             return $mItem;
319 319
         }
@@ -325,8 +325,8 @@  discard block
 block discarded – undo
325 325
          */
326 326
         static private function _getLegible( $mValue ) {                
327 327
             if ( is_array( $mValue ) ) {            
328
-                return '(array, length: ' . count( $mValue ).') ' 
329
-                    . print_r( self::_getLegibleArray( $mValue ) , true );
328
+                return '(array, length: '.count( $mValue ).') ' 
329
+                    . print_r( self::_getLegibleArray( $mValue ), true );
330 330
             }
331 331
             return print_r( self::_getLegibleValue( $mValue ), true );
332 332
         }
@@ -339,16 +339,16 @@  discard block
 block discarded – undo
339 339
         static private function _getLegibleCallable( $asoCallable ) {
340 340
             
341 341
             if ( is_string( $asoCallable ) ) {
342
-                return '(callable) ' . $asoCallable;
342
+                return '(callable) '.$asoCallable;
343 343
             }
344 344
             if ( is_object( $asoCallable ) ) {
345
-                return '(callable) ' . get_class( $asoCallable );
345
+                return '(callable) '.get_class( $asoCallable );
346 346
             }
347 347
             $_sSubject = is_object( $asoCallable[ 0 ] )
348 348
                 ? get_class( $asoCallable[ 0 ] )
349 349
                 : ( string ) $asoCallable[ 0 ];
350 350
 
351
-            return '(callable) ' . $_sSubject . '::' . ( string ) $asoCallable[ 1 ];
351
+            return '(callable) '.$_sSubject.'::'.( string ) $asoCallable[ 1 ];
352 352
             
353 353
         }        
354 354
         /**
@@ -361,8 +361,8 @@  discard block
 block discarded – undo
361 361
             if ( method_exists( $oObject, '__toString' ) ) {
362 362
                 return ( string ) $oObject;
363 363
             }
364
-            return '(object) ' . get_class( $oObject ) . ' ' 
365
-                . count( get_object_vars( $oObject ) ) . ' properties.';
364
+            return '(object) '.get_class( $oObject ).' ' 
365
+                . count( get_object_vars( $oObject ) ).' properties.';
366 366
             
367 367
         } 
368 368
         /**
@@ -400,12 +400,12 @@  discard block
 block discarded – undo
400 400
                         return '(null)';
401 401
                     }                    
402 402
                     if ( is_object( $mNonScalar ) ) {
403
-                        return '(' . $_sType . ') ' . get_class( $mNonScalar );
403
+                        return '('.$_sType.') '.get_class( $mNonScalar );
404 404
                     }
405 405
                     if ( is_array( $mNonScalar ) ) {
406
-                        return '(' . $_sType . ') ' . count( $mNonScalar ) . ' elements';
406
+                        return '('.$_sType.') '.count( $mNonScalar ).' elements';
407 407
                     }
408
-                    return '(' . $_sType . ') ' . ( string ) $mNonScalar;
408
+                    return '('.$_sType.') '.( string ) $mNonScalar;
409 409
                     
410 410
                 }
411 411
                 /**
@@ -417,11 +417,11 @@  discard block
 block discarded – undo
417 417
                 static private function _getLegibleScalar( $sScalar ) {
418 418
                  
419 419
                     if ( is_bool( $sScalar ) ) {
420
-                        return '(boolean) ' . ( $sScalar ? 'true' : 'false' );
420
+                        return '(boolean) '.( $sScalar ? 'true' : 'false' );
421 421
                     }                 
422 422
                     return is_string( $sScalar )
423 423
                         ? self::_getLegibleString( $sScalar )
424
-                        : '(' . gettype( $sScalar ) . ', length: ' . self::_getValueLength( $sScalar ) .  ') ' . $sScalar;
424
+                        : '('.gettype( $sScalar ).', length: '.self::_getValueLength( $sScalar ).') '.$sScalar;
425 425
                 }
426 426
                     /**
427 427
                      * Returns a length of a value.
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
                     /**
444 444
                      * @return      string
445 445
                      */
446
-                    static private function _getLegibleString( $sString, $iCharLimit=200 ) {
446
+                    static private function _getLegibleString( $sString, $iCharLimit = 200 ) {
447 447
                     
448 448
                         static $_iMBSupport;
449 449
                         $_iMBSupport    = isset( $_iMBSupport ) ? $_iMBSupport : ( integer ) function_exists( 'mb_strlen' );
@@ -452,8 +452,8 @@  discard block
 block discarded – undo
452 452
                         
453 453
                         $_iCharLength   = call_user_func_array( $_aStrLenMethod[ $_iMBSupport ], array( $sString ) );
454 454
                         return $_iCharLength <= $iCharLimit
455
-                            ? '(string, length: ' . $_iCharLength . ') ' . $sString
456
-                            : '(string, length: ' . $_iCharLength . ') ' . call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) )
455
+                            ? '(string, length: '.$_iCharLength.') '.$sString
456
+                            : '(string, length: '.$_iCharLength.') '.call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) )
457 457
                                 . '...';
458 458
                         
459 459
                     }
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
          * @return      array
467 467
          * @internal
468 468
          */
469
-        static private function _getSliceByDepth( array $aSubject, $iDepth=0 ) {
469
+        static private function _getSliceByDepth( array $aSubject, $iDepth = 0 ) {
470 470
 
471 471
             foreach ( $aSubject as $_sKey => $_vValue ) {
472 472
                 if ( is_array( $_vValue ) ) {
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @since       3.8.9
54 54
      * @return      string
55 55
      */
56
-    static public function getDetails( $mValue, $bEscape=true ) {    
56
+    static public function getDetails( $mValue, $bEscape=true ) {
57 57
         $_sValueWithDetails = self::_getArrayRepresentationSanitized(
58 58
             self::_getLegible( $mValue )
59 59
         );
@@ -323,8 +323,8 @@  discard block
 block discarded – undo
323 323
          * @since       3.8.9
324 324
          * @return      string
325 325
          */
326
-        static private function _getLegible( $mValue ) {                
327
-            if ( is_array( $mValue ) ) {            
326
+        static private function _getLegible( $mValue ) {
327
+            if ( is_array( $mValue ) ) {
328 328
                 return '(array, length: ' . count( $mValue ).') ' 
329 329
                     . print_r( self::_getLegibleArray( $mValue ) , true );
330 330
             }
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
              * @return      mixed       A modified value.
503 503
              * @since       3.8.9
504 504
              */
505
-            static private function _getArrayMappedNested( $mItem ) {            
505
+            static private function _getArrayMappedNested( $mItem ) {
506 506
                 return is_array( $mItem ) 
507 507
                     ? array_map( array( __CLASS__, '_getArrayMappedNested' ), $mItem ) 
508 508
                     : call_user_func( self::$_oCurrentCallableForArrayMapRecursive, $mItem );            
Please login to merge, or discard this patch.