@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * @return void |
29 | 29 | * @since 3.8.8 |
30 | 30 | */ |
31 | - static public function showDeprecationNotice( $sDeprecated, $sAlternative='', $sProgramName='Admin Page Framework' ) { |
|
31 | + static public function showDeprecationNotice( $sDeprecated, $sAlternative = '', $sProgramName = 'Admin Page Framework' ) { |
|
32 | 32 | trigger_error( |
33 | - $sProgramName . ': ' . sprintf( |
|
33 | + $sProgramName.': '.sprintf( |
|
34 | 34 | $sAlternative |
35 | 35 | ? '<code>%1$s</code> has been deprecated. Use <code>%2$s</code> instead.' |
36 | 36 | : '<code>%1$s</code> has been deprecated.', |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | * @param callable $oCallable |
53 | 53 | * @param string|array $asParameters Parameters to pass to the callback function. |
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 | ); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @since 3.6.3 |
90 | 90 | * @return string The captured output buffer. |
91 | 91 | */ |
92 | - static public function getOutputBuffer( $oCallable, array $aParameters=array() ) { |
|
92 | + static public function getOutputBuffer( $oCallable, array $aParameters = array() ) { |
|
93 | 93 | |
94 | 94 | ob_start(); |
95 | 95 | echo call_user_func_array( $oCallable, $aParameters ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $_iCount = count( get_object_vars( $oInstance ) ); |
112 | 112 | $_sClassName = get_class( $oInstance ); |
113 | - return '(object) ' . $_sClassName . ': ' . $_iCount . ' properties.'; |
|
113 | + return '(object) '.$_sClassName.': '.$_iCount.' properties.'; |
|
114 | 114 | |
115 | 115 | } |
116 | 116 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @param boolean|integer|double|string|array|object|resource|NULL $mTrue The value to return when the first parameter value yields false. |
128 | 128 | * @return mixed |
129 | 129 | */ |
130 | - static public function getAOrB( $mValue, $mTrue=null, $mFalse=null ) { |
|
130 | + static public function getAOrB( $mValue, $mTrue = null, $mFalse = null ) { |
|
131 | 131 | return $mValue ? $mTrue : $mFalse; |
132 | 132 | } |
133 | 133 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @deprecated 3.8.0 Use `getLengthSanitized()` instead. |
32 | 32 | * @since 3.8.8 Moved from `AdminPageFramework_Utility_String`. |
33 | 33 | */ |
34 | - static public function sanitizeLength( $sLength, $sUnit='px' ) { |
|
34 | + static public function sanitizeLength( $sLength, $sUnit = 'px' ) { |
|
35 | 35 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getLengthSanitized()' ); |
36 | 36 | return AdminPageFramework_Utility_String::getLengthSanitized( $sLength, $sUnit ); |
37 | 37 | } |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | * @since 3.5.3 Moved from `AdminPageFramework_Utility_Array`. |
51 | 51 | * @deprecated 3.5.3 Use `getElement()`. |
52 | 52 | */ |
53 | - public static function getCorrespondingArrayValue( $vSubject, $sKey, $sDefault='', $bBlankToDefault=false ) { |
|
53 | + public static function getCorrespondingArrayValue( $vSubject, $sKey, $sDefault = '', $bBlankToDefault = false ) { |
|
54 | 54 | |
55 | 55 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getElement()' ); |
56 | 56 | |
57 | 57 | // If $vSubject is null, |
58 | - if ( ! isset( $vSubject ) ) { |
|
58 | + if ( !isset( $vSubject ) ) { |
|
59 | 59 | return $sDefault; |
60 | 60 | } |
61 | 61 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | // If $vSubject is not an array, |
68 | - if ( ! is_array( $vSubject ) ) { |
|
68 | + if ( !is_array( $vSubject ) ) { |
|
69 | 69 | return ( string ) $vSubject; |
70 | 70 | } // consider it as string. |
71 | 71 | |
@@ -116,11 +116,11 @@ discard block |
||
116 | 116 | * @since 3.5.3 Moved from `AdminPageFramework_FieldType_Base`. |
117 | 117 | * @deprecated 3.5.3 Use the `getElement()` method. |
118 | 118 | */ |
119 | - protected function getFieldElementByKey( $asElement, $sKey, $asDefault='' ) { |
|
119 | + protected function getFieldElementByKey( $asElement, $sKey, $asDefault = '' ) { |
|
120 | 120 | |
121 | 121 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getElement()' ); |
122 | 122 | |
123 | - if ( ! is_array( $asElement ) || ! isset( $sKey ) ) { |
|
123 | + if ( !is_array( $asElement ) || !isset( $sKey ) ) { |
|
124 | 124 | return $asElement; |
125 | 125 | } |
126 | 126 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__ ); |
145 | 145 | |
146 | - foreach( $aArray as &$vElem ) { |
|
146 | + foreach ( $aArray as &$vElem ) { |
|
147 | 147 | |
148 | 148 | if ( $vElem ) { break; } |
149 | 149 | unset( $vElem ); |
@@ -177,15 +177,15 @@ discard block |
||
177 | 177 | |
178 | 178 | AdminPageFramework_Utility::showDeprecationNotice( __METHOD__, 'AdminPageFramework_WPUtility::getAttributes()' ); |
179 | 179 | |
180 | - $_sQuoteCharactor ="'"; |
|
180 | + $_sQuoteCharactor = "'"; |
|
181 | 181 | $_aOutput = array(); |
182 | - foreach( $aAttributes as $sAttribute => $sProperty ) { |
|
182 | + foreach ( $aAttributes as $sAttribute => $sProperty ) { |
|
183 | 183 | |
184 | 184 | // Must be resolved as a string. |
185 | 185 | if ( in_array( gettype( $sProperty ), array( 'array', 'object' ) ) ) { |
186 | 186 | continue; |
187 | 187 | } |
188 | - $_aOutput[] = "{$sAttribute}={$_sQuoteCharactor}{$sProperty}{$_sQuoteCharactor}"; |
|
188 | + $_aOutput[ ] = "{$sAttribute}={$_sQuoteCharactor}{$sProperty}{$_sQuoteCharactor}"; |
|
189 | 189 | |
190 | 190 | } |
191 | 191 | return implode( ' ', $_aOutput ); |
@@ -50,27 +50,27 @@ |
||
50 | 50 | * @since 3.5.3 Moved from `AdminPageFramework_Utility_Array`. |
51 | 51 | * @deprecated 3.5.3 Use `getElement()`. |
52 | 52 | */ |
53 | - public static function getCorrespondingArrayValue( $vSubject, $sKey, $sDefault='', $bBlankToDefault=false ) { |
|
53 | + public static function getCorrespondingArrayValue( $vSubject, $sKey, $sDefault='', $bBlankToDefault=false ) { |
|
54 | 54 | |
55 | 55 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getElement()' ); |
56 | 56 | |
57 | 57 | // If $vSubject is null, |
58 | - if ( ! isset( $vSubject ) ) { |
|
58 | + if ( ! isset( $vSubject ) ) { |
|
59 | 59 | return $sDefault; |
60 | 60 | } |
61 | 61 | |
62 | 62 | // If the $bBlankToDefault flag is set and the subject value is a blank string, return the default value. |
63 | - if ( $bBlankToDefault && $vSubject == '' ) { |
|
63 | + if ( $bBlankToDefault && $vSubject == '' ) { |
|
64 | 64 | return $sDefault; |
65 | 65 | } |
66 | 66 | |
67 | 67 | // If $vSubject is not an array, |
68 | - if ( ! is_array( $vSubject ) ) { |
|
68 | + if ( ! is_array( $vSubject ) ) { |
|
69 | 69 | return ( string ) $vSubject; |
70 | 70 | } // consider it as string. |
71 | 71 | |
72 | 72 | // Consider $vSubject as array. |
73 | - if ( isset( $vSubject[ $sKey ] ) ) { |
|
73 | + if ( isset( $vSubject[ $sKey ] ) ) { |
|
74 | 74 | return $vSubject[ $sKey ]; |
75 | 75 | } |
76 | 76 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @since 3.8.8 |
24 | 24 | * @return void |
25 | 25 | */ |
26 | - static public function showDeprecationNotice( $sDeprecated, $sAlternative='', $sProgramName='' ) { |
|
26 | + static public function showDeprecationNotice( $sDeprecated, $sAlternative = '', $sProgramName = '' ) { |
|
27 | 27 | $sProgramName = $sProgramName ? $sProgramName : self::getFrameworkName(); |
28 | 28 | parent::showDeprecationNotice( $sDeprecated, $sAlternative, $sProgramName ); |
29 | 29 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | return; |
43 | 43 | } |
44 | 44 | |
45 | - foreach( ( array ) $GLOBALS[ '_apf_sub_menus_to_sort' ] as $_sIndex => $_sMenuSlug ) { |
|
46 | - if ( ! isset( $GLOBALS[ 'submenu' ][ $_sMenuSlug ] ) ) { |
|
45 | + foreach ( ( array ) $GLOBALS[ '_apf_sub_menus_to_sort' ] as $_sIndex => $_sMenuSlug ) { |
|
46 | + if ( !isset( $GLOBALS[ 'submenu' ][ $_sMenuSlug ] ) ) { |
|
47 | 47 | continue; |
48 | 48 | } |
49 | 49 | ksort( $GLOBALS[ 'submenu' ][ $_sMenuSlug ] ); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param boolean $bTrimDevVer Whether the `.dev` suffix should be removed or not. |
69 | 69 | * @return string |
70 | 70 | */ |
71 | - static public function getFrameworkVersion( $bTrimDevVer=false ) { |
|
71 | + static public function getFrameworkVersion( $bTrimDevVer = false ) { |
|
72 | 72 | $_sVersion = AdminPageFramework_Registry::getVersion(); |
73 | 73 | return $bTrimDevVer |
74 | 74 | ? self::getSuffixRemoved( $_sVersion, '.dev' ) |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @return string |
97 | 97 | */ |
98 | 98 | static public function getFrameworkNameVersion() { |
99 | - return self::getFrameworkName() . ' ' . self::getFrameworkVersion(); |
|
99 | + return self::getFrameworkName().' '.self::getFrameworkVersion(); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @since 3.3.1 Moved from `AdminPageFramework_Base`. |
94 | 94 | * @internal |
95 | 95 | */ |
96 | - public function __call( $sMethodName, $aArgs=null ) { |
|
96 | + public function __call( $sMethodName, $aArgs=null ) { |
|
97 | 97 | |
98 | 98 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
99 | 99 | $_sTabSlug = $this->oProp->getCurrentTabSlug( $_sPageSlug ); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | // Note that the if the tab is the first item, and the user arrives the page by clicking on the sidebar menu, the tab slug will be empty unless an in-page tab is added. |
183 | 183 | $sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
184 | 184 | |
185 | - if ( strlen( $sTabSlug ) ) { |
|
185 | + if ( strlen( $sTabSlug ) ) { |
|
186 | 186 | $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
187 | 187 | $this->oUtil->addAndDoActions( |
188 | 188 | $this, // the caller object |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | return true; |
306 | 306 | } |
307 | 307 | |
308 | - if ( ! isset( $_GET[ 'page' ] ) ) { |
|
308 | + if ( ! isset( $_GET[ 'page' ] ) ) { |
|
309 | 309 | return false; |
310 | 310 | } |
311 | 311 |
@@ -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 | $_sProprtyClassName = 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 $_sProprtyClassName( |
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,7 +64,7 @@ discard block |
||
64 | 64 | * @callback add_action wp_loaded |
65 | 65 | */ |
66 | 66 | public function _replyToLoadComponentsForAjax() { |
67 | - if ( ! $this->oProp->bIsAdminAjax ) { |
|
67 | + if ( !$this->oProp->bIsAdminAjax ) { |
|
68 | 68 | return; |
69 | 69 | } |
70 | 70 | new AdminPageFramework_Model_Menu__RegisterMenu( $this, 'pseudo_admin_menu' ); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @since 3.3.1 Moved from `AdminPageFramework_Base`. |
112 | 112 | * @internal |
113 | 113 | */ |
114 | - public function __call( $sMethodName, $aArgs=null ) { |
|
114 | + public function __call( $sMethodName, $aArgs = null ) { |
|
115 | 115 | |
116 | 116 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
117 | 117 | $_sTabSlug = $this->oProp->getCurrentTabSlug( $_sPageSlug ); |
@@ -122,15 +122,15 @@ discard block |
||
122 | 122 | 'load_pre_', |
123 | 123 | ); |
124 | 124 | |
125 | - switch( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) { |
|
125 | + switch ( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) { |
|
126 | 126 | |
127 | 127 | // add_settings_section() callback |
128 | 128 | case 'section_pre_': |
129 | - return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting |
|
129 | + return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting |
|
130 | 130 | |
131 | 131 | // add_settings_field() callback |
132 | 132 | case 'field_pre_': |
133 | - return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting |
|
133 | + return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting |
|
134 | 134 | |
135 | 135 | // load-{page} callback |
136 | 136 | case 'load_pre_': |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | * @return string The found callback method name or the prefix of a known callback method name. An empty string if not found. |
149 | 149 | * @internal |
150 | 150 | */ |
151 | - private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes=array() ) { |
|
151 | + private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes = array() ) { |
|
152 | 152 | |
153 | - foreach( $aKnownMethodPrefixes as $_sMethodPrefix ) { |
|
153 | + foreach ( $aKnownMethodPrefixes as $_sMethodPrefix ) { |
|
154 | 154 | if ( $this->oUtil->hasPrefix( $_sMethodPrefix, $sMethodName ) ) { |
155 | 155 | return $_sMethodPrefix; |
156 | 156 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | protected function _doPageLoadCall( $sMethodName, $sPageSlug, $sTabSlug, $oScreen ) { |
176 | 176 | |
177 | - if ( ! $this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen ) ) { |
|
177 | + if ( !$this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen ) ) { |
|
178 | 178 | return; |
179 | 179 | } |
180 | 180 | |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | // the tab slug will be empty unless an in-page tab is added. |
199 | 199 | $sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
200 | 200 | if ( strlen( $sTabSlug ) ) { |
201 | - $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
|
201 | + $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
|
202 | 202 | $this->oUtil->addAndDoActions( |
203 | 203 | $this, // the caller object |
204 | - array( "load_{$sPageSlug}_" . $sTabSlug ), |
|
204 | + array( "load_{$sPageSlug}_".$sTabSlug ), |
|
205 | 205 | $this // the admin page object - this lets third-party scripts use the framework methods. |
206 | 206 | ); |
207 | 207 | } |
@@ -226,10 +226,10 @@ discard block |
||
226 | 226 | * @since 3.8.8 |
227 | 227 | * @return void |
228 | 228 | */ |
229 | - private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug='' ) { |
|
229 | + private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug = '' ) { |
|
230 | 230 | |
231 | 231 | // For the page, |
232 | - if ( ! strlen( $sTabSlug ) ) { |
|
232 | + if ( !strlen( $sTabSlug ) ) { |
|
233 | 233 | $this->oProp->bShowDebugInfo = $this->oUtil->getElement( |
234 | 234 | $this->oProp->aPages, |
235 | 235 | array( $sPageSlug, 'show_debug_info' ), |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | if ( substr( $sMethodName, strlen( 'load_pre_' ) ) !== $sPageSlug ) { |
275 | 275 | return false; |
276 | 276 | } |
277 | - if ( ! isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
277 | + if ( !isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
278 | 278 | return false; |
279 | 279 | } |
280 | 280 | $_sPageHook = is_object( $osScreenORPageHook ) |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | // } |
303 | 303 | |
304 | 304 | // Nothing to do in the network admin area. |
305 | - return ! is_network_admin(); |
|
305 | + return !is_network_admin(); |
|
306 | 306 | |
307 | 307 | } |
308 | 308 | |
@@ -323,11 +323,11 @@ discard block |
||
323 | 323 | } |
324 | 324 | |
325 | 325 | // If the setUp method is not loaded yet, |
326 | - if ( ! did_action( 'set_up_' . $this->oProp->sClassName ) ) { |
|
326 | + if ( !did_action( 'set_up_'.$this->oProp->sClassName ) ) { |
|
327 | 327 | return true; |
328 | 328 | } |
329 | 329 | |
330 | - if ( ! isset( $_GET[ 'page' ] ) ) { |
|
330 | + if ( !isset( $_GET[ 'page' ] ) ) { |
|
331 | 331 | return false; |
332 | 332 | } |
333 | 333 |
@@ -31,15 +31,15 @@ |
||
31 | 31 | 'page_slug' => null, |
32 | 32 | 'tab_slug' => null, |
33 | 33 | 'title' => null, |
34 | - 'order' => 10, // (integer) |
|
35 | - 'show_in_page_tab' => true, // 3.6.0+ (boolean) |
|
36 | - 'parent_tab_slug' => null, // this needs to be set if the above show_in_page_tab is false so that the framework can mark the parent tab to be active when the hidden page is accessed. |
|
37 | - 'url' => null, // 3.5.0+ This allows the user set custom link. |
|
38 | - 'disabled' => null, // 3.5.10+ (boolean) If true, the link will be unlinked. |
|
39 | - 'attributes' => null, // 3.5.10+ (array) Applies to the navigation tab bar element. |
|
40 | - 'capability' => null, // 3.6.0+ (string) |
|
41 | - 'if' => true, // 3.6.0+ (boolean) |
|
42 | - 'show_debug_info' => null, // 3.8.8+ (boolean, optional) Whether to show debug information. If not set, the existent `bShowDebugInfo` property value will be used. The initial value here is `null` as the default value will be assigned in the formatting method. |
|
34 | + 'order' => 10, // (integer) |
|
35 | + 'show_in_page_tab' => true, // 3.6.0+ (boolean) |
|
36 | + 'parent_tab_slug' => null, // this needs to be set if the above show_in_page_tab is false so that the framework can mark the parent tab to be active when the hidden page is accessed. |
|
37 | + 'url' => null, // 3.5.0+ This allows the user set custom link. |
|
38 | + 'disabled' => null, // 3.5.10+ (boolean) If true, the link will be unlinked. |
|
39 | + 'attributes' => null, // 3.5.10+ (array) Applies to the navigation tab bar element. |
|
40 | + 'capability' => null, // 3.6.0+ (string) |
|
41 | + 'if' => true, // 3.6.0+ (boolean) |
|
42 | + 'show_debug_info' => null, // 3.8.8+ (boolean, optional) Whether to show debug information. If not set, the existent `bShowDebugInfo` property value will be used. The initial value here is `null` as the default value will be assigned in the formatting method. |
|
43 | 43 | ); |
44 | 44 | |
45 | 45 | /** |
@@ -24,12 +24,12 @@ |
||
24 | 24 | * @since 3.0.0 |
25 | 25 | * @deprecated 3.7.0 Use `AdminPageFramework_PageMetaBox` instead. |
26 | 26 | */ |
27 | - public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
27 | + public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
28 | 28 | |
29 | 29 | parent::__construct( $sMetaBoxID, $sTitle, $asPageSlugs, $sContext, $sPriority, $sCapability, $sTextDomain ); |
30 | 30 | |
31 | 31 | $this->oUtil->showDeprecationNotice( |
32 | - 'The class, ' . __CLASS__ . ',', // deprecated item |
|
32 | + 'The class, '.__CLASS__.',', // deprecated item |
|
33 | 33 | 'AdminPageFramework_PageMetaBox' // alternative |
34 | 34 | ); |
35 | 35 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | * @since 3.8.9 |
43 | 43 | * @return string |
44 | 44 | */ |
45 | - static public function getDetails( $mValue, $bEscape=true ) { |
|
45 | + static public function getDetails( $mValue, $bEscape=true ) { |
|
46 | 46 | $_sValueWithDetails = self::_getArrayRepresentationSanitized( |
47 | 47 | self::_getLegibleDetails( $mValue ) |
48 | 48 | ); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param string $sFilePath The file path for a log file. |
34 | 34 | * @return void |
35 | 35 | */ |
36 | - static public function dump( $asArray, $sFilePath=null ) { |
|
36 | + static public function dump( $asArray, $sFilePath = null ) { |
|
37 | 37 | echo self::get( $asArray, $sFilePath ); |
38 | 38 | } |
39 | 39 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @since 3.8.9 |
43 | 43 | * @return string |
44 | 44 | */ |
45 | - static public function getDetails( $mValue, $bEscape=true ) { |
|
45 | + static public function getDetails( $mValue, $bEscape = true ) { |
|
46 | 46 | $_sValueWithDetails = self::_getArrayRepresentationSanitized( |
47 | 47 | self::_getLegibleDetails( $mValue ) |
48 | 48 | ); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @param string $sFilePath The file path for a log file. |
65 | 65 | * @param boolean $bEscape Whether to escape characters. |
66 | 66 | */ |
67 | - static public function get( $asArray, $sFilePath=null, $bEscape=true ) { |
|
67 | + static public function get( $asArray, $sFilePath = null, $bEscape = true ) { |
|
68 | 68 | |
69 | 69 | if ( $sFilePath ) { |
70 | 70 | self::log( $asArray, $sFilePath ); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @param string $sFilePath The log file path. |
97 | 97 | * @return void |
98 | 98 | **/ |
99 | - static public function log( $mValue, $sFilePath=null ) { |
|
99 | + static public function log( $mValue, $sFilePath = null ) { |
|
100 | 100 | self::_log( $mValue, $sFilePath ); |
101 | 101 | } |
102 | 102 | |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | * @since unknown |
111 | 111 | * @deprecated 3.2.0 |
112 | 112 | */ |
113 | - static public function dumpArray( $asArray, $sFilePath=null ) { |
|
114 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::dump()' ); |
|
113 | + static public function dumpArray( $asArray, $sFilePath = null ) { |
|
114 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::dump()' ); |
|
115 | 115 | AdminPageFramework_Debug::dump( $asArray, $sFilePath ); |
116 | 116 | } |
117 | 117 | |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | * @since 3.0.0 Changed the $bEncloseInTag parameter to bEscape. |
125 | 125 | * @deprecated 3.2.0 |
126 | 126 | */ |
127 | - static public function getArray( $asArray, $sFilePath=null, $bEscape=true ) { |
|
128 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::get()' ); |
|
127 | + static public function getArray( $asArray, $sFilePath = null, $bEscape = true ) { |
|
128 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::get()' ); |
|
129 | 129 | return AdminPageFramework_Debug::get( $asArray, $sFilePath, $bEscape ); |
130 | 130 | } |
131 | 131 | |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | * @since 3.0.3 Changed the default log location and file name. |
137 | 137 | * @deprecated 3.1.0 Use the `log()` method instead. |
138 | 138 | */ |
139 | - static public function logArray( $asArray, $sFilePath=null ) { |
|
140 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::log()' ); |
|
139 | + static public function logArray( $asArray, $sFilePath = null ) { |
|
140 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::log()' ); |
|
141 | 141 | AdminPageFramework_Debug::log( $asArray, $sFilePath ); |
142 | 142 | } |
143 | 143 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @deprecated 3.8.9 |
151 | 151 | */ |
152 | 152 | static public function getAsString( $mValue ) { |
153 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__ ); |
|
153 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__ ); |
|
154 | 154 | return self::_getLegible( $mValue ); |
155 | 155 | } |
156 | 156 |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | * @since 3.8.9 |
23 | 23 | * @return string |
24 | 24 | */ |
25 | - static protected function _getLegibleDetails( $mValue ) { |
|
26 | - if ( is_array( $mValue ) ) { |
|
25 | + static protected function _getLegibleDetails( $mValue ) { |
|
26 | + if ( is_array( $mValue ) ) { |
|
27 | 27 | return '(array, length: ' . count( $mValue ).') ' |
28 | 28 | . print_r( self::_getLegibleArray( $mValue ) , true ); |
29 | 29 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * @return mixed A modified value. |
263 | 263 | * @since 3.8.9 |
264 | 264 | */ |
265 | - static private function _getArrayMappedNested( $mItem ) { |
|
265 | + static private function _getArrayMappedNested( $mItem ) { |
|
266 | 266 | return is_array( $mItem ) |
267 | 267 | ? array_map( array( __CLASS__, '_getArrayMappedNested' ), $mItem ) |
268 | 268 | : call_user_func( self::$_oCurrentCallableForArrayMapRecursive, $mItem ); |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | */ |
27 | 27 | static protected function _getLegibleDetails( $mValue ) { |
28 | 28 | if ( is_array( $mValue ) ) { |
29 | - return '(array, length: ' . count( $mValue ).') ' |
|
30 | - . print_r( self::_getLegibleArray( $mValue ) , true ); |
|
29 | + return '(array, length: '.count( $mValue ).') ' |
|
30 | + . print_r( self::_getLegibleArray( $mValue ), true ); |
|
31 | 31 | } |
32 | 32 | return print_r( self::_getLegibleValue( $mValue ), true ); |
33 | 33 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | static private function _getObjectName( $mItem ) { |
65 | 65 | if ( is_object( $mItem ) ) { |
66 | - return '(object) ' . get_class( $mItem ); |
|
66 | + return '(object) '.get_class( $mItem ); |
|
67 | 67 | } |
68 | 68 | return $mItem; |
69 | 69 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @return string |
75 | 75 | */ |
76 | 76 | static private function _getLegibleCallable( $asoCallable ) { |
77 | - return '(callable) ' . self::_getCallableName( $asoCallable ); |
|
77 | + return '(callable) '.self::_getCallableName( $asoCallable ); |
|
78 | 78 | } |
79 | 79 | /** |
80 | 80 | * @since 3.8.9 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | ? get_class( $asoCallable[ 0 ] ) |
94 | 94 | : ( string ) $asoCallable[ 0 ]; |
95 | 95 | |
96 | - return $_sSubject . '::' . ( string ) $asoCallable[ 1 ]; |
|
96 | + return $_sSubject.'::'.( string ) $asoCallable[ 1 ]; |
|
97 | 97 | |
98 | 98 | } |
99 | 99 | |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | if ( method_exists( $oObject, '__toString' ) ) { |
108 | 108 | return ( string ) $oObject; |
109 | 109 | } |
110 | - return '(object) ' . get_class( $oObject ) . ' ' |
|
111 | - . count( get_object_vars( $oObject ) ) . ' properties.'; |
|
110 | + return '(object) '.get_class( $oObject ).' ' |
|
111 | + . count( get_object_vars( $oObject ) ).' properties.'; |
|
112 | 112 | |
113 | 113 | } |
114 | 114 | /** |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | return '(null)'; |
147 | 147 | } |
148 | 148 | if ( is_object( $mNonScalar ) ) { |
149 | - return '(' . $_sType . ') ' . get_class( $mNonScalar ); |
|
149 | + return '('.$_sType.') '.get_class( $mNonScalar ); |
|
150 | 150 | } |
151 | 151 | if ( is_array( $mNonScalar ) ) { |
152 | - return '(' . $_sType . ') ' . count( $mNonScalar ) . ' elements'; |
|
152 | + return '('.$_sType.') '.count( $mNonScalar ).' elements'; |
|
153 | 153 | } |
154 | - return '(' . $_sType . ') ' . ( string ) $mNonScalar; |
|
154 | + return '('.$_sType.') '.( string ) $mNonScalar; |
|
155 | 155 | |
156 | 156 | } |
157 | 157 | /** |
@@ -161,11 +161,11 @@ discard block |
||
161 | 161 | */ |
162 | 162 | static private function _getLegibleScalar( $sScalar ) { |
163 | 163 | if ( is_bool( $sScalar ) ) { |
164 | - return '(boolean) ' . ( $sScalar ? 'true' : 'false' ); |
|
164 | + return '(boolean) '.( $sScalar ? 'true' : 'false' ); |
|
165 | 165 | } |
166 | 166 | return is_string( $sScalar ) |
167 | 167 | ? self::_getLegibleString( $sScalar ) |
168 | - : '(' . gettype( $sScalar ) . ', length: ' . self::_getValueLength( $sScalar ) . ') ' . $sScalar; |
|
168 | + : '('.gettype( $sScalar ).', length: '.self::_getValueLength( $sScalar ).') '.$sScalar; |
|
169 | 169 | } |
170 | 170 | /** |
171 | 171 | * Returns a length of a value. |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | $iCharLimit = self::$iLegibleStringCharacterLimit; |
199 | 199 | $_iCharLength = call_user_func_array( $_aStrLenMethod[ $_iMBSupport ], array( $sString ) ); |
200 | 200 | return $_iCharLength <= $iCharLimit |
201 | - ? '(string, length: ' . $_iCharLength . ') ' . $sString |
|
202 | - : '(string, length: ' . $_iCharLength . ') ' . call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) ) |
|
201 | + ? '(string, length: '.$_iCharLength.') '.$sString |
|
202 | + : '(string, length: '.$_iCharLength.') '.call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) ) |
|
203 | 203 | . '...'; |
204 | 204 | |
205 | 205 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * @return array |
243 | 243 | * @internal |
244 | 244 | */ |
245 | - static private function _getSlicedByDepth( array $aSubject, $iDepth=0 ) { |
|
245 | + static private function _getSlicedByDepth( array $aSubject, $iDepth = 0 ) { |
|
246 | 246 | |
247 | 247 | foreach ( $aSubject as $_sKey => $_vValue ) { |
248 | 248 | if ( is_array( $_vValue ) ) { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @since 3.8.9 |
26 | 26 | * @return void |
27 | 27 | **/ |
28 | - static protected function _log( $mValue, $sFilePath=null ) { |
|
28 | + static protected function _log( $mValue, $sFilePath = null ) { |
|
29 | 29 | |
30 | 30 | static $_fPreviousTimeStamp = 0; |
31 | 31 | |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | round( $_fCurrentTimeStamp - $_fPreviousTimeStamp, 3 ), // elapsed time |
54 | 54 | $_sCallerClass, |
55 | 55 | $_sCallerFunction |
56 | - ) . PHP_EOL |
|
57 | - . self::_getLegibleDetails( $mValue ) . PHP_EOL . PHP_EOL; |
|
56 | + ).PHP_EOL |
|
57 | + . self::_getLegibleDetails( $mValue ).PHP_EOL.PHP_EOL; |
|
58 | 58 | } |
59 | 59 | /** |
60 | 60 | * @since 3.8.9 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | static private function _getCallerFunctionName( $oCallerInfo ) { |
64 | 64 | return self::getElement( |
65 | - $oCallerInfo, // subject array |
|
65 | + $oCallerInfo, // subject array |
|
66 | 66 | array( 1, 'function' ), // key |
67 | 67 | '' // default |
68 | 68 | ); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | static private function _getCallerClassName( $oCallerInfo ) { |
75 | 75 | return self::getElement( |
76 | - $oCallerInfo, // subject array |
|
76 | + $oCallerInfo, // subject array |
|
77 | 77 | array( 1, 'class' ), // key |
78 | 78 | '' // default |
79 | 79 | ); |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | } |
93 | 93 | // Return a generated default log path. |
94 | 94 | if ( true === $bsFilePath ) { |
95 | - return WP_CONTENT_DIR . DIRECTORY_SEPARATOR . basename( get_class() ) . '_' . date( "Ymd" ) . '.log'; |
|
95 | + return WP_CONTENT_DIR.DIRECTORY_SEPARATOR.basename( get_class() ).'_'.date( "Ymd" ).'.log'; |
|
96 | 96 | } |
97 | - return WP_CONTENT_DIR . DIRECTORY_SEPARATOR . basename( get_class() ) . '_' . basename( $sCallerClass ) . '_' . date( "Ymd" ) . '.log'; |
|
97 | + return WP_CONTENT_DIR.DIRECTORY_SEPARATOR.basename( get_class() ).'_'.basename( $sCallerClass ).'_'.date( "Ymd" ).'.log'; |
|
98 | 98 | |
99 | 99 | } |
100 | 100 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @internal |
104 | 104 | */ |
105 | 105 | static private function _createFile( $sFilePath ) { |
106 | - if ( ! $sFilePath || true === $sFilePath ) { |
|
106 | + if ( !$sFilePath || true === $sFilePath ) { |
|
107 | 107 | return false; |
108 | 108 | } |
109 | 109 | if ( file_exists( $sFilePath ) ) { |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | $_nNow = $fCurrentTimeStamp + ( self::_getSiteGMTOffset() * 60 * 60 ); |
126 | 126 | $_nMicroseconds = str_pad( round( ( $_nNow - floor( $_nNow ) ) * 10000 ), 4, '0' ); |
127 | 127 | $_aOutput = array( |
128 | - date( "Y/m/d H:i:s", $_nNow ) . '.' . $_nMicroseconds, |
|
128 | + date( "Y/m/d H:i:s", $_nNow ).'.'.$_nMicroseconds, |
|
129 | 129 | self::_getFormattedElapsedTime( $nElapsed ), |
130 | 130 | self::_getPageLoadID(), |
131 | 131 | self::getFrameworkVersion(), |
132 | - $sCallerClass . '::' . $sCallerFunction, |
|
132 | + $sCallerClass.'::'.$sCallerFunction, |
|
133 | 133 | current_filter(), |
134 | 134 | self::getCurrentURL(), |
135 | 135 | ); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | static private function _getSiteGMTOffset() { |
146 | 146 | static $_nGMTOffset; |
147 | - $_nGMTOffset = isset( $_nGMTOffset ) |
|
147 | + $_nGMTOffset = isset( $_nGMTOffset ) |
|
148 | 148 | ? $_nGMTOffset |
149 | 149 | : get_option( 'gmt_offset' ); |
150 | 150 | return $_nGMTOffset; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | static private function _getPageLoadID() { |
157 | 157 | static $_iPageLoadID; |
158 | - $_iPageLoadID = $_iPageLoadID |
|
158 | + $_iPageLoadID = $_iPageLoadID |
|
159 | 159 | ? $_iPageLoadID |
160 | 160 | : uniqid(); |
161 | 161 | return $_iPageLoadID; |
@@ -179,15 +179,15 @@ discard block |
||
179 | 179 | 3, |
180 | 180 | '0' |
181 | 181 | ); |
182 | - $_sElapsed = self::getElement( |
|
183 | - $_aElapsedParts, // subject array |
|
184 | - 0, // key |
|
182 | + $_sElapsed = self::getElement( |
|
183 | + $_aElapsedParts, // subject array |
|
184 | + 0, // key |
|
185 | 185 | 0 // default |
186 | 186 | ); |
187 | - $_sElapsed = strlen( $_sElapsed ) > 1 |
|
188 | - ? '+' . substr( $_sElapsed, -1, 2 ) |
|
189 | - : ' ' . $_sElapsed; |
|
190 | - return $_sElapsed . '.' . $_sElapsedFloat; |
|
187 | + $_sElapsed = strlen( $_sElapsed ) > 1 |
|
188 | + ? '+'.substr( $_sElapsed, -1, 2 ) |
|
189 | + : ' '.$_sElapsed; |
|
190 | + return $_sElapsed.'.'.$_sElapsedFloat; |
|
191 | 191 | |
192 | 192 | } |
193 | 193 |