@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
18 | 18 | |
19 | - const VERSION = '3.8.12'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
19 | + const VERSION = '3.8.12'; // <--- 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 |
@@ -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 ) ) { |