@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | * @return string |
38 | 38 | * @since 3.8.9 |
39 | 39 | */ |
40 | - static protected function _getLegibleDetails( $mValue, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
40 | + static protected function _getLegibleDetails( $mValue, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
41 | 41 | if ( is_array( $mValue ) ) { |
42 | - return '(array, length: ' . count( $mValue ).') ' |
|
43 | - . self::getAsString( print_r( self::___getLegibleDetailedArray( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) , true ) ); |
|
42 | + return '(array, length: '.count( $mValue ).') ' |
|
43 | + . self::getAsString( print_r( self::___getLegibleDetailedArray( $mValue, $iStringLengthLimit, $iArrayDepthLimit ), true ) ); |
|
44 | 44 | } |
45 | 45 | return self::getAsString( print_r( self::getLegibleDetailedValue( $mValue, $iStringLengthLimit ), true ) ); |
46 | 46 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | static public function getObjectName( $mItem ) { |
59 | 59 | if ( is_object( $mItem ) ) { |
60 | - return '(object) ' . get_class( $mItem ); |
|
60 | + return '(object) '.get_class( $mItem ); |
|
61 | 61 | } |
62 | 62 | return $mItem; |
63 | 63 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @since 3.8.9 |
73 | 73 | * @since 3.8.22 Added the `$sStringLengthLimit` and `$iArrayDepthLimit` parameters. |
74 | 74 | */ |
75 | - static protected function _getLegible( $mValue, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
75 | + static protected function _getLegible( $mValue, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
76 | 76 | |
77 | 77 | $iArrayDepthLimit = $iArrayDepthLimit ? $iArrayDepthLimit : self::$iLegibleArrayDepthLimit; |
78 | 78 | $mValue = is_object( $mValue ) |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | ) |
90 | 90 | : $mValue; |
91 | 91 | $mValue = is_string( $mValue ) |
92 | - ? self::___getLegibleString( $mValue, $iStringLengthLimit, false ) |
|
92 | + ? self::___getLegibleString( $mValue, $iStringLengthLimit, false ) |
|
93 | 93 | : $mValue; |
94 | 94 | return self::_getArrayRepresentationSanitized( self::getAsString( print_r( $mValue, true ) ) ); |
95 | 95 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @return string |
102 | 102 | */ |
103 | 103 | static private function ___getLegibleDetailedCallable( $asoCallable ) { |
104 | - return '(callable) ' . self::___getCallableName( $asoCallable ); |
|
104 | + return '(callable) '.self::___getCallableName( $asoCallable ); |
|
105 | 105 | } |
106 | 106 | /** |
107 | 107 | * @since 3.8.9 |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $_sSubject = is_object( $asoCallable[ 0 ] ) |
120 | 120 | ? get_class( $asoCallable[ 0 ] ) |
121 | 121 | : ( string ) $asoCallable[ 0 ]; |
122 | - return $_sSubject . '::' . ( string ) $asoCallable[ 1 ]; |
|
122 | + return $_sSubject.'::'.( string ) $asoCallable[ 1 ]; |
|
123 | 123 | |
124 | 124 | } |
125 | 125 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | if ( method_exists( $oObject, '__toString' ) ) { |
134 | 134 | return ( string ) $oObject; |
135 | 135 | } |
136 | - return '(object) ' . get_class( $oObject ) . ' ' . count( get_object_vars( $oObject ) ) . ' properties.'; |
|
136 | + return '(object) '.get_class( $oObject ).' '.count( get_object_vars( $oObject ) ).' properties.'; |
|
137 | 137 | |
138 | 138 | } |
139 | 139 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @since 3.8.22 Changed the scope to private from public. |
150 | 150 | * @since 3.8.22 Renamed from `_getLegibleArray()`. |
151 | 151 | */ |
152 | - static private function ___getLegibleDetailedArray( array $aArray, $iStringLengthLimit=0, $iDepthLimit=0 ) { |
|
152 | + static private function ___getLegibleDetailedArray( array $aArray, $iStringLengthLimit = 0, $iDepthLimit = 0 ) { |
|
153 | 153 | $_iDepthLimit = $iDepthLimit ? $iDepthLimit : self::$iLegibleArrayDepthLimit; |
154 | 154 | return self::getArrayMappedRecursive( |
155 | 155 | array( __CLASS__, 'getLegibleDetailedValue' ), |
@@ -191,9 +191,9 @@ discard block |
||
191 | 191 | return self::___getLegibleDetailedObject( $mNonScalar ); |
192 | 192 | } |
193 | 193 | if ( is_array( $mNonScalar ) ) { |
194 | - return '(' . $_sType . ') ' . count( $mNonScalar ) . ' elements'; |
|
194 | + return '('.$_sType.') '.count( $mNonScalar ).' elements'; |
|
195 | 195 | } |
196 | - return '(' . $_sType . ') ' . ( string ) $mNonScalar; |
|
196 | + return '('.$_sType.') '.( string ) $mNonScalar; |
|
197 | 197 | |
198 | 198 | } |
199 | 199 | /** |
@@ -205,11 +205,11 @@ discard block |
||
205 | 205 | */ |
206 | 206 | static private function ___getLegibleDetailedScalar( $sScalar, $iStringLengthLimit ) { |
207 | 207 | if ( is_bool( $sScalar ) ) { |
208 | - return '(boolean) ' . ( $sScalar ? 'true' : 'false' ); |
|
208 | + return '(boolean) '.( $sScalar ? 'true' : 'false' ); |
|
209 | 209 | } |
210 | 210 | return is_string( $sScalar ) |
211 | 211 | ? self::___getLegibleString( $sScalar, $iStringLengthLimit, true ) |
212 | - : '(' . gettype( $sScalar ) . ', length: ' . self::___getValueLength( $sScalar ) . ') ' . $sScalar; |
|
212 | + : '('.gettype( $sScalar ).', length: '.self::___getValueLength( $sScalar ).') '.$sScalar; |
|
213 | 213 | } |
214 | 214 | /** |
215 | 215 | * Returns a length of a value. |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | * @param boolean $bShowDetails |
235 | 235 | * @return string |
236 | 236 | */ |
237 | - static private function ___getLegibleString( $sString, $iLengthLimit, $bShowDetails=true ) { |
|
237 | + static private function ___getLegibleString( $sString, $iLengthLimit, $bShowDetails = true ) { |
|
238 | 238 | |
239 | 239 | static $_iMBSupport; |
240 | 240 | $_iMBSupport = isset( $_iMBSupport ) ? $_iMBSupport : ( integer ) function_exists( 'mb_strlen' ); |
@@ -245,8 +245,8 @@ discard block |
||
245 | 245 | |
246 | 246 | if ( $bShowDetails ) { |
247 | 247 | return $_iCharLength <= $iCharLimit |
248 | - ? '(string, length: ' . $_iCharLength . ') ' . $sString |
|
249 | - : '(string, length: ' . $_iCharLength . ') ' . call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) ) |
|
248 | + ? '(string, length: '.$_iCharLength.') '.$sString |
|
249 | + : '(string, length: '.$_iCharLength.') '.call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) ) |
|
250 | 250 | . '...'; |
251 | 251 | } |
252 | 252 | return $_iCharLength <= $iCharLimit |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | * @return array |
287 | 287 | * @since 3.8.22 |
288 | 288 | */ |
289 | - static public function getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) { |
|
289 | + static public function getSlicedByDepth( array $aSubject, $iDepth = 0, $sMore = '(array truncated) ...' ) { |
|
290 | 290 | return self::_getSlicedByDepth( $aSubject, $iDepth, $sMore ); |
291 | 291 | } |
292 | 292 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * @since 3.8.22 Added the `$sMore` parameter. |
307 | 307 | * @internal |
308 | 308 | */ |
309 | - static private function _getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) { |
|
309 | + static private function _getSlicedByDepth( array $aSubject, $iDepth = 0, $sMore = '(array truncated) ...' ) { |
|
310 | 310 | |
311 | 311 | foreach ( $aSubject as $_sKey => $_vValue ) { |
312 | 312 | |
@@ -339,9 +339,9 @@ discard block |
||
339 | 339 | * @since 3.8.22 |
340 | 340 | * @since 3.8.23 Deprecated the `$oException` parameter. |
341 | 341 | */ |
342 | - static public function getStackTrace( $iSkip=0, $_deprecated=null ) { |
|
342 | + static public function getStackTrace( $iSkip = 0, $_deprecated = null ) { |
|
343 | 343 | |
344 | - $_iSkip = 1; // need to skip this method trace itself |
|
344 | + $_iSkip = 1; // need to skip this method trace itself |
|
345 | 345 | $_oException = new Exception(); |
346 | 346 | |
347 | 347 | // Backward compatibility. |
@@ -357,22 +357,22 @@ discard block |
||
357 | 357 | $_aFrames = array_slice( $_aFrames, $_iSkip ); |
358 | 358 | foreach ( array_reverse( $_aFrames ) as $_iIndex => $_aFrame ) { |
359 | 359 | |
360 | - $_aFrame = $_aFrame + array( |
|
360 | + $_aFrame = $_aFrame + array( |
|
361 | 361 | 'file' => null, 'line' => null, 'function' => null, |
362 | 362 | 'class' => null, 'args' => array(), |
363 | 363 | ); |
364 | 364 | $_sArguments = self::___getArgumentsOfEachStackTrace( $_aFrame[ 'args' ] ); |
365 | - $_aTraces[] = sprintf( |
|
365 | + $_aTraces[ ] = sprintf( |
|
366 | 366 | "#%s %s(%s): %s(%s)", |
367 | 367 | $_iIndex + 1, |
368 | 368 | $_aFrame[ 'file' ], |
369 | 369 | $_aFrame[ 'line' ], |
370 | - isset( $_aFrame[ 'class' ] ) ? $_aFrame[ 'class' ] . '->' . $_aFrame[ 'function' ] : $_aFrame[ 'function' ], |
|
370 | + isset( $_aFrame[ 'class' ] ) ? $_aFrame[ 'class' ].'->'.$_aFrame[ 'function' ] : $_aFrame[ 'function' ], |
|
371 | 371 | $_sArguments |
372 | 372 | ); |
373 | 373 | |
374 | 374 | } |
375 | - return implode( PHP_EOL, $_aTraces ) . PHP_EOL; |
|
375 | + return implode( PHP_EOL, $_aTraces ).PHP_EOL; |
|
376 | 376 | |
377 | 377 | } |
378 | 378 | /** |
@@ -387,16 +387,16 @@ discard block |
||
387 | 387 | foreach ( $aTraceArguments as $_mArgument ) { |
388 | 388 | $_sType = gettype( $_mArgument ); |
389 | 389 | $_sType = str_replace( |
390 | - array( 'resource (closed)', 'unknown type', 'integer', 'double', ), |
|
391 | - array( 'resource', 'unknown', 'scalar', 'scalar', ), |
|
390 | + array( 'resource (closed)', 'unknown type', 'integer', 'double',), |
|
391 | + array( 'resource', 'unknown', 'scalar', 'scalar',), |
|
392 | 392 | $_sType |
393 | 393 | ); |
394 | 394 | $_sMethodName = "___getStackTraceArgument_{$_sType}"; |
395 | - $_aArguments[] = method_exists( __CLASS__, $_sMethodName ) |
|
395 | + $_aArguments[ ] = method_exists( __CLASS__, $_sMethodName ) |
|
396 | 396 | ? self::{$_sMethodName}( $_mArgument ) |
397 | 397 | : $_sType; |
398 | 398 | } |
399 | - return join(", ", $_aArguments ); |
|
399 | + return join( ", ", $_aArguments ); |
|
400 | 400 | } |
401 | 401 | /** |
402 | 402 | * @since 3.8.22 |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | */ |
407 | 407 | static private function ___getStackTraceArgument_string( $mArgument ) { |
408 | 408 | $_sString = self::___getLegibleString( $mArgument, 200, true ); |
409 | - return "'" . $_sString . "'"; |
|
409 | + return "'".$_sString."'"; |
|
410 | 410 | } |
411 | 411 | static private function ___getStackTraceArgument_scalar( $mArgument ) { |
412 | 412 | return $mArgument; |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | return 'NULL'; |
419 | 419 | } |
420 | 420 | static private function ___getStackTraceArgument_object( $mArgument ) { |
421 | - return 'Object(' . get_class( $mArgument ) . ')'; |
|
421 | + return 'Object('.get_class( $mArgument ).')'; |
|
422 | 422 | } |
423 | 423 | static private function ___getStackTraceArgument_resource( $mArgument ) { |
424 | 424 | return get_resource_type( $mArgument ); |
@@ -431,18 +431,18 @@ discard block |
||
431 | 431 | $_iMax = 10; |
432 | 432 | $_iTotal = count( $mArgument ); |
433 | 433 | $_iIndex = 0; |
434 | - foreach( $mArgument as $_sKey => $_mValue ) { |
|
434 | + foreach ( $mArgument as $_sKey => $_mValue ) { |
|
435 | 435 | $_iIndex++; |
436 | - $_mValue = is_scalar( $_mValue ) |
|
436 | + $_mValue = is_scalar( $_mValue ) |
|
437 | 437 | ? self::___getLegibleDetailedScalar( $_mValue, 100 ) |
438 | - : ucfirst( gettype( $_mValue ) ) . ( |
|
438 | + : ucfirst( gettype( $_mValue ) ).( |
|
439 | 439 | is_object( $_mValue ) |
440 | - ? ' (' . get_class( $_mValue ) . ')' |
|
440 | + ? ' ('.get_class( $_mValue ).')' |
|
441 | 441 | : '' |
442 | 442 | ); |
443 | - $_sOutput .= $_sKey . ': ' . $_mValue . ', '; |
|
443 | + $_sOutput .= $_sKey.': '.$_mValue.', '; |
|
444 | 444 | if ( $_iIndex > $_iMax && $_iTotal > $_iMax ) { |
445 | - $_sOutput = rtrim( $_sOutput, ',' ) . '...'; |
|
445 | + $_sOutput = rtrim( $_sOutput, ',' ).'...'; |
|
446 | 446 | break; |
447 | 447 | } |
448 | 448 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @param integer $iArrayDepthLimit |
36 | 36 | * @return void |
37 | 37 | */ |
38 | - static public function dump( $asArray, $sFilePath=null, $bStackTrace=false, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
38 | + static public function dump( $asArray, $sFilePath = null, $bStackTrace = false, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
39 | 39 | echo self::get( $asArray, $sFilePath, true, $bStackTrace, $iStringLengthLimit, $iArrayDepthLimit ); |
40 | 40 | } |
41 | 41 | |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | * @since 3.8.9 |
45 | 45 | * @return string |
46 | 46 | */ |
47 | - static public function getDetails( $mValue, $bEscape=true, $bStackTrace=false, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
47 | + static public function getDetails( $mValue, $bEscape = true, $bStackTrace = false, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
48 | 48 | $_sValueWithDetails = self::_getArrayRepresentationSanitized( |
49 | 49 | self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) |
50 | 50 | ); |
51 | 51 | $_sValueWithDetails = $bStackTrace |
52 | - ? $_sValueWithDetails . PHP_EOL . self::getStackTrace() |
|
52 | + ? $_sValueWithDetails.PHP_EOL.self::getStackTrace() |
|
53 | 53 | : $_sValueWithDetails; |
54 | 54 | return $bEscape |
55 | 55 | ? "<pre class='dump-array'>" |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param integer $iArrayDepthLimit |
76 | 76 | * @return string |
77 | 77 | */ |
78 | - static public function get( $asArray, $sFilePath=null, $bEscape=true, $bStackTrace=false, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
78 | + static public function get( $asArray, $sFilePath = null, $bEscape = true, $bStackTrace = false, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
79 | 79 | |
80 | 80 | if ( $sFilePath ) { |
81 | 81 | self::log( $asArray, $sFilePath ); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @param integer $iArrayDepthLimit The depth limit for arrays.* |
118 | 118 | * @return void |
119 | 119 | **/ |
120 | - static public function log( $mValue, $sFilePath=null, $bStackTrace=false, $iTrace=0, $iStringLengthLimit=99999, $iArrayDepthLimit=50 ) { |
|
120 | + static public function log( $mValue, $sFilePath = null, $bStackTrace = false, $iTrace = 0, $iStringLengthLimit = 99999, $iArrayDepthLimit = 50 ) { |
|
121 | 121 | self::_log( $mValue, $sFilePath, $bStackTrace, $iTrace, $iStringLengthLimit, $iArrayDepthLimit ); |
122 | 122 | } |
123 | 123 | |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @since unknown |
132 | 132 | * @deprecated 3.2.0 |
133 | 133 | */ |
134 | - static public function dumpArray( $asArray, $sFilePath=null ) { |
|
135 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::dump()' ); |
|
134 | + static public function dumpArray( $asArray, $sFilePath = null ) { |
|
135 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::dump()' ); |
|
136 | 136 | AdminPageFramework_Debug::dump( $asArray, $sFilePath ); |
137 | 137 | } |
138 | 138 | |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | * @since 3.0.0 Changed the $bEncloseInTag parameter to bEscape. |
146 | 146 | * @deprecated 3.2.0 |
147 | 147 | */ |
148 | - static public function getArray( $asArray, $sFilePath=null, $bEscape=true ) { |
|
149 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::get()' ); |
|
148 | + static public function getArray( $asArray, $sFilePath = null, $bEscape = true ) { |
|
149 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::get()' ); |
|
150 | 150 | return AdminPageFramework_Debug::get( $asArray, $sFilePath, $bEscape ); |
151 | 151 | } |
152 | 152 | |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | * @since 3.0.3 Changed the default log location and file name. |
158 | 158 | * @deprecated 3.1.0 Use the `log()` method instead. |
159 | 159 | */ |
160 | - static public function logArray( $asArray, $sFilePath=null ) { |
|
161 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::log()' ); |
|
160 | + static public function logArray( $asArray, $sFilePath = null ) { |
|
161 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::log()' ); |
|
162 | 162 | AdminPageFramework_Debug::log( $asArray, $sFilePath ); |
163 | 163 | } |
164 | 164 |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | */ |
27 | 27 | static public function getReadableListOfArray( array $aArray ) { |
28 | 28 | |
29 | - $_aOutput = array(); |
|
30 | - foreach( $aArray as $_sKey => $_vValue ) { |
|
31 | - $_aOutput[] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ) . PHP_EOL; |
|
29 | + $_aOutput = array(); |
|
30 | + foreach ( $aArray as $_sKey => $_vValue ) { |
|
31 | + $_aOutput[ ] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ).PHP_EOL; |
|
32 | 32 | } |
33 | 33 | return implode( PHP_EOL, $_aOutput ); |
34 | 34 | |
@@ -40,37 +40,37 @@ discard block |
||
40 | 40 | * @since 3.9.0 Moved from `AdminPageFramework_Utility_Array.php`. |
41 | 41 | * @return string The generated human-readable array contents. |
42 | 42 | */ |
43 | - static public function getReadableArrayContents( $sKey, $vValue, $sLabelCharLengths=16, $iOffset=0 ) { |
|
43 | + static public function getReadableArrayContents( $sKey, $vValue, $sLabelCharLengths = 16, $iOffset = 0 ) { |
|
44 | 44 | |
45 | 45 | $_aOutput = array(); |
46 | - $_aOutput[] = ( $iOffset |
|
47 | - ? str_pad( ' ', $iOffset ) |
|
46 | + $_aOutput[ ] = ( $iOffset |
|
47 | + ? str_pad( ' ', $iOffset ) |
|
48 | 48 | : '' |
49 | 49 | ) |
50 | 50 | . ( $sKey |
51 | - ? '[' . $sKey . ']' |
|
51 | + ? '['.$sKey.']' |
|
52 | 52 | : '' |
53 | 53 | ); |
54 | 54 | |
55 | - if ( ! in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) { |
|
56 | - $_aOutput[] = $vValue; |
|
55 | + if ( !in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) { |
|
56 | + $_aOutput[ ] = $vValue; |
|
57 | 57 | return implode( PHP_EOL, $_aOutput ); |
58 | 58 | } |
59 | 59 | |
60 | 60 | foreach ( $vValue as $_sTitle => $_asDescription ) { |
61 | - if ( ! in_array( gettype( $_asDescription ), array( 'array', 'object' ) ) ) { |
|
62 | - $_aOutput[] = str_pad( ' ', $iOffset ) |
|
61 | + if ( !in_array( gettype( $_asDescription ), array( 'array', 'object' ) ) ) { |
|
62 | + $_aOutput[ ] = str_pad( ' ', $iOffset ) |
|
63 | 63 | . $_sTitle |
64 | 64 | . str_pad( ':', $sLabelCharLengths - self::getStringLength( $_sTitle ) ) |
65 | 65 | . $_asDescription; |
66 | 66 | continue; |
67 | 67 | } |
68 | - $_aOutput[] = str_pad( ' ', $iOffset ) |
|
68 | + $_aOutput[ ] = str_pad( ' ', $iOffset ) |
|
69 | 69 | . $_sTitle |
70 | 70 | . ": {" |
71 | 71 | . self::getReadableArrayContents( '', $_asDescription, 16, $iOffset + 4 ) |
72 | 72 | . PHP_EOL |
73 | - . str_pad( ' ', $iOffset ) . "}"; |
|
73 | + . str_pad( ' ', $iOffset )."}"; |
|
74 | 74 | } |
75 | 75 | return implode( PHP_EOL, $_aOutput ); |
76 | 76 | |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | * @return string The HTML list generated from the given array. |
84 | 84 | */ |
85 | 85 | static public function getReadableListOfArrayAsHTML( array $aArray ) { |
86 | - $_aOutput = array(); |
|
87 | - foreach( $aArray as $_sKey => $_vValue ) { |
|
88 | - $_aOutput[] = "<ul class='array-contents'>" |
|
86 | + $_aOutput = array(); |
|
87 | + foreach ( $aArray as $_sKey => $_vValue ) { |
|
88 | + $_aOutput[ ] = "<ul class='array-contents'>" |
|
89 | 89 | . self::getReadableArrayContentsHTML( $_sKey, $_vValue ) |
90 | - . "</ul>" . PHP_EOL; |
|
90 | + . "</ul>".PHP_EOL; |
|
91 | 91 | } |
92 | 92 | return implode( PHP_EOL, $_aOutput ); |
93 | 93 | } |
@@ -105,25 +105,25 @@ discard block |
||
105 | 105 | $_aOutput = array(); |
106 | 106 | |
107 | 107 | // Title - array key |
108 | - $_aOutput[] = $sKey |
|
109 | - ? "<h3 class='array-key'>" . $sKey . "</h3>" |
|
108 | + $_aOutput[ ] = $sKey |
|
109 | + ? "<h3 class='array-key'>".$sKey."</h3>" |
|
110 | 110 | : ""; |
111 | 111 | |
112 | 112 | // If it does not have a nested array or object, |
113 | - if ( ! in_array( gettype( $vValue ), array( 'array', 'object' ), true ) ) { |
|
114 | - $_aOutput[] = "<div class='array-value'>" |
|
113 | + if ( !in_array( gettype( $vValue ), array( 'array', 'object' ), true ) ) { |
|
114 | + $_aOutput[ ] = "<div class='array-value'>" |
|
115 | 115 | . html_entity_decode( nl2br( $vValue ), ENT_QUOTES ) |
116 | 116 | . "</div>"; |
117 | - return "<li>" . implode( PHP_EOL, $_aOutput ) . "</li>"; |
|
117 | + return "<li>".implode( PHP_EOL, $_aOutput )."</li>"; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | // Now it is a nested item. |
121 | 121 | foreach ( $vValue as $_sKey => $_vValue ) { |
122 | - $_aOutput[] = "<ul class='array-contents'>" |
|
122 | + $_aOutput[ ] = "<ul class='array-contents'>" |
|
123 | 123 | . self::getReadableArrayContentsHTML( $_sKey, $_vValue ) |
124 | 124 | . "</ul>"; |
125 | 125 | } |
126 | - return implode( PHP_EOL, $_aOutput ) ; |
|
126 | + return implode( PHP_EOL, $_aOutput ); |
|
127 | 127 | |
128 | 128 | } |
129 | 129 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @return string |
143 | 143 | * @since 3.9.0 |
144 | 144 | */ |
145 | - static public function getTableOfKeyValues( array $aArray, array $aAllAttributes=array(), array $aHeader=array(), array $aFooter=array(), $bEscape=true, $sCaption='' ) { |
|
145 | + static public function getTableOfKeyValues( array $aArray, array $aAllAttributes = array(), array $aHeader = array(), array $aFooter = array(), $bEscape = true, $sCaption = '' ) { |
|
146 | 146 | $_aAllAttributes = $aAllAttributes + array( |
147 | 147 | 'table' => array(), |
148 | 148 | 'caption' => array(), |
@@ -157,10 +157,10 @@ discard block |
||
157 | 157 | 'li' => array(), |
158 | 158 | 'p' => array(), |
159 | 159 | ); |
160 | - return "<table " . self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'table' ) ) . ">" |
|
160 | + return "<table ".self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'table' ) ).">" |
|
161 | 161 | . self::___getTableCaption( $sCaption, $_aAllAttributes, $bEscape ) |
162 | 162 | . self::___getTableHeaderOfKeyValuePair( $aHeader, $aAllAttributes, $bEscape ) |
163 | - . "<tbody " . self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'tbody' ) ) . ">" |
|
163 | + . "<tbody ".self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'tbody' ) ).">" |
|
164 | 164 | . self::___getRowsOfKeyValuePair( $aArray, $aAllAttributes, $bEscape ) |
165 | 165 | . "</tbody>" |
166 | 166 | . self::___getTableFooterOfKeyValuePair( $aFooter, $aAllAttributes, $bEscape ) |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * @return string |
181 | 181 | * @since 3.9.0 |
182 | 182 | */ |
183 | - static public function getTableOfArray( array $aArray, array $aAllAttributes=array(), array $aHeader=array(), array $aFooter=array(), $bEscape=true, $sCaption='' ) { |
|
183 | + static public function getTableOfArray( array $aArray, array $aAllAttributes = array(), array $aHeader = array(), array $aFooter = array(), $bEscape = true, $sCaption = '' ) { |
|
184 | 184 | |
185 | 185 | $_aAllAttributes = $aAllAttributes + array( |
186 | 186 | 'table' => array(), |
@@ -196,10 +196,10 @@ discard block |
||
196 | 196 | 'li' => array(), |
197 | 197 | 'p' => array(), |
198 | 198 | ); |
199 | - return "<table " . self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'table' ) ) . ">" |
|
199 | + return "<table ".self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'table' ) ).">" |
|
200 | 200 | . self::___getTableCaption( $sCaption, $_aAllAttributes, $bEscape ) |
201 | 201 | . self::___getTableHeader( $aHeader, $_aAllAttributes, $bEscape ) |
202 | - . "<tbody " . self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'tbody' ) ) . ">" |
|
202 | + . "<tbody ".self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'tbody' ) ).">" |
|
203 | 203 | . self::___getTableRows( $aArray, $_aAllAttributes, $bEscape ) |
204 | 204 | . "</tbody>" |
205 | 205 | . self::___getTableFooter( $aFooter, $_aAllAttributes, $bEscape ) |
@@ -207,14 +207,14 @@ discard block |
||
207 | 207 | } |
208 | 208 | static private function ___getTableCaption( $sCaption, $aAllAttributes, $bEscape ) { |
209 | 209 | $sCaption = ( string ) $sCaption; |
210 | - if ( ! strlen( $sCaption ) ) { |
|
210 | + if ( !strlen( $sCaption ) ) { |
|
211 | 211 | return ''; |
212 | 212 | } |
213 | 213 | $_aCapAttr = self::getElementAsArray( $aAllAttributes, 'caption' ); |
214 | 214 | $_sCaption = $bEscape |
215 | 215 | ? htmlspecialchars( $sCaption ) |
216 | 216 | : $sCaption; |
217 | - return "<caption " . self::getAttributes( $_aCapAttr ) . ">" |
|
217 | + return "<caption ".self::getAttributes( $_aCapAttr ).">" |
|
218 | 218 | . $_sCaption |
219 | 219 | . "</caption>"; |
220 | 220 | } |
@@ -237,24 +237,24 @@ discard block |
||
237 | 237 | $_aTHAttr1 = self::getElementAsArray( $aAllAttributes, array( 'th', 0 ) ) + $_aTHAttr; |
238 | 238 | $_aTHAttr2 = self::getElementAsArray( $aAllAttributes, array( 'th', 1 ) ) + $_aTHAttr; |
239 | 239 | $_sOutput = ''; |
240 | - foreach( $aHeader as $_sKey => $_sValue ) { |
|
241 | - $_sOutput .= "<tr " . self::getAttributes( $_aTRAttr ) . ">" |
|
242 | - . "<th " . self::getAttributes( $_aTHAttr1 ) . ">" . self::___getHTMLEscaped( $_sKey, $bEscape ) . "</th>" |
|
243 | - . "<th " . self::getAttributes( $_aTHAttr2 ) . ">" . self::___getHTMLEscaped( $_sValue, $bEscape ) . "</th>" |
|
240 | + foreach ( $aHeader as $_sKey => $_sValue ) { |
|
241 | + $_sOutput .= "<tr ".self::getAttributes( $_aTRAttr ).">" |
|
242 | + . "<th ".self::getAttributes( $_aTHAttr1 ).">".self::___getHTMLEscaped( $_sKey, $bEscape )."</th>" |
|
243 | + . "<th ".self::getAttributes( $_aTHAttr2 ).">".self::___getHTMLEscaped( $_sValue, $bEscape )."</th>" |
|
244 | 244 | . "</tr>"; |
245 | 245 | } |
246 | - return "<thead>" . $_sOutput . "</thead>"; |
|
246 | + return "<thead>".$_sOutput."</thead>"; |
|
247 | 247 | } |
248 | 248 | static private function ___getTableHeaderOfMultiColumns( array $aHeader, array $aAllAttributes, $bEscape ) { |
249 | 249 | $_aTRAttr = self::getElementAsArray( $aAllAttributes, 'tr' ); |
250 | 250 | $_aTHAttr = self::getElementAsArray( $aAllAttributes, 'th' ); |
251 | - $_sOutput = "<tr " . self::getAttributes( $_aTRAttr ) . ">"; |
|
252 | - foreach( array_values( $aHeader ) as $_iIndex => $_sColumnName ) { |
|
251 | + $_sOutput = "<tr ".self::getAttributes( $_aTRAttr ).">"; |
|
252 | + foreach ( array_values( $aHeader ) as $_iIndex => $_sColumnName ) { |
|
253 | 253 | $_aTHAttrNth = self::getElementAsArray( $aAllAttributes, array( 'th', $_iIndex ) ) + $_aTHAttr; |
254 | - $_sOutput .= "<th " . self::getAttributes( $_aTHAttrNth ) . ">" . self::___getHTMLEscaped( ( string ) $_sColumnName, $bEscape ) . "</th>"; |
|
254 | + $_sOutput .= "<th ".self::getAttributes( $_aTHAttrNth ).">".self::___getHTMLEscaped( ( string ) $_sColumnName, $bEscape )."</th>"; |
|
255 | 255 | } |
256 | 256 | $_sOutput .= "</tr>"; |
257 | - return "<thead>" . $_sOutput . "</thead>"; |
|
257 | + return "<thead>".$_sOutput."</thead>"; |
|
258 | 258 | } |
259 | 259 | static private function ___getTableFooter( array $aFooter, array $aAllAttributes, $bEscape ) { |
260 | 260 | if ( empty( $aFooter ) ) { |
@@ -271,24 +271,24 @@ discard block |
||
271 | 271 | $_aTDAttr1 = self::getElementAsArray( $aAllAttributes, array( 'td', 0 ) ) + $_aTDAttr; |
272 | 272 | $_aTDAttr2 = self::getElementAsArray( $aAllAttributes, array( 'td', 1 ) ) + $_aTDAttr; |
273 | 273 | $_sOutput = ''; |
274 | - foreach( $aFooter as $_sKey => $_sValue ) { |
|
275 | - $_sOutput = "<tr " . self::getAttributes( $_aTRAttr ) . ">" |
|
276 | - . "<td " . self::getAttributes( $_aTDAttr1 ) . ">" . self::___getHTMLEscaped( $_sKey, $bEscape ) . "</td>" |
|
277 | - . "<td " . self::getAttributes( $_aTDAttr2 ) . ">" . self::___getHTMLEscaped( $_sValue, $bEscape ) . "</td>" |
|
274 | + foreach ( $aFooter as $_sKey => $_sValue ) { |
|
275 | + $_sOutput = "<tr ".self::getAttributes( $_aTRAttr ).">" |
|
276 | + . "<td ".self::getAttributes( $_aTDAttr1 ).">".self::___getHTMLEscaped( $_sKey, $bEscape )."</td>" |
|
277 | + . "<td ".self::getAttributes( $_aTDAttr2 ).">".self::___getHTMLEscaped( $_sValue, $bEscape )."</td>" |
|
278 | 278 | . "</tr>"; |
279 | 279 | } |
280 | - return "<tfoot>" . $_sOutput . "</tfoot>"; |
|
280 | + return "<tfoot>".$_sOutput."</tfoot>"; |
|
281 | 281 | } |
282 | 282 | static private function ___getTableFooterOfMultiColumns( array $aFooter, array $aAllAttributes, $bEscape ) { |
283 | 283 | $_aTRAttr = self::getElementAsArray( $aAllAttributes, 'tr' ); |
284 | 284 | $_aTDAttr = self::getElementAsArray( $aAllAttributes, 'td' ); |
285 | - $_sOutput = "<tr " . self::getAttributes( $_aTRAttr ) . ">"; |
|
286 | - foreach( array_values( $aFooter ) as $_iIndex => $_sColumnName ) { |
|
285 | + $_sOutput = "<tr ".self::getAttributes( $_aTRAttr ).">"; |
|
286 | + foreach ( array_values( $aFooter ) as $_iIndex => $_sColumnName ) { |
|
287 | 287 | $_aTDAttrNth = self::getElementAsArray( $aAllAttributes, array( 'td', $_iIndex ) ) + $_aTDAttr; |
288 | - $_sOutput .= "<td " . self::getAttributes( $_aTDAttrNth ) . ">" . self::___getHTMLEscaped( ( string ) $_sColumnName, $bEscape ) . "</td>"; |
|
288 | + $_sOutput .= "<td ".self::getAttributes( $_aTDAttrNth ).">".self::___getHTMLEscaped( ( string ) $_sColumnName, $bEscape )."</td>"; |
|
289 | 289 | } |
290 | 290 | $_sOutput .= "</tr>"; |
291 | - return "<tfoot>" . $_sOutput . "</tfoot>"; |
|
291 | + return "<tfoot>".$_sOutput."</tfoot>"; |
|
292 | 292 | } |
293 | 293 | static private function ___getTableRows( array $aArray, array $aAllAttributes, $bEscape ) { |
294 | 294 | if ( empty( $aArray ) ) { |
@@ -325,10 +325,10 @@ discard block |
||
325 | 325 | $_aTDAttrFirst = self::getElementAsArray( $aAllAttributes, array( 'td', 0 ) ) + $_aTDAttr; |
326 | 326 | $_aTDAttrFirst[ 'class' ] = self::getClassAttribute( 'column-key', self::getElement( $_aTDAttrFirst, array( 'class' ), '' ) ); |
327 | 327 | $_sOutput = ''; |
328 | - foreach( $aItem as $_sColumnName => $_asValue ) { |
|
329 | - $_sOutput .= "<tr " . self::getAttributes( $_aTRAttr ) . ">"; |
|
330 | - $_sOutput .= "<td " . self::getAttributes( $_aTDAttrFirst ) . ">" |
|
331 | - . "<p " . self::getAttributes( $_aPAttr ) . ">" . self::___getHTMLEscaped( $_sColumnName, $bEscape ) . "</p>" |
|
328 | + foreach ( $aItem as $_sColumnName => $_asValue ) { |
|
329 | + $_sOutput .= "<tr ".self::getAttributes( $_aTRAttr ).">"; |
|
330 | + $_sOutput .= "<td ".self::getAttributes( $_aTDAttrFirst ).">" |
|
331 | + . "<p ".self::getAttributes( $_aPAttr ).">".self::___getHTMLEscaped( $_sColumnName, $bEscape )."</p>" |
|
332 | 332 | . "</td>"; |
333 | 333 | $_sOutput .= self::___getColumnValue( $_asValue, $aAllAttributes, $bEscape, 1 ); |
334 | 334 | $_sOutput .= "</tr>"; |
@@ -342,15 +342,15 @@ discard block |
||
342 | 342 | static private function ___getRowsOfMultiColumns( array $aArray, array $aAllAttributes, $bEscape ) { |
343 | 343 | $_aTRAttr = self::getElementAsArray( $aAllAttributes, 'tr' ); |
344 | 344 | $_sOutput = ''; |
345 | - foreach( $aArray as $_iRowIndex => $_asValue ) { |
|
345 | + foreach ( $aArray as $_iRowIndex => $_asValue ) { |
|
346 | 346 | if ( is_scalar( $_asValue ) ) { |
347 | - $_sOutput .= "<tr " . self::getAttributes( $_aTRAttr ) . ">" |
|
347 | + $_sOutput .= "<tr ".self::getAttributes( $_aTRAttr ).">" |
|
348 | 348 | . self::___getColumnValue( $_asValue, $aAllAttributes, $bEscape, 0 ) |
349 | 349 | . "</tr>"; |
350 | 350 | continue; |
351 | 351 | } |
352 | 352 | $_aColumns = self::getAsArray( $_asValue ); |
353 | - $_sOutput .= "<tr " . self::getAttributes( $_aTRAttr ) . ">" |
|
353 | + $_sOutput .= "<tr ".self::getAttributes( $_aTRAttr ).">" |
|
354 | 354 | . self::___getColumns( $_aColumns, $aAllAttributes, $bEscape ) |
355 | 355 | . "</tr>"; |
356 | 356 | } |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | } |
359 | 359 | static private function ___getColumns( array $aColumns, $aAllAttributes, $bEscape ) { |
360 | 360 | $_sOutput = ''; |
361 | - foreach( array_values( $aColumns ) as $_iIndex => $_asValue ) { |
|
361 | + foreach ( array_values( $aColumns ) as $_iIndex => $_asValue ) { |
|
362 | 362 | $_sOutput .= self::___getColumnValue( $_asValue, $aAllAttributes, $bEscape, $_iIndex ); |
363 | 363 | } |
364 | 364 | return $_sOutput; |
@@ -380,24 +380,24 @@ discard block |
||
380 | 380 | if ( is_null( $mValue ) ) { |
381 | 381 | $mValue = '(null)'; |
382 | 382 | } |
383 | - $_aPAttr = self::getElementAsArray( $aAllAttributes, 'p' ); |
|
383 | + $_aPAttr = self::getElementAsArray( $aAllAttributes, 'p' ); |
|
384 | 384 | if ( is_scalar( $mValue ) ) { |
385 | - return "<td " . self::getAttributes( $_aTDAttrNth ) . ">" |
|
386 | - . "<p " . self::getAttributes( $_aPAttr ) . ">" . self::___getHTMLEscaped( $mValue, $bEscape ) . "</p>" |
|
385 | + return "<td ".self::getAttributes( $_aTDAttrNth ).">" |
|
386 | + . "<p ".self::getAttributes( $_aPAttr ).">".self::___getHTMLEscaped( $mValue, $bEscape )."</p>" |
|
387 | 387 | . "</td>"; |
388 | 388 | } |
389 | 389 | if ( is_array( $mValue ) ) { |
390 | 390 | return self::isAssociativeArray( $mValue ) || self::isMultiDimensional( $mValue ) |
391 | - ? "<td " . self::getAttributes( $_aTDAttrNth ) . ">" |
|
391 | + ? "<td ".self::getAttributes( $_aTDAttrNth ).">" |
|
392 | 392 | . self::getTableOfKeyValues( $mValue, $aAllAttributes ) |
393 | 393 | . "</td>" |
394 | - : "<td " . self::getAttributes( $_aTDAttrNth ) . ">" |
|
394 | + : "<td ".self::getAttributes( $_aTDAttrNth ).">" |
|
395 | 395 | // @todo may ought to be numeric-rows table |
396 | 396 | . self::___getList( $mValue, $aAllAttributes, $bEscape ) |
397 | 397 | . "</td>"; |
398 | 398 | } |
399 | - return "<td " . self::getAttributes( $_aTDAttrNth ) . ">" |
|
400 | - . '(' . gettype( $mValue ) . ')' . ( is_object( $mValue ) ? get_class( $mValue ) : '' ) |
|
399 | + return "<td ".self::getAttributes( $_aTDAttrNth ).">" |
|
400 | + . '('.gettype( $mValue ).')'.( is_object( $mValue ) ? get_class( $mValue ) : '' ) |
|
401 | 401 | . "</td>"; |
402 | 402 | } |
403 | 403 | /** |
@@ -414,16 +414,16 @@ discard block |
||
414 | 414 | if ( empty( $aArray ) ) { |
415 | 415 | return ''; |
416 | 416 | } |
417 | - $_sList = "<ul " . self::getAttributes( $_aULAttr ) . ">"; |
|
418 | - foreach( $aArray as $_asValue ) { |
|
417 | + $_sList = "<ul ".self::getAttributes( $_aULAttr ).">"; |
|
418 | + foreach ( $aArray as $_asValue ) { |
|
419 | 419 | $_sItem = is_array( $_asValue ) |
420 | 420 | ? self::___getList( $_asValue, $aAllAttributes, $bEscape ) |
421 | 421 | : self::___getHTMLEscaped( $_asValue, $bEscape ); |
422 | - $_sList .= "<li " . self::getAttributes( $_aLIAttr ) . ">" |
|
422 | + $_sList .= "<li ".self::getAttributes( $_aLIAttr ).">" |
|
423 | 423 | . $_sItem |
424 | 424 | . "</li>"; |
425 | 425 | } |
426 | - $_sList .= "</ul>"; |
|
426 | + $_sList .= "</ul>"; |
|
427 | 427 | return $_sList; |
428 | 428 | } |
429 | 429 |