Completed
Branch master (6d8b39)
by
unknown
08:42
created
factory/_common/form/field_type/AdminPageFramework_FieldType_system.php 4 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.
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *      )
31 31
      *  );
32 32
      */
33
-    public $aFieldTypeSlugs = array( 'system', );
33
+    public $aFieldTypeSlugs = array( 'system',);
34 34
     
35 35
     /**
36 36
      * Defines the default key-values of this field type. 
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
      * @remark            $_aDefaultKeys holds shared default key-values defined in the base class.
48 48
      */
49 49
     protected $aDefaultKeys = array(
50
-        'data'          =>  array(),        // [3.2.0+] Stores the data to be displayed
51
-        'print_type'    =>  1,              // [3.4.6+] 1: readable representation of array. 2: print_r()
50
+        'data'          =>  array(), // [3.2.0+] Stores the data to be displayed
51
+        'print_type'    =>  1, // [3.4.6+] 1: readable representation of array. 2: print_r()
52 52
         'attributes'    =>    array(
53 53
             'rows'          => 60,
54 54
             'autofocus'     => null,
@@ -161,25 +161,25 @@  discard block
 block discarded – undo
161 161
      */
162 162
     protected function getField( $aField ) { 
163 163
 
164
-        $_aInputAttributes           = $aField['attributes'];
165
-        $_aInputAttributes['class'] .= ' system';
166
-        unset( $_aInputAttributes['value'] );
164
+        $_aInputAttributes           = $aField[ 'attributes' ];
165
+        $_aInputAttributes[ 'class' ] .= ' system';
166
+        unset( $_aInputAttributes[ 'value' ] );
167 167
         return 
168
-            $aField['before_label']
168
+            $aField[ 'before_label' ]
169 169
             . "<div class='admin-page-framework-input-label-container'>"
170
-                . "<label for='{$aField['input_id']}'>"
171
-                    . $aField['before_input']
172
-                    . ( $aField['label'] && ! $aField['repeatable']
173
-                        ? "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength( $aField['label_min_width'] ) . ";'>" . $aField['label'] . "</span>"
170
+                . "<label for='{$aField[ 'input_id' ]}'>"
171
+                    . $aField[ 'before_input' ]
172
+                    . ( $aField[ 'label' ] && !$aField[ 'repeatable' ]
173
+                        ? "<span class='admin-page-framework-input-label-string' style='min-width:".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>".$aField[ 'label' ]."</span>"
174 174
                         : "" 
175 175
                     )
176
-                    . "<textarea " . $this->getAttributes( $_aInputAttributes ) . " >"    
177
-                        . esc_textarea( $this->_getSystemInfomation( $aField['value'], $aField['data'], $aField['print_type'] ) )
176
+                    . "<textarea ".$this->getAttributes( $_aInputAttributes )." >"    
177
+                        . esc_textarea( $this->_getSystemInfomation( $aField[ 'value' ], $aField[ 'data' ], $aField[ 'print_type' ] ) )
178 178
                     . "</textarea>"
179
-                    . $aField['after_input']
179
+                    . $aField[ 'after_input' ]
180 180
                 . "</label>"
181 181
             . "</div>"
182
-            . $aField['after_label'];
182
+            . $aField[ 'after_label' ];
183 183
         
184 184
     }    
185 185
         /**
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
          * 
188 188
          * @return      string      The human readable system information.
189 189
          */
190
-        private function _getSystemInfomation( $asValue=null, $asCustomData=null, $iPrintType=1 ) {
190
+        private function _getSystemInfomation( $asValue = null, $asCustomData = null, $iPrintType = 1 ) {
191 191
 
192 192
             if ( isset( $asValue ) ) {
193 193
                 return $asValue;
194 194
             }
195 195
 
196
-            $_aOutput   = array();
197
-            foreach( $this->_getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) {
198
-                $_aOutput[] = $this->_getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType );
196
+            $_aOutput = array();
197
+            foreach ( $this->_getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) {
198
+                $_aOutput[ ] = $this->_getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType );
199 199
             }
200 200
             return implode( PHP_EOL, $_aOutput );
201 201
             
@@ -210,18 +210,18 @@  discard block
 block discarded – undo
210 210
                 
211 211
                 $_aData = $this->getAsArray( $asCustomData );
212 212
                 $_aData = $_aData + array(
213
-                    'Admin Page Framework'  => isset( $_aData['Admin Page Framework'] )
213
+                    'Admin Page Framework'  => isset( $_aData[ 'Admin Page Framework' ] )
214 214
                         ? null
215 215
                         : AdminPageFramework_Registry::getInfo(),
216
-                    'WordPress'             => $this->_getSiteInfoWithCache( ! isset( $_aData['WordPress'] ) ),
217
-                    'PHP'                   => $this->_getPHPInfo( ! isset( $_aData['PHP'] ) ),
218
-                    'PHP Error Log'         => $this->_getErrorLogByType( 'php', ! isset( $_aData['PHP Error Log'] ) ),
219
-                    'MySQL'                 => isset( $_aData['MySQL'] )
216
+                    'WordPress'             => $this->_getSiteInfoWithCache( !isset( $_aData[ 'WordPress' ] ) ),
217
+                    'PHP'                   => $this->_getPHPInfo( !isset( $_aData[ 'PHP' ] ) ),
218
+                    'PHP Error Log'         => $this->_getErrorLogByType( 'php', !isset( $_aData[ 'PHP Error Log' ] ) ),
219
+                    'MySQL'                 => isset( $_aData[ 'MySQL' ] )
220 220
                         ? null
221
-                        : $this->getMySQLInfo(),    // defined in the utility class.
222
-                    'MySQL Error Log'       => $this->_getErrorLogByType( 'mysql', ! isset( $_aData['MySQL Error Log'] ) ),
223
-                    'Server'                => $this->_getWebServerInfo( ! isset( $_aData['Server'] ) ),
224
-                    'Browser'               => $this->_getClientInfo( ! isset( $_aData['Browser'] ) ),
221
+                        : $this->getMySQLInfo(), // defined in the utility class.
222
+                    'MySQL Error Log'       => $this->_getErrorLogByType( 'mysql', !isset( $_aData[ 'MySQL Error Log' ] ) ),
223
+                    'Server'                => $this->_getWebServerInfo( !isset( $_aData[ 'Server' ] ) ),
224
+                    'Browser'               => $this->_getClientInfo( !isset( $_aData[ 'Browser' ] ) ),
225 225
                 );
226 226
                 
227 227
                 // Dropping empty elements allows the user to remove a section by setting an empty section.
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
                 switch ( $iPrintType ) {
238 238
                     default:
239 239
                     case 1: // use the framework readable representation of arrays.
240
-                        return $this->getReadableArrayContents( $sSectionName, $aData, 32 ) . PHP_EOL;
240
+                        return $this->getReadableArrayContents( $sSectionName, $aData, 32 ).PHP_EOL;
241 241
                     case 2: // use print_r()
242
-                        return "[{$sSectionName}]" . PHP_EOL
243
-                            . print_r( $aData, true ) . PHP_EOL;
242
+                        return "[{$sSectionName}]".PHP_EOL
243
+                            . print_r( $aData, true ).PHP_EOL;
244 244
                 }                      
245 245
             }
246 246
             /**
@@ -249,17 +249,17 @@  discard block
 block discarded – undo
249 249
              * @since       3.4.6
250 250
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
251 251
              */
252
-            private function _getClientInfo( $bGenerateInfo=true ) {
252
+            private function _getClientInfo( $bGenerateInfo = true ) {
253 253
                  
254
-                if ( ! $bGenerateInfo ) {
254
+                if ( !$bGenerateInfo ) {
255 255
                     return '';
256 256
                 }
257 257
                  
258 258
                 // Check the browscap value in the ini file first to prevent warnings from being populated
259 259
                 $_aBrowser = @ini_get( 'browscap' ) 
260
-                    ? get_browser( $_SERVER['HTTP_USER_AGENT'], true )
260
+                    ? get_browser( $_SERVER[ 'HTTP_USER_AGENT' ], true )
261 261
                     : array();
262
-                unset( $_aBrowser['browser_name_regex'] );  // this element causes output to be blank
262
+                unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank
263 263
                 return empty( $_aBrowser ) 
264 264
                     ? __( 'No browser information found.', 'admin-page-framework' )
265 265
                     : $_aBrowser;
@@ -274,9 +274,9 @@  discard block
 block discarded – undo
274 274
              * @param       string      $sType          The error log type. Either 'php' or 'mysql' is accepted.
275 275
              * @param       boolean     $bGenerateInfo  Whether to generate a log. This is for the caller method to reduce a conditinal statement.
276 276
              */
277
-            private function _getErrorLogByType( $sType, $bGenerateInfo=true ) {
277
+            private function _getErrorLogByType( $sType, $bGenerateInfo = true ) {
278 278
 
279
-                if ( ! $bGenerateInfo ) {
279
+                if ( !$bGenerateInfo ) {
280 280
                     return '';
281 281
                 }
282 282
                 switch ( $sType ) {
@@ -307,9 +307,9 @@  discard block
 block discarded – undo
307 307
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
308 308
              * @return      array      The generated site information array.
309 309
              */
310
-            private function _getSiteInfoWithCache( $bGenerateInfo=true ) {
310
+            private function _getSiteInfoWithCache( $bGenerateInfo = true ) {
311 311
                 
312
-                if ( ! $bGenerateInfo || isset( self::$_aSiteInfo ) ) {
312
+                if ( !$bGenerateInfo || isset( self::$_aSiteInfo ) ) {
313 313
                     return self::$_aSiteInfo;
314 314
                 }
315 315
                 self::$_aSiteInfo = self::_getSiteInfo();
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
                         'wp_remote_get()'                                           => $this->_getWPRemoteGetStatus(),
343 343
                         __( 'Multibite String Extension', 'admin-page-framework' )  => $this->getAOrB( function_exists( 'mb_detect_encoding' ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ),
344 344
                         __( 'WP_CONTENT_DIR Writeable', 'admin-page-framework' )    => $this->getAOrB( is_writable( WP_CONTENT_DIR ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), 
345
-                        __( 'Active Plugins', 'admin-page-framework' )              => PHP_EOL . $this->_getActivePlugins(),
346
-                        __( 'Network Active Plugins', 'admin-page-framework' )      => PHP_EOL . $this->_getNetworkActivePlugins(),
345
+                        __( 'Active Plugins', 'admin-page-framework' )              => PHP_EOL.$this->_getActivePlugins(),
346
+                        __( 'Network Active Plugins', 'admin-page-framework' )      => PHP_EOL.$this->_getNetworkActivePlugins(),
347 347
                         __( 'Constants', 'admin-page-framework' )                   => $this->_getDefinedConstants( 'user' ),
348 348
                     );                        
349 349
                 }
@@ -352,9 +352,9 @@  discard block
 block discarded – undo
352 352
                      * @since       3.5.12
353 353
                      * @return      stirng|array
354 354
                      */
355
-                    private function _getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) {
355
+                    private function _getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) {
356 356
                         $_asConstants = $this->getDefinedConstants( $asCategories, $asRemovingCategories );
357
-                        if ( ! is_array( $_asConstants ) ) {
357
+                        if ( !is_array( $_asConstants ) ) {
358 358
                             return $_asConstants;
359 359
                         }
360 360
                         if ( isset( $_asConstants[ 'user' ] ) ) {
@@ -388,13 +388,13 @@  discard block
 block discarded – undo
388 388
                 private function _getActiveThemeName() {
389 389
                     
390 390
                     // If the WordPress version is less than 3.4,
391
-                    if ( version_compare( $GLOBALS['wp_version'], '3.4', '<' ) ) {
392
-                        $_aThemeData = get_theme_data( get_stylesheet_directory() . '/style.css' );
393
-                        return $_aThemeData['Name'] . ' ' . $_aThemeData['Version'];
391
+                    if ( version_compare( $GLOBALS[ 'wp_version' ], '3.4', '<' ) ) {
392
+                        $_aThemeData = get_theme_data( get_stylesheet_directory().'/style.css' );
393
+                        return $_aThemeData[ 'Name' ].' '.$_aThemeData[ 'Version' ];
394 394
                     } 
395 395
                     
396 396
                     $_oThemeData = wp_get_theme();
397
-                    return $_oThemeData->Name . ' ' . $_oThemeData->Version;
397
+                    return $_oThemeData->Name.' '.$_oThemeData->Version;
398 398
                     
399 399
                 }   
400 400
                 /**
@@ -407,10 +407,10 @@  discard block
 block discarded – undo
407 407
                     $_aPluginList       = array();
408 408
                     $_aActivePlugins    = get_option( 'active_plugins', array() );
409 409
                     foreach ( get_plugins() as $_sPluginPath => $_aPlugin ) {
410
-                        if ( ! in_array( $_sPluginPath, $_aActivePlugins ) ) {
410
+                        if ( !in_array( $_sPluginPath, $_aActivePlugins ) ) {
411 411
                             continue;
412 412
                         }
413
-                        $_aPluginList[] = '    ' . $_aPlugin['Name'] . ': ' . $_aPlugin['Version'];
413
+                        $_aPluginList[ ] = '    '.$_aPlugin[ 'Name' ].': '.$_aPlugin[ 'Version' ];
414 414
                     }
415 415
                     return implode( PHP_EOL, $_aPluginList );
416 416
                     
@@ -421,17 +421,17 @@  discard block
 block discarded – undo
421 421
                  */
422 422
                 private function _getNetworkActivePlugins() {
423 423
                     
424
-                    if ( ! is_multisite() ) {
424
+                    if ( !is_multisite() ) {
425 425
                         return '';
426 426
                     }
427 427
                     $_aPluginList       = array();
428 428
                     $_aActivePlugins    = get_site_option( 'active_sitewide_plugins', array() );
429 429
                     foreach ( wp_get_active_network_plugins() as $_sPluginPath ) {
430
-                        if ( ! array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) {
430
+                        if ( !array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) {
431 431
                             continue;
432 432
                         }
433 433
                         $_aPlugin       = get_plugin_data( $_sPluginPath );
434
-                        $_aPluginList[] = '    ' . $_aPlugin['Name'] . ' :' . $_aPlugin['Version'];
434
+                        $_aPluginList[ ] = '    '.$_aPlugin[ 'Name' ].' :'.$_aPlugin[ 'Version' ];
435 435
                     }
436 436
                     return implode( PHP_EOL, $_aPluginList );
437 437
                     
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
                     $_vResponse = false === $_vResponse
449 449
                         ? wp_remote_post( 
450 450
                             // 'https://www.paypal.com/cgi-bin/webscr', 
451
-                            add_query_arg( $_GET, admin_url( $GLOBALS['pagenow'] ) ),
451
+                            add_query_arg( $_GET, admin_url( $GLOBALS[ 'pagenow' ] ) ),
452 452
                             array(
453 453
                                 'sslverify'     => false,
454 454
                                 'timeout'       => 60,
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
                     $_vResponse = $this->getTransient( 'apf_rg_check' );
471 471
                     $_vResponse = false === $_vResponse
472 472
                         ? wp_remote_get( 
473
-                            add_query_arg( $_GET + array( 'apf_remote_request_test' => '_testing' ), admin_url( $GLOBALS['pagenow'] ) ),
473
+                            add_query_arg( $_GET + array( 'apf_remote_request_test' => '_testing' ), admin_url( $GLOBALS[ 'pagenow' ] ) ),
474 474
                             array(
475 475
                                 'sslverify'     => false,
476 476
                                 'timeout'       => 60,
@@ -494,10 +494,10 @@  discard block
 block discarded – undo
494 494
                         if ( is_wp_error( $mResponse ) ) {
495 495
                             return true;
496 496
                         }
497
-                        if ( $mResponse['response']['code'] < 200 ) {
497
+                        if ( $mResponse[ 'response' ][ 'code' ] < 200 ) {
498 498
                             return true;
499 499
                         }
500
-                        if ( $mResponse['response']['code'] >= 300 ) {
500
+                        if ( $mResponse[ 'response' ][ 'code' ] >= 300 ) {
501 501
                             return true;
502 502
                         }
503 503
                         return false;
@@ -514,13 +514,13 @@  discard block
 block discarded – undo
514 514
              * @since       3.4.6
515 515
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
516 516
              */
517
-            private function _getPHPInfo( $bGenerateInfo=true ) {
517
+            private function _getPHPInfo( $bGenerateInfo = true ) {
518 518
                 
519
-                if ( ! $bGenerateInfo || isset( self::$_aPHPInfo ) ) {
519
+                if ( !$bGenerateInfo || isset( self::$_aPHPInfo ) ) {
520 520
                     return self::$_aPHPInfo;
521 521
                 }
522 522
                 
523
-                $_oErrorReporting   = new AdminPageFramework_ErrorReporting;
523
+                $_oErrorReporting = new AdminPageFramework_ErrorReporting;
524 524
                 self::$_aPHPInfo = array(
525 525
                     __( 'Version', 'admin-page-framework' )                 => phpversion(),
526 526
                     __( 'Safe Mode', 'admin-page-framework' )               => $this->getAOrB( @ini_get( 'safe_mode' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), 
@@ -531,16 +531,16 @@  discard block
 block discarded – undo
531 531
                     __( 'Max Execution Time', 'admin-page-framework' )      => @ini_get( 'max_execution_time' ),
532 532
                     __( 'Max Input Vars', 'admin-page-framework' )          => @ini_get( 'max_input_vars' ),
533 533
                     __( 'Argument Separator', 'admin-page-framework' )      => @ini_get( 'arg_separator.output' ),
534
-                    __( 'Allow URL File Open', 'admin-page-framework' )     => $this->getAOrB( @ini_get( 'allow_url_fopen' ),    $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
535
-                    __( 'Display Errors', 'admin-page-framework' )          => $this->getAOrB( @ini_get( 'display_errors' ),     $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
536
-                    __( 'Log Errors', 'admin-page-framework' )              => $this->getAOrB( @ini_get( 'log_errors' ),         $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
534
+                    __( 'Allow URL File Open', 'admin-page-framework' )     => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
535
+                    __( 'Display Errors', 'admin-page-framework' )          => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
536
+                    __( 'Log Errors', 'admin-page-framework' )              => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
537 537
                     __( 'Error log location', 'admin-page-framework' )      => @ini_get( 'error_log' ),
538 538
                     __( 'Error Reporting Level', 'admin-page-framework' )   => $_oErrorReporting->getErrorLevel(),
539
-                    __( 'FSOCKOPEN', 'admin-page-framework' )               => $this->getAOrB( function_exists( 'fsockopen' ),   $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
540
-                    __( 'cURL', 'admin-page-framework' )                    => $this->getAOrB( function_exists( 'curl_init' ),   $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
541
-                    __( 'SOAP', 'admin-page-framework' )                    => $this->getAOrB( class_exists( 'SoapClient' ),     $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
542
-                    __( 'SUHOSIN', 'admin-page-framework' )                 => $this->getAOrB( extension_loaded( 'suhosin' ),    $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
543
-                    'ini_set()'                                             => $this->getAOrB( function_exists( 'ini_set' ),     $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
539
+                    __( 'FSOCKOPEN', 'admin-page-framework' )               => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
540
+                    __( 'cURL', 'admin-page-framework' )                    => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
541
+                    __( 'SOAP', 'admin-page-framework' )                    => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
542
+                    __( 'SUHOSIN', 'admin-page-framework' )                 => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
543
+                    'ini_set()'                                             => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
544 544
                 ) 
545 545
                 + $this->getPHPInfo()
546 546
                 + array( 
@@ -557,11 +557,11 @@  discard block
 block discarded – undo
557 557
              * @since       3.4.6
558 558
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
559 559
              */                      
560
-            private function _getWebServerInfo( $bGenerateInfo=true ) {
560
+            private function _getWebServerInfo( $bGenerateInfo = true ) {
561 561
                         
562 562
                 return $bGenerateInfo 
563 563
                     ? array(
564
-                        __( 'Web Server', 'admin-page-framework' )                  => $_SERVER['SERVER_SOFTWARE'],
564
+                        __( 'Web Server', 'admin-page-framework' )                  => $_SERVER[ 'SERVER_SOFTWARE' ],
565 565
                         'SSL'                                                       => $this->getAOrB( is_ssl(), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
566 566
                         __( 'Session', 'admin-page-framework' )                     => $this->getAOrB( isset( $_SESSION ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ),
567 567
                         __( 'Session Name', 'admin-page-framework' )                => esc_html( @ini_get( 'session.name' ) ),
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      *     <li>**attributes** - (optional, array) [3.3.0+] attribute argument array. `array( 'async' => '', 'data-id' => '...' )`</li>
95 95
      * </ul>     
96 96
      */
97
-    protected function getEnqueuingScripts() { 
97
+    protected function getEnqueuingScripts() {
98 98
         return array();
99 99
     }
100 100
     
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      *     <li><strong>media</strong> - ( optional, string ) the description of the field which is inserted into the after the input field tag.</li>
111 111
      * </ul>
112 112
      */
113
-    protected function getEnqueuingStyles() { 
113
+    protected function getEnqueuingStyles() {
114 114
         return array();
115 115
     }            
116 116
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     /**
119 119
      * Returns the field type specific JavaScript script.
120 120
      */ 
121
-    protected function getScripts() { 
121
+    protected function getScripts() {
122 122
         return '';
123 123
     }
124 124
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     /**
160 160
      * Returns the output of the field type.
161 161
      */
162
-    protected function getField( $aField ) { 
162
+    protected function getField( $aField ) {
163 163
 
164 164
         $_aInputAttributes           = $aField['attributes'];
165 165
         $_aInputAttributes['class'] .= ' system';
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Admin Page Framework
4
- * 
5
- * http://en.michaeluno.jp/admin-page-framework/
6
- * Copyright (c) 2013-2016 Michael Uno; Licensed MIT
7
- * 
8
- */
3
+         * Admin Page Framework
4
+         * 
5
+         * http://en.michaeluno.jp/admin-page-framework/
6
+         * Copyright (c) 2013-2016 Michael Uno; Licensed MIT
7
+         * 
8
+         */
9 9
 
10 10
 /**
11 11
  * Provides utility methods which can be accessed among different components of the framework.
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_taxonomy.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -426,7 +426,7 @@
 block discarded – undo
426 426
              * 
427 427
              * @since   2.0.0
428 428
              * @param   array   $vValue This can be either an one-dimensional array ( for single field ) or a two-dimensional array ( for multiple fields ).
429
-             * @param   string  $sKey     
429
+             * @param string $sTaxonomySlug
430 430
              * @return  array   Returns an numerically indexed array holding the keys that yield true as the value.
431 431
              */ 
432 432
             private function _getSelectedKeyArray( $vValue, $sTaxonomySlug ) {
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * Defines the field type slugs used for this field type.
23 23
      */
24
-    public $aFieldTypeSlugs = array( 'taxonomy', );
24
+    public $aFieldTypeSlugs = array( 'taxonomy',);
25 25
     
26 26
     /**
27 27
      * Defines the default key-values of this field type. 
@@ -29,40 +29,40 @@  discard block
 block discarded – undo
29 29
      * @remark  $_aDefaultKeys holds shared default key-values defined in the base class.
30 30
      */
31 31
     protected $aDefaultKeys = array(
32
-        'taxonomy_slugs'        => 'category',      // (array|string) This is for the taxonomy field type.
33
-        'height'                => '250px',         // the tab box height
34
-        'width'                 => null,            // 3.5.7.2+ the tab box width
35
-        'max_width'             => '100%',          // for the taxonomy checklist field type, since 2.1.1.     
36
-        'show_post_count'       => true,            // (boolean) 3.2.0+ whether or not the post count associated with the term should be displayed or not.
32
+        'taxonomy_slugs'        => 'category', // (array|string) This is for the taxonomy field type.
33
+        'height'                => '250px', // the tab box height
34
+        'width'                 => null, // 3.5.7.2+ the tab box width
35
+        'max_width'             => '100%', // for the taxonomy checklist field type, since 2.1.1.     
36
+        'show_post_count'       => true, // (boolean) 3.2.0+ whether or not the post count associated with the term should be displayed or not.
37 37
         'attributes'            => array(),    
38
-        'select_all_button'     => true,            // (boolean|string) 3.3.0+ to change the label, set the label here
39
-        'select_none_button'    => true,            // (boolean|string) 3.3.0+ to change the label, set the label here                
40
-        'label_no_term_found'   => null,            // (string) 3.3.2+  The label to display when no term is found. null needs to be set here as the default value will be assigned in the field output method.
41
-        'label_list_title'      => '',              // (string) 3.3.2+ The heading title string for a term list. Default: `''`. Insert an HTML custom string right before the list starts.
38
+        'select_all_button'     => true, // (boolean|string) 3.3.0+ to change the label, set the label here
39
+        'select_none_button'    => true, // (boolean|string) 3.3.0+ to change the label, set the label here                
40
+        'label_no_term_found'   => null, // (string) 3.3.2+  The label to display when no term is found. null needs to be set here as the default value will be assigned in the field output method.
41
+        'label_list_title'      => '', // (string) 3.3.2+ The heading title string for a term list. Default: `''`. Insert an HTML custom string right before the list starts.
42 42
         'query'                 => array(       // (array)  3.3.2+ Defines the default query argument.
43 43
             // see the arguments of the get_category() function: http://codex.wordpress.org/Function_Reference/get_categories
44 44
             // see the argument of the get_terms() function: http://codex.wordpress.org/Function_Reference/get_terms        
45 45
             'child_of'          => 0,
46 46
             'parent'            => '',
47
-            'orderby'           => 'name',      // (string) 'ID' or 'term_id' or 'name'
48
-            'order'             => 'ASC',       // (string) 'ASC' or 'DESC'
49
-            'hide_empty'        => false,       // (boolean) whether to show the terms with no post associated. Default: false
50
-            'hierarchical'      => true,        // (boolean) whether to show the terms as a hierarchical tree.
51
-            'number'            => '',          // (integer) The maximum number of the terms to show.
52
-            'pad_counts'        => false,       // (boolean) whether to sum up the post counts with the child post counts.
53
-            'exclude'           => array(),     // (string) Comma separated term IDs to exclude from the list. for example `1` will remove the 'Uncategorized' category from the list.
47
+            'orderby'           => 'name', // (string) 'ID' or 'term_id' or 'name'
48
+            'order'             => 'ASC', // (string) 'ASC' or 'DESC'
49
+            'hide_empty'        => false, // (boolean) whether to show the terms with no post associated. Default: false
50
+            'hierarchical'      => true, // (boolean) whether to show the terms as a hierarchical tree.
51
+            'number'            => '', // (integer) The maximum number of the terms to show.
52
+            'pad_counts'        => false, // (boolean) whether to sum up the post counts with the child post counts.
53
+            'exclude'           => array(), // (string) Comma separated term IDs to exclude from the list. for example `1` will remove the 'Uncategorized' category from the list.
54 54
             'exclude_tree'      => array(), 
55
-            'include'           => array(),     // (string) Comma separated term IDs to include in the list.
55
+            'include'           => array(), // (string) Comma separated term IDs to include in the list.
56 56
             'fields'            => 'all', 
57 57
             'slug'              => '', 
58 58
             'get'               => '', 
59 59
             'name__like'        => '',
60 60
             'description__like' => '',
61 61
             'offset'            => '', 
62
-            'search'            => '',          // (string) The search keyword to get the term with.
62
+            'search'            => '', // (string) The search keyword to get the term with.
63 63
             'cache_domain'      => 'core',
64 64
         ),
65
-        'queries'   => array(),         // (optional, array) 3.3.2+  Allows to set a query argument for each taxonomy. The array key must be the taxonomy slug and the value is the query argument array.
65
+        'queries'   => array(), // (optional, array) 3.3.2+  Allows to set a query argument for each taxonomy. The array key must be the taxonomy slug and the value is the query argument array.
66 66
     );
67 67
     
68 68
     /**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
         $_aJSArray = json_encode( $this->aFieldTypeSlugs );
90 90
         
91
-        return parent::getScripts() . 
91
+        return parent::getScripts(). 
92 92
         // return 
93 93
 <<<JAVASCRIPTS
94 94
 /* For tabs */
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
     protected function getField( $aField ) {
322 322
         
323 323
         // Format
324
-        $aField['label_no_term_found'] = $this->getElement( 
324
+        $aField[ 'label_no_term_found' ] = $this->getElement( 
325 325
             $aField, 
326 326
             'label_no_term_found', 
327 327
             $this->oMsg->get( 'no_term_found' ) 
@@ -330,18 +330,18 @@  discard block
 block discarded – undo
330 330
         // Parse
331 331
         $_aTabs         = array();
332 332
         $_aCheckboxes   = array();      
333
-        foreach( $this->getAsArray( $aField['taxonomy_slugs'] ) as $sKey => $sTaxonomySlug ) {
334
-            $_aTabs[]        = $this->_getTaxonomyTab( $aField, $sKey, $sTaxonomySlug );    
335
-            $_aCheckboxes[]  = $this->_getTaxonomyCheckboxes( $aField, $sKey, $sTaxonomySlug );
333
+        foreach ( $this->getAsArray( $aField[ 'taxonomy_slugs' ] ) as $sKey => $sTaxonomySlug ) {
334
+            $_aTabs[ ]        = $this->_getTaxonomyTab( $aField, $sKey, $sTaxonomySlug );    
335
+            $_aCheckboxes[ ]  = $this->_getTaxonomyCheckboxes( $aField, $sKey, $sTaxonomySlug );
336 336
         }
337 337
 
338 338
         // Output
339
-        return "<div id='tabbox-{$aField['field_id']}' class='tab-box-container categorydiv' style='max-width:{$aField['max_width']};'>"
339
+        return "<div id='tabbox-{$aField[ 'field_id' ]}' class='tab-box-container categorydiv' style='max-width:{$aField[ 'max_width' ]};'>"
340 340
                 . "<ul class='tab-box-tabs category-tabs'>" 
341 341
                     . implode( PHP_EOL, $_aTabs ) 
342 342
                 . "</ul>" 
343 343
                 . "<div class='tab-box-contents-container'>"
344
-                    . "<div class='tab-box-contents' style='height: {$aField['height']};'>"
344
+                    . "<div class='tab-box-contents' style='height: {$aField[ 'height' ]};'>"
345 345
                         . implode( PHP_EOL, $_aCheckboxes )
346 346
                     . "</div>"
347 347
                 . "</div>" 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         private function _getTaxonomyCheckboxes( array $aField, $sKey, $sTaxonomySlug ) {
359 359
             
360 360
             $_aTabBoxContainerArguments = array(
361
-                'id'    => "tab_{$aField['input_id']}_{$sKey}",
361
+                'id'    => "tab_{$aField[ 'input_id' ]}_{$sKey}",
362 362
                 'class' => 'tab-box-content',
363 363
                 'style' => $this->generateInlineCSS(
364 364
                     array(
@@ -367,9 +367,9 @@  discard block
 block discarded – undo
367 367
                     )
368 368
                 ),
369 369
             );
370
-            return "<div " . $this->getAttributes( $_aTabBoxContainerArguments ) . ">"
370
+            return "<div ".$this->getAttributes( $_aTabBoxContainerArguments ).">"
371 371
                     . $this->getElement( $aField, array( 'before_label', $sKey ) )
372
-                    . "<div " . $this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ) . "></div>"
372
+                    . "<div ".$this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) )."></div>"
373 373
                     . "<ul class='list:category taxonomychecklist form-no-clear'>"
374 374
                         . $this->_getTaxonomyChecklist( $aField, $sKey, $sTaxonomySlug )
375 375
                     . "</ul>"     
@@ -389,23 +389,23 @@  discard block
 block discarded – undo
389 389
                     array(
390 390
                         'walker'                => new AdminPageFramework_WalkerTaxonomyChecklist, // the walker class instance
391 391
                         'taxonomy'              => $sTaxonomySlug, 
392
-                        '_name_prefix'          => is_array( $aField['taxonomy_slugs'] ) 
393
-                            ? "{$aField['_input_name']}[{$sTaxonomySlug}]" 
394
-                            : $aField['_input_name'],   // name prefix of the input
395
-                        '_input_id_prefix'      => $aField['input_id'],
392
+                        '_name_prefix'          => is_array( $aField[ 'taxonomy_slugs' ] ) 
393
+                            ? "{$aField[ '_input_name' ]}[{$sTaxonomySlug}]" 
394
+                            : $aField[ '_input_name' ], // name prefix of the input
395
+                        '_input_id_prefix'      => $aField[ 'input_id' ],
396 396
                         '_attributes'           => $this->getElement( 
397 397
                             $aField, 
398 398
                             array( 'attributes', $sKey ), 
399 399
                             array() 
400
-                        ) + $aField['attributes'],                 
400
+                        ) + $aField[ 'attributes' ],                 
401 401
                         
402 402
                         // checked items ( term IDs ) e.g.  array( 6, 10, 7, 15 ), 
403
-                        '_selected_items'       => $this->_getSelectedKeyArray( $aField['value'], $sTaxonomySlug ),
403
+                        '_selected_items'       => $this->_getSelectedKeyArray( $aField[ 'value' ], $sTaxonomySlug ),
404 404
                         
405
-                        'echo'                  => false,  // returns the output
406
-                        'show_post_count'       => $aField['show_post_count'],      // 3.2.0+
407
-                        'show_option_none'      => $aField['label_no_term_found'],  // 3.3.2+ 
408
-                        'title_li'              => $aField['label_list_title'],     // 3.3.2+
405
+                        'echo'                  => false, // returns the output
406
+                        'show_post_count'       => $aField[ 'show_post_count' ], // 3.2.0+
407
+                        'show_option_none'      => $aField[ 'label_no_term_found' ], // 3.3.2+ 
408
+                        'title_li'              => $aField[ 'label_list_title' ], // 3.3.2+
409 409
                     ) 
410 410
                     + $this->getAsArray( 
411 411
                         $this->getElement( 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
                         ), 
416 416
                         true 
417 417
                     )
418
-                    + $aField['query']                             
418
+                    + $aField[ 'query' ]                             
419 419
                 );
420 420
             }
421 421
      
@@ -433,10 +433,10 @@  discard block
 block discarded – undo
433 433
 
434 434
                 $vValue = ( array ) $vValue; // cast array because the initial value (null) may not be an array.
435 435
                 
436
-                if ( ! isset( $vValue[ $sTaxonomySlug ] ) ) { 
436
+                if ( !isset( $vValue[ $sTaxonomySlug ] ) ) { 
437 437
                     return array(); 
438 438
                 }
439
-                if ( ! is_array( $vValue[ $sTaxonomySlug ] ) ) { 
439
+                if ( !is_array( $vValue[ $sTaxonomySlug ] ) ) { 
440 440
                     return array(); 
441 441
                 }
442 442
                 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
          */
453 453
         private function _getTaxonomyTab( array $aField, $sKey, $sTaxonomySlug ) {
454 454
             return "<li class='tab-box-tab'>"
455
-                    . "<a href='#tab_{$aField['input_id']}_{$sKey}'>"
455
+                    . "<a href='#tab_{$aField[ 'input_id' ]}_{$sKey}'>"
456 456
                         . "<span class='tab-box-tab-text'>" 
457 457
                             . $this->_getLabelFromTaxonomySlug( $sTaxonomySlug )
458 458
                         . "</span>"
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -433,10 +433,10 @@
 block discarded – undo
433 433
 
434 434
                 $vValue = ( array ) $vValue; // cast array because the initial value (null) may not be an array.
435 435
                 
436
-                if ( ! isset( $vValue[ $sTaxonomySlug ] ) ) { 
436
+                if ( ! isset( $vValue[ $sTaxonomySlug ] ) ) {
437 437
                     return array(); 
438 438
                 }
439
-                if ( ! is_array( $vValue[ $sTaxonomySlug ] ) ) { 
439
+                if ( ! is_array( $vValue[ $sTaxonomySlug ] ) ) {
440 440
                     return array(); 
441 441
                 }
442 442
                 
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   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
     public function get( /* $sLabel, $aAttributes=array() */ ) {
28 28
         
29 29
         // Parameters
30
-        $_aParams       = func_get_args() + array( 
31
-            0 => '',            // 1st parameter
30
+        $_aParams = func_get_args() + array( 
31
+            0 => '', // 1st parameter
32 32
             1 => array()        // 2nd parameter
33 33
         );
34
-        $_sLabel        = $_aParams[ 0 ];       // first parameter
34
+        $_sLabel        = $_aParams[ 0 ]; // first parameter
35 35
 
36 36
         // Attributes
37 37
         $_aAttributes   = $this->uniteArrays(   // second parameter
@@ -46,9 +46,9 @@  discard block
 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
-                . "<input " . $this->getAttributes( 
51
+                . "<input ".$this->getAttributes( 
52 52
                     array(
53 53
                         'type'      => 'hidden',
54 54
                         'class'     => $_aAttributes[ 'class' ],
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
                     ) 
58 58
                 ) 
59 59
                 . " />"
60
-                . "<input " . $this->getAttributes( $_aAttributes ) . " />" 
60
+                . "<input ".$this->getAttributes( $_aAttributes )." />" 
61 61
             . "</{$this->aOptions[ 'input_container_tag' ]}>"
62
-            . "<{$this->aOptions[ 'label_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ) . ">"
62
+            . "<{$this->aOptions[ 'label_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ).">"
63 63
                 . $_sLabel
64 64
             . "</{$this->aOptions[ 'label_container_tag' ]}>"
65 65
         ;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function getAttributesByKey( /* $sKey */ ) {
76 76
         
77 77
         // Parameters
78
-        $_aParams       = func_get_args() + array( 0 => '', );
78
+        $_aParams       = func_get_args() + array( 0 => '',);
79 79
         $_sKey          = $_aParams[ 0 ];        
80 80
         $_bIsMultiple   = '' !== $_sKey;
81 81
         
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
             // 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.
88 88
             + array(
89 89
                 'type'      => 'checkbox', 
90
-                'id'        => $this->aAttributes[ 'id' ] . '_' . $_sKey,
90
+                'id'        => $this->aAttributes[ 'id' ].'_'.$_sKey,
91 91
                 'checked'   => $this->_getCheckedAttributeValue( $_sKey ),
92
-                '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.
92
+                '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.
93 93
                 'name'      => $_bIsMultiple 
94 94
                     ? "{$this->aAttributes[ 'name' ]}[{$_sKey}]" 
95 95
                     : $this->aAttributes[ 'name' ],
96
-                'data-id'   => $this->aAttributes[ 'id' ],       // referenced by the JavaScript scripts such as the revealer script.
96
+                'data-id'   => $this->aAttributes[ 'id' ], // referenced by the JavaScript scripts such as the revealer script.
97 97
             )
98 98
             + $this->aAttributes
99 99
             ;
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 : array( 'value', $_sKey );
111 111
             return $this->getElement( $this->aAttributes, $_aValueDimension )
112 112
                 ? 'checked' 
113
-                : null;    // to not to set, pass null. An empty value '' will still set the attribute.            
113
+                : null; // to not to set, pass null. An empty value '' will still set the attribute.            
114 114
         
115 115
         }
116 116
         
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.
development/factory/_common/utility/AdminPageFramework_RegisterClasses.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -170,6 +170,7 @@
 block discarded – undo
170 170
         
171 171
         /**
172 172
          * The recursive version of the glob() function.
173
+         * @param string $sPathPatten
173 174
          */
174 175
         protected function doRecursiveGlob( $sPathPatten, $nFlags=0, array $aExcludeDirs=array(), array $aExcludeDirNames=array() ) {
175 176
 
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         'is_recursive'          => true,
38 38
         'exclude_dir_paths'     => array(),
39 39
         'exclude_dir_names'     => array( 'asset', 'assets', 'css', 'js', 'image', 'images', 'license', 'document', 'documents' ),
40
-        'allowed_extensions'    => array( 'php', ), // 'inc'
40
+        'allowed_extensions'    => array( 'php',), // 'inc'
41 41
         'include_function'      => 'include',
42 42
         'exclude_class_names'   => array( /* 'SomeClass', 'SomeOtherClass' */ ),
43 43
     );
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
      * </code>
66 66
      * @remark The directory paths set for the 'exclude_dir_paths' option should use the system directory separator.
67 67
      */
68
-    function __construct( $asScanDirPaths, array $aOptions=array(), array $aClasses=array() ) {
68
+    function __construct( $asScanDirPaths, array $aOptions = array(), array $aClasses = array() ) {
69 69
         
70 70
         $_aOptions = $aOptions + self::$_aStructure_Options;
71
-        $this->_aClasses   = $aClasses + $this->_getClassArray( $asScanDirPaths, $_aOptions );
71
+        $this->_aClasses = $aClasses + $this->_getClassArray( $asScanDirPaths, $_aOptions );
72 72
         $this->_registerClasses( $_aOptions[ 'include_function' ] );
73 73
         
74 74
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             return array();
94 94
         }
95 95
         $_aFilePaths = array();
96
-        foreach( ( array ) $asScanDirPaths as $_sClassDirPath ) {
96
+        foreach ( ( array ) $asScanDirPaths as $_sClassDirPath ) {
97 97
             if ( realpath( $_sClassDirPath ) ) {
98 98
                 $_aFilePaths = array_merge( $this->getFilePaths( $_sClassDirPath, $aSearchOptions ), $_aFilePaths );
99 99
             }
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
         
102 102
         // Store classes in an array.
103 103
         $_aClasses = array();
104
-        foreach( $_aFilePaths as $_sFilePath ) {
104
+        foreach ( $_aFilePaths as $_sFilePath ) {
105 105
             
106 106
             // Class name without a file extension.
107 107
             $_sClassNameWOExt = pathinfo( $_sFilePath, PATHINFO_FILENAME );
108
-            if ( in_array( $_sClassNameWOExt, $aSearchOptions['exclude_class_names'] ) ) {
108
+            if ( in_array( $_sClassNameWOExt, $aSearchOptions[ 'exclude_class_names' ] ) ) {
109 109
                 continue;
110 110
             }
111 111
             $_aClasses[ $_sClassNameWOExt ] = $_sFilePath; 
@@ -134,26 +134,26 @@  discard block
 block discarded – undo
134 134
          */
135 135
         protected function getFilePaths( $sClassDirPath, array $aSearchOptions ) {
136 136
             
137
-            $sClassDirPath = rtrim( $sClassDirPath, '\\/' ) . DIRECTORY_SEPARATOR; // ensures the trailing (back/)slash exists. 
138
-            $_aAllowedExtensions = $aSearchOptions['allowed_extensions'];
139
-            $_aExcludeDirPaths = ( array ) $aSearchOptions['exclude_dir_paths'];
140
-            $_aExcludeDirNames = ( array ) $aSearchOptions['exclude_dir_names'];
137
+            $sClassDirPath = rtrim( $sClassDirPath, '\\/' ).DIRECTORY_SEPARATOR; // ensures the trailing (back/)slash exists. 
138
+            $_aAllowedExtensions = $aSearchOptions[ 'allowed_extensions' ];
139
+            $_aExcludeDirPaths = ( array ) $aSearchOptions[ 'exclude_dir_paths' ];
140
+            $_aExcludeDirNames = ( array ) $aSearchOptions[ 'exclude_dir_names' ];
141 141
             $_bIsRecursive = $aSearchOptions[ 'is_recursive' ];
142 142
             
143 143
             if ( defined( 'GLOB_BRACE' ) ) { // in some OSes this flag constant is not available.
144 144
                 $_aFilePaths = $_bIsRecursive
145
-                    ? $this->doRecursiveGlob( $sClassDirPath . '*.' . $this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE, $_aExcludeDirPaths, $_aExcludeDirNames )
146
-                    : ( array ) glob( $sClassDirPath . '*.' . $this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE );
145
+                    ? $this->doRecursiveGlob( $sClassDirPath.'*.'.$this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE, $_aExcludeDirPaths, $_aExcludeDirNames )
146
+                    : ( array ) glob( $sClassDirPath.'*.'.$this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE );
147 147
                 return array_filter( $_aFilePaths ); // drop non-value elements.    
148 148
             } 
149 149
                 
150 150
             // For the Solaris operation system.
151 151
             $_aFilePaths = array();
152
-            foreach( $_aAllowedExtensions as $__sAllowedExtension ) {
152
+            foreach ( $_aAllowedExtensions as $__sAllowedExtension ) {
153 153
                                 
154 154
                 $__aFilePaths = $_bIsRecursive
155
-                    ? $this->doRecursiveGlob( $sClassDirPath . '*.' . $__sAllowedExtension, 0, $_aExcludeDirPaths, $_aExcludeDirNames )
156
-                    : ( array ) glob( $sClassDirPath . '*.' . $__sAllowedExtension );
155
+                    ? $this->doRecursiveGlob( $sClassDirPath.'*.'.$__sAllowedExtension, 0, $_aExcludeDirPaths, $_aExcludeDirNames )
156
+                    : ( array ) glob( $sClassDirPath.'*.'.$__sAllowedExtension );
157 157
 
158 158
                 $_aFilePaths = array_merge( $__aFilePaths, $_aFilePaths );
159 159
                 
@@ -165,27 +165,27 @@  discard block
 block discarded – undo
165 165
         /**
166 166
          * Constructs the file pattern of the file extension part used for the glob() function with the given file extensions.
167 167
          */
168
-        protected function _getGlobPatternExtensionPart( array $aExtensions=array( 'php', 'inc' ) ) {
168
+        protected function _getGlobPatternExtensionPart( array $aExtensions = array( 'php', 'inc' ) ) {
169 169
             return empty( $aExtensions ) 
170 170
                 ? '*'
171
-                : '{' . implode( ',', $aExtensions ) . '}';
171
+                : '{'.implode( ',', $aExtensions ).'}';
172 172
         }
173 173
         
174 174
         /**
175 175
          * The recursive version of the glob() function.
176 176
          */
177
-        protected function doRecursiveGlob( $sPathPatten, $nFlags=0, array $aExcludeDirs=array(), array $aExcludeDirNames=array() ) {
177
+        protected function doRecursiveGlob( $sPathPatten, $nFlags = 0, array $aExcludeDirs = array(), array $aExcludeDirNames = array() ) {
178 178
 
179 179
             $_aFiles = glob( $sPathPatten, $nFlags );    
180 180
             $_aFiles = is_array( $_aFiles ) ? $_aFiles : array(); // glob() can return false.
181
-            $_aDirs = glob( dirname( $sPathPatten ) . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR|GLOB_NOSORT );
181
+            $_aDirs = glob( dirname( $sPathPatten ).DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR | GLOB_NOSORT );
182 182
             $_aDirs = is_array( $_aDirs ) ? $_aDirs : array();
183 183
             foreach ( $_aDirs as $_sDirPath ) {
184 184
 
185 185
                 if ( in_array( $_sDirPath, $aExcludeDirs ) ) { continue; }
186 186
                 if ( in_array( pathinfo( $_sDirPath, PATHINFO_DIRNAME ), $aExcludeDirNames ) ) { continue; }
187 187
                 
188
-                $_aFiles = array_merge( $_aFiles, $this->doRecursiveGlob( $_sDirPath . DIRECTORY_SEPARATOR . basename( $sPathPatten ), $nFlags, $aExcludeDirs ) );
188
+                $_aFiles = array_merge( $_aFiles, $this->doRecursiveGlob( $_sDirPath.DIRECTORY_SEPARATOR.basename( $sPathPatten ), $nFlags, $aExcludeDirs ) );
189 189
                 
190 190
             }
191 191
             return $_aFiles;
@@ -199,31 +199,31 @@  discard block
 block discarded – undo
199 199
      * 
200 200
      */
201 201
     protected function _registerClasses( $sIncludeFunction ) {
202
-        spl_autoload_register( array( $this, '_replyToAutoLoad_' . $sIncludeFunction ) );
202
+        spl_autoload_register( array( $this, '_replyToAutoLoad_'.$sIncludeFunction ) );
203 203
     }    
204 204
         /**
205 205
          * Responds to the PHP auto-loader and includes the passed class based on the previously stored path associated with the class name in the constructor.
206 206
          */
207 207
         public function _replyToAutoLoad_include( $sCalledUnknownClassName ) {            
208
-            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
208
+            if ( !isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
209 209
                 return; 
210 210
             }
211 211
             include( $this->_aClasses[ $sCalledUnknownClassName ] );
212 212
         }
213 213
         public function _replyToAutoLoad_include_once( $sCalledUnknownClassName ) {            
214
-            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
214
+            if ( !isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
215 215
                 return; 
216 216
             }
217 217
             include_once( $this->_aClasses[ $sCalledUnknownClassName ] );
218 218
         }        
219 219
         public function _replyToAutoLoad_require( $sCalledUnknownClassName ) {            
220
-            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
220
+            if ( !isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
221 221
                 return; 
222 222
             }
223 223
             require( $this->_aClasses[ $sCalledUnknownClassName ] );
224 224
         }        
225 225
         public function _replyToAutoLoad_require_once( $sCalledUnknownClassName ) {            
226
-            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
226
+            if ( !isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
227 227
                 return; 
228 228
             }
229 229
             require_once( $this->_aClasses[ $sCalledUnknownClassName ] );
Please login to merge, or discard this patch.
Braces   +10 added lines, -9 removed lines patch added patch discarded remove patch
@@ -140,7 +140,8 @@  discard block
 block discarded – undo
140 140
             $_aExcludeDirNames = ( array ) $aSearchOptions['exclude_dir_names'];
141 141
             $_bIsRecursive = $aSearchOptions[ 'is_recursive' ];
142 142
             
143
-            if ( defined( 'GLOB_BRACE' ) ) { // in some OSes this flag constant is not available.
143
+            if ( defined( 'GLOB_BRACE' ) ) {
144
+// in some OSes this flag constant is not available.
144 145
                 $_aFilePaths = $_bIsRecursive
145 146
                     ? $this->doRecursiveGlob( $sClassDirPath . '*.' . $this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE, $_aExcludeDirPaths, $_aExcludeDirNames )
146 147
                     : ( array ) glob( $sClassDirPath . '*.' . $this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE );
@@ -204,26 +205,26 @@  discard block
 block discarded – undo
204 205
         /**
205 206
          * Responds to the PHP auto-loader and includes the passed class based on the previously stored path associated with the class name in the constructor.
206 207
          */
207
-        public function _replyToAutoLoad_include( $sCalledUnknownClassName ) {            
208
-            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
208
+        public function _replyToAutoLoad_include( $sCalledUnknownClassName ) {
209
+            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) {
209 210
                 return; 
210 211
             }
211 212
             include( $this->_aClasses[ $sCalledUnknownClassName ] );
212 213
         }
213
-        public function _replyToAutoLoad_include_once( $sCalledUnknownClassName ) {            
214
-            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
214
+        public function _replyToAutoLoad_include_once( $sCalledUnknownClassName ) {
215
+            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) {
215 216
                 return; 
216 217
             }
217 218
             include_once( $this->_aClasses[ $sCalledUnknownClassName ] );
218 219
         }        
219
-        public function _replyToAutoLoad_require( $sCalledUnknownClassName ) {            
220
-            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
220
+        public function _replyToAutoLoad_require( $sCalledUnknownClassName ) {
221
+            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) {
221 222
                 return; 
222 223
             }
223 224
             require( $this->_aClasses[ $sCalledUnknownClassName ] );
224 225
         }        
225
-        public function _replyToAutoLoad_require_once( $sCalledUnknownClassName ) {            
226
-            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { 
226
+        public function _replyToAutoLoad_require_once( $sCalledUnknownClassName ) {
227
+            if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) {
227 228
                 return; 
228 229
             }
229 230
             require_once( $this->_aClasses[ $sCalledUnknownClassName ] );
Please login to merge, or discard this patch.
factory/_common/utility/base_utility/AdminPageFramework_Utility_String.php 3 patches
Doc Comments   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      * Converts non-alphabetic characters to underscore.
37 37
      * 
38 38
      * @since       2.0.0
39
-     * @return      string|null     The sanitized string.
39
+     * @return      string     The sanitized string.
40 40
      * @todo        Change the method name as it does not tell for what it will sanitized.
41 41
      * @todo        Examine why null needs to be returned.
42 42
      */ 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     /**
120 120
      * Returns the given string length.
121 121
      * @since       3.3.0
122
-     * @return      integer|null        Null if an array is given.
122
+     * @return      integer        Null if an array is given.
123 123
      */
124 124
     static public function getStringLength( $sString ) {
125 125
         return function_exists( 'mb_strlen' )
@@ -176,6 +176,8 @@  discard block
 block discarded – undo
176 176
     }
177 177
     /**
178 178
      * Trims a traling sub-string if exists.
179
+     * @param string $sString
180
+     * @param string $sSuffix
179 181
      * @return      string
180 182
      * @since       3.7.2
181 183
      */
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
      * @since       3.1.1
27 27
      * @return      string
28 28
      */
29
-    static public function sanitizeLength( $sLength, $sUnit='px' ) {
29
+    static public function sanitizeLength( $sLength, $sUnit = 'px' ) {
30 30
         return is_numeric( $sLength ) 
31
-            ? $sLength . $sUnit
31
+            ? $sLength.$sUnit
32 32
             : $sLength;
33 33
     }
34 34
   
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
      * @since       2.0.0
72 72
      * @return      string|integer      A numeric value will be returned. 
73 73
      */ 
74
-    static public function fixNumber( $nToFix, $nDefault, $nMin='', $nMax='' ) {
74
+    static public function fixNumber( $nToFix, $nDefault, $nMin = '', $nMax = '' ) {
75 75
 
76
-        if ( ! is_numeric( trim( $nToFix ) ) ) { 
76
+        if ( !is_numeric( trim( $nToFix ) ) ) { 
77 77
             return $nDefault; 
78 78
         }
79 79
         if ( $nMin !== '' && $nToFix < $nMin ) { 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     static public function getCSSMinified( $sCSSRules ) {
97 97
         return str_replace( 
98
-            array( "\r\n", "\r", "\n", "\t", '  ', '    ', '    '),  // remove line breaks, tab, and white sspaces.
98
+            array( "\r\n", "\r", "\n", "\t", '  ', '    ', '    ' ), // remove line breaks, tab, and white sspaces.
99 99
             '', 
100 100
             preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $sCSSRules ) // remove comments
101 101
         );
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
          */
106 106
         static public function minifyCSS( $sCSSRules ) {
107 107
             trigger_error( 
108
-                AdminPageFramework_Registry::NAME . ': ' . sprintf(
108
+                AdminPageFramework_Registry::NAME.': '.sprintf(
109 109
                     'The method, %1$s, is deprecated. Use %2$s instead.',
110 110
                     'minifyCSS()',
111 111
                     'getCSSMinified()'
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
      */     
135 135
     static public function getNumberOfReadableSize( $nSize ) {
136 136
         
137
-        $_nReturn     = substr( $nSize, 0, -1 );
138
-        switch( strtoupper( substr( $nSize, -1 ) ) ) {
137
+        $_nReturn = substr( $nSize, 0, -1 );
138
+        switch ( strtoupper( substr( $nSize, -1 ) ) ) {
139 139
             case 'P':
140 140
                 $_nReturn *= 1024;
141 141
             case 'T':
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         $_nLog      = log( $nBytes, 1024 );
162 162
         $_iPower    = ( int ) $_nLog;
163 163
         $_iSize     = pow( 1024, $_nLog - $_iPower );
164
-        return $_iSize . $_aUnits[ $_iPower ];
164
+        return $_iSize.$_aUnits[ $_iPower ];
165 165
     }
166 166
 
167 167
     /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,13 +58,13 @@
 block discarded – undo
58 58
      */ 
59 59
     static public function fixNumber( $nToFix, $nDefault, $nMin='', $nMax='' ) {
60 60
 
61
-        if ( ! is_numeric( trim( $nToFix ) ) ) { 
61
+        if ( ! is_numeric( trim( $nToFix ) ) ) {
62 62
             return $nDefault; 
63 63
         }
64
-        if ( $nMin !== '' && $nToFix < $nMin ) { 
64
+        if ( $nMin !== '' && $nToFix < $nMin ) {
65 65
             return $nMin; 
66 66
         }
67
-        if ( $nMax !== '' && $nToFix > $nMax ) { 
67
+        if ( $nMax !== '' && $nToFix > $nMax ) {
68 68
             return $nMax; 
69 69
         }
70 70
         return $nToFix;
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.