@@ -39,7 +39,7 @@ |
||
39 | 39 | '' // default value |
40 | 40 | ); |
41 | 41 | |
42 | - if ( ! $this->canUserView( $this->sCapability ) ) { |
|
42 | + if ( !$this->canUserView( $this->sCapability ) ) { |
|
43 | 43 | return ''; |
44 | 44 | } |
45 | 45 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @return array |
49 | 49 | */ |
50 | - public function get( $iItems=0 ) { |
|
50 | + public function get( $iItems = 0 ) { |
|
51 | 51 | |
52 | 52 | $_aOutput = array(); |
53 | 53 | $_aURLs = $this->_aURLs; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return $_aOutput; |
57 | 57 | } |
58 | 58 | |
59 | - $_oFeed = fetch_feed( $_aURLs ); |
|
59 | + $_oFeed = fetch_feed( $_aURLs ); |
|
60 | 60 | if ( is_wp_error( $_oFeed ) ) { |
61 | 61 | return $_aOutput; |
62 | 62 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | 'title' => $_oItem->get_title(), |
68 | 68 | 'date' => $_oItem->get_date( 'j F Y, g:i a' ), |
69 | 69 | 'author' => $_oItem->get_author(), |
70 | - 'link' => $_oItem->get_permalink(), // get_link() may be used as well |
|
70 | + 'link' => $_oItem->get_permalink(), // get_link() may be used as well |
|
71 | 71 | ); |
72 | 72 | } |
73 | 73 |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | static public function getRelativePath( $from, $to ) { |
29 | 29 | |
30 | 30 | // some compatibility fixes for Windows paths |
31 | - $from = is_dir( $from ) ? rtrim( $from, '\/') . '/' : $from; |
|
32 | - $to = is_dir( $to ) ? rtrim( $to, '\/') . '/' : $to; |
|
31 | + $from = is_dir( $from ) ? rtrim( $from, '\/' ).'/' : $from; |
|
32 | + $to = is_dir( $to ) ? rtrim( $to, '\/' ).'/' : $to; |
|
33 | 33 | $from = str_replace( '\\', '/', $from ); |
34 | 34 | $to = str_replace( '\\', '/', $to ); |
35 | 35 | |
@@ -37,21 +37,21 @@ discard block |
||
37 | 37 | $to = explode( '/', $to ); |
38 | 38 | $relPath = $to; |
39 | 39 | |
40 | - foreach( $from as $depth => $dir ) { |
|
40 | + foreach ( $from as $depth => $dir ) { |
|
41 | 41 | // find first non-matching dir |
42 | - if( $dir === $to[ $depth ] ) { |
|
42 | + if ( $dir === $to[ $depth ] ) { |
|
43 | 43 | // ignore this directory |
44 | 44 | array_shift( $relPath ); |
45 | 45 | } else { |
46 | 46 | // get number of remaining dirs to $from |
47 | 47 | $remaining = count( $from ) - $depth; |
48 | - if( $remaining > 1 ) { |
|
48 | + if ( $remaining > 1 ) { |
|
49 | 49 | // add traversals up to first matching dir |
50 | 50 | $padLength = ( count( $relPath ) + $remaining - 1 ) * -1; |
51 | 51 | $relPath = array_pad( $relPath, $padLength, '..' ); |
52 | 52 | break; |
53 | 53 | } else { |
54 | - $relPath[ 0 ] = './' . $relPath[ 0 ]; |
|
54 | + $relPath[ 0 ] = './'.$relPath[ 0 ]; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | 'debug_backtrace', |
76 | 76 | self::_getDebugBacktraceArguments() |
77 | 77 | ); |
78 | - foreach( $_aBackTrace as $_aDebugInfo ) { |
|
78 | + foreach ( $_aBackTrace as $_aDebugInfo ) { |
|
79 | 79 | $_aDebugInfo = self::getAsArray( $_aDebugInfo ) + array( 'file' => '' ); // prevents an undefined index |
80 | 80 | $_sCallerFilePath = $_aDebugInfo[ 'file' ]; |
81 | 81 | if ( in_array( $_sCallerFilePath, $_aRedirectedFilePaths ) ) { |
@@ -75,7 +75,7 @@ |
||
75 | 75 | 'debug_backtrace', |
76 | 76 | self::_getDebugBacktraceArguments() |
77 | 77 | ); |
78 | - foreach( $_aBackTrace as $_aDebugInfo ) { |
|
78 | + foreach( $_aBackTrace as $_aDebugInfo ) { |
|
79 | 79 | $_aDebugInfo = self::getAsArray( $_aDebugInfo ) + array( 'file' => '' ); // prevents an undefined index |
80 | 80 | $_sCallerFilePath = $_aDebugInfo[ 'file' ]; |
81 | 81 | if ( in_array( $_sCallerFilePath, $_aRedirectedFilePaths ) ) { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // Do actions before rendering the page. In this order, global -> page -> in-page tab |
49 | 49 | $this->addAndDoActions( |
50 | - $this->oFactory, // the caller object |
|
50 | + $this->oFactory, // the caller object |
|
51 | 51 | $this->getFilterArrayByPrefix( 'do_before_', $this->oFactory->oProp->sClassName, $_sPageSlug, $_sTabSlug, true ), // the action hooks |
52 | 52 | $this->oFactory // the argument 1 |
53 | 53 | ); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | </div><!-- #post-body --> |
73 | 73 | </div><!-- #poststuff --> |
74 | 74 | |
75 | - <?php echo $this->_printFormClosingTag( $_sPageSlug, $_sTabSlug, $this->oFactory->oProp->bEnableForm ); // </form> ?> |
|
75 | + <?php echo $this->_printFormClosingTag( $_sPageSlug, $_sTabSlug, $this->oFactory->oProp->bEnableForm ); // </form> ?> |
|
76 | 76 | </div><!-- .admin-page-framework-container --> |
77 | 77 | |
78 | 78 | <?php |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | <?php |
84 | 84 | // Do actions after rendering the page. |
85 | 85 | $this->addAndDoActions( |
86 | - $this->oFactory, // the caller object |
|
86 | + $this->oFactory, // the caller object |
|
87 | 87 | $this->getFilterArrayByPrefix( 'do_after_', $this->oFactory->oProp->sClassName, $_sPageSlug, $_sTabSlug, true ), // the action hooks |
88 | 88 | $this->oFactory // the argument 1 |
89 | 89 | ); |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | */ |
101 | 101 | private function _getNumberOfColumns() { |
102 | 102 | |
103 | - if ( ! $this->doesMetaBoxExist( 'side' ) ) { |
|
103 | + if ( !$this->doesMetaBoxExist( 'side' ) ) { |
|
104 | 104 | return 1; |
105 | 105 | } |
106 | 106 | |
107 | 107 | $_iColumns = $this->getNumberOfScreenColumns(); |
108 | 108 | return $_iColumns |
109 | 109 | ? $_iColumns |
110 | - : 1; // default - this is because generic pages do not have meta boxes. |
|
110 | + : 1; // default - this is because generic pages do not have meta boxes. |
|
111 | 111 | } |
112 | 112 | // @deprecated |
113 | 113 | // Make sure if no side meta box exists, set it 1. |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | private function _getContentTop() { |
127 | 127 | |
128 | 128 | // Screen icon, page heading tabs(page title), and in-page tabs. |
129 | - $_oScreenIcon = new AdminPageFramework_View__PageRenderer__ScreenIcon( |
|
129 | + $_oScreenIcon = new AdminPageFramework_View__PageRenderer__ScreenIcon( |
|
130 | 130 | $this->oFactory, |
131 | 131 | $this->sPageSlug, |
132 | 132 | $this->sTabSlug |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $this->oFactory, |
143 | 143 | $this->sPageSlug |
144 | 144 | ); |
145 | - $_sContentTop .= $_oInPageTabs->get(); |
|
145 | + $_sContentTop .= $_oInPageTabs->get(); |
|
146 | 146 | |
147 | 147 | // Apply filters in this order, in-page tab -> page -> global. |
148 | 148 | return $this->addAndApplyFilters( |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | private function _getFormOutput( $sPageSlug ) { |
216 | 216 | |
217 | - if ( ! $this->oFactory->oProp->bEnableForm ) { |
|
217 | + if ( !$this->oFactory->oProp->bEnableForm ) { |
|
218 | 218 | return ''; |
219 | 219 | } |
220 | 220 | return $this->oFactory->oForm->get(); |
@@ -244,9 +244,9 @@ discard block |
||
244 | 244 | * @internal |
245 | 245 | * @return void |
246 | 246 | */ |
247 | - private function _printFormOpeningTag( $fEnableForm=true ) { |
|
247 | + private function _printFormOpeningTag( $fEnableForm = true ) { |
|
248 | 248 | |
249 | - if ( ! $fEnableForm ) { |
|
249 | + if ( !$fEnableForm ) { |
|
250 | 250 | return; |
251 | 251 | } |
252 | 252 | |
@@ -259,12 +259,12 @@ discard block |
||
259 | 259 | 'action' => wp_unslash( remove_query_arg( 'settings-updated', $this->oFactory->oProp->sTargetFormPage ) ), |
260 | 260 | ) |
261 | 261 | ) |
262 | - . " >" . PHP_EOL; |
|
262 | + . " >".PHP_EOL; |
|
263 | 263 | |
264 | 264 | // [3.5.11+] Insert a mark that indicates the framework form has started. |
265 | 265 | // This will be checked in the validation method with the `is_admin_page_framework` input value which gets inserted at the end of the form |
266 | 266 | // in order to determine all the fields are sent for the PHP max_input_vars limitation set in the server configuration. |
267 | - echo "<input type='hidden' name='admin_page_framework_start' value='1' />" . PHP_EOL; |
|
267 | + echo "<input type='hidden' name='admin_page_framework_start' value='1' />".PHP_EOL; |
|
268 | 268 | |
269 | 269 | // Embed the '_wp_http_referer' hidden field that is checked in the submit data processing method. |
270 | 270 | settings_fields( $this->oFactory->oProp->sOptionKey ); |
@@ -280,16 +280,16 @@ discard block |
||
280 | 280 | * @internal |
281 | 281 | * @return void |
282 | 282 | */ |
283 | - private function _printFormClosingTag( $sPageSlug, $sTabSlug, $fEnableForm=true ) { |
|
283 | + private function _printFormClosingTag( $sPageSlug, $sTabSlug, $fEnableForm = true ) { |
|
284 | 284 | |
285 | - if ( ! $fEnableForm ) { |
|
285 | + if ( !$fEnableForm ) { |
|
286 | 286 | return; |
287 | 287 | } |
288 | - $_sNonce = wp_create_nonce( 'form_' . md5( $this->oFactory->oProp->sClassName . get_current_user_id() ) ); |
|
289 | - echo "<input type='hidden' name='page_slug' value='{$sPageSlug}' />" . PHP_EOL |
|
290 | - . "<input type='hidden' name='tab_slug' value='{$sTabSlug}' />" . PHP_EOL |
|
291 | - . "<input type='hidden' name='_is_admin_page_framework' value='{$_sNonce}' />" . PHP_EOL |
|
292 | - . "</form><!-- End Form -->" . PHP_EOL; |
|
288 | + $_sNonce = wp_create_nonce( 'form_'.md5( $this->oFactory->oProp->sClassName.get_current_user_id() ) ); |
|
289 | + echo "<input type='hidden' name='page_slug' value='{$sPageSlug}' />".PHP_EOL |
|
290 | + . "<input type='hidden' name='tab_slug' value='{$sTabSlug}' />".PHP_EOL |
|
291 | + . "<input type='hidden' name='_is_admin_page_framework' value='{$_sNonce}' />".PHP_EOL |
|
292 | + . "</form><!-- End Form -->".PHP_EOL; |
|
293 | 293 | |
294 | 294 | } |
295 | 295 |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function _appendInternalAssets( $sInternal, &$aContainer ) { |
69 | 69 | $_aInternals = array_unique( $aContainer ); |
70 | - $sInternal = PHP_EOL . $sInternal; |
|
71 | - foreach( $_aInternals as $_iIndex => $_sInternal ) { |
|
72 | - $sInternal .= $_sInternal . PHP_EOL; |
|
70 | + $sInternal = PHP_EOL.$sInternal; |
|
71 | + foreach ( $_aInternals as $_iIndex => $_sInternal ) { |
|
72 | + $sInternal .= $_sInternal.PHP_EOL; |
|
73 | 73 | unset( $_aInternals[ $_iIndex ] ); |
74 | 74 | } |
75 | 75 | $aContainer = $_aInternals; // update the container array. |
@@ -83,23 +83,23 @@ discard block |
||
83 | 83 | private function _parseAssets( $oFactory ) { |
84 | 84 | |
85 | 85 | // page |
86 | - $_aPageStyles = $this->getElementAsArray( |
|
86 | + $_aPageStyles = $this->getElementAsArray( |
|
87 | 87 | $oFactory->oProp->aPages, |
88 | 88 | array( $this->sCurrentPageSlug, 'style' ) |
89 | 89 | ); |
90 | 90 | $this->_enqueuePageAssets( $_aPageStyles, 'style' ); |
91 | 91 | |
92 | - $_aPageScripts = $this->getElementAsArray( |
|
92 | + $_aPageScripts = $this->getElementAsArray( |
|
93 | 93 | $oFactory->oProp->aPages, |
94 | 94 | array( $this->sCurrentPageSlug, 'script' ) |
95 | 95 | ); |
96 | 96 | $this->_enqueuePageAssets( $_aPageScripts, 'script' ); |
97 | 97 | |
98 | 98 | // In-page tabs |
99 | - if ( ! $this->sCurrentTabSlug ) { |
|
99 | + if ( !$this->sCurrentTabSlug ) { |
|
100 | 100 | return; |
101 | 101 | } |
102 | - $_aInPageTabStyles = $this->getElementAsArray( |
|
102 | + $_aInPageTabStyles = $this->getElementAsArray( |
|
103 | 103 | $oFactory->oProp->aInPageTabs, |
104 | 104 | array( $this->sCurrentPageSlug, $this->sCurrentTabSlug, 'style' ) |
105 | 105 | ); |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | * @since 3.6.3 |
117 | 117 | * @return void |
118 | 118 | */ |
119 | - private function _enqueuePageAssets( array $aPageAssets, $sType='style' ) { |
|
120 | - $_sMethodName = "_enqueueAsset_" . $sType; |
|
121 | - foreach( $aPageAssets as $_asPageAsset ) { |
|
122 | - $this->{$_sMethodName}( $_asPageAsset); |
|
119 | + private function _enqueuePageAssets( array $aPageAssets, $sType = 'style' ) { |
|
120 | + $_sMethodName = "_enqueueAsset_".$sType; |
|
121 | + foreach ( $aPageAssets as $_asPageAsset ) { |
|
122 | + $this->{$_sMethodName}( $_asPageAsset ); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | // Insert the CSS rule in the head tag. |
147 | - $this->aCSSRules[] = $_sSRC; |
|
147 | + $this->aCSSRules[ ] = $_sSRC; |
|
148 | 148 | |
149 | 149 | } |
150 | 150 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | // Insert the scripts in the head tag. |
172 | - $this->aScripts[] = $_sSRC; |
|
172 | + $this->aScripts[ ] = $_sSRC; |
|
173 | 173 | |
174 | 174 | } |
175 | 175 |
@@ -162,7 +162,7 @@ |
||
162 | 162 | /* |
163 | 163 | * Shared methods |
164 | 164 | */ |
165 | - /** |
|
165 | + /** |
|
166 | 166 | * Checks the src url of the enqueued script/style to determine whether or not to set up a attribute modification callback. |
167 | 167 | * |
168 | 168 | * If it is one of the framework added item, the method sets up a hook to modify the url to add custom attributes. |
@@ -352,7 +352,8 @@ discard block |
||
352 | 352 | static $_iCallCount = 0; |
353 | 353 | |
354 | 354 | $_sFilterName = "style_{$this->oProp->sClassName}"; |
355 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
355 | + if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { |
|
356 | +// 3.8.22 |
|
356 | 357 | return ''; |
357 | 358 | } |
358 | 359 | $_sStyle = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyle ); |
@@ -379,7 +380,8 @@ discard block |
||
379 | 380 | static $_iCallCountIE = 1; |
380 | 381 | |
381 | 382 | $_sFilterName = "style_ie_{$this->oProp->sClassName}"; |
382 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
383 | + if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { |
|
384 | +// 3.8.22 |
|
383 | 385 | return ''; |
384 | 386 | } |
385 | 387 | $_sStyleIE = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyleIE ); |
@@ -407,7 +409,8 @@ discard block |
||
407 | 409 | |
408 | 410 | static $_iCallCount = 1; |
409 | 411 | $_sFilterName = "script_{$this->oProp->sClassName}"; |
410 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
412 | + if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { |
|
413 | +// 3.8.22 |
|
411 | 414 | return ''; |
412 | 415 | } |
413 | 416 | $_sScript = $this->addAndApplyFilters( $this->oProp->oCaller, $_sFilterName, $this->oProp->sScript ); |
@@ -37,19 +37,19 @@ discard block |
||
37 | 37 | /* The system internal keys. */ |
38 | 38 | 'sSRC' => null, |
39 | 39 | 'sSRCRaw' => null, |
40 | - 'aPostTypes' => array(), // for meta box class |
|
40 | + 'aPostTypes' => array(), // for meta box class |
|
41 | 41 | 'sPageSlug' => null, |
42 | 42 | 'sTabSlug' => null, |
43 | - 'sType' => null, // script or style |
|
43 | + 'sType' => null, // script or style |
|
44 | 44 | |
45 | 45 | /* The below keys are for users. */ |
46 | 46 | 'handle_id' => null, |
47 | 47 | 'dependencies' => array(), |
48 | - 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
49 | - 'translation' => array(), // only for scripts |
|
50 | - 'in_footer' => false, // only for scripts |
|
51 | - 'media' => 'all', // only for styles |
|
52 | - 'attributes' => array(), // 3.3.0+ - the attribute array |
|
48 | + 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
49 | + 'translation' => array(), // only for scripts |
|
50 | + 'in_footer' => false, // only for scripts |
|
51 | + 'media' => 'all', // only for styles |
|
52 | + 'attributes' => array(), // 3.3.0+ - the attribute array |
|
53 | 53 | |
54 | 54 | ); |
55 | 55 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @remark This value should be overridden in an extended class. |
61 | 61 | * @internal |
62 | 62 | */ |
63 | - protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
63 | + protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Stores the class selector used to the class-specific script. |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @remark This value should be overridden in an extended class. |
70 | 70 | * @internal |
71 | 71 | */ |
72 | - protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
72 | + protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * Stores hand IDs by resource url to look up handle id and add custom arguments. |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | return $sSanitizedURL; |
207 | 207 | } |
208 | 208 | |
209 | - $_sAttributes = $this->getAttributes( $_aAttributes ); |
|
210 | - return $sSanitizedURL . "' " . rtrim( $_sAttributes, "'\"" ); |
|
209 | + $_sAttributes = $this->getAttributes( $_aAttributes ); |
|
210 | + return $sSanitizedURL."' ".rtrim( $_sAttributes, "'\"" ); |
|
211 | 211 | |
212 | 212 | } |
213 | 213 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | protected function _printCommonStyles( $sIDPrefix, $sClassName ) { |
229 | 229 | |
230 | - if ( $this->hasBeenCalled( 'COMMON_STYLES: ' . get_class( $this ) . '::' . __METHOD__ ) ) { |
|
230 | + if ( $this->hasBeenCalled( 'COMMON_STYLES: '.get_class( $this ).'::'.__METHOD__ ) ) { |
|
231 | 231 | return; |
232 | 232 | } |
233 | 233 | $_oCaller = $this->oProp->oCaller; |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | */ |
244 | 244 | private function ___getCommonStyleTag( $oCaller, $sIDPrefix ) { |
245 | 245 | |
246 | - $_sStyle = $this->addAndApplyFilters( |
|
246 | + $_sStyle = $this->addAndApplyFilters( |
|
247 | 247 | $oCaller, |
248 | 248 | array( |
249 | - "style_common_admin_page_framework", // 3.2.1+ |
|
249 | + "style_common_admin_page_framework", // 3.2.1+ |
|
250 | 250 | "style_common_{$this->oProp->sClassName}", |
251 | 251 | ), |
252 | 252 | AdminPageFramework_CSS::getDefaultCSS() |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $_sStyle = $this->isDebugMode() ? $_sStyle : $this->getCSSMinified( $_sStyle ); |
255 | 255 | $_sStyle = trim( $_sStyle ); |
256 | 256 | if ( $_sStyle ) { |
257 | - echo "<style type='text/css' id='" . esc_attr( strtolower( $sIDPrefix ) ) . "'>" |
|
257 | + echo "<style type='text/css' id='".esc_attr( strtolower( $sIDPrefix ) )."'>" |
|
258 | 258 | . $_sStyle |
259 | 259 | . "</style>"; |
260 | 260 | } |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | */ |
270 | 270 | private function ___getCommonIEStyleTag( $oCaller, $sIDPrefix ) { |
271 | 271 | |
272 | - $_sStyleIE = $this->addAndApplyFilters( |
|
272 | + $_sStyleIE = $this->addAndApplyFilters( |
|
273 | 273 | $oCaller, |
274 | 274 | array( |
275 | - "style_ie_common_admin_page_framework", // 3.2.1+ |
|
275 | + "style_ie_common_admin_page_framework", // 3.2.1+ |
|
276 | 276 | "style_ie_common_{$this->oProp->sClassName}", |
277 | 277 | ), |
278 | 278 | AdminPageFramework_CSS::getDefaultCSSIE() |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $_sStyleIE = $this->isDebugMode() ? $_sStyleIE : $this->getCSSMinified( $_sStyleIE ); |
281 | 281 | $_sStyleIE = trim( $_sStyleIE ); |
282 | 282 | return $_sStyleIE |
283 | - ? "<!--[if IE]><style type='text/css' id='" . esc_attr( strtolower( $sIDPrefix . "-ie" ) ) . "'>" |
|
283 | + ? "<!--[if IE]><style type='text/css' id='".esc_attr( strtolower( $sIDPrefix."-ie" ) )."'>" |
|
284 | 284 | . $_sStyleIE |
285 | 285 | . "</style><![endif]-->" |
286 | 286 | : ''; |
@@ -299,23 +299,23 @@ discard block |
||
299 | 299 | */ |
300 | 300 | protected function _printCommonScripts( $sIDPrefix, $sClassName ) { |
301 | 301 | |
302 | - if ( $this->hasBeenCalled( 'COMMON_SCRIPT: ' . get_class( $this ) . '::' . __METHOD__ ) ) { |
|
302 | + if ( $this->hasBeenCalled( 'COMMON_SCRIPT: '.get_class( $this ).'::'.__METHOD__ ) ) { |
|
303 | 303 | return; |
304 | 304 | } |
305 | 305 | |
306 | 306 | $_sScript = $this->addAndApplyFilters( |
307 | 307 | $this->oProp->oCaller, |
308 | 308 | array( |
309 | - "script_common_admin_page_framework", // 3.2.1+ |
|
309 | + "script_common_admin_page_framework", // 3.2.1+ |
|
310 | 310 | "script_common_{$this->oProp->sClassName}", |
311 | 311 | ), |
312 | 312 | AdminPageFramework_Property_Base::$_sDefaultScript |
313 | 313 | ); |
314 | 314 | $_sScript = trim( $_sScript ); |
315 | - if ( ! $_sScript ) { |
|
315 | + if ( !$_sScript ) { |
|
316 | 316 | return; |
317 | 317 | } |
318 | - echo "<script type='text/javascript' id='" . esc_attr( strtolower( $sIDPrefix ) ) . "'>" |
|
318 | + echo "<script type='text/javascript' id='".esc_attr( strtolower( $sIDPrefix ) )."'>" |
|
319 | 319 | . '/* <![CDATA[ */' |
320 | 320 | . $_sScript |
321 | 321 | . '/* ]]> */' |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | */ |
334 | 334 | protected function _printClassSpecificStyles( $sIDPrefix ) { |
335 | 335 | |
336 | - $_oCaller = $this->oProp->oCaller; |
|
336 | + $_oCaller = $this->oProp->oCaller; |
|
337 | 337 | echo $this->_getClassSpecificStyleTag( $_oCaller, $sIDPrefix ); |
338 | 338 | echo $this->_getClassSpecificIEStyleTag( $_oCaller, $sIDPrefix ); |
339 | 339 | |
@@ -354,18 +354,18 @@ discard block |
||
354 | 354 | static $_iCallCount = 0; |
355 | 355 | |
356 | 356 | $_sFilterName = "style_{$this->oProp->sClassName}"; |
357 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
357 | + if ( $this->hasBeenCalled( 'FILTER: '.$_sFilterName ) ) { // 3.8.22 |
|
358 | 358 | return ''; |
359 | 359 | } |
360 | 360 | $_sStyle = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyle ); |
361 | 361 | $_sStyle = $this->isDebugMode() ? $_sStyle : $this->getCSSMinified( $_sStyle ); |
362 | 362 | $_sStyle = trim( $_sStyle ); |
363 | - if ( ! $_sStyle ) { |
|
363 | + if ( !$_sStyle ) { |
|
364 | 364 | return ''; |
365 | 365 | } |
366 | 366 | $_iCallCount++; |
367 | - $_sID = strtolower( "{$sIDPrefix}-" . $this->oProp->sClassName . "_{$_iCallCount}" ); |
|
368 | - return "<style type='text/css' id='" . esc_attr( $_sID ) . "'>" |
|
367 | + $_sID = strtolower( "{$sIDPrefix}-".$this->oProp->sClassName."_{$_iCallCount}" ); |
|
368 | + return "<style type='text/css' id='".esc_attr( $_sID )."'>" |
|
369 | 369 | . $_sStyle |
370 | 370 | . "</style>"; |
371 | 371 | |
@@ -381,18 +381,18 @@ discard block |
||
381 | 381 | static $_iCallCountIE = 1; |
382 | 382 | |
383 | 383 | $_sFilterName = "style_ie_{$this->oProp->sClassName}"; |
384 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
384 | + if ( $this->hasBeenCalled( 'FILTER: '.$_sFilterName ) ) { // 3.8.22 |
|
385 | 385 | return ''; |
386 | 386 | } |
387 | 387 | $_sStyleIE = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyleIE ); |
388 | 388 | $_sStyleIE = $this->isDebugMode() ? $_sStyleIE : $this->getCSSMinified( $_sStyleIE ); |
389 | 389 | $_sStyleIE = trim( $_sStyleIE ); |
390 | - if ( ! $_sStyleIE ) { |
|
390 | + if ( !$_sStyleIE ) { |
|
391 | 391 | return ''; |
392 | 392 | } |
393 | 393 | $_iCallCountIE++; |
394 | - $_sID = strtolower( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" ); |
|
395 | - return "<!--[if IE]><style type='text/css' id='" . esc_attr( $_sID ) . "'>" |
|
394 | + $_sID = strtolower( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" ); |
|
395 | + return "<!--[if IE]><style type='text/css' id='".esc_attr( $_sID )."'>" |
|
396 | 396 | . $_sStyleIE |
397 | 397 | . "</style><![endif]-->"; |
398 | 398 | |
@@ -409,18 +409,18 @@ discard block |
||
409 | 409 | |
410 | 410 | static $_iCallCount = 1; |
411 | 411 | $_sFilterName = "script_{$this->oProp->sClassName}"; |
412 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
412 | + if ( $this->hasBeenCalled( 'FILTER: '.$_sFilterName ) ) { // 3.8.22 |
|
413 | 413 | return ''; |
414 | 414 | } |
415 | 415 | $_sScript = $this->addAndApplyFilters( $this->oProp->oCaller, $_sFilterName, $this->oProp->sScript ); |
416 | 416 | $_sScript = trim( $_sScript ); |
417 | - if ( ! $_sScript ) { |
|
417 | + if ( !$_sScript ) { |
|
418 | 418 | return ''; |
419 | 419 | } |
420 | 420 | |
421 | 421 | $_iCallCount++; |
422 | 422 | $_sID = strtolower( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ); |
423 | - echo "<script type='text/javascript' id='" . esc_attr( $_sID ) . "'>" |
|
423 | + echo "<script type='text/javascript' id='".esc_attr( $_sID )."'>" |
|
424 | 424 | . '/* <![CDATA[ */' |
425 | 425 | . $_sScript |
426 | 426 | . '/* ]]> */' |
@@ -443,12 +443,12 @@ discard block |
||
443 | 443 | public function _replyToAddStyle() { |
444 | 444 | |
445 | 445 | $_oCaller = $this->oProp->oCaller; |
446 | - if ( ! $_oCaller->isInThePage() ) { |
|
446 | + if ( !$_oCaller->isInThePage() ) { |
|
447 | 447 | return; |
448 | 448 | } |
449 | 449 | |
450 | 450 | $this->_printCommonStyles( 'admin-page-framework-style-common', get_class() ); |
451 | - $this->_printClassSpecificStyles( $this->_sClassSelector_Style . '-' . $this->oProp->sStructureType ); |
|
451 | + $this->_printClassSpecificStyles( $this->_sClassSelector_Style.'-'.$this->oProp->sStructureType ); |
|
452 | 452 | |
453 | 453 | } |
454 | 454 | /** |
@@ -463,12 +463,12 @@ discard block |
||
463 | 463 | public function _replyToAddScript() { |
464 | 464 | |
465 | 465 | $_oCaller = $this->oProp->oCaller; |
466 | - if ( ! $_oCaller->isInThePage() ) { |
|
466 | + if ( !$_oCaller->isInThePage() ) { |
|
467 | 467 | return; |
468 | 468 | } |
469 | 469 | |
470 | 470 | $this->_printCommonScripts( 'admin-page-framework-script-common', get_class() ); |
471 | - $this->_printClassSpecificScripts( $this->_sClassSelector_Script . '-' . $this->oProp->sStructureType ); |
|
471 | + $this->_printClassSpecificScripts( $this->_sClassSelector_Script.'-'.$this->oProp->sStructureType ); |
|
472 | 472 | |
473 | 473 | } |
474 | 474 | |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | */ |
520 | 520 | private function ___getSRCFormatted( array $aEnqueueItem ) { |
521 | 521 | |
522 | - if ( ! $this->oProp->bAutoloadMinifiedResource ) { |
|
522 | + if ( !$this->oProp->bAutoloadMinifiedResource ) { |
|
523 | 523 | return $aEnqueueItem[ 'sSRC' ]; |
524 | 524 | } |
525 | 525 | |
@@ -546,16 +546,16 @@ discard block |
||
546 | 546 | + array( 'dirname' => '', 'filename' => '', 'basename' => '', 'extension' => '' ); // avoid undefined index warnings |
547 | 547 | |
548 | 548 | // If there is no extension, avoid using a minified version. |
549 | - if ( ! $_aPathParts[ 'extension' ] ) { |
|
549 | + if ( !$_aPathParts[ 'extension' ] ) { |
|
550 | 550 | return $aEnqueueItem[ 'sSRC' ]; |
551 | 551 | } |
552 | 552 | |
553 | 553 | $_aPathPartsURL = pathinfo( $aEnqueueItem[ 'sSRC' ] ) |
554 | 554 | + array( 'dirname' => '', 'filename' => '', 'basename' => '', 'extension' => '' ); // avoid undefined index warnings |
555 | 555 | |
556 | - $_sPathMinifiedVersion = $_aPathParts[ 'dirname' ] . '/' . $_aPathParts[ 'filename' ] . $_sMinPrefix . '.' . $_aPathParts[ 'extension' ]; |
|
556 | + $_sPathMinifiedVersion = $_aPathParts[ 'dirname' ].'/'.$_aPathParts[ 'filename' ].$_sMinPrefix.'.'.$_aPathParts[ 'extension' ]; |
|
557 | 557 | return file_exists( $_sPathMinifiedVersion ) |
558 | - ? $_aPathPartsURL[ 'dirname' ] . '/' . $_aPathPartsURL[ 'filename' ] . $_sMinPrefix . '.' . $_aPathPartsURL[ 'extension' ] |
|
558 | + ? $_aPathPartsURL[ 'dirname' ].'/'.$_aPathPartsURL[ 'filename' ].$_sMinPrefix.'.'.$_aPathPartsURL[ 'extension' ] |
|
559 | 559 | : $aEnqueueItem[ 'sSRC' ]; |
560 | 560 | |
561 | 561 | } |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | * @internal |
572 | 572 | */ |
573 | 573 | public function _replyToEnqueueStyles() { |
574 | - foreach( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
574 | + foreach ( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
575 | 575 | $this->_enqueueSRCByCondition( $_aEnqueuingStyle ); |
576 | 576 | unset( $this->oProp->aEnqueuingStyles[ $_sKey ] ); |
577 | 577 | } |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | * @internal |
589 | 589 | */ |
590 | 590 | public function _replyToEnqueueScripts() { |
591 | - foreach( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
591 | + foreach ( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
592 | 592 | $this->_enqueueSRCByCondition( $_aEnqueuingScript ); |
593 | 593 | unset( $this->oProp->aEnqueuingScripts[ $_sKey ] ); |
594 | 594 | } |
@@ -602,10 +602,10 @@ discard block |
||
602 | 602 | * @param string $sType Accepts 'style' or 'script' |
603 | 603 | * @return string[] Added resource handle IDs. |
604 | 604 | */ |
605 | - public function _enqueueResourcesByType( $aSRCs, array $aCustomArgs=array(), $sType='style' ) { |
|
605 | + public function _enqueueResourcesByType( $aSRCs, array $aCustomArgs = array(), $sType = 'style' ) { |
|
606 | 606 | $_aHandleIDs = array(); |
607 | - foreach( $aSRCs as $_sSRC ) { |
|
608 | - $_aHandleIDs[] = call_user_func_array( array( $this, '_addEnqueuingResourceByType' ), array( $_sSRC, $aCustomArgs, $sType ) ); |
|
607 | + foreach ( $aSRCs as $_sSRC ) { |
|
608 | + $_aHandleIDs[ ] = call_user_func_array( array( $this, '_addEnqueuingResourceByType' ), array( $_sSRC, $aCustomArgs, $sType ) ); |
|
609 | 609 | } |
610 | 610 | return $_aHandleIDs; |
611 | 611 | } |
@@ -622,9 +622,9 @@ discard block |
||
622 | 622 | * @return string The script handle ID if added. If the passed url is not a valid url string, an empty string will be returned. |
623 | 623 | * @internal |
624 | 624 | */ |
625 | - public function _addEnqueuingResourceByType( $sSRC, array $aCustomArgs=array(), $sType='style' ) { |
|
625 | + public function _addEnqueuingResourceByType( $sSRC, array $aCustomArgs = array(), $sType = 'style' ) { |
|
626 | 626 | |
627 | - $sSRC = trim( $sSRC ); |
|
627 | + $sSRC = trim( $sSRC ); |
|
628 | 628 | if ( empty( $sSRC ) ) { |
629 | 629 | return ''; |
630 | 630 | } |
@@ -640,12 +640,12 @@ discard block |
||
640 | 640 | 'sSRCRaw' => $_sRawSRC, |
641 | 641 | 'sSRC' => $_sSRC, |
642 | 642 | 'sType' => $sType, |
643 | - 'handle_id' => $sType . '_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->{$_sEnqueuedIndexPropertyName} ), |
|
643 | + 'handle_id' => $sType.'_'.$this->oProp->sClassName.'_'.( ++$this->oProp->{$_sEnqueuedIndexPropertyName} ), |
|
644 | 644 | ) |
645 | 645 | + self::$_aStructure_EnqueuingResources; |
646 | 646 | |
647 | 647 | // Store the attributes in another container by url. |
648 | - $this->oProp->aResourceAttributes[ $this->oProp->{$_sContainerPropertyName}[ $_sSRC ]['handle_id'] ] = $this->oProp->{$_sContainerPropertyName}[ $_sSRC ]['attributes']; |
|
648 | + $this->oProp->aResourceAttributes[ $this->oProp->{$_sContainerPropertyName}[ $_sSRC ][ 'handle_id' ] ] = $this->oProp->{$_sContainerPropertyName}[ $_sSRC ][ 'attributes' ]; |
|
649 | 649 | |
650 | 650 | return $this->oProp->{$_sContainerPropertyName}[ $_sSRC ][ 'handle_id' ]; |
651 | 651 |
@@ -266,7 +266,7 @@ |
||
266 | 266 | * @since 3.8.22 |
267 | 267 | */ |
268 | 268 | static public function getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) { |
269 | - return self::_getSlicedByDepth( $aSubject, $iDepth, $sMore ); |
|
269 | + return self::_getSlicedByDepth( $aSubject, $iDepth, $sMore ); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -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 | - . print_r( self::___getLegibleDetailedArray( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) , true ); |
|
42 | + return '(array, length: '.count( $mValue ).') ' |
|
43 | + . print_r( self::___getLegibleDetailedArray( $mValue, $iStringLengthLimit, $iArrayDepthLimit ), true ); |
|
44 | 44 | } |
45 | 45 | return 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( 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 |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * @return array |
288 | 288 | * @since 3.8.22 |
289 | 289 | */ |
290 | - static public function getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) { |
|
290 | + static public function getSlicedByDepth( array $aSubject, $iDepth = 0, $sMore = '(array truncated) ...' ) { |
|
291 | 291 | return self::_getSlicedByDepth( $aSubject, $iDepth, $sMore ); |
292 | 292 | } |
293 | 293 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * @since 3.8.22 Added the `$sMore` parameter. |
308 | 308 | * @internal |
309 | 309 | */ |
310 | - static private function _getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) { |
|
310 | + static private function _getSlicedByDepth( array $aSubject, $iDepth = 0, $sMore = '(array truncated) ...' ) { |
|
311 | 311 | |
312 | 312 | foreach ( $aSubject as $_sKey => $_vValue ) { |
313 | 313 | |
@@ -340,9 +340,9 @@ discard block |
||
340 | 340 | * @since 3.8.22 |
341 | 341 | * @since 3.8.23 Deprecated the `$oException` parameter. |
342 | 342 | */ |
343 | - static public function getStackTrace( $iSkip=0, $_deprecated=null ) { |
|
343 | + static public function getStackTrace( $iSkip = 0, $_deprecated = null ) { |
|
344 | 344 | |
345 | - $_iSkip = 1; // need to skip this method trace itself |
|
345 | + $_iSkip = 1; // need to skip this method trace itself |
|
346 | 346 | $_oException = new Exception(); |
347 | 347 | |
348 | 348 | // Backward compatibility. |
@@ -358,22 +358,22 @@ discard block |
||
358 | 358 | $_aFrames = array_slice( $_aFrames, $_iSkip ); |
359 | 359 | foreach ( array_reverse( $_aFrames ) as $_iIndex => $_aFrame ) { |
360 | 360 | |
361 | - $_aFrame = $_aFrame + array( |
|
361 | + $_aFrame = $_aFrame + array( |
|
362 | 362 | 'file' => null, 'line' => null, 'function' => null, |
363 | 363 | 'class' => null, 'args' => array(), |
364 | 364 | ); |
365 | 365 | $_sArguments = self::___getArgumentsOfEachStackTrace( $_aFrame[ 'args' ] ); |
366 | - $_aTraces[] = sprintf( |
|
366 | + $_aTraces[ ] = sprintf( |
|
367 | 367 | "#%s %s(%s): %s(%s)", |
368 | 368 | $_iIndex + 1, |
369 | 369 | $_aFrame[ 'file' ], |
370 | 370 | $_aFrame[ 'line' ], |
371 | - isset( $_aFrame[ 'class' ] ) ? $_aFrame[ 'class' ] . '->' . $_aFrame[ 'function' ] : $_aFrame[ 'function' ], |
|
371 | + isset( $_aFrame[ 'class' ] ) ? $_aFrame[ 'class' ].'->'.$_aFrame[ 'function' ] : $_aFrame[ 'function' ], |
|
372 | 372 | $_sArguments |
373 | 373 | ); |
374 | 374 | |
375 | 375 | } |
376 | - return implode( PHP_EOL, $_aTraces ) . PHP_EOL; |
|
376 | + return implode( PHP_EOL, $_aTraces ).PHP_EOL; |
|
377 | 377 | |
378 | 378 | } |
379 | 379 | /** |
@@ -388,16 +388,16 @@ discard block |
||
388 | 388 | foreach ( $aTraceArguments as $_mArgument ) { |
389 | 389 | $_sType = gettype( $_mArgument ); |
390 | 390 | $_sType = str_replace( |
391 | - array( 'resource (closed)', 'unknown type', 'integer', 'double', ), |
|
392 | - array( 'resource', 'unknown', 'scalar', 'scalar', ), |
|
391 | + array( 'resource (closed)', 'unknown type', 'integer', 'double',), |
|
392 | + array( 'resource', 'unknown', 'scalar', 'scalar',), |
|
393 | 393 | $_sType |
394 | 394 | ); |
395 | 395 | $_sMethodName = "___getStackTraceArgument_{$_sType}"; |
396 | - $_aArguments[] = method_exists( __CLASS__, $_sMethodName ) |
|
396 | + $_aArguments[ ] = method_exists( __CLASS__, $_sMethodName ) |
|
397 | 397 | ? self::{$_sMethodName}( $_mArgument ) |
398 | 398 | : $_sType; |
399 | 399 | } |
400 | - return join(", ", $_aArguments ); |
|
400 | + return join( ", ", $_aArguments ); |
|
401 | 401 | } |
402 | 402 | /** |
403 | 403 | * @since 3.8.22 |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | */ |
408 | 408 | static private function ___getStackTraceArgument_string( $mArgument ) { |
409 | 409 | $_sString = self::___getLegibleString( $mArgument, 200, true ); |
410 | - return "'" . $_sString . "'"; |
|
410 | + return "'".$_sString."'"; |
|
411 | 411 | } |
412 | 412 | static private function ___getStackTraceArgument_scalar( $mArgument ) { |
413 | 413 | return $mArgument; |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | return 'NULL'; |
420 | 420 | } |
421 | 421 | static private function ___getStackTraceArgument_object( $mArgument ) { |
422 | - return 'Object(' . get_class( $mArgument ) . ')'; |
|
422 | + return 'Object('.get_class( $mArgument ).')'; |
|
423 | 423 | } |
424 | 424 | static private function ___getStackTraceArgument_resource( $mArgument ) { |
425 | 425 | return get_resource_type( $mArgument ); |
@@ -432,18 +432,18 @@ discard block |
||
432 | 432 | $_iMax = 10; |
433 | 433 | $_iTotal = count( $mArgument ); |
434 | 434 | $_iIndex = 0; |
435 | - foreach( $mArgument as $_sKey => $_mValue ) { |
|
435 | + foreach ( $mArgument as $_sKey => $_mValue ) { |
|
436 | 436 | $_iIndex++; |
437 | - $_mValue = is_scalar( $_mValue ) |
|
437 | + $_mValue = is_scalar( $_mValue ) |
|
438 | 438 | ? self::___getLegibleDetailedScalar( $_mValue, 100 ) |
439 | - : ucfirst( gettype( $_mValue ) ) . ( |
|
439 | + : ucfirst( gettype( $_mValue ) ).( |
|
440 | 440 | is_object( $_mValue ) |
441 | - ? ' (' . get_class( $_mValue ) . ')' |
|
441 | + ? ' ('.get_class( $_mValue ).')' |
|
442 | 442 | : '' |
443 | 443 | ); |
444 | - $_sOutput .= $_sKey . ': ' . $_mValue . ', '; |
|
444 | + $_sOutput .= $_sKey.': '.$_mValue.', '; |
|
445 | 445 | if ( $_iIndex > $_iMax && $_iTotal > $_iMax ) { |
446 | - $_sOutput = rtrim( $_sOutput, ',' ) . '...'; |
|
446 | + $_sOutput = rtrim( $_sOutput, ',' ).'...'; |
|
447 | 447 | break; |
448 | 448 | } |
449 | 449 | } |
@@ -282,7 +282,7 @@ |
||
282 | 282 | CSSRULES; |
283 | 283 | |
284 | 284 | } |
285 | - private function ___getForWP38OrBelow(){ |
|
285 | + private function ___getForWP38OrBelow() { |
|
286 | 286 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
287 | 287 | return ''; |
288 | 288 | } |
@@ -282,7 +282,7 @@ |
||
282 | 282 | CSSRULES; |
283 | 283 | |
284 | 284 | } |
285 | - private function ___getForWP38OrBelow(){ |
|
285 | + private function ___getForWP38OrBelow() { |
|
286 | 286 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
287 | 287 | return ''; |
288 | 288 | } |
@@ -76,21 +76,21 @@ |
||
76 | 76 | * @param string $sPriority The priority, either `high`, `core`, `default` or `low`. |
77 | 77 | * @param string $sCapability The capability. See <a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Roles and Capabilities</a>. |
78 | 78 | */ |
79 | - public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
79 | + public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
80 | 80 | |
81 | 81 | if ( empty( $asPageSlugs ) ) { |
82 | 82 | return; |
83 | 83 | } |
84 | 84 | |
85 | - if ( ! $this->_isInstantiatable() ) { |
|
85 | + if ( !$this->_isInstantiatable() ) { |
|
86 | 86 | return; |
87 | 87 | } |
88 | 88 | |
89 | 89 | // The property object needs to be done first before the parent constructor. |
90 | 90 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
91 | 91 | ? $this->aSubClassNames[ 'oProp' ] |
92 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
93 | - $this->oProp = new $_sPropertyClassName( |
|
92 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
93 | + $this->oProp = new $_sPropertyClassName( |
|
94 | 94 | $this, |
95 | 95 | get_class( $this ), |
96 | 96 | $sCapability, |