@@ -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 |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @since 3.3.0 |
28 | 28 | */ |
29 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
29 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
30 | 30 | |
31 | 31 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
32 | 32 | ? $this->aSubClassNames[ 'oProp' ] |
33 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
33 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
34 | 34 | |
35 | 35 | $this->oProp = new $_sPropertyClassName( |
36 | 36 | $this, |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | // if ( $this->oProp->bIsAdminAjax ) { |
48 | 48 | // return; |
49 | 49 | // } |
50 | - if ( ! $this->oProp->bIsAdmin ) { |
|
50 | + if ( !$this->oProp->bIsAdmin ) { |
|
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
54 | 54 | add_action( 'wp_loaded', array( $this, '_replyToDetermineToLoad' ) ); |
55 | - add_action( 'set_up_' . $this->oProp->sClassName, array( $this, '_replyToLoadComponentsForAjax' ), 100 ); |
|
55 | + add_action( 'set_up_'.$this->oProp->sClassName, array( $this, '_replyToLoadComponentsForAjax' ), 100 ); |
|
56 | 56 | |
57 | 57 | } |
58 | 58 | |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | * @callback add_action set_up_{extended class name} |
65 | 65 | */ |
66 | 66 | public function _replyToLoadComponentsForAjax() { |
67 | - if ( ! $this->oProp->bIsAdminAjax ) { |
|
67 | + if ( !$this->oProp->bIsAdminAjax ) { |
|
68 | 68 | return; |
69 | 69 | } |
70 | 70 | |
71 | 71 | new AdminPageFramework_Model_Menu__RegisterMenu( $this, 'pseudo_admin_menu' ); |
72 | 72 | do_action( 'pseudo_admin_menu', '' ); |
73 | - do_action( 'pseudo_current_screen' ); // @deprecated 3.8.22 Kept for backward-compatibility |
|
73 | + do_action( 'pseudo_current_screen' ); // @deprecated 3.8.22 Kept for backward-compatibility |
|
74 | 74 | |
75 | 75 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
76 | 76 | if ( $this->oProp->isPageAdded( $_sPageSlug ) ) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @since 3.3.1 Moved from `AdminPageFramework_Base`. |
118 | 118 | * @internal |
119 | 119 | */ |
120 | - public function __call( $sMethodName, $aArgs=null ) { |
|
120 | + public function __call( $sMethodName, $aArgs = null ) { |
|
121 | 121 | |
122 | 122 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
123 | 123 | $_sTabSlug = $this->oProp->getCurrentTabSlug( $_sPageSlug ); |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | 'load_pre_', |
129 | 129 | ); |
130 | 130 | |
131 | - switch( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) { |
|
131 | + switch ( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) { |
|
132 | 132 | |
133 | 133 | // add_settings_section() callback |
134 | 134 | case 'section_pre_': |
135 | - return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting |
|
135 | + return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting |
|
136 | 136 | |
137 | 137 | // add_settings_field() callback |
138 | 138 | case 'field_pre_': |
139 | - return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting |
|
139 | + return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting |
|
140 | 140 | |
141 | 141 | // load-{page} callback |
142 | 142 | case 'load_pre_': |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | * @return string The found callback method name or the prefix of a known callback method name. An empty string if not found. |
155 | 155 | * @internal |
156 | 156 | */ |
157 | - private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes=array() ) { |
|
157 | + private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes = array() ) { |
|
158 | 158 | |
159 | - foreach( $aKnownMethodPrefixes as $_sMethodPrefix ) { |
|
159 | + foreach ( $aKnownMethodPrefixes as $_sMethodPrefix ) { |
|
160 | 160 | if ( $this->oUtil->hasPrefix( $_sMethodPrefix, $sMethodName ) ) { |
161 | 161 | return $_sMethodPrefix; |
162 | 162 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | protected function _doPageLoadCall( $sMethodName, $sPageSlug, $sTabSlug, $oScreen ) { |
182 | 182 | |
183 | - if ( ! $this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen ) ) { |
|
183 | + if ( !$this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen ) ) { |
|
184 | 184 | return; |
185 | 185 | } |
186 | 186 | |
@@ -204,10 +204,10 @@ discard block |
||
204 | 204 | // the tab slug will be empty unless an in-page tab is added. |
205 | 205 | $sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
206 | 206 | if ( strlen( $sTabSlug ) ) { |
207 | - $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
|
207 | + $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
|
208 | 208 | $this->oUtil->addAndDoActions( |
209 | 209 | $this, // the caller object |
210 | - array( "load_{$sPageSlug}_" . $sTabSlug ), |
|
210 | + array( "load_{$sPageSlug}_".$sTabSlug ), |
|
211 | 211 | $this // the admin page object - this lets third-party scripts use the framework methods. |
212 | 212 | ); |
213 | 213 | } |
@@ -232,10 +232,10 @@ discard block |
||
232 | 232 | * @since 3.8.8 |
233 | 233 | * @return void |
234 | 234 | */ |
235 | - private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug='' ) { |
|
235 | + private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug = '' ) { |
|
236 | 236 | |
237 | 237 | // For the page, |
238 | - if ( ! strlen( $sTabSlug ) ) { |
|
238 | + if ( !strlen( $sTabSlug ) ) { |
|
239 | 239 | $this->oProp->bShowDebugInfo = $this->oUtil->getElement( |
240 | 240 | $this->oProp->aPages, |
241 | 241 | array( $sPageSlug, 'show_debug_info' ), |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | if ( substr( $sMethodName, strlen( 'load_pre_' ) ) !== $sPageSlug ) { |
281 | 281 | return false; |
282 | 282 | } |
283 | - if ( ! isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
283 | + if ( !isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
284 | 284 | return false; |
285 | 285 | } |
286 | 286 | $_sPageHook = is_object( $osScreenORPageHook ) |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | } |
307 | 307 | |
308 | 308 | // Nothing to do in the network admin area. |
309 | - return ! is_network_admin(); |
|
309 | + return !is_network_admin(); |
|
310 | 310 | |
311 | 311 | } |
312 | 312 | |
@@ -321,13 +321,13 @@ discard block |
||
321 | 321 | */ |
322 | 322 | protected function _isInThePage() { |
323 | 323 | |
324 | - if ( ! $this->oProp->bIsAdmin ) { |
|
324 | + if ( !$this->oProp->bIsAdmin ) { |
|
325 | 325 | return false; |
326 | 326 | } |
327 | 327 | |
328 | 328 | // If the `setUp()` method is not loaded yet, nothing can be checked |
329 | 329 | // as there is not page is added. |
330 | - if ( ! did_action( 'set_up_' . $this->oProp->sClassName ) ) { |
|
330 | + if ( !did_action( 'set_up_'.$this->oProp->sClassName ) ) { |
|
331 | 331 | return true; |
332 | 332 | } |
333 | 333 |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | * @return void |
28 | 28 | * @since 3.8.8 |
29 | 29 | */ |
30 | - static public function showDeprecationNotice( $sDeprecated, $sAlternative='', $sProgramName='Admin Page Framework' ) { |
|
30 | + static public function showDeprecationNotice( $sDeprecated, $sAlternative = '', $sProgramName = 'Admin Page Framework' ) { |
|
31 | 31 | trigger_error( |
32 | - $sProgramName . ': ' . sprintf( |
|
32 | + $sProgramName.': '.sprintf( |
|
33 | 33 | $sAlternative |
34 | 34 | ? '<code>%1$s</code> has been deprecated. Use <code>%2$s</code> instead.' |
35 | 35 | : '<code>%1$s</code> has been deprecated.', |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | * @param string|array $asParameters Parameters to pass to the callback function. |
53 | 53 | * @return mixed |
54 | 54 | */ |
55 | - public function callBack( $oCallable, $asParameters=array() ) { |
|
56 | - $_aParameters = self::getAsArray( |
|
55 | + public function callBack( $oCallable, $asParameters = array() ) { |
|
56 | + $_aParameters = self::getAsArray( |
|
57 | 57 | $asParameters, |
58 | 58 | true // preserve empty |
59 | 59 | ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @since 3.6.3 |
91 | 91 | * @return string The captured output buffer. |
92 | 92 | */ |
93 | - static public function getOutputBuffer( $oCallable, array $aParameters=array() ) { |
|
93 | + static public function getOutputBuffer( $oCallable, array $aParameters = array() ) { |
|
94 | 94 | |
95 | 95 | ob_start(); |
96 | 96 | echo call_user_func_array( $oCallable, $aParameters ); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | $_iCount = count( get_object_vars( $oInstance ) ); |
113 | 113 | $_sClassName = get_class( $oInstance ); |
114 | - return '(object) ' . $_sClassName . ': ' . $_iCount . ' properties.'; |
|
114 | + return '(object) '.$_sClassName.': '.$_iCount.' properties.'; |
|
115 | 115 | |
116 | 116 | } |
117 | 117 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @param boolean|integer|double|string|array|object|resource|NULL $mTrue The value to return when the first parameter value yields false. |
129 | 129 | * @return mixed |
130 | 130 | */ |
131 | - static public function getAOrB( $mValue, $mTrue=null, $mFalse=null ) { |
|
131 | + static public function getAOrB( $mValue, $mTrue = null, $mFalse = null ) { |
|
132 | 132 | return $mValue ? $mTrue : $mFalse; |
133 | 133 | } |
134 | 134 |
@@ -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( new Exception, 0 ) |
|
52 | + ? $_sValueWithDetails.PHP_EOL.self::getStackTrace( new Exception, 0 ) |
|
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 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @deprecated 3.8.9 |
172 | 172 | */ |
173 | 173 | static public function getAsString( $mValue ) { |
174 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__ ); |
|
174 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__ ); |
|
175 | 175 | return self::_getLegible( $mValue ); |
176 | 176 | } |
177 | 177 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @since 3.8.9 |
29 | 29 | * @return void |
30 | 30 | **/ |
31 | - static protected function _log( $mValue, $sFilePath=null, $bStackTrace=false, $iTrace=0, $iStringLengthLimit=99999, $iArrayDepthLimit=50 ) { |
|
31 | + static protected function _log( $mValue, $sFilePath = null, $bStackTrace = false, $iTrace = 0, $iStringLengthLimit = 99999, $iArrayDepthLimit = 50 ) { |
|
32 | 32 | |
33 | 33 | static $_fPreviousTimeStamp = 0; |
34 | 34 | |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | round( $_fCurrentTimeStamp - $_fPreviousTimeStamp, 3 ), // elapsed time |
55 | 55 | $_sCallerClass, |
56 | 56 | $_sCallerFunction |
57 | - ) . PHP_EOL |
|
58 | - . self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) . PHP_EOL; |
|
57 | + ).PHP_EOL |
|
58 | + . self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit ).PHP_EOL; |
|
59 | 59 | } |
60 | 60 | /** |
61 | 61 | * @since 3.8.9 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | static private function ___getCallerFunctionName( $oCallerInfo, $iTrace ) { |
65 | 65 | return self::getElement( |
66 | - $oCallerInfo, // subject array |
|
66 | + $oCallerInfo, // subject array |
|
67 | 67 | array( 2 + $iTrace, 'function' ), // key |
68 | 68 | '' // default |
69 | 69 | ); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | static private function ___getCallerClassName( $oCallerInfo, $iTrace ) { |
76 | 76 | return self::getElement( |
77 | - $oCallerInfo, // subject array |
|
77 | + $oCallerInfo, // subject array |
|
78 | 78 | array( 2 + $iTrace, 'class' ), // key |
79 | 79 | '' // default |
80 | 80 | ); |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | */ |
90 | 90 | static private function ___getLogFilePath( $bsFilePathOrName, $sCallerClass ) { |
91 | 91 | |
92 | - $_sWPContentDir = WP_CONTENT_DIR . DIRECTORY_SEPARATOR; |
|
92 | + $_sWPContentDir = WP_CONTENT_DIR.DIRECTORY_SEPARATOR; |
|
93 | 93 | |
94 | 94 | // It is a partial file name |
95 | - if ( is_string( $bsFilePathOrName ) && ! self::hasSlash( $bsFilePathOrName ) ) { |
|
96 | - return $_sWPContentDir . $bsFilePathOrName . '_' . date( "Ymd" ) . '.log'; |
|
95 | + if ( is_string( $bsFilePathOrName ) && !self::hasSlash( $bsFilePathOrName ) ) { |
|
96 | + return $_sWPContentDir.$bsFilePathOrName.'_'.date( "Ymd" ).'.log'; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | // Try creating a file. |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | // Return a generated default log path. |
108 | 108 | $_sClassBaseName = $sCallerClass ? basename( $sCallerClass ) : basename( get_class() ); |
109 | - return $_sWPContentDir . $_sClassBaseName . '_' . date( "Ymd" ) . '.log'; |
|
109 | + return $_sWPContentDir.$_sClassBaseName.'_'.date( "Ymd" ).'.log'; |
|
110 | 110 | |
111 | 111 | } |
112 | 112 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @internal |
116 | 116 | */ |
117 | 117 | static private function ___createFile( $sFilePath ) { |
118 | - if ( ! $sFilePath || true === $sFilePath ) { |
|
118 | + if ( !$sFilePath || true === $sFilePath ) { |
|
119 | 119 | return false; |
120 | 120 | } |
121 | 121 | if ( file_exists( $sFilePath ) ) { |
@@ -137,11 +137,11 @@ discard block |
||
137 | 137 | $_nNow = $fCurrentTimeStamp + ( self::___getSiteGMTOffset() * 60 * 60 ); |
138 | 138 | $_nMicroseconds = str_pad( round( ( $_nNow - floor( $_nNow ) ) * 10000 ), 4, '0' ); |
139 | 139 | $_aOutput = array( |
140 | - date( "Y/m/d H:i:s", $_nNow ) . '.' . $_nMicroseconds, |
|
140 | + date( "Y/m/d H:i:s", $_nNow ).'.'.$_nMicroseconds, |
|
141 | 141 | self::___getFormattedElapsedTime( $nElapsed ), |
142 | 142 | self::___getPageLoadID(), |
143 | 143 | self::getFrameworkVersion(), |
144 | - $sCallerClass . '::' . $sCallerFunction, |
|
144 | + $sCallerClass.'::'.$sCallerFunction, |
|
145 | 145 | current_filter(), |
146 | 146 | self::getCurrentURL(), |
147 | 147 | ); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | static private function ___getSiteGMTOffset() { |
158 | 158 | static $_nGMTOffset; |
159 | - $_nGMTOffset = isset( $_nGMTOffset ) |
|
159 | + $_nGMTOffset = isset( $_nGMTOffset ) |
|
160 | 160 | ? $_nGMTOffset |
161 | 161 | : get_option( 'gmt_offset' ); |
162 | 162 | return $_nGMTOffset; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | static private function ___getPageLoadID() { |
169 | 169 | static $_sPageLoadID; |
170 | - $_sPageLoadID = $_sPageLoadID |
|
170 | + $_sPageLoadID = $_sPageLoadID |
|
171 | 171 | ? $_sPageLoadID |
172 | 172 | : uniqid(); |
173 | 173 | return $_sPageLoadID; |
@@ -191,15 +191,15 @@ discard block |
||
191 | 191 | 3, |
192 | 192 | '0' |
193 | 193 | ); |
194 | - $_sElapsed = self::getElement( |
|
195 | - $_aElapsedParts, // subject array |
|
196 | - 0, // key |
|
194 | + $_sElapsed = self::getElement( |
|
195 | + $_aElapsedParts, // subject array |
|
196 | + 0, // key |
|
197 | 197 | 0 // default |
198 | 198 | ); |
199 | - $_sElapsed = strlen( $_sElapsed ) > 1 |
|
200 | - ? '+' . substr( $_sElapsed, -1, 2 ) |
|
201 | - : ' ' . $_sElapsed; |
|
202 | - return $_sElapsed . '.' . $_sElapsedFloat; |
|
199 | + $_sElapsed = strlen( $_sElapsed ) > 1 |
|
200 | + ? '+'.substr( $_sElapsed, -1, 2 ) |
|
201 | + : ' '.$_sElapsed; |
|
202 | + return $_sElapsed.'.'.$_sElapsedFloat; |
|
203 | 203 | |
204 | 204 | } |
205 | 205 |
@@ -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 | } |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
18 | 18 | |
19 | - const VERSION = '3.8.22'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
19 | + const VERSION = '3.8.22'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
20 | 20 | const NAME = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing. |
21 | - const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
21 | + const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
22 | 22 | const DESCRIPTION = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.'; |
23 | 23 | const URI = 'http://admin-page-framework.michaeluno.jp/'; |
24 | 24 | const AUTHOR = 'miunosoft (Michael Uno)'; |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | * @remark This is also accessed from `uninstall.php` so do not remove. |
56 | 56 | * @remark Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added. |
57 | 57 | */ |
58 | - const TRANSIENT_PREFIX = 'APFL_'; |
|
58 | + const TRANSIENT_PREFIX = 'APFL_'; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * The hook slug used for the prefix of action and filter hook names. |
62 | 62 | * |
63 | 63 | * @remark The ending underscore is not necessary. |
64 | 64 | */ |
65 | - const HOOK_SLUG = 'admin_page_framework_loader'; |
|
65 | + const HOOK_SLUG = 'admin_page_framework_loader'; |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * The text domain slug and its path. |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | static public $aAdminPages = array( |
118 | 118 | // key => 'page slug' |
119 | - 'about' => 'apfl_about', // the welcome page |
|
119 | + 'about' => 'apfl_about', // the welcome page |
|
120 | 120 | 'addon' => 'apfl_addons', |
121 | 121 | 'tool' => 'apfl_tools', |
122 | 122 | 'help' => 'apfl_contact', |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | * @since 3.5.0 |
155 | 155 | * @return string |
156 | 156 | */ |
157 | - public static function getPluginURL( $sRelativePath='' ) { |
|
157 | + public static function getPluginURL( $sRelativePath = '' ) { |
|
158 | 158 | if ( isset( self::$_sPluginURLCache ) ) { |
159 | - return self::$_sPluginURLCache . $sRelativePath; |
|
159 | + return self::$_sPluginURLCache.$sRelativePath; |
|
160 | 160 | } |
161 | 161 | self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) ); |
162 | - return self::$_sPluginURLCache . $sRelativePath; |
|
162 | + return self::$_sPluginURLCache.$sRelativePath; |
|
163 | 163 | } |
164 | 164 | /** |
165 | 165 | * @since 3.7.9 |
@@ -189,13 +189,13 @@ discard block |
||
189 | 189 | * @since 3.5.0 |
190 | 190 | * @return void |
191 | 191 | */ |
192 | - static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) { |
|
193 | - if ( ! is_admin() ) { |
|
192 | + static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) { |
|
193 | + if ( !is_admin() ) { |
|
194 | 194 | return; |
195 | 195 | } |
196 | - self::$_aAdminNotices[] = array( |
|
196 | + self::$_aAdminNotices[ ] = array( |
|
197 | 197 | 'message' => $sMessage, |
198 | - 'class_attribute' => trim( $sClassAttribute ) . ' notice is-dismissible', |
|
198 | + 'class_attribute' => trim( $sClassAttribute ).' notice is-dismissible', |
|
199 | 199 | ); |
200 | 200 | add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) ); |
201 | 201 | } |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | * @return void |
206 | 206 | */ |
207 | 207 | static public function _replyToSetAdminNotice() { |
208 | - foreach( self::$_aAdminNotices as $_aAdminNotice ) { |
|
209 | - echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>" |
|
208 | + foreach ( self::$_aAdminNotices as $_aAdminNotice ) { |
|
209 | + echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>" |
|
210 | 210 | ."<p>" |
211 | 211 | . sprintf( |
212 | - '<strong>%1$s</strong>: ' . $_aAdminNotice['message'], |
|
213 | - self::NAME . ' ' . self::VERSION |
|
212 | + '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ], |
|
213 | + self::NAME.' '.self::VERSION |
|
214 | 214 | ) |
215 | 215 | . "</p>" |
216 | 216 | . "</div>"; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | AdminPageFrameworkLoader_Registry::setUp( __FILE__ ); |
223 | 223 | |
224 | 224 | // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file. |
225 | -if ( ! defined( 'ABSPATH' ) ) { |
|
225 | +if ( !defined( 'ABSPATH' ) ) { |
|
226 | 226 | return; |
227 | 227 | } |
228 | 228 | if ( defined( 'DOING_UNINSTALL' ) && DOING_UNINSTALL ) { |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | |
235 | 235 | $_bFrameworkLoaded = class_exists( 'AdminPageFramework_Registry', false ); |
236 | 236 | if ( |
237 | - ! $_bFrameworkLoaded |
|
238 | - || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
237 | + !$_bFrameworkLoaded |
|
238 | + || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
239 | 239 | || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' ) |
240 | 240 | ) { |
241 | 241 | AdminPageFrameworkLoader_Registry::setAdminNotice( |
@@ -253,18 +253,18 @@ discard block |
||
253 | 253 | add_action( 'admin_init', 'AdminPageFrameworkLoader_Warning' ); |
254 | 254 | |
255 | 255 | // Include the library file - the development version will be available if you cloned the GitHub repository. |
256 | -$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/development/admin-page-framework.php'; |
|
256 | +$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/development/admin-page-framework.php'; |
|
257 | 257 | $_bDebugMode = defined( 'WP_DEBUG' ) && WP_DEBUG; |
258 | 258 | $_bLoadDevelopmentVersion = $_bDebugMode && file_exists( $_sDevelopmentVersionPath ); |
259 | 259 | include( |
260 | 260 | $_bLoadDevelopmentVersion |
261 | 261 | ? $_sDevelopmentVersionPath |
262 | - : AdminPageFrameworkLoader_Registry::$sDirPath . '/library/apf/admin-page-framework.php' |
|
262 | + : AdminPageFrameworkLoader_Registry::$sDirPath.'/library/apf/admin-page-framework.php' |
|
263 | 263 | ); |
264 | 264 | |
265 | 265 | // Include the framework loader plugin components. |
266 | 266 | include( AdminPageFramework_Registry::$aClassFiles[ 'AdminPageFramework_PluginBootstrap' ] ); |
267 | -include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
267 | +include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
268 | 268 | new AdminPageFrameworkLoader_Bootstrap( |
269 | 269 | AdminPageFrameworkLoader_Registry::$sFilePath, |
270 | 270 | AdminPageFrameworkLoader_Registry::HOOK_SLUG // hook prefix |