@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string The text domain. Default: `admin-page-framework`. |
46 | 46 | * @return void |
47 | 47 | */ |
48 | - function __construct( $asTaxonomySlug, $sOptionKey='', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
48 | + function __construct( $asTaxonomySlug, $sOptionKey = '', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
49 | 49 | |
50 | 50 | if ( empty( $asTaxonomySlug ) ) { |
51 | 51 | return; |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | // Properties |
55 | 55 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
56 | 56 | ? $this->aSubClassNames[ 'oProp' ] |
57 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
58 | - $this->oProp = new $_sPropertyClassName( |
|
57 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
58 | + $this->oProp = new $_sPropertyClassName( |
|
59 | 59 | $this, |
60 | 60 | get_class( $this ), |
61 | 61 | $sCapability, |
@@ -38,16 +38,16 @@ |
||
38 | 38 | * @since 3.7.4 Changed the default capability value to `read`. |
39 | 39 | * @todo Examine the appropriate default capability level. |
40 | 40 | */ |
41 | - public function __construct( $sCapability='read', $sTextDomain='admin-page-framework' ) { |
|
41 | + public function __construct( $sCapability = 'read', $sTextDomain = 'admin-page-framework' ) { |
|
42 | 42 | |
43 | 43 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
44 | 44 | ? $this->aSubClassNames[ 'oProp' ] |
45 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
45 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
46 | 46 | $this->oProp = new $_sPropertyClassName( |
47 | - $this, // the caller object |
|
48 | - get_class( $this ), // the caller class name |
|
49 | - $sCapability, // the capability level |
|
50 | - $sTextDomain, // the text domain |
|
47 | + $this, // the caller object |
|
48 | + get_class( $this ), // the caller class name |
|
49 | + $sCapability, // the capability level |
|
50 | + $sTextDomain, // the text domain |
|
51 | 51 | $this->_sStructureType // the structure type |
52 | 52 | ); |
53 | 53 |
@@ -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 | add_filter( 'admin_title', array( $this, '_replyToSetAdminPageTitleForTab' ), 1, 2 ); |
@@ -233,10 +233,10 @@ discard block |
||
233 | 233 | * @since 3.8.8 |
234 | 234 | * @return void |
235 | 235 | */ |
236 | - private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug='' ) { |
|
236 | + private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug = '' ) { |
|
237 | 237 | |
238 | 238 | // For the page, |
239 | - if ( ! strlen( $sTabSlug ) ) { |
|
239 | + if ( !strlen( $sTabSlug ) ) { |
|
240 | 240 | $this->oProp->bShowDebugInfo = $this->oUtil->getElement( |
241 | 241 | $this->oProp->aPages, |
242 | 242 | array( $sPageSlug, 'show_debug_info' ), |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | if ( substr( $sMethodName, strlen( 'load_pre_' ) ) !== $sPageSlug ) { |
282 | 282 | return false; |
283 | 283 | } |
284 | - if ( ! isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
284 | + if ( !isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
285 | 285 | return false; |
286 | 286 | } |
287 | 287 | $_sPageHook = is_object( $osScreenORPageHook ) |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | // Nothing to do in the network admin area. |
310 | - return ! is_network_admin(); |
|
310 | + return !is_network_admin(); |
|
311 | 311 | |
312 | 312 | } |
313 | 313 | |
@@ -322,13 +322,13 @@ discard block |
||
322 | 322 | */ |
323 | 323 | protected function _isInThePage() { |
324 | 324 | |
325 | - if ( ! $this->oProp->bIsAdmin ) { |
|
325 | + if ( !$this->oProp->bIsAdmin ) { |
|
326 | 326 | return false; |
327 | 327 | } |
328 | 328 | |
329 | 329 | // If the `setUp()` method is not loaded yet, nothing can be checked |
330 | 330 | // as there is not page is added. |
331 | - if ( ! did_action( 'set_up_' . $this->oProp->sClassName ) ) { |
|
331 | + if ( !did_action( 'set_up_'.$this->oProp->sClassName ) ) { |
|
332 | 332 | return true; |
333 | 333 | } |
334 | 334 |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $this->oProp->aInPageTabs, |
33 | 33 | array( $this->oProp->getCurrentPageSlug(), $this->oProp->getCurrentTabSlug(), 'title' ) |
34 | 34 | ); |
35 | - if ( ! $_sTabTitle ) { |
|
35 | + if ( !$_sTabTitle ) { |
|
36 | 36 | return $sAdminTitle; |
37 | 37 | } |
38 | - return $_sTabTitle . ' ‹ ' . $sAdminTitle; |
|
38 | + return $_sTabTitle.' ‹ '.$sAdminTitle; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @return void |
83 | 83 | * @internal |
84 | 84 | */ |
85 | - protected function _renderPage( $sPageSlug, $sTabSlug=null ) { |
|
85 | + protected function _renderPage( $sPageSlug, $sTabSlug = null ) { |
|
86 | 86 | $_oPageRenderer = new AdminPageFramework_View__PageRenderer( $this, $sPageSlug, $sTabSlug ); |
87 | 87 | $_oPageRenderer->render(); |
88 | 88 | } |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @param string $sTextDomain (optional) The text domain applied to the displayed text messages. Default: `admin-page-framework`. |
54 | 54 | * @return void |
55 | 55 | */ |
56 | - public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
|
56 | + public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID = array( 'post' ), $sContext = 'normal', $sPriority = 'default', $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework' ) { |
|
57 | 57 | |
58 | - if ( ! $this->_isInstantiatable() ) { |
|
58 | + if ( !$this->_isInstantiatable() ) { |
|
59 | 59 | return; |
60 | 60 | } |
61 | 61 | if ( empty( $asPostTypeOrScreenID ) ) { |
@@ -65,15 +65,15 @@ discard block |
||
65 | 65 | // A property object needs to be done first. |
66 | 66 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
67 | 67 | ? $this->aSubClassNames[ 'oProp' ] |
68 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
69 | - $this->oProp = new $_sPropertyClassName( |
|
68 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
69 | + $this->oProp = new $_sPropertyClassName( |
|
70 | 70 | $this, |
71 | 71 | get_class( $this ), |
72 | 72 | $sCapability, |
73 | 73 | $sTextDomain, |
74 | 74 | $this->_sStructureType |
75 | 75 | ); |
76 | - $this->oProp->aPostTypes = is_string( $asPostTypeOrScreenID ) |
|
76 | + $this->oProp->aPostTypes = is_string( $asPostTypeOrScreenID ) |
|
77 | 77 | ? array( $asPostTypeOrScreenID ) |
78 | 78 | : $asPostTypeOrScreenID; |
79 | 79 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string The text domain. Default: `admin-page-framework`. |
46 | 46 | * @return void |
47 | 47 | */ |
48 | - public function __construct( $asTaxonomySlug, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
48 | + public function __construct( $asTaxonomySlug, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
49 | 49 | |
50 | 50 | if ( empty( $asTaxonomySlug ) ) { |
51 | 51 | return; |
@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | // Properties |
55 | 55 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
56 | 56 | ? $this->aSubClassNames[ 'oProp' ] |
57 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
58 | - $this->oProp = new $_sPropertyClassName( |
|
57 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
58 | + $this->oProp = new $_sPropertyClassName( |
|
59 | 59 | $this, |
60 | 60 | get_class( $this ), |
61 | 61 | $sCapability, |
62 | 62 | $sTextDomain, |
63 | 63 | $this->_sStructureType |
64 | 64 | ); |
65 | - $this->oProp->aTaxonomySlugs = ( array ) $asTaxonomySlug; |
|
65 | + $this->oProp->aTaxonomySlugs = ( array ) $asTaxonomySlug; |
|
66 | 66 | |
67 | 67 | parent::__construct( $this->oProp ); |
68 | 68 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | if ( is_string( $_sCustomMenuSlug ) ) { |
30 | 30 | return $_sCustomMenuSlug; |
31 | 31 | } |
32 | - return 'edit.php?post_type=' . $sPostTypeSlug; |
|
32 | + return 'edit.php?post_type='.$sPostTypeSlug; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | static public function getWPAdminDirPath() { |
64 | 64 | |
65 | 65 | $_sWPAdminPath = str_replace( |
66 | - get_bloginfo( 'url' ) . '/', // search |
|
67 | - ABSPATH, // replace |
|
66 | + get_bloginfo( 'url' ).'/', // search |
|
67 | + ABSPATH, // replace |
|
68 | 68 | get_admin_url() // subject - works even in the network admin |
69 | 69 | ); |
70 | 70 | return rtrim( $_sWPAdminPath, '/' ); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @since 3.7.0 |
83 | 83 | * @return void |
84 | 84 | */ |
85 | - static public function goToLocalURL( $sURL, $oCallbackOnError=null ) { |
|
85 | + static public function goToLocalURL( $sURL, $oCallbackOnError = null ) { |
|
86 | 86 | self::redirectByType( $sURL, 1, $oCallbackOnError ); |
87 | 87 | } |
88 | 88 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @since 3.6.3 |
96 | 96 | * @since 3.7.0 Added the second callback parameter. |
97 | 97 | */ |
98 | - static public function goToURL( $sURL, $oCallbackOnError=null ) { |
|
98 | + static public function goToURL( $sURL, $oCallbackOnError = null ) { |
|
99 | 99 | self::redirectByType( $sURL, 0, $oCallbackOnError ); |
100 | 100 | } |
101 | 101 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param integer $iType 0: external site, 1: local site (within the same domain). |
106 | 106 | * @param callable $oCallbackOnError |
107 | 107 | */ |
108 | - static public function redirectByType( $sURL, $iType=0, $oCallbackOnError=null ) { |
|
108 | + static public function redirectByType( $sURL, $iType = 0, $oCallbackOnError = null ) { |
|
109 | 109 | |
110 | 110 | $_iRedirectError = self::getRedirectPreError( $sURL, $iType ); |
111 | 111 | if ( $_iRedirectError && is_callable( $oCallbackOnError ) ) { |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | static public function getRedirectPreError( $sURL, $iType ) { |
137 | 137 | |
138 | 138 | // check only external urls as local ones can be a relative url and always fails the below check. |
139 | - if ( ! $iType && filter_var( $sURL, FILTER_VALIDATE_URL) === false ) { |
|
139 | + if ( !$iType && filter_var( $sURL, FILTER_VALIDATE_URL ) === false ) { |
|
140 | 140 | return 1; |
141 | 141 | } |
142 | 142 | // If HTTP headers are already sent, redirect cannot be done. |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | $sPageURL = 'on' == @$_SERVER[ "HTTPS" ] ? "https://" : "http://"; |
30 | 30 | |
31 | 31 | if ( "80" != $_SERVER[ "SERVER_PORT" ] ) { |
32 | - $sPageURL .= $_SERVER[ "SERVER_NAME" ] . ":" . $_SERVER[ "SERVER_PORT" ] . $sRequestURI; |
|
32 | + $sPageURL .= $_SERVER[ "SERVER_NAME" ].":".$_SERVER[ "SERVER_PORT" ].$sRequestURI; |
|
33 | 33 | } else { |
34 | - $sPageURL .= $_SERVER[ "SERVER_NAME" ] . $sRequestURI; |
|
34 | + $sPageURL .= $_SERVER[ "SERVER_NAME" ].$sRequestURI; |
|
35 | 35 | } |
36 | 36 | return $sPageURL; |
37 | 37 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param string $sSubjectURL ( optional ) The subject url to modify |
49 | 49 | * @return string The modified url. |
50 | 50 | */ |
51 | - static public function getQueryAdminURL( $aAddingQueries=array(), $aRemovingQueryKeys=array(), $sSubjectURL='' ) { |
|
51 | + static public function getQueryAdminURL( $aAddingQueries = array(), $aRemovingQueryKeys = array(), $sSubjectURL = '' ) { |
|
52 | 52 | |
53 | 53 | $_sAdminURL = is_network_admin() |
54 | 54 | ? network_admin_url( AdminPageFramework_WPUtility_Page::getPageNow() ) |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $_oWPStyles = new WP_Styles(); // It doesn't matter whether the file is a style or not. Just use the built-in WordPress class to calculate the SRC URL. |
100 | 100 | $_sRelativePath = AdminPageFramework_Utility::getRelativePath( preg_replace( '/[\/\\\\]wp-content$/', '', rtrim( WP_CONTENT_DIR, '/\\' ) ), $sFilePath ); |
101 | 101 | $_sRelativePath = preg_replace( "/^\.[\/\\\]/", '', $_sRelativePath, 1 ); // removes the heading ./ or .\ |
102 | - $_sHref = trailingslashit( $_oWPStyles->base_url ) . $_sRelativePath; |
|
102 | + $_sHref = trailingslashit( $_oWPStyles->base_url ).$_sRelativePath; |
|
103 | 103 | unset( $_oWPStyles ); // for PHP 5.2.x or below |
104 | 104 | return $_sHref; |
105 | 105 | |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | * @param string $sSRC |
119 | 119 | * @param boolean $bReturnNullIfNotExist |
120 | 120 | */ |
121 | - static public function getResolvedSRC( $sSRC, $bReturnNullIfNotExist=false ) { |
|
121 | + static public function getResolvedSRC( $sSRC, $bReturnNullIfNotExist = false ) { |
|
122 | 122 | |
123 | - if ( ! self::isResourcePath( $sSRC ) ) { |
|
123 | + if ( !self::isResourcePath( $sSRC ) ) { |
|
124 | 124 | return $bReturnNullIfNotExist |
125 | 125 | ? null |
126 | 126 | : $sSRC; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | // If the file exists, it means it is an absolute path. If so, calculate the URL from the path. |
135 | 135 | if ( file_exists( realpath( $sSRC ) ) ) { |
136 | - return self::getSRCFromPath( $sSRC ); // url escaping is done in the method |
|
136 | + return self::getSRCFromPath( $sSRC ); // url escaping is done in the method |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | if ( $bReturnNullIfNotExist ) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @param boolean $bReturnNullIfNotExist |
151 | 151 | * @return string |
152 | 152 | */ |
153 | - static public function resolveSRC( $sSRC, $bReturnNullIfNotExist=false ) { |
|
153 | + static public function resolveSRC( $sSRC, $bReturnNullIfNotExist = false ) { |
|
154 | 154 | return self::getResolvedSRC( $sSRC, $bReturnNullIfNotExist ); |
155 | 155 | } |
156 | 156 |
@@ -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 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $_sCallerClass = self::___getCallerClassName( $_oCallerInfo, $iTrace ); |
38 | 38 | $_fCurrentTimeStamp = microtime( true ); |
39 | 39 | $_sLogContent = self::___getLogContents( $mValue, $_fCurrentTimeStamp, $_fPreviousTimeStamp, $_sCallerClass, $_sCallerFunction, $iStringLengthLimit, $iArrayDepthLimit ) |
40 | - . ( $bStackTrace ? self::getStackTrace($iTrace + 1 ) : '' ) |
|
40 | + . ( $bStackTrace ? self::getStackTrace( $iTrace + 1 ) : '' ) |
|
41 | 41 | . PHP_EOL; |
42 | 42 | |
43 | 43 | file_put_contents( self::___getLogFilePath( $sFilePath, $_sCallerClass ), $_sLogContent, FILE_APPEND ); |
@@ -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 |