Completed
Branch master (6574bf)
by
unknown
07:51 queued 04:01
created
factory/_common/form/field_type/AdminPageFramework_FieldType_system.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -231,6 +231,7 @@  discard block
 block discarded – undo
231 231
             /**
232 232
              * Returns the system information by section.
233 233
              * @since       3.5.3
234
+             * @param integer $iPrintType
234 235
              * @return      string      The system information by section.
235 236
              */
236 237
             private function _getSystemInfoBySection( $sSectionName, $aData, $iPrintType ) {
@@ -350,6 +351,8 @@  discard block
 block discarded – undo
350 351
                     /**
351 352
                      * 
352 353
                      * @since       3.5.12
354
+                     * @param string $asCategories
355
+                     * @param string $asRemovingCategories
353 356
                      * @return      stirng|array
354 357
                      */
355 358
                     private function _getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) {
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      * @internal
145 145
      * @return      array
146 146
      */
147
-    protected function getEnqueuingScripts() { 
147
+    protected function getEnqueuingScripts() {
148 148
         return array();
149 149
     }
150 150
     
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      * @return      array
163 163
      * @internal
164 164
      */
165
-    protected function getEnqueuingStyles() { 
165
+    protected function getEnqueuingStyles() {
166 166
         return array();
167 167
     }            
168 168
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      * @internal
173 173
      * @return      string
174 174
      */ 
175
-    protected function getScripts() { 
175
+    protected function getScripts() {
176 176
         return '';
177 177
     }
178 178
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
      * @internal
183 183
      * @return      string
184 184
      */
185
-    protected function getIEStyles() { 
185
+    protected function getIEStyles() {
186 186
         return ''; 
187 187
     }
188 188
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
      * @internal
224 224
      * @return      string
225 225
      */
226
-    protected function getField( $aField ) { 
226
+    protected function getField( $aField ) {
227 227
 
228 228
         $_aInputAttributes           = $aField['attributes'];
229 229
         $_aInputAttributes['class'] .= ' system';
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      * </code>
74 74
      * @var         array
75 75
      */
76
-    public $aFieldTypeSlugs = array( 'system', );
76
+    public $aFieldTypeSlugs = array( 'system',);
77 77
     
78 78
     /**
79 79
      * Defines the default key-values of this field type. 
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
      * @remark          `$_aDefaultKeys` holds shared default key-values defined in the base class.
94 94
      */
95 95
     protected $aDefaultKeys = array(
96
-        'data'          =>  array(),        // [3.2.0+] Stores the data to be displayed
97
-        'print_type'    =>  1,              // [3.4.6+] 1: readable representation of array. 2: print_r()
96
+        'data'          =>  array(), // [3.2.0+] Stores the data to be displayed
97
+        'print_type'    =>  1, // [3.4.6+] 1: readable representation of array. 2: print_r()
98 98
         'attributes'    =>    array(
99 99
             'rows'          => 60,
100 100
             'autofocus'     => null,
@@ -233,13 +233,13 @@  discard block
 block discarded – undo
233 233
             . "<div class='admin-page-framework-input-label-container'>"
234 234
                 . "<label for='{$aField[ 'input_id' ]}'>"
235 235
                     . $aField[ 'before_input' ]
236
-                    . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ]
237
-                        ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
236
+                    . ( $aField[ 'label' ] && !$aField[ 'repeatable' ]
237
+                        ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
238 238
                                 . $aField[ 'label' ] 
239 239
                             . "</span>"
240 240
                         : "" 
241 241
                     )
242
-                    . "<textarea " . $this->getAttributes( $_aInputAttributes ) . " >"    
242
+                    . "<textarea ".$this->getAttributes( $_aInputAttributes )." >"    
243 243
                         . esc_textarea( $this->_getSystemInfomation( $aField[ 'value' ], $aField[ 'data' ], $aField[ 'print_type' ] ) )
244 244
                     . "</textarea>"
245 245
                     . $aField[ 'after_input' ]
@@ -254,15 +254,15 @@  discard block
 block discarded – undo
254 254
          * @return      string      The human readable system information.
255 255
          * @internal
256 256
          */
257
-        private function _getSystemInfomation( $asValue=null, $asCustomData=null, $iPrintType=1 ) {
257
+        private function _getSystemInfomation( $asValue = null, $asCustomData = null, $iPrintType = 1 ) {
258 258
 
259 259
             if ( isset( $asValue ) ) {
260 260
                 return $asValue;
261 261
             }
262 262
 
263
-            $_aOutput   = array();
264
-            foreach( $this->_getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) {
265
-                $_aOutput[] = $this->_getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType );
263
+            $_aOutput = array();
264
+            foreach ( $this->_getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) {
265
+                $_aOutput[ ] = $this->_getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType );
266 266
             }
267 267
             return implode( PHP_EOL, $_aOutput );
268 268
             
@@ -277,18 +277,18 @@  discard block
 block discarded – undo
277 277
                 
278 278
                 $_aData = $this->getAsArray( $asCustomData );
279 279
                 $_aData = $_aData + array(
280
-                    'Admin Page Framework'  => isset( $_aData['Admin Page Framework'] )
280
+                    'Admin Page Framework'  => isset( $_aData[ 'Admin Page Framework' ] )
281 281
                         ? null
282 282
                         : AdminPageFramework_Registry::getInfo(),
283
-                    'WordPress'             => $this->_getSiteInfoWithCache( ! isset( $_aData['WordPress'] ) ),
284
-                    'PHP'                   => $this->_getPHPInfo( ! isset( $_aData['PHP'] ) ),
285
-                    'PHP Error Log'         => $this->_getErrorLogByType( 'php', ! isset( $_aData['PHP Error Log'] ) ),
286
-                    'MySQL'                 => isset( $_aData['MySQL'] )
283
+                    'WordPress'             => $this->_getSiteInfoWithCache( !isset( $_aData[ 'WordPress' ] ) ),
284
+                    'PHP'                   => $this->_getPHPInfo( !isset( $_aData[ 'PHP' ] ) ),
285
+                    'PHP Error Log'         => $this->_getErrorLogByType( 'php', !isset( $_aData[ 'PHP Error Log' ] ) ),
286
+                    'MySQL'                 => isset( $_aData[ 'MySQL' ] )
287 287
                         ? null
288
-                        : $this->getMySQLInfo(),    // defined in the utility class.
289
-                    'MySQL Error Log'       => $this->_getErrorLogByType( 'mysql', ! isset( $_aData['MySQL Error Log'] ) ),
290
-                    'Server'                => $this->_getWebServerInfo( ! isset( $_aData['Server'] ) ),
291
-                    'Browser'               => $this->_getClientInfo( ! isset( $_aData['Browser'] ) ),
288
+                        : $this->getMySQLInfo(), // defined in the utility class.
289
+                    'MySQL Error Log'       => $this->_getErrorLogByType( 'mysql', !isset( $_aData[ 'MySQL Error Log' ] ) ),
290
+                    'Server'                => $this->_getWebServerInfo( !isset( $_aData[ 'Server' ] ) ),
291
+                    'Browser'               => $this->_getClientInfo( !isset( $_aData[ 'Browser' ] ) ),
292 292
                 );
293 293
                 
294 294
                 // Dropping empty elements allows the user to remove a section by setting an empty section.
@@ -305,10 +305,10 @@  discard block
 block discarded – undo
305 305
                 switch ( $iPrintType ) {
306 306
                     default:
307 307
                     case 1: // use the framework readable representation of arrays.
308
-                        return $this->getReadableArrayContents( $sSectionName, $aData, 32 ) . PHP_EOL;
308
+                        return $this->getReadableArrayContents( $sSectionName, $aData, 32 ).PHP_EOL;
309 309
                     case 2: // use print_r()
310
-                        return "[{$sSectionName}]" . PHP_EOL
311
-                            . print_r( $aData, true ) . PHP_EOL;
310
+                        return "[{$sSectionName}]".PHP_EOL
311
+                            . print_r( $aData, true ).PHP_EOL;
312 312
                 }                      
313 313
             }
314 314
             /**
@@ -318,17 +318,17 @@  discard block
 block discarded – undo
318 318
              * @since       3.4.6
319 319
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
320 320
              */
321
-            private function _getClientInfo( $bGenerateInfo=true ) {
321
+            private function _getClientInfo( $bGenerateInfo = true ) {
322 322
                  
323
-                if ( ! $bGenerateInfo ) {
323
+                if ( !$bGenerateInfo ) {
324 324
                     return '';
325 325
                 }
326 326
                  
327 327
                 // Check the browscap value in the ini file first to prevent warnings from being populated
328 328
                 $_aBrowser = @ini_get( 'browscap' ) 
329
-                    ? get_browser( $_SERVER['HTTP_USER_AGENT'], true )
329
+                    ? get_browser( $_SERVER[ 'HTTP_USER_AGENT' ], true )
330 330
                     : array();
331
-                unset( $_aBrowser['browser_name_regex'] );  // this element causes output to be blank
331
+                unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank
332 332
                 return empty( $_aBrowser ) 
333 333
                     ? __( 'No browser information found.', 'admin-page-framework' )
334 334
                     : $_aBrowser;
@@ -344,9 +344,9 @@  discard block
 block discarded – undo
344 344
              * @param       string      $sType          The error log type. Either 'php' or 'mysql' is accepted.
345 345
              * @param       boolean     $bGenerateInfo  Whether to generate a log. This is for the caller method to reduce a conditinal statement.
346 346
              */
347
-            private function _getErrorLogByType( $sType, $bGenerateInfo=true ) {
347
+            private function _getErrorLogByType( $sType, $bGenerateInfo = true ) {
348 348
 
349
-                if ( ! $bGenerateInfo ) {
349
+                if ( !$bGenerateInfo ) {
350 350
                     return '';
351 351
                 }
352 352
                 switch ( $sType ) {
@@ -378,9 +378,9 @@  discard block
 block discarded – undo
378 378
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
379 379
              * @return      array      The generated site information array.
380 380
              */
381
-            private function _getSiteInfoWithCache( $bGenerateInfo=true ) {
381
+            private function _getSiteInfoWithCache( $bGenerateInfo = true ) {
382 382
                 
383
-                if ( ! $bGenerateInfo || isset( self::$_aSiteInfo ) ) {
383
+                if ( !$bGenerateInfo || isset( self::$_aSiteInfo ) ) {
384 384
                     return self::$_aSiteInfo;
385 385
                 }
386 386
                 self::$_aSiteInfo = self::_getSiteInfo();
@@ -414,8 +414,8 @@  discard block
 block discarded – undo
414 414
                         'wp_remote_get()'                                           => $this->_getWPRemoteGetStatus(),
415 415
                         __( 'Multibite String Extension', 'admin-page-framework' )  => $this->getAOrB( function_exists( 'mb_detect_encoding' ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ),
416 416
                         __( 'WP_CONTENT_DIR Writeable', 'admin-page-framework' )    => $this->getAOrB( is_writable( WP_CONTENT_DIR ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), 
417
-                        __( 'Active Plugins', 'admin-page-framework' )              => PHP_EOL . $this->_getActivePlugins(),
418
-                        __( 'Network Active Plugins', 'admin-page-framework' )      => PHP_EOL . $this->_getNetworkActivePlugins(),
417
+                        __( 'Active Plugins', 'admin-page-framework' )              => PHP_EOL.$this->_getActivePlugins(),
418
+                        __( 'Network Active Plugins', 'admin-page-framework' )      => PHP_EOL.$this->_getNetworkActivePlugins(),
419 419
                         __( 'Constants', 'admin-page-framework' )                   => $this->_getDefinedConstants( 'user' ),
420 420
                     );                        
421 421
                 }
@@ -425,9 +425,9 @@  discard block
 block discarded – undo
425 425
                      * @return      string|array
426 426
                      * @internal
427 427
                      */
428
-                    private function _getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) {
428
+                    private function _getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) {
429 429
                         $_asConstants = $this->getDefinedConstants( $asCategories, $asRemovingCategories );
430
-                        if ( ! is_array( $_asConstants ) ) {
430
+                        if ( !is_array( $_asConstants ) ) {
431 431
                             return $_asConstants;
432 432
                         }
433 433
                         if ( isset( $_asConstants[ 'user' ] ) ) {
@@ -463,13 +463,13 @@  discard block
 block discarded – undo
463 463
                 private function _getActiveThemeName() {
464 464
                     
465 465
                     // If the WordPress version is less than 3.4,
466
-                    if ( version_compare( $GLOBALS['wp_version'], '3.4', '<' ) ) {
467
-                        $_aThemeData = get_theme_data( get_stylesheet_directory() . '/style.css' );
468
-                        return $_aThemeData['Name'] . ' ' . $_aThemeData['Version'];
466
+                    if ( version_compare( $GLOBALS[ 'wp_version' ], '3.4', '<' ) ) {
467
+                        $_aThemeData = get_theme_data( get_stylesheet_directory().'/style.css' );
468
+                        return $_aThemeData[ 'Name' ].' '.$_aThemeData[ 'Version' ];
469 469
                     } 
470 470
                     
471 471
                     $_oThemeData = wp_get_theme();
472
-                    return $_oThemeData->Name . ' ' . $_oThemeData->Version;
472
+                    return $_oThemeData->Name.' '.$_oThemeData->Version;
473 473
                     
474 474
                 }   
475 475
                 /**
@@ -483,10 +483,10 @@  discard block
 block discarded – undo
483 483
                     $_aPluginList       = array();
484 484
                     $_aActivePlugins    = get_option( 'active_plugins', array() );
485 485
                     foreach ( get_plugins() as $_sPluginPath => $_aPlugin ) {
486
-                        if ( ! in_array( $_sPluginPath, $_aActivePlugins ) ) {
486
+                        if ( !in_array( $_sPluginPath, $_aActivePlugins ) ) {
487 487
                             continue;
488 488
                         }
489
-                        $_aPluginList[] = '    ' . $_aPlugin['Name'] . ': ' . $_aPlugin['Version'];
489
+                        $_aPluginList[ ] = '    '.$_aPlugin[ 'Name' ].': '.$_aPlugin[ 'Version' ];
490 490
                     }
491 491
                     return implode( PHP_EOL, $_aPluginList );
492 492
                     
@@ -498,17 +498,17 @@  discard block
 block discarded – undo
498 498
                  */
499 499
                 private function _getNetworkActivePlugins() {
500 500
                     
501
-                    if ( ! is_multisite() ) {
501
+                    if ( !is_multisite() ) {
502 502
                         return '';
503 503
                     }
504 504
                     $_aPluginList       = array();
505 505
                     $_aActivePlugins    = get_site_option( 'active_sitewide_plugins', array() );
506 506
                     foreach ( wp_get_active_network_plugins() as $_sPluginPath ) {
507
-                        if ( ! array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) {
507
+                        if ( !array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) {
508 508
                             continue;
509 509
                         }
510 510
                         $_aPlugin       = get_plugin_data( $_sPluginPath );
511
-                        $_aPluginList[] = '    ' . $_aPlugin['Name'] . ' :' . $_aPlugin['Version'];
511
+                        $_aPluginList[ ] = '    '.$_aPlugin[ 'Name' ].' :'.$_aPlugin[ 'Version' ];
512 512
                     }
513 513
                     return implode( PHP_EOL, $_aPluginList );
514 514
                     
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
                     $_vResponse = false === $_vResponse
527 527
                         ? wp_remote_post( 
528 528
                             // 'https://www.paypal.com/cgi-bin/webscr', 
529
-                            add_query_arg( $_GET, admin_url( $GLOBALS['pagenow'] ) ),
529
+                            add_query_arg( $_GET, admin_url( $GLOBALS[ 'pagenow' ] ) ),
530 530
                             array(
531 531
                                 'sslverify'     => false,
532 532
                                 'timeout'       => 60,
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                     $_vResponse = $this->getTransient( 'apf_rg_check' );
550 550
                     $_vResponse = false === $_vResponse
551 551
                         ? wp_remote_get( 
552
-                            add_query_arg( $_GET + array( 'apf_remote_request_test' => '_testing' ), admin_url( $GLOBALS['pagenow'] ) ),
552
+                            add_query_arg( $_GET + array( 'apf_remote_request_test' => '_testing' ), admin_url( $GLOBALS[ 'pagenow' ] ) ),
553 553
                             array(
554 554
                                 'sslverify'     => false,
555 555
                                 'timeout'       => 60,
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
                         if ( is_wp_error( $mResponse ) ) {
575 575
                             return true;
576 576
                         }
577
-                        if ( $mResponse[ 'response'][ 'code' ] < 200 ) {
577
+                        if ( $mResponse[ 'response' ][ 'code' ] < 200 ) {
578 578
                             return true;
579 579
                         }
580 580
                         if ( $mResponse[ 'response' ][ 'code' ] >= 300 ) {
@@ -597,13 +597,13 @@  discard block
 block discarded – undo
597 597
              * @since       3.4.6
598 598
              * @since       3.5.3       Added the $bGenerateInfo parameter. This is to reduce conditional statement in the caller method.
599 599
              */
600
-            private function _getPHPInfo( $bGenerateInfo=true ) {
600
+            private function _getPHPInfo( $bGenerateInfo = true ) {
601 601
                 
602
-                if ( ! $bGenerateInfo || isset( self::$_aPHPInfo ) ) {
602
+                if ( !$bGenerateInfo || isset( self::$_aPHPInfo ) ) {
603 603
                     return self::$_aPHPInfo;
604 604
                 }
605 605
                 
606
-                $_oErrorReporting   = new AdminPageFramework_ErrorReporting;
606
+                $_oErrorReporting = new AdminPageFramework_ErrorReporting;
607 607
                 self::$_aPHPInfo = array(
608 608
                     __( 'Version', 'admin-page-framework' )                 => phpversion(),
609 609
                     __( 'Safe Mode', 'admin-page-framework' )               => $this->getAOrB( @ini_get( 'safe_mode' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), 
@@ -614,16 +614,16 @@  discard block
 block discarded – undo
614 614
                     __( 'Max Execution Time', 'admin-page-framework' )      => @ini_get( 'max_execution_time' ),
615 615
                     __( 'Max Input Vars', 'admin-page-framework' )          => @ini_get( 'max_input_vars' ),
616 616
                     __( 'Argument Separator', 'admin-page-framework' )      => @ini_get( 'arg_separator.output' ),
617
-                    __( 'Allow URL File Open', 'admin-page-framework' )     => $this->getAOrB( @ini_get( 'allow_url_fopen' ),    $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
618
-                    __( 'Display Errors', 'admin-page-framework' )          => $this->getAOrB( @ini_get( 'display_errors' ),     $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
619
-                    __( 'Log Errors', 'admin-page-framework' )              => $this->getAOrB( @ini_get( 'log_errors' ),         $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
617
+                    __( 'Allow URL File Open', 'admin-page-framework' )     => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
618
+                    __( 'Display Errors', 'admin-page-framework' )          => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
619
+                    __( 'Log Errors', 'admin-page-framework' )              => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
620 620
                     __( 'Error log location', 'admin-page-framework' )      => @ini_get( 'error_log' ),
621 621
                     __( 'Error Reporting Level', 'admin-page-framework' )   => $_oErrorReporting->getErrorLevel(),
622
-                    __( 'FSOCKOPEN', 'admin-page-framework' )               => $this->getAOrB( function_exists( 'fsockopen' ),   $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
623
-                    __( 'cURL', 'admin-page-framework' )                    => $this->getAOrB( function_exists( 'curl_init' ),   $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
624
-                    __( 'SOAP', 'admin-page-framework' )                    => $this->getAOrB( class_exists( 'SoapClient' ),     $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
625
-                    __( 'SUHOSIN', 'admin-page-framework' )                 => $this->getAOrB( extension_loaded( 'suhosin' ),    $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
626
-                    'ini_set()'                                             => $this->getAOrB( function_exists( 'ini_set' ),     $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
622
+                    __( 'FSOCKOPEN', 'admin-page-framework' )               => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
623
+                    __( 'cURL', 'admin-page-framework' )                    => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
624
+                    __( 'SOAP', 'admin-page-framework' )                    => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
625
+                    __( 'SUHOSIN', 'admin-page-framework' )                 => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
626
+                    'ini_set()'                                             => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
627 627
                 ) 
628 628
                 + $this->getPHPInfo()
629 629
                 + array( 
@@ -642,11 +642,11 @@  discard block
 block discarded – undo
642 642
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
643 643
              * @return      array|string
644 644
              */                      
645
-            private function _getWebServerInfo( $bGenerateInfo=true ) {
645
+            private function _getWebServerInfo( $bGenerateInfo = true ) {
646 646
                         
647 647
                 return $bGenerateInfo 
648 648
                     ? array(
649
-                        __( 'Web Server', 'admin-page-framework' )                  => $_SERVER['SERVER_SOFTWARE'],
649
+                        __( 'Web Server', 'admin-page-framework' )                  => $_SERVER[ 'SERVER_SOFTWARE' ],
650 650
                         'SSL'                                                       => $this->getAOrB( is_ssl(), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
651 651
                         __( 'Session', 'admin-page-framework' )                     => $this->getAOrB( isset( $_SESSION ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ),
652 652
                         __( 'Session Name', 'admin-page-framework' )                => esc_html( @ini_get( 'session.name' ) ),
Please login to merge, or discard this patch.
development/factory/_common/form/input/AdminPageFramework_Input_Base.php 3 patches
Doc Comments   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -105,10 +105,8 @@
 block discarded – undo
105 105
      * If a parameter is not passed, it returns the entire attribute array.
106 106
      * 
107 107
      * @since       3.5.3
108
-     * @return      string|array|null        The specified attribute value or the entire attribute array if not specified. 
108
+     * @return      string        The specified attribute value or the entire attribute array if not specified. 
109 109
      * If not set, null will be returned as the `getAttributes()` method will not list an attribute with the null value.
110
-     * @param       string      $sName      The attribute name.
111
-     * @param       string      $sDefault   The defaqult value if the value is not set.
112 110
      */
113 111
     public function getAttribute( /* $sName=null, $sDefault=null */ ) {
114 112
         $_aParams = func_get_args() + array(
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
      * @param       array       $aAttributes    The attribute array. A field definition array is deprecated.
64 64
      * @param       array       $aOptions       options that allows to set custom container tags and class selctors.
65 65
      */
66
-    public function __construct( array $aAttributes, array $aOptions=array() ) {
66
+    public function __construct( array $aAttributes, array $aOptions = array() ) {
67 67
 
68
-        $this->aAttributes  = $this->getElementAsArray( 
68
+        $this->aAttributes = $this->getElementAsArray( 
69 69
             $aAttributes, 
70 70
             'attributes', 
71 71
             $aAttributes    // if the above key is not set, this will be set
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
      * @return      string      The set class selector(s).
128 128
      */
129 129
     public function addClass( /* $asSelectors1, $asSelectors2 */ ) {
130
-        foreach( func_get_args() as $_asSelectors ) {            
131
-            $this->aAttributes['class'] = $this->getClassAttribute( 
132
-                $this->aAttributes['class'],
130
+        foreach ( func_get_args() as $_asSelectors ) {            
131
+            $this->aAttributes[ 'class' ] = $this->getClassAttribute( 
132
+                $this->aAttributes[ 'class' ],
133 133
                 $_asSelectors
134 134
             );
135 135
         }
136
-        return $this->aAttributes['class'];
136
+        return $this->aAttributes[ 'class' ];
137 137
     }
138 138
     
139 139
     /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         // $this->aAttributes[ $_aParams[ 0 ] ] = $_aParams[ 1 ];
159 159
         $this->setMultiDimensionalArray(
160 160
             $this->aAttributes, 
161
-            $this->getElementAsArray( $_aParams, 0 ),   // $asAttributeName
161
+            $this->getElementAsArray( $_aParams, 0 ), // $asAttributeName
162 162
             $_aParams[ 1 ]  // $mValue
163 163
         );
164 164
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
127 127
      * @return      string      The set class selector(s).
128 128
      */
129 129
     public function addClass( /* $asSelectors1, $asSelectors2 */ ) {
130
-        foreach( func_get_args() as $_asSelectors ) {            
130
+        foreach( func_get_args() as $_asSelectors ) {
131 131
             $this->aAttributes['class'] = $this->getClassAttribute( 
132 132
                 $this->aAttributes['class'],
133 133
                 $_asSelectors
Please login to merge, or discard this patch.
factory/_common/form/input/AdminPageFramework_Input_checkbox.php 3 patches
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,6 @@
 block discarded – undo
21 21
      * Returns the output of the input element.
22 22
      * 
23 23
      * @since       3.4.0    
24
-     * @param       string      $sLabel         The label text.
25
-     * @param       array       $aAttributes    (optional) The attribute array. If set, it will be merged with the attribute set in the constructor.
26 24
      */    
27 25
     public function get( /* $sLabel, $aAttributes=array() */ ) {
28 26
         
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 
47 47
         // Output
48 48
         return 
49
-           "<{$this->aOptions[ 'input_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ) . ">"
49
+            "<{$this->aOptions[ 'input_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ) . ">"
50 50
                 // the unchecked value must be set prior to the checkbox input field.
51 51
                 . "<input " . $this->getAttributes( 
52 52
                     array(
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
     public function get( /* $sLabel, $aAttributes=array() */ ) {
35 35
         
36 36
         // Parameters
37
-        $_aParams       = func_get_args() + array( 
38
-            0 => '',            // 1st parameter
37
+        $_aParams = func_get_args() + array( 
38
+            0 => '', // 1st parameter
39 39
             1 => array()        // 2nd parameter
40 40
         );
41
-        $_sLabel        = $_aParams[ 0 ];       // first parameter
41
+        $_sLabel        = $_aParams[ 0 ]; // first parameter
42 42
 
43 43
         // Attributes
44 44
         $_aAttributes   = $this->uniteArrays(   // second parameter
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
 
49 49
         // Output
50 50
         return 
51
-           "<{$this->aOptions[ 'input_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ) . ">"
51
+           "<{$this->aOptions[ 'input_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ).">"
52 52
                 . $this->_getInputElements( $_aAttributes, $this->aOptions )
53 53
             . "</{$this->aOptions[ 'input_container_tag' ]}>"
54
-            . "<{$this->aOptions[ 'label_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ) . ">"
54
+            . "<{$this->aOptions[ 'label_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ).">"
55 55
                 . $_sLabel
56 56
             . "</{$this->aOptions[ 'label_container_tag' ]}>"
57 57
         ;
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
         private function _getInputElements( $aAttributes, $aOptions ) {
66 66
             $_sOutput = $this->aOptions[ 'save_unchecked' ]
67 67
                 // the unchecked value must be set prior to the checkbox input field.
68
-                ? "<input " . $this->getAttributes( 
68
+                ? "<input ".$this->getAttributes( 
69 69
                     array(
70 70
                         'type'      => 'hidden',
71 71
                         'class'     => $aAttributes[ 'class' ],
72 72
                         'name'      => $aAttributes[ 'name' ],
73 73
                         'value'     => '0',
74 74
                     ) 
75
-                ) . " />"
75
+                )." />"
76 76
                 : '';
77
-            $_sOutput .= "<input " . $this->getAttributes( $aAttributes ) . " />";
77
+            $_sOutput .= "<input ".$this->getAttributes( $aAttributes )." />";
78 78
             return $_sOutput;
79 79
         }
80 80
         
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     public function getAttributesByKey( /* $sKey */ ) {
88 88
         
89 89
         // Parameters
90
-        $_aParams       = func_get_args() + array( 0 => '', );
90
+        $_aParams       = func_get_args() + array( 0 => '',);
91 91
         $_sKey          = $_aParams[ 0 ];        
92 92
         $_bIsMultiple   = '' !== $_sKey;
93 93
         
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
             // The type needs to be specified since the postytpe field type extends this class. If not set, the 'posttype' will be passed to the type attribute.
100 100
             + array(
101 101
                 'type'      => 'checkbox', 
102
-                'id'        => $this->aAttributes[ 'id' ] . '_' . $_sKey,
102
+                'id'        => $this->aAttributes[ 'id' ].'_'.$_sKey,
103 103
                 'checked'   => $this->_getCheckedAttributeValue( $_sKey ),
104
-                'value'     => 1,   // this must be always 1 because the key value can be zero. In that case, the value always will be false and unchecked.
104
+                'value'     => 1, // this must be always 1 because the key value can be zero. In that case, the value always will be false and unchecked.
105 105
                 'name'      => $_bIsMultiple 
106 106
                     ? "{$this->aAttributes[ 'name' ]}[{$_sKey}]" 
107 107
                     : $this->aAttributes[ 'name' ],
108
-                'data-id'   => $this->aAttributes[ 'id' ],       // referenced by the JavaScript scripts such as the revealer script.
108
+                'data-id'   => $this->aAttributes[ 'id' ], // referenced by the JavaScript scripts such as the revealer script.
109 109
             )
110 110
             + $this->aAttributes
111 111
             ;
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                 : array( 'value', $_sKey );
123 123
             return $this->getElement( $this->aAttributes, $_aValueDimension )
124 124
                 ? 'checked' 
125
-                : null;    // to not to set, pass null. An empty value '' will still set the attribute.            
125
+                : null; // to not to set, pass null. An empty value '' will still set the attribute.            
126 126
         
127 127
         }
128 128
         
Please login to merge, or discard this patch.
development/factory/_common/form/input/AdminPageFramework_Input_radio.php 2 patches
Doc Comments   -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,6 @@  discard block
 block discarded – undo
21 21
      * Returns the output of the input element.
22 22
      * 
23 23
      * @since       3.4.0    
24
-     * @param       string      $sLabel         The label text.
25
-     * @param       array       $aAttributes    (optional) The attribute array. If set, it will be merged with the attribute set in the constructor.
26 24
      */    
27 25
     public function get( /* $sLabel, $aAttributes=array() */ ) {
28 26
         
@@ -52,8 +50,6 @@  discard block
 block discarded – undo
52 50
      * 
53 51
      * @return      array       The updated attribute array. 
54 52
      * @since       3.5.3
55
-     * @param       string      $sKey       The array element key of the radio button. 
56
-     * It is assumed that there is an array that holds multiple radio buttons and each of them has an array key.
57 53
      */
58 54
     public function getAttributesByKey( /* $sKey */ ) {
59 55
         
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
         
37 37
         // Output
38 38
         return 
39
-            "<{$this->aOptions['input_container_tag']} " . $this->getAttributes( $this->aOptions['input_container_attributes'] ) . ">"
40
-                . "<input " . $this->getAttributes( $_aAttributes ) . " />" 
41
-            . "</{$this->aOptions['input_container_tag']}>"
42
-            . "<{$this->aOptions['label_container_tag']} " . $this->getAttributes( $this->aOptions['label_container_attributes'] ) . ">"
39
+            "<{$this->aOptions[ 'input_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ).">"
40
+                . "<input ".$this->getAttributes( $_aAttributes )." />" 
41
+            . "</{$this->aOptions[ 'input_container_tag' ]}>"
42
+            . "<{$this->aOptions[ 'label_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ).">"
43 43
                 . $_sLabel
44
-            . "</{$this->aOptions['label_container_tag']}>"
44
+            . "</{$this->aOptions[ 'label_container_tag' ]}>"
45 45
             ;
46 46
         
47 47
     }    
@@ -58,22 +58,22 @@  discard block
 block discarded – undo
58 58
     public function getAttributesByKey( /* $sKey */ ) {
59 59
         
60 60
         // Parameters
61
-        $_aParams       = func_get_args() + array( 0 => '', );
62
-        $_sKey           = $_aParams[ 0 ];        
61
+        $_aParams = func_get_args() + array( 0 => '',);
62
+        $_sKey = $_aParams[ 0 ];        
63 63
         
64 64
         // Result
65 65
         return $this->getElementAsArray( $this->aAttributes, $_sKey, array() )
66 66
             + array(
67 67
                 'type'          => 'radio',
68
-                'checked'       => isset( $this->aAttributes['value'] ) && $this->aAttributes['value'] == $_sKey 
68
+                'checked'       => isset( $this->aAttributes[ 'value' ] ) && $this->aAttributes[ 'value' ] == $_sKey 
69 69
                     ? 'checked' 
70 70
                     : null,
71 71
                 'value'         => $_sKey,
72 72
                 // 'id'            => $this->aField['input_id'] . '_' . $_sKey,
73
-                'id'            => $this->getAttribute( 'id' ) . '_' . $_sKey,
73
+                'id'            => $this->getAttribute( 'id' ).'_'.$_sKey,
74 74
                 // 'data-default'  => $this->aField['default'],        // refered by the repeater script
75 75
                 // 'data-id'       => $this->aField['input_id'],       // refered by the JavaScript scripts such as the revealer script.
76
-                'data-id'       => $this->getAttribute( 'id' ),       // refered by the JavaScript scripts such as the revealer script.
76
+                'data-id'       => $this->getAttribute( 'id' ), // refered by the JavaScript scripts such as the revealer script.
77 77
             ) 
78 78
             + $this->aAttributes; 
79 79
             
Please login to merge, or discard this patch.
development/factory/_common/form/input/AdminPageFramework_Input_select.php 2 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
          * @internal
123 123
          * @param       string      $sInputID           The input ID that will be the base of each generated option tag ID.
124 124
          * @param       array       $aLabels            The array holding labels.
125
-         * @param       array       $aAttributes        The attribute arrays. Accepts the following arguments.
125
+         * @param       array       $aBaseAttributes        The attribute arrays. Accepts the following arguments.
126 126
          * - optgroup
127 127
          * - option
128 128
          */     
@@ -160,6 +160,7 @@  discard block
 block discarded – undo
160 160
             /**
161 161
              * Returns an HTML output of optgroup tag.
162 162
              * @since       3.5.3
163
+             * @param string $sInputID
163 164
              * @return      string      an HTML output of optgroup tag.
164 165
              */
165 166
             private function _getOptGroup( array $aBaseAttributes, $sInputID, $sKey, $asLabel ) {
@@ -179,6 +180,7 @@  discard block
 block discarded – undo
179 180
             /**
180 181
              * 
181 182
              * @since        3.5.3
183
+             * @param string $sInputID
182 184
              */
183 185
             private function _getOptionTagAttributes( array $aBaseAttributes, $sInputID, $sKey, $aValues ) {
184 186
             
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
         );    
70 70
 
71 71
         return  
72
-            "<{$this->aOptions[ 'input_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ) . ">"
73
-                . "<select " . $this->getAttributes( $this->_getSelectAttributes( $_aAttributes ) ) . " >"
72
+            "<{$this->aOptions[ 'input_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ).">"
73
+                . "<select ".$this->getAttributes( $this->_getSelectAttributes( $_aAttributes ) )." >"
74 74
                     . $this->_getDropDownList( 
75 75
                         $this->getAttribute( 'id' ),
76 76
                         $this->getAsArray(
77 77
                             isset( $_aLabels ) 
78 78
                                 ? $_aLabels
79
-                                : $this->aField[ 'label' ],    // backward compatibility
79
+                                : $this->aField[ 'label' ], // backward compatibility
80 80
                             true
81 81
                         ),
82 82
                         $_aAttributes
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
                         ? 'multiple' 
105 105
                         : null,
106 106
                     'name'      => $_bIsMultiple 
107
-                        ? $this->getAttribute( 'name' ) . '[]'
107
+                        ? $this->getAttribute( 'name' ).'[]'
108 108
                         : $this->getAttribute( 'name' ),
109
-                    'data-id'   => $this->getAttribute( 'id' ),       // referenced by the JavaScript scripts such as the revealer script.
109
+                    'data-id'   => $this->getAttribute( 'id' ), // referenced by the JavaScript scripts such as the revealer script.
110 110
                 )
111 111
             );            
112 112
             
@@ -128,12 +128,12 @@  discard block
 block discarded – undo
128 128
          */     
129 129
         private function _getDropDownList( $sInputID, array $aLabels, array $aBaseAttributes ) {
130 130
             
131
-            $_aOutput   = array();
132
-            foreach( $aLabels as $__sKey => $__asLabel ) {
131
+            $_aOutput = array();
132
+            foreach ( $aLabels as $__sKey => $__asLabel ) {
133 133
                 
134 134
                 // For an optgroup tag,
135 135
                 if ( is_array( $__asLabel ) ) {
136
-                    $_aOutput[] = $this->_getOptGroup(
136
+                    $_aOutput[ ] = $this->_getOptGroup(
137 137
                         $aBaseAttributes, 
138 138
                         $sInputID, 
139 139
                         $__sKey, 
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
                 }
144 144
                 
145 145
                 // A normal option tag,
146
-                $_aOutput[] = $this->_getOptionTag( 
147
-                    $__asLabel,   // the text label the user sees to be selected
146
+                $_aOutput[ ] = $this->_getOptionTag( 
147
+                    $__asLabel, // the text label the user sees to be selected
148 148
                     $this->_getOptionTagAttributes( 
149 149
                         $aBaseAttributes, 
150 150
                         $sInputID, 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                 $_aOptGroupAttributes = array(
171 171
                     'label' => $sKey,
172 172
                 ) + $_aOptGroupAttributes;
173
-                return "<optgroup " . $this->getAttributes( $_aOptGroupAttributes ) . ">"
173
+                return "<optgroup ".$this->getAttributes( $_aOptGroupAttributes ).">"
174 174
                         . $this->_getDropDownList( $sInputID, $asLabel, $aBaseAttributes )
175 175
                     . "</optgroup>";
176 176
              
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                     $aValues 
189 189
                 );
190 190
                 return array(      
191
-                        'id'        => $sInputID . '_' . $sKey,
191
+                        'id'        => $sInputID.'_'.$sKey,
192 192
                         'value'     => $sKey,
193 193
                         'selected'  => in_array( ( string ) $sKey, $aValues ) 
194 194
                             ? 'selected' 
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
              * @sicne       3.4.0
205 205
              * @return      string      The generated option tag HTML output.
206 206
              */
207
-            private function _getOptionTag( $sLabel, array $aOptionTagAttributes=array() ) {
208
-                return "<option " . $this->getAttributes( $aOptionTagAttributes ) . " >"    
207
+            private function _getOptionTag( $sLabel, array $aOptionTagAttributes = array() ) {
208
+                return "<option ".$this->getAttributes( $aOptionTagAttributes )." >"    
209 209
                         . $sLabel
210 210
                     . "</option>";
211 211
             }
Please login to merge, or discard this patch.
utility/base_utility/AdminPageFramework_Utility_SystemInformation.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
      * Returns an array of constants.
96 96
      * 
97 97
      * @since       3.4.6
98
-     * @param       array|string      $asCategory      The category key names of the returning array.
98
+     * @param       array|string      $asCategories      The category key names of the returning array.
99 99
      */
100 100
     static public function getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) {
101 101
         
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $_sOutput = preg_replace(
42 42
             array(
43 43
                 '#^.*<body>(.*)</body>.*$#ms', '#<h2>PHP License</h2>.*$#ms',
44
-                '#<h1>Configuration</h1>#',  "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#',
44
+                '#<h1>Configuration</h1>#', "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#',
45 45
                 "#[ \t]+#", '#&nbsp;#', '#  +#', '# class=".*?"#', '%&#039;%',
46 46
                 '#<tr>(?:.*?)" src="(?:.*?)=(.*?)" alt="PHP Logo" /></a>'
47 47
                     .'<h1>PHP Version (.*?)</h1>(?:\n+?)</td></tr>#',
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
                 '#</tr>#'
53 53
             ),
54 54
             array(
55
-                '$1', '', '', '', '</$1>' . "\n", '<', ' ', ' ', ' ', '', ' ',
55
+                '$1', '', '', '', '</$1>'."\n", '<', ' ', ' ', ' ', '', ' ',
56 56
                 '<h2>PHP Configuration</h2>'."\n".'<tr><td>PHP Version</td><td>$2</td></tr>'.
57 57
                 "\n".'<tr><td>PHP Egg</td><td>$1</td></tr>',
58 58
                 '<tr><td>PHP Credits Egg</td><td>$1</td></tr>',
59
-                '<tr><td>Zend Engine</td><td>$2</td></tr>' . "\n" . '<tr><td>Zend Egg</td><td>$1</td></tr>',
59
+                '<tr><td>Zend Engine</td><td>$2</td></tr>'."\n".'<tr><td>Zend Egg</td><td>$1</td></tr>',
60 60
                 ' ',
61 61
                 '%S%',
62 62
                 '%E%'
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         unset( $_aSections[ 0 ] );
69 69
 
70 70
         $_aOutput = array();
71
-        foreach( $_aSections as $_sSection ) {
71
+        foreach ( $_aSections as $_sSection ) {
72 72
             $_iIndex = substr( $_sSection, 0, strpos( $_sSection, '</h2>' ) );
73 73
             preg_match_all(
74 74
                 '#%S%(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?%E%#',
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
                 $_aAskApache, 
77 77
                 PREG_SET_ORDER
78 78
             );
79
-            foreach( $_aAskApache as $_aMatches ) {
80
-                if ( ! isset( $_aMatches[ 1 ], $_aMatches[ 2 ] ) ) {
79
+            foreach ( $_aAskApache as $_aMatches ) {
80
+                if ( !isset( $_aMatches[ 1 ], $_aMatches[ 2 ] ) ) {
81 81
                     array_slice( $_aMatches, 2 );
82 82
                     continue;
83 83
                 }
84
-                $_aOutput[ $_iIndex ][ $_aMatches[ 1 ] ] = ! isset( $_aMatches[ 3 ] ) || $_aMatches[ 2 ] == $_aMatches[ 3 ]
84
+                $_aOutput[ $_iIndex ][ $_aMatches[ 1 ] ] = !isset( $_aMatches[ 3 ] ) || $_aMatches[ 2 ] == $_aMatches[ 3 ]
85 85
                     ? $_aMatches[ 2 ] 
86 86
                     : array_slice( $_aMatches, 2 );
87 87
             }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      * @since       3.4.6
98 98
      * @param       array|string      $asCategory      The category key names of the returning array.
99 99
      */
100
-    static public function getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) {
100
+    static public function getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) {
101 101
         
102 102
         $_aCategories           = is_array( $asCategories ) ? $asCategories : array( $asCategories );
103 103
         $_aCategories           = array_filter( $_aCategories );
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
     static public function getPHPErrorLogPath() {
125 125
                 
126 126
         $_aPHPInfo = self::getPHPInfo();
127
-        return isset( $_aPHPInfo['PHP Core']['error_log'] ) 
128
-            ? $_aPHPInfo['PHP Core']['error_log']
127
+        return isset( $_aPHPInfo[ 'PHP Core' ][ 'error_log' ] ) 
128
+            ? $_aPHPInfo[ 'PHP Core' ][ 'error_log' ]
129 129
             : '';
130 130
         
131 131
     }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      * Returns a PHP error log.
135 135
      * @since       3.4.6
136 136
      */
137
-    static public function getPHPErrorLog( $iLines=1 ) {
137
+    static public function getPHPErrorLog( $iLines = 1 ) {
138 138
         
139 139
         $_sLog = self::getFileTailContents( self::getPHPErrorLogPath(), $iLines );
140 140
         
Please login to merge, or discard this patch.
factory/_common/utility/base_utility/AdminPageFramework_Utility_URL.php 2 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -23,6 +23,7 @@  discard block
 block discarded – undo
23 23
      * 
24 24
      * @since       2.0.0
25 25
      * @since       3.5.7       Moved from `AdminPageFramework_Utility`.
26
+     * @param string $sQueryKey
26 27
      * @return      string|null
27 28
      */ 
28 29
     static public function getQueryValueInURLByKey( $sURL, $sQueryKey ) {
@@ -72,6 +73,7 @@  discard block
 block discarded – undo
72 73
         /**
73 74
          * Returns the port suffix in the currently loading url.
74 75
          * @since       3.5.7
76
+         * @param boolean $_bSSL
75 77
          * @return      string
76 78
          */
77 79
         static private function _getURLPortSuffix( $_bSSL ) {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             0 => '',
53 53
             1 => 's',
54 54
         );
55
-        $_sProtocol         = substr( $_sServerProtocol, 0, strpos( $_sServerProtocol, '/' ) )
55
+        $_sProtocol = substr( $_sServerProtocol, 0, strpos( $_sServerProtocol, '/' ) )
56 56
             . $_aProrocolSuffix[ ( int ) $_bSSL ];
57 57
         
58 58
         // Port: e.g. :80
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                 : $_SERVER[ 'SERVER_NAME' ] 
67 67
             );
68 68
             
69
-        return $_sProtocol . '://' . $_sHost . $_sPort . $_SERVER[ 'REQUEST_URI' ];
69
+        return $_sProtocol.'://'.$_sHost.$_sPort.$_SERVER[ 'REQUEST_URI' ];
70 70
         
71 71
     }
72 72
         /**
@@ -79,10 +79,10 @@  discard block
 block discarded – undo
79 79
                 ? ( string ) $_SERVER[ 'SERVER_PORT' ]
80 80
                 : '';
81 81
             $_aPort     = array(
82
-                0 => ':' . $_sPort,
82
+                0 => ':'.$_sPort,
83 83
                 1 => '',
84 84
             );
85
-            $_bPortSet  = ( ! $_bSSL && '80' === $_sPort ) || ( $_bSSL && '443' === $_sPort );
85
+            $_bPortSet = ( !$_bSSL && '80' === $_sPort ) || ( $_bSSL && '443' === $_sPort );
86 86
             return $_aPort[ ( int ) $_bPortSet ];
87 87
         }
88 88
     
Please login to merge, or discard this patch.
factory/_common/utility/wp_utility/AdminPageFramework_WPUtility_Hook.php 3 patches
Doc Comments   +1 added lines, -9 removed lines patch added patch discarded remove patch
@@ -89,11 +89,6 @@  discard block
 block discarded – undo
89 89
      * @access      public
90 90
      * @since       2.0.0
91 91
      * @remark      Accepts variadic parameters.
92
-     * @param       object      $oCallerObject      the object that holds the callback method that matches the action hook name.
93
-     * @param       array       $aActionHooks       a numerically index array consisting of action hook names that serve as the callback method names. 
94
-     * @param       mixed       $vArgs1             the argument to pass to the hook callback functions.
95
-     * @param       mixed       $vArgs2             another argument to pass to the hook callback functions.
96
-     * @param       mixed       $_and_more          add as many arguments as necessary to the next parameters.
97 92
      * @return      void
98 93
      */ 
99 94
     static public function addAndDoActions( /* $oCallerObject, $aActionHooks, $vArgs1=null, $vArgs2=null, $_and_more=null */ ) {
@@ -192,10 +187,6 @@  discard block
 block discarded – undo
192 187
      * `
193 188
      * 
194 189
      * @since       2.0.0
195
-     * @param       object      $oCallerObject
196
-     * @param       string      $sFilter            The filter hook name.
197
-     * @param       mixed       $vData              The filtering data
198
-     * @param       mixed       $vArgs              The arguments.
199 190
      */
200 191
     static public function addAndApplyFilter( /* $oCallerObject, $sFilter, $vData, $vArgs... */ ) { 
201 192
         
@@ -233,6 +224,7 @@  discard block
 block discarded – undo
233 224
      * 
234 225
      * @since       2.0.0
235 226
      * @access      public
227
+     * @param string $sPrefix
236 228
      * @return      array       Returns an array consisting of the filters.
237 229
      */ 
238 230
     static public function getFilterArrayByPrefix( $sPrefix, $sClassName, $sPageSlug, $sTabSlug, $bReverse=false ) {
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * @since       3.4.2
27 27
      * @todo        Create a similar function for filters.
28 28
      */
29
-    static public function registerAction( $sActionHook, $oCallable, $iPriority=10 ) {
29
+    static public function registerAction( $sActionHook, $oCallable, $iPriority = 10 ) {
30 30
       
31 31
         if ( did_action( $sActionHook ) ) {
32 32
             return call_user_func_array( $oCallable, array() );
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
      * @param       mixed       $_and_more      add as many arguments as necessary to the next parameters.
64 64
      * @return      void        does not return a value.
65 65
      */     
66
-    static public function doActions( $aActionHooks, $vArgs1=null, $vArgs2=null, $_and_more=null ) {
66
+    static public function doActions( $aActionHooks, $vArgs1 = null, $vArgs2 = null, $_and_more = null ) {
67 67
         
68 68
         $aArgs          = func_get_args();     
69 69
         $aActionHooks   = $aArgs[ 0 ];
70
-        foreach( ( array ) $aActionHooks as $sActionHook  ) {
70
+        foreach ( ( array ) $aActionHooks as $sActionHook ) {
71 71
             $aArgs[ 0 ] = $sActionHook;
72
-            call_user_func_array( 'do_action' , $aArgs );
72
+            call_user_func_array( 'do_action', $aArgs );
73 73
         }
74 74
 
75 75
     }
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
         $aArgs          = func_get_args();    
102 102
         $oCallerObject  = $aArgs[ 0 ];
103 103
         $aActionHooks   = $aArgs[ 1 ];
104
-        foreach( ( array ) $aActionHooks as $sActionHook ) {
105
-            if ( ! $sActionHook ) { 
104
+        foreach ( ( array ) $aActionHooks as $sActionHook ) {
105
+            if ( !$sActionHook ) { 
106 106
                 continue; 
107 107
             }
108 108
             $aArgs[ 1 ] = $sActionHook;    
109
-            call_user_func_array( array( get_class(), 'addAndDoAction' ) , $aArgs );     
109
+            call_user_func_array( array( get_class(), 'addAndDoAction' ), $aArgs );     
110 110
         }
111 111
         
112 112
     }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $_aArgs          = func_get_args();
126 126
         $_oCallerObject  = $_aArgs[ 0 ];
127 127
         $_sActionHook    = $_aArgs[ 1 ];
128
-        if ( ! $_sActionHook ) { 
128
+        if ( !$_sActionHook ) { 
129 129
             return; 
130 130
         }
131 131
         
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 
138 138
         // Remove the first element, the caller object.
139 139
         array_shift( $_aArgs ); 
140
-        call_user_func_array( 'do_action' , $_aArgs );
140
+        call_user_func_array( 'do_action', $_aArgs );
141 141
         
142 142
     }
143 143
     
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
         $_aFilters      = $_aArgs[ 1 ];
166 166
         $_vInput        = $_aArgs[ 2 ];
167 167
 
168
-        foreach( ( array ) $_aFilters as $_sFilter ) {
169
-            if ( ! $_sFilter ) { 
168
+        foreach ( ( array ) $_aFilters as $_sFilter ) {
169
+            if ( !$_sFilter ) { 
170 170
                 continue; 
171 171
             }
172 172
             $_aArgs[ 1 ] = $_sFilter;
173
-            $_aArgs[ 2 ] = $_vInput;    // assigns the updated value as it is filtered in previous iterations
173
+            $_aArgs[ 2 ] = $_vInput; // assigns the updated value as it is filtered in previous iterations
174 174
             $_vInput = call_user_func_array( 
175 175
                 array( get_class(), 'addAndApplyFilter' ), 
176 176
                 $_aArgs 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         $_aArgs          = func_get_args();
205 205
         $_oCallerObject  = $_aArgs[ 0 ];
206 206
         $_sFilter        = $_aArgs[ 1 ];
207
-        if ( ! $_sFilter ) { 
207
+        if ( !$_sFilter ) { 
208 208
             return $_aArgs[ 2 ]; 
209 209
         }
210 210
         
@@ -235,17 +235,17 @@  discard block
 block discarded – undo
235 235
      * @access      public
236 236
      * @return      array       Returns an array consisting of the filters.
237 237
      */ 
238
-    static public function getFilterArrayByPrefix( $sPrefix, $sClassName, $sPageSlug, $sTabSlug, $bReverse=false ) {
238
+    static public function getFilterArrayByPrefix( $sPrefix, $sClassName, $sPageSlug, $sTabSlug, $bReverse = false ) {
239 239
                 
240 240
         $_aFilters = array();
241 241
         if ( $sTabSlug && $sPageSlug ) {
242
-            $_aFilters[] = "{$sPrefix}{$sPageSlug}_{$sTabSlug}";
242
+            $_aFilters[ ] = "{$sPrefix}{$sPageSlug}_{$sTabSlug}";
243 243
         }
244 244
         if ( $sPageSlug ) {
245
-            $_aFilters[] = "{$sPrefix}{$sPageSlug}";     
245
+            $_aFilters[ ] = "{$sPrefix}{$sPageSlug}";     
246 246
         }
247 247
         if ( $sClassName ) {
248
-            $_aFilters[] = "{$sPrefix}{$sClassName}";
248
+            $_aFilters[ ] = "{$sPrefix}{$sClassName}";
249 249
         }
250 250
         return $bReverse 
251 251
             ? array_reverse( $_aFilters ) 
Please login to merge, or discard this patch.
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $oCallerObject  = $aArgs[ 0 ];
103 103
         $aActionHooks   = $aArgs[ 1 ];
104 104
         foreach( ( array ) $aActionHooks as $sActionHook ) {
105
-            if ( ! $sActionHook ) { 
105
+            if ( ! $sActionHook ) {
106 106
                 continue; 
107 107
             }
108 108
             $aArgs[ 1 ] = $sActionHook;    
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $_aArgs          = func_get_args();
126 126
         $_oCallerObject  = $_aArgs[ 0 ];
127 127
         $_sActionHook    = $_aArgs[ 1 ];
128
-        if ( ! $_sActionHook ) { 
128
+        if ( ! $_sActionHook ) {
129 129
             return; 
130 130
         }
131 131
         
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      * 
159 159
      * @since       2.0.0
160 160
      */    
161
-    static public function addAndApplyFilters( /* $oCallerObject, $aFilters, $vInput, $vArgs... */ ) { 
161
+    static public function addAndApplyFilters( /* $oCallerObject, $aFilters, $vInput, $vArgs... */ ) {
162 162
             
163 163
         $_aArgs         = func_get_args();    
164 164
         // $oCallerObject  = $_aArgs[ 0 ];
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $_vInput        = $_aArgs[ 2 ];
167 167
 
168 168
         foreach( ( array ) $_aFilters as $_sFilter ) {
169
-            if ( ! $_sFilter ) { 
169
+            if ( ! $_sFilter ) {
170 170
                 continue; 
171 171
             }
172 172
             $_aArgs[ 1 ] = $_sFilter;
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
      * @param       mixed       $vData              The filtering data
198 198
      * @param       mixed       $vArgs              The arguments.
199 199
      */
200
-    static public function addAndApplyFilter( /* $oCallerObject, $sFilter, $vData, $vArgs... */ ) { 
200
+    static public function addAndApplyFilter( /* $oCallerObject, $sFilter, $vData, $vArgs... */ ) {
201 201
         
202 202
         // Parameters
203 203
         $_iArgs          = func_num_args();
204 204
         $_aArgs          = func_get_args();
205 205
         $_oCallerObject  = $_aArgs[ 0 ];
206 206
         $_sFilter        = $_aArgs[ 1 ];
207
-        if ( ! $_sFilter ) { 
207
+        if ( ! $_sFilter ) {
208 208
             return $_aArgs[ 2 ]; 
209 209
         }
210 210
         
Please login to merge, or discard this patch.
factory/_common/utility/wp_utility/AdminPageFramework_WPUtility_Page.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -284,6 +284,7 @@
 block discarded – undo
284 284
              * Checkes whether the passed base url name is of the admin index page.
285 285
              * @since       3.5.3
286 286
              * return       boolean      Whether the passed base url name is of the admin index page.
287
+             * @param string $sPageNow
287 288
              */
288 289
             static private function _isInAdminIndex( $sPageNow ) {
289 290
                 return in_array(
Please login to merge, or discard this patch.
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     static public function getCurrentPostType() {
31 31
                          
32
-        if ( isset( self::$_sCurrentPostType ) ) { 
32
+        if ( isset( self::$_sCurrentPostType ) ) {
33 33
             return self::$_sCurrentPostType; 
34 34
         }
35 35
         self::$_sCurrentPostType = self::_getCurrentPostType();
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     static public function isPostDefinitionPage( $asPostTypes=array() ) {
142 142
         
143 143
         // If it's not the post definition page, 
144
-        if ( ! in_array( self::getPageNow(), array( 'post.php', 'post-new.php', ) ) ) { 
144
+        if ( ! in_array( self::getPageNow(), array( 'post.php', 'post-new.php', ) ) ) {
145 145
             return false;
146 146
         }
147 147
         return self::isCurrentPostTypeIn( $asPostTypes );
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         $_aPostTypes = self::getAsArray( $asPostTypes );        
161 161
         
162 162
         // If the parameter is empty, 
163
-        if ( empty( $_aPostTypes ) ) { 
163
+        if ( empty( $_aPostTypes ) ) {
164 164
             return true;
165 165
         }
166 166
 
@@ -176,13 +176,13 @@  discard block
 block discarded – undo
176 176
      */
177 177
     static public function isPostListingPage( $asPostTypes=array() ) {
178 178
                 
179
-        if ( 'edit.php' != self::getPageNow() ) { 
179
+        if ( 'edit.php' != self::getPageNow() ) {
180 180
             return false;
181 181
         }
182 182
         
183 183
         $_aPostTypes = self::getAsArray( $asPostTypes );    
184 184
         
185
-        if ( ! isset( $_GET[ 'post_type' ] )  ) { 
185
+        if ( ! isset( $_GET[ 'post_type' ] )  ) {
186 186
             return in_array( 'post', $_aPostTypes );
187 187
         }
188 188
 
@@ -273,11 +273,9 @@  discard block
 block discarded – undo
273 273
                 
274 274
                 if ( is_network_admin() ) {
275 275
                     $_sNeedle = '#/wp-admin/network/?(.*?)$#i';
276
-                }
277
-                else if ( is_user_admin() ) {
276
+                } else if ( is_user_admin() ) {
278 277
                     $_sNeedle = '#/wp-admin/user/?(.*?)$#i';
279
-                }
280
-                else {
278
+                } else {
281 279
                     $_sNeedle = '#/wp-admin/?(.*?)$#i';
282 280
                 }                
283 281
                 preg_match( $_sNeedle, $_SERVER[ 'PHP_SELF' ], $_aMatches );
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                 'getPostTypeByTypeNow',
58 58
                 'getPostTypeByScreenObject',
59 59
                 'getPostTypeByREQUEST',
60
-                'getPostTypeByPostObject',  // 3.6.0+ Moved to the last as it is not reliable.
60
+                'getPostTypeByPostObject', // 3.6.0+ Moved to the last as it is not reliable.
61 61
             );
62 62
             foreach ( $_aMethodsToTry as $_sMethodName ) {
63 63
                 $_sPostType = call_user_func( array( __CLASS__, $_sMethodName ) );
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
      * @param       array|string        The post type slug(s) to check. If this is empty, the method just checks the current page is a taxonomy page.
122 122
      * @return      boolean
123 123
      */    
124
-    static public function isCustomTaxonomyPage( $asPostTypes=array() ) {
124
+    static public function isCustomTaxonomyPage( $asPostTypes = array() ) {
125 125
         
126
-        if ( ! in_array( self::getPageNow(), array( 'tags.php', 'edit-tags.php', 'term.php' ) ) ) {
126
+        if ( !in_array( self::getPageNow(), array( 'tags.php', 'edit-tags.php', 'term.php' ) ) ) {
127 127
             return false;
128 128
         }
129 129
         return self::isCurrentPostTypeIn( $asPostTypes );
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
      * Otherwise, it will check if the page belongs to the given post type(s).
139 139
      * @return      boolean
140 140
      */
141
-    static public function isPostDefinitionPage( $asPostTypes=array() ) {
141
+    static public function isPostDefinitionPage( $asPostTypes = array() ) {
142 142
         
143 143
         // If it's not the post definition page, 
144
-        if ( ! in_array( self::getPageNow(), array( 'post.php', 'post-new.php', ) ) ) { 
144
+        if ( !in_array( self::getPageNow(), array( 'post.php', 'post-new.php',) ) ) { 
145 145
             return false;
146 146
         }
147 147
         return self::isCurrentPostTypeIn( $asPostTypes );
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      * 
175 175
      * @since 3.0.0
176 176
      */
177
-    static public function isPostListingPage( $asPostTypes=array() ) {
177
+    static public function isPostListingPage( $asPostTypes = array() ) {
178 178
                 
179 179
         if ( 'edit.php' != self::getPageNow() ) { 
180 180
             return false;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         
183 183
         $_aPostTypes = self::getAsArray( $asPostTypes );    
184 184
         
185
-        if ( ! isset( $_GET[ 'post_type' ] )  ) { 
185
+        if ( !isset( $_GET[ 'post_type' ] ) ) { 
186 186
             return in_array( 'post', $_aPostTypes );
187 187
         }
188 188
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             0 => '_getPageNow_FrontEnd',
221 221
             1 => '_getPageNow_BackEnd',
222 222
         );
223
-        $_sMethodName  = $_aMethodNames[ ( integer ) is_admin() ];
223
+        $_sMethodName = $_aMethodNames[ ( integer ) is_admin() ];
224 224
         self::$_sPageNow = self::$_sMethodName();            
225 225
         return self::$_sPageNow;          
226 226
         
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         
316 316
         if ( isset( $GLBOALS[ 'page_hook' ] ) ) {
317 317
             return is_network_admin() 
318
-                ? $GLBOALS[ 'page_hook' ] . '-network'
318
+                ? $GLBOALS[ 'page_hook' ].'-network'
319 319
                 : $GLBOALS[ 'page_hook' ];
320 320
         }
321 321
         
@@ -329,11 +329,11 @@  discard block
 block discarded – undo
329 329
      * @since       3.7.0
330 330
      * @return      boolean
331 331
      */
332
-    static public function doesMetaBoxExist( $sContext='' ) {
332
+    static public function doesMetaBoxExist( $sContext = '' ) {
333 333
         
334 334
         $_aDimensions = array( 'wp_meta_boxes', $GLOBALS[ 'page_hook' ] );
335 335
         if ( $sContext ) {
336
-            $_aDimensions[] = $sContext;
336
+            $_aDimensions[ ] = $sContext;
337 337
         }
338 338
         $_aSideMetaBoxes = self::getElementAsArray( 
339 339
             $GLOBALS, 
Please login to merge, or discard this patch.