Completed
Branch master (a559c4)
by
unknown
05:07
created
development/factory/_abstract/AdminPageFramework_Factory_Router.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         // Property object
134 134
         $this->oProp = $oProp;
135 135
     
136
-        if ( $this->oProp->bIsAdmin && ! $this->oProp->bIsAdminAjax ) {
136
+        if ( $this->oProp->bIsAdmin && !$this->oProp->bIsAdminAjax ) {
137 137
             add_action( 'current_screen', array( $this, '_replyToLoadComponents' ) );
138 138
         }
139 139
         
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                 $this->oLink = $this->oLink;
157 157
             }
158 158
     
159
-            if ( ! $this->_isInThePage() ) { 
159
+            if ( !$this->_isInThePage() ) { 
160 160
                 return; 
161 161
             }
162 162
             
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
             return null;
240 240
         }
241 241
         return $this->_getInstanceByMap( 
242
-            $this->_aFormElementClassNameMap,   // map
243
-            $oProp->sFieldsType,    // key
244
-            $oProp->sFieldsType,    // parameter 1
245
-            $oProp->sCapability,    // parameter 2
242
+            $this->_aFormElementClassNameMap, // map
243
+            $oProp->sFieldsType, // key
244
+            $oProp->sFieldsType, // parameter 1
245
+            $oProp->sCapability, // parameter 2
246 246
             $this   // parameter 3
247 247
         );
248 248
         
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         'network_admin_page'    => 'AdminPageFramework_HelpPane_Page',
282 282
         'post_meta_box'         => 'AdminPageFramework_HelpPane_MetaBox',
283 283
         'page_meta_box'         => 'AdminPageFramework_HelpPane_MetaBox_Page',
284
-        'post_type'             => null,    // no help pane class for the post type factory class.
284
+        'post_type'             => null, // no help pane class for the post type factory class.
285 285
         'taxonomy'              => 'AdminPageFramework_HelpPane_TaxonomyField',
286 286
         'widget'                => 'AdminPageFramework_HelpPane_Widget',
287 287
         'user_meta'             => 'AdminPageFramework_HelpPane_UserMeta',
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
      */
343 343
     protected function _getPageLoadInfoInstance( $oProp, $oMsg ) {
344 344
         
345
-        if ( ! isset( $this->_aPageLoadClassNameMap[ $oProp->sFieldsType ] ) ) {
345
+        if ( !isset( $this->_aPageLoadClassNameMap[ $oProp->sFieldsType ] ) ) {
346 346
             return null;
347 347
         }
348 348
         $_sClassName = $this->_aPageLoadClassNameMap[ $oProp->sFieldsType ];
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         $_aClassNameMap = array_shift( $_aParams );
365 365
         $_sKey          = array_shift( $_aParams );
366 366
         
367
-        if ( ! isset( $_aClassNameMap[ $_sKey ] ) ) {
367
+        if ( !isset( $_aClassNameMap[ $_sKey ] ) ) {
368 368
             return null;
369 369
         }
370 370
         
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
      */
429 429
     public function __get( $sPropertyName ) {
430 430
             
431
-        switch( $sPropertyName ) {
431
+        switch ( $sPropertyName ) {
432 432
             case 'oHeadTag':    // 3.3.0+ for backward compatibility
433 433
                 $sPropertyName = 'oResource';
434 434
                 break;
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
         // Set and return the sub class object instance.
438 438
         if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) {            
439 439
             return call_user_func( 
440
-                array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}"  )
440
+                array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" )
441 441
             );
442 442
         }
443 443
         
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
      * 
519 519
      * @internal
520 520
      */
521
-    public function __call( $sMethodName, $aArguments=null ) {    
521
+    public function __call( $sMethodName, $aArguments = null ) {    
522 522
          
523 523
         $_mFirstArg = $this->oUtil->getElement( $aArguments, 0 );
524 524
         
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
             
559 559
             // Check if the method name contains a backslash.
560 560
             if ( false === strpos( $sMethodName, "\\" ) ) {
561
-                return $this->oUtil->getElement( $aArguments, 0 );  // the first element - the filter value
561
+                return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value
562 562
             }
563 563
                 
564 564
             // if the method name contains a backslash, the user may be using a name space. 
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
                     array( $this, $_sAutoCallbackClassName ),
570 570
                     $aArguments
571 571
                 )
572
-                : $this->oUtil->getElement( $aArguments, 0 );   // the first argument
572
+                : $this->oUtil->getElement( $aArguments, 0 ); // the first argument
573 573
             
574 574
         }
575 575
         
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
          */
580 580
         private function _triggerUndefinedMethodWarning( $sMethodName ) {
581 581
             trigger_error(
582
-                AdminPageFramework_Registry::NAME . ': ' 
582
+                AdminPageFramework_Registry::NAME.': ' 
583 583
                     . sprintf( 
584 584
                         __( 'The method is not defined: %1$s', $this->oProp->sTextDomain ),
585 585
                         $sMethodName 
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                 $this->oLink = $this->oLink;
157 157
             }
158 158
     
159
-            if ( ! $this->_isInThePage() ) { 
159
+            if ( ! $this->_isInThePage() ) {
160 160
                 return; 
161 161
             }
162 162
             
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         }     
436 436
 
437 437
         // Set and return the sub class object instance.
438
-        if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) {            
438
+        if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) {
439 439
             return call_user_func( 
440 440
                 array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}"  )
441 441
             );
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
      * 
519 519
      * @internal
520 520
      */
521
-    public function __call( $sMethodName, $aArguments=null ) {    
521
+    public function __call( $sMethodName, $aArguments=null ) {
522 522
          
523 523
         $_mFirstArg = $this->oUtil->getElement( $aArguments, 0 );
524 524
         
Please login to merge, or discard this patch.
admin-page-framework-loader.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class AdminPageFrameworkLoader_Registry_Base {
18 18
 
19
-	const VERSION        = '3.6.6';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
20
-	const NAME           = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing.
19
+    const VERSION        = '3.6.6';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
20
+    const NAME           = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing.
21 21
     const SHORTNAME      = 'Admin Page Framework';  // used for a menu title etc.
22
-	const DESCRIPTION    = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.';
23
-	const URI            = 'http://en.michaeluno.jp/';
24
-	const AUTHOR         = 'miunosoft (Michael Uno)';
25
-	const AUTHOR_URI     = 'http://en.michaeluno.jp/';
26
-	const COPYRIGHT      = 'Copyright (c) 2015, Michael Uno';
27
-	const LICENSE        = 'GPL v2 or later';
22
+    const DESCRIPTION    = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.';
23
+    const URI            = 'http://en.michaeluno.jp/';
24
+    const AUTHOR         = 'miunosoft (Michael Uno)';
25
+    const AUTHOR_URI     = 'http://en.michaeluno.jp/';
26
+    const COPYRIGHT      = 'Copyright (c) 2015, Michael Uno';
27
+    const LICENSE        = 'GPL v2 or later';
28 28
     const CONTRIBUTORS   = '';
29 29
 	
30 30
 }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
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.
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
      * 
71 71
      * These will be accessed from the bootstrap script.
72 72
      */
73
-	const TEXT_DOMAIN              = 'admin-page-framework-loader';
74
-	const TEXT_DOMAIN_PATH         = '/language';    
73
+    const TEXT_DOMAIN              = 'admin-page-framework-loader';
74
+    const TEXT_DOMAIN_PATH         = '/language';    
75 75
     	    
76
-	// These properties will be defined in the setUp() method.
77
-	static public $sFilePath = '';
78
-	static public $sDirPath  = '';
76
+    // These properties will be defined in the setUp() method.
77
+    static public $sFilePath = '';
78
+    static public $sDirPath  = '';
79 79
 	
80 80
     /**
81 81
      * Requirements.
@@ -136,30 +136,30 @@  discard block
 block discarded – undo
136 136
     static public $aTaxonomies = array(
137 137
     );
138 138
     
139
-	/**
140
-	 * Sets up static properties.
139
+    /**
140
+     * Sets up static properties.
141 141
      * @return      void
142
-	 */
143
-	static public function setUp( $sPluginFilePath=null ) {
142
+     */
143
+    static public function setUp( $sPluginFilePath=null ) {
144 144
 	                    
145
-		self::$sFilePath = $sPluginFilePath ? $sPluginFilePath : __FILE__;
146
-		self::$sDirPath  = dirname( self::$sFilePath );
145
+        self::$sFilePath = $sPluginFilePath ? $sPluginFilePath : __FILE__;
146
+        self::$sDirPath  = dirname( self::$sFilePath );
147 147
 	    
148
-	}    
148
+    }    
149 149
 	
150
-	/**
151
-	 * Returns the URL with the given relative path to the plugin path.
152
-	 * 
153
-	 * <h3>Example</h3>
150
+    /**
151
+     * Returns the URL with the given relative path to the plugin path.
152
+     * 
153
+     * <h3>Example</h3>
154 154
      * <code>
155 155
      * AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/css/meta_box.css' );
156 156
      * </code>
157 157
      * @since       3.5.0
158 158
      * @return      string
159
-	 */
160
-	public static function getPluginURL( $sRelativePath='' ) {
161
-		return plugins_url( $sRelativePath, self::$sFilePath );
162
-	}
159
+     */
160
+    public static function getPluginURL( $sRelativePath='' ) {
161
+        return plugins_url( $sRelativePath, self::$sFilePath );
162
+    }
163 163
     
164 164
     /**
165 165
      * Returns the information of this class.
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class AdminPageFrameworkLoader_Registry_Base {
18 18
 
19
-	const VERSION        = '3.6.6';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
19
+	const VERSION        = '3.6.6'; // <--- 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://en.michaeluno.jp/';
24 24
 	const AUTHOR         = 'miunosoft (Michael Uno)';
25 25
 	const AUTHOR_URI     = 'http://en.michaeluno.jp/';
26 26
 	const COPYRIGHT      = 'Copyright (c) 2015, Michael Uno';
27 27
 	const LICENSE        = 'GPL v2 or later';
28
-    const CONTRIBUTORS   = '';
28
+    const CONTRIBUTORS = '';
29 29
 	
30 30
 }
31 31
 /**
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
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
     /**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     static public $aAdminPages = array(
119 119
         // key => 'page slug'
120
-        'about'     => 'apfl_about',        // the welcome page
120
+        'about'     => 'apfl_about', // the welcome page
121 121
         'addon'     => 'apfl_addons',
122 122
         'tool'      => 'apfl_tools',
123 123
         'help'      => 'apfl_contact',
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * Sets up static properties.
141 141
      * @return      void
142 142
 	 */
143
-	static public function setUp( $sPluginFilePath=null ) {
143
+	static public function setUp( $sPluginFilePath = null ) {
144 144
 	                    
145 145
 		self::$sFilePath = $sPluginFilePath ? $sPluginFilePath : __FILE__;
146 146
 		self::$sDirPath  = dirname( self::$sFilePath );
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @since       3.5.0
158 158
      * @return      string
159 159
 	 */
160
-	public static function getPluginURL( $sRelativePath='' ) {
160
+	public static function getPluginURL( $sRelativePath = '' ) {
161 161
 		return plugins_url( $sRelativePath, self::$sFilePath );
162 162
 	}
163 163
     
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
      * @since       3.5.0
185 185
      * @return      void
186 186
      */ 
187
-    static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) {
188
-        if ( ! is_admin() ) {  
187
+    static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) {
188
+        if ( !is_admin() ) {  
189 189
             return; 
190 190
         }
191
-        self::$_aAdminNotices[] = array(
191
+        self::$_aAdminNotices[ ] = array(
192 192
             'message'           => $sMessage,
193
-            'class_attribute'   => trim( $sClassAttribute ) . ' notice is-dismissible',
193
+            'class_attribute'   => trim( $sClassAttribute ).' notice is-dismissible',
194 194
         );
195 195
         add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) );
196 196
     }
@@ -200,12 +200,12 @@  discard block
 block discarded – undo
200 200
          * @return      void
201 201
          */
202 202
         static public function _replyToSetAdminNotice() {
203
-            foreach( self::$_aAdminNotices as $_aAdminNotice ) {                
204
-                echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>"
203
+            foreach ( self::$_aAdminNotices as $_aAdminNotice ) {                
204
+                echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>"
205 205
                         ."<p>" 
206 206
                             . sprintf( 
207
-                                '<strong>%1$s</strong>: ' . $_aAdminNotice['message'],
208
-                                self::NAME . ' ' . self::VERSION
207
+                                '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ],
208
+                                self::NAME.' '.self::VERSION
209 209
                             )
210 210
                         . "</p>"
211 211
                     . "</div>";
@@ -217,24 +217,24 @@  discard block
 block discarded – undo
217 217
 AdminPageFrameworkLoader_Registry::setUp( __FILE__ );
218 218
 
219 219
 // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file.
220
-if ( ! defined( 'ABSPATH' ) ) { return; }
220
+if ( !defined( 'ABSPATH' ) ) { return; }
221 221
 if ( defined( 'DOING_UNINSTALL' ) ) { return; }
222 222
 
223 223
 // Include the library file 
224
-if ( ! class_exists( 'AdminPageFramework' ) ) {    
224
+if ( !class_exists( 'AdminPageFramework' ) ) {    
225 225
     // The development version is available in the repository cloned via GitHub.
226
-    $_sDevelopmentVersionPath = dirname( __FILE__ ) . '/development/admin-page-framework.php';
226
+    $_sDevelopmentVersionPath = dirname( __FILE__ ).'/development/admin-page-framework.php';
227 227
     $_bDebugMode              = defined( 'WP_DEBUG' ) && WP_DEBUG;
228 228
     include( 
229 229
         $_bDebugMode && file_exists( $_sDevelopmentVersionPath )
230 230
             ? $_sDevelopmentVersionPath
231
-            : dirname( __FILE__ ) . '/library/admin-page-framework/admin-page-framework.php'
231
+            : dirname( __FILE__ ).'/library/admin-page-framework/admin-page-framework.php'
232 232
     );
233 233
 } 
234 234
  
235 235
 if ( 
236
-    ! class_exists( 'AdminPageFramework_Registry' ) 
237
-    || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility
236
+    !class_exists( 'AdminPageFramework_Registry' ) 
237
+    || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility
238 238
     || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' )
239 239
 ) {
240 240
     AdminPageFrameworkLoader_Registry::setAdminNotice(
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 }
250 250
 
251 251
 // Include the framework loader plugin components.
252
-include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/boot/AdminPageFrameworkLoader_Bootstrap.php' );
252
+include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/boot/AdminPageFrameworkLoader_Bootstrap.php' );
253 253
 if ( class_exists( 'AdminPageFrameworkLoader_Bootstrap' ) ) {   // for backward compatibility
254 254
     new AdminPageFrameworkLoader_Bootstrap( 
255 255
         AdminPageFrameworkLoader_Registry::$sFilePath,
Please login to merge, or discard this patch.