Completed
Branch dev (43e9e0)
by
unknown
06:03
created
development/factory/post_type/AdminPageFramework_PostType_View.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -112,6 +112,7 @@
 block discarded – undo
112 112
              * 
113 113
              * @internal
114 114
              * @since       3.5.10
115
+             * @param string $sMenuKey
115 116
              * @return      void
116 117
              */
117 118
             private function _removeAddNewSidebarSubMenu( $sMenuKey, $sPostTypeSlug ) {
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             $this->_removeAddNewSidebarSubMenu(
77 77
                 is_string( $_bsShowInMenu )
78 78
                     ? $_bsShowInMenu
79
-                    : 'edit.php?post_type=' . $this->oProp->sPostType,
79
+                    : 'edit.php?post_type='.$this->oProp->sPostType,
80 80
                 $this->oProp->sPostType
81 81
             );
82 82
             
@@ -117,20 +117,20 @@  discard block
 block discarded – undo
117 117
             private function _removeAddNewSidebarSubMenu( $sMenuKey, $sPostTypeSlug ) {
118 118
 
119 119
                 // Remove the default post type menu item.
120
-                if ( ! isset( $GLOBALS['submenu'][ $sMenuKey ] ) ) {
120
+                if ( !isset( $GLOBALS[ 'submenu' ][ $sMenuKey ] ) ) {
121 121
                     // logged-in users of an insufficient access level don't have the menu to be registered.
122 122
                     return; 
123 123
                 } 
124 124
                 
125
-                foreach ( $GLOBALS['submenu'][ $sMenuKey ] as $_iIndex => $_aSubMenu ) {
125
+                foreach ( $GLOBALS[ 'submenu' ][ $sMenuKey ] as $_iIndex => $_aSubMenu ) {
126 126
                                 
127
-                    if ( ! isset( $_aSubMenu[ 2 ] ) ) { 
127
+                    if ( !isset( $_aSubMenu[ 2 ] ) ) { 
128 128
                         continue; 
129 129
                     }
130 130
                     
131 131
                     // Remove the default Add New entry.
132
-                    if ( 'post-new.php?post_type=' . $sPostTypeSlug === $_aSubMenu[ 2 ] ) {
133
-                        unset( $GLOBALS['submenu'][ $sMenuKey ][ $_iIndex ] );
132
+                    if ( 'post-new.php?post_type='.$sPostTypeSlug === $_aSubMenu[ 2 ] ) {
133
+                        unset( $GLOBALS[ 'submenu' ][ $sMenuKey ][ $_iIndex ] );
134 134
                         continue;
135 135
                     }
136 136
                     
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
      */ 
146 146
     public function _replyToAddAuthorTableFilter() {
147 147
         
148
-        if ( ! $this->oProp->bEnableAuthorTableFileter ) { 
148
+        if ( !$this->oProp->bEnableAuthorTableFileter ) { 
149 149
             return; 
150 150
         }
151 151
         
152 152
         if ( 
153
-            ! ( isset( $_GET['post_type'] ) && post_type_exists( $_GET['post_type'] ) 
154
-            && in_array( strtolower( $_GET['post_type'] ), array( $this->oProp->sPostType ) ) ) 
153
+            !( isset( $_GET[ 'post_type' ] ) && post_type_exists( $_GET[ 'post_type' ] ) 
154
+            && in_array( strtolower( $_GET[ 'post_type' ] ), array( $this->oProp->sPostType ) ) ) 
155 155
         ) {
156 156
             return;
157 157
         }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                 'show_option_all'   => $this->oMsg->get( 'show_all_authors' ),
162 162
                 'show_option_none'  => false,
163 163
                 'name'              => 'author',
164
-                'selected'          => ! empty( $_GET[ 'author' ] ) 
164
+                'selected'          => !empty( $_GET[ 'author' ] ) 
165 165
                     ? $_GET[ 'author' ] 
166 166
                     : 0,
167 167
                 'include_selected'  => false,
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
             return;
188 188
         }
189 189
         
190
-        foreach ( get_object_taxonomies( $GLOBALS['typenow'] ) as $_sTaxonomySulg ) {
190
+        foreach ( get_object_taxonomies( $GLOBALS[ 'typenow' ] ) as $_sTaxonomySulg ) {
191 191
             
192
-            if ( ! in_array( $_sTaxonomySulg, $this->oProp->aTaxonomyTableFilters ) ) {
192
+            if ( !in_array( $_sTaxonomySulg, $this->oProp->aTaxonomyTableFilters ) ) {
193 193
                 continue;
194 194
             }
195 195
             
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
             // Echo the drop down list based on the passed array argument.
204 204
             wp_dropdown_categories( 
205 205
                 array(
206
-                    'show_option_all'   => $this->oMsg->get( 'show_all' ) . ' ' . $_oTaxonomy->label,
206
+                    'show_option_all'   => $this->oMsg->get( 'show_all' ).' '.$_oTaxonomy->label,
207 207
                     'taxonomy'          => $_sTaxonomySulg,
208 208
                     'name'              => $_oTaxonomy->name,
209 209
                     'orderby'           => 'name',
@@ -223,24 +223,24 @@  discard block
 block discarded – undo
223 223
      * 
224 224
      * @internal
225 225
      */
226
-    public function _replyToGetTableFilterQueryForTaxonomies( $oQuery=null ) {
226
+    public function _replyToGetTableFilterQueryForTaxonomies( $oQuery = null ) {
227 227
         
228 228
         if ( 'edit.php' != $this->oProp->sPageNow ) { 
229 229
             return $oQuery; 
230 230
         }
231 231
         
232
-        if ( ! isset( $GLOBALS['typenow'] ) ) { 
232
+        if ( !isset( $GLOBALS[ 'typenow' ] ) ) { 
233 233
             return $oQuery; 
234 234
         }
235 235
 
236
-        foreach ( get_object_taxonomies( $GLOBALS['typenow'] ) as $sTaxonomySlug ) {
236
+        foreach ( get_object_taxonomies( $GLOBALS[ 'typenow' ] ) as $sTaxonomySlug ) {
237 237
             
238
-            if ( ! in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { 
238
+            if ( !in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { 
239 239
                 continue; 
240 240
             }
241 241
             
242 242
             $sVar = &$oQuery->query_vars[ $sTaxonomySlug ];
243
-            if ( ! isset( $sVar ) ) { 
243
+            if ( !isset( $sVar ) ) { 
244 244
                 continue; 
245 245
             }
246 246
             
@@ -268,14 +268,14 @@  discard block
 block discarded – undo
268 268
         }
269 269
 
270 270
         // If the screen icon url is specified
271
-        if ( isset( $this->oProp->aPostTypeArgs['screen_icon'] ) && $this->oProp->aPostTypeArgs['screen_icon'] ) {
272
-            $this->oProp->sStyle .= $this->_getStylesForPostTypeScreenIcon( $this->oProp->aPostTypeArgs['screen_icon'] );
271
+        if ( isset( $this->oProp->aPostTypeArgs[ 'screen_icon' ] ) && $this->oProp->aPostTypeArgs[ 'screen_icon' ] ) {
272
+            $this->oProp->sStyle .= $this->_getStylesForPostTypeScreenIcon( $this->oProp->aPostTypeArgs[ 'screen_icon' ] );
273 273
         }
274 274
             
275 275
         $this->oProp->sStyle = $this->oUtil->addAndApplyFilters( $this, "style_{$this->oProp->sClassName}", $this->oProp->sStyle );
276 276
         
277 277
         // Print out the filtered styles.
278
-        if ( ! empty( $this->oProp->sStyle ) ) {
278
+        if ( !empty( $this->oProp->sStyle ) ) {
279 279
             echo "<style type='text/css' id='admin-page-framework-style-post-type'>" 
280 280
                 . $this->oProp->sStyle
281 281
                 . "</style>";     
@@ -326,10 +326,10 @@  discard block
 block discarded – undo
326 326
      */
327 327
     public function _replyToFilterPostTypeContent( $sContent ) {
328 328
         
329
-        if ( ! is_singular() ) {
329
+        if ( !is_singular() ) {
330 330
             return $sContent;
331 331
         }
332
-        if ( ! is_main_query() ) {
332
+        if ( !is_main_query() ) {
333 333
             return $sContent;
334 334
         }
335 335
         global $post;
Please login to merge, or discard this patch.
Braces   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @package     AdminPageFramework
18 18
  * @subpackage  PostType
19 19
  */
20
-abstract class AdminPageFramework_PostType_View extends AdminPageFramework_PostType_Model {    
20
+abstract class AdminPageFramework_PostType_View extends AdminPageFramework_PostType_Model {
21 21
 
22 22
     /**
23 23
      * Sets up hooks.
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         
30 30
         parent::__construct( $oProp );
31 31
                         
32
-        if ( $this->_isInThePage() ) {     
32
+        if ( $this->_isInThePage() ) {
33 33
     
34 34
             // Table filters
35 35
             add_action( 'restrict_manage_posts', array( $this, '_replyToAddAuthorTableFilter' ) );
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                 
125 125
                 foreach ( $GLOBALS['submenu'][ $sMenuKey ] as $_iIndex => $_aSubMenu ) {
126 126
                                 
127
-                    if ( ! isset( $_aSubMenu[ 2 ] ) ) { 
127
+                    if ( ! isset( $_aSubMenu[ 2 ] ) ) {
128 128
                         continue; 
129 129
                     }
130 130
                     
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      */ 
146 146
     public function _replyToAddAuthorTableFilter() {
147 147
         
148
-        if ( ! $this->oProp->bEnableAuthorTableFileter ) { 
148
+        if ( ! $this->oProp->bEnableAuthorTableFileter ) {
149 149
             return; 
150 150
         }
151 151
         
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */ 
178 178
     public function _replyToAddTaxonomyTableFilter() {
179 179
         
180
-        if ( $GLOBALS[ 'typenow' ] != $this->oProp->sPostType ) { 
180
+        if ( $GLOBALS[ 'typenow' ] != $this->oProp->sPostType ) {
181 181
             return; 
182 182
         }
183 183
         
@@ -225,22 +225,22 @@  discard block
 block discarded – undo
225 225
      */
226 226
     public function _replyToGetTableFilterQueryForTaxonomies( $oQuery=null ) {
227 227
         
228
-        if ( 'edit.php' != $this->oProp->sPageNow ) { 
228
+        if ( 'edit.php' != $this->oProp->sPageNow ) {
229 229
             return $oQuery; 
230 230
         }
231 231
         
232
-        if ( ! isset( $GLOBALS['typenow'] ) ) { 
232
+        if ( ! isset( $GLOBALS['typenow'] ) ) {
233 233
             return $oQuery; 
234 234
         }
235 235
 
236 236
         foreach ( get_object_taxonomies( $GLOBALS['typenow'] ) as $sTaxonomySlug ) {
237 237
             
238
-            if ( ! in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { 
238
+            if ( ! in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) {
239 239
                 continue; 
240 240
             }
241 241
             
242 242
             $sVar = &$oQuery->query_vars[ $sTaxonomySlug ];
243
-            if ( ! isset( $sVar ) ) { 
243
+            if ( ! isset( $sVar ) ) {
244 244
                 continue; 
245 245
             }
246 246
             
Please login to merge, or discard this patch.
factory/taxonomy_field/AdminPageFramework_TaxonomyField_View.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -107,6 +107,7 @@
 block discarded – undo
107 107
          * 
108 108
          * @since       3.0.0
109 109
          * @internal
110
+         * @param boolean $bRenderTableRow
110 111
          * @return      string
111 112
          */
112 113
         private function _getFieldsOutput( $iTermID, $bRenderTableRow ) {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
         return "{$_aField['field_id']}{$_sKey}";
70 70
     }
71 71
 
72
-   /**
72
+    /**
73 73
      * Adds input fields
74 74
      * 
75 75
      * @internal
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             '',
49 49
             "[{$_sKey}]"
50 50
         );        
51
-        return $_aField['field_id'] . $_sKey; 
51
+        return $_aField[ 'field_id' ].$_sKey; 
52 52
         
53 53
     }
54 54
     /**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             '',
67 67
             "|{$_sKey}"
68 68
         );
69
-        return "{$_aField['field_id']}{$_sKey}";
69
+        return "{$_aField[ 'field_id' ]}{$_sKey}";
70 70
     }
71 71
 
72 72
    /**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             $_aOutput = array();
115 115
             
116 116
             // Set nonce.           
117
-            $_aOutput[] = wp_nonce_field( 
117
+            $_aOutput[ ] = wp_nonce_field( 
118 118
                 $this->oProp->sClassHash, 
119 119
                 $this->oProp->sClassHash, 
120 120
                 true, 
@@ -125,17 +125,17 @@  discard block
 block discarded – undo
125 125
             $this->_setOptionArray( $iTermID, $this->oProp->sOptionKey );
126 126
             
127 127
             // Get the field outputs
128
-            $_aOutput[] = $this->oForm->get();
128
+            $_aOutput[ ] = $this->oForm->get();
129 129
             
130 130
             // Filter the output
131 131
             $_sOutput = $this->oUtil->addAndApplyFilters( 
132 132
                 $this, 
133
-                'content_' . $this->oProp->sClassName, 
133
+                'content_'.$this->oProp->sClassName, 
134 134
                 $this->content( implode( PHP_EOL, $_aOutput ) )
135 135
             );
136 136
 
137 137
             // Do action 
138
-            $this->oUtil->addAndDoActions( $this, 'do_' . $this->oProp->sClassName, $this );
138
+            $this->oUtil->addAndDoActions( $this, 'do_'.$this->oProp->sClassName, $this );
139 139
 
140 140
             return $_sOutput;
141 141
                        
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
     public function _replyToPrintColumnCell( $vValue, $sColumnSlug, $sTermID ) {
155 155
         
156 156
         $_sCellHTML = '';
157
-        if ( isset( $_GET['taxonomy'] ) && $_GET['taxonomy'] ) {
158
-            $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$_GET['taxonomy']}", $vValue, $sColumnSlug, $sTermID );
157
+        if ( isset( $_GET[ 'taxonomy' ] ) && $_GET[ 'taxonomy' ] ) {
158
+            $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$_GET[ 'taxonomy' ]}", $vValue, $sColumnSlug, $sTermID );
159 159
         }
160 160
         $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$this->oProp->sClassName}", $_sCellHTML, $sColumnSlug, $sTermID );
161 161
         $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$this->oProp->sClassName}_{$sColumnSlug}", $_sCellHTML, $sTermID ); // 3.0.2+
Please login to merge, or discard this patch.
development/factory/widget/AdminPageFramework_Widget_Controller.php 4 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -24,6 +24,7 @@
 block discarded – undo
24 24
      * 
25 25
      * @since       3.2.0
26 26
      * @internal    
27
+     * @param AdminPageFramework_Property_Widget $oProp
27 28
      */
28 29
     function __construct( $oProp ) {
29 30
         
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,22 +44,22 @@
 block discarded – undo
44 44
     }
45 45
 
46 46
     /**
47
-    * The method for necessary set-ups.
48
-    * 
49
-    * <h4>Example</h4>
50
-    * <code>
51
-    *   public function setUp() {
52
-    *       $this->setArguments( 
53
-    *           array(
54
-    *               'description'   =>  __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ),
55
-    *           ) 
56
-    *       );
57
-    *   }  
58
-    * </code>
59
-    * 
60
-    * @abstract
61
-    * @since        3.2.0
62
-    */
47
+     * The method for necessary set-ups.
48
+     * 
49
+     * <h4>Example</h4>
50
+     * <code>
51
+     *   public function setUp() {
52
+     *       $this->setArguments( 
53
+     *           array(
54
+     *               'description'   =>  __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ),
55
+     *           ) 
56
+     *       );
57
+     *   }  
58
+     * </code>
59
+     * 
60
+     * @abstract
61
+     * @since        3.2.0
62
+     */
63 63
     public function setUp() {}    
64 64
       
65 65
     /**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      * @since       3.2.0
151 151
      * @internal    Temporarily marked internal
152 152
      */
153
-    public function enqueueStyles( $aSRCs, $aCustomArgs=array() ) {     
153
+    public function enqueueStyles( $aSRCs, $aCustomArgs = array() ) {     
154 154
         if ( method_exists( $this->oResource, '_enqueueStyles' ) ) {
155 155
             return $this->oResource->_enqueueStyles( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs );
156 156
         }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      * @since       3.2.0
164 164
      * @internal    Temporarily marked internal
165 165
      */    
166
-    public function enqueueStyle( $sSRC, $aCustomArgs=array() ) {
166
+    public function enqueueStyle( $sSRC, $aCustomArgs = array() ) {
167 167
         if ( method_exists( $this->oResource, '_enqueueStyle' ) ) {
168 168
             return $this->oResource->_enqueueStyle( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs );     
169 169
         }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      * @since       3.2.0
177 177
      * @internal    Temporarily marked internal
178 178
      */
179
-    public function enqueueScripts( $aSRCs, $aCustomArgs=array() ) {
179
+    public function enqueueScripts( $aSRCs, $aCustomArgs = array() ) {
180 180
         if ( method_exists( $this->oResource, '_enqueueScripts' ) ) {
181 181
             return $this->oResource->_enqueueScripts( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs );
182 182
         }
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      * @since           3.2.0
190 190
      * @internal    Temporarily marked internal
191 191
      */
192
-    public function enqueueScript( $sSRC, $aCustomArgs=array() ) {    
192
+    public function enqueueScript( $sSRC, $aCustomArgs = array() ) {    
193 193
         if ( method_exists( $this->oResource, '_enqueueScript' ) ) {
194 194
             return $this->oResource->_enqueueScript( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs );
195 195
         }
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      * @since       3.2.0
204 204
      * @return      void
205 205
      */ 
206
-    protected function setArguments( array $aArguments=array() ) {
206
+    protected function setArguments( array $aArguments = array() ) {
207 207
         $this->oProp->aWidgetArguments = $aArguments;  
208 208
     }  
209 209
     
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @package     AdminPageFramework
18 18
  * @subpackage  Widget
19 19
  */
20
-abstract class AdminPageFramework_Widget_Controller extends AdminPageFramework_Widget_View {    
20
+abstract class AdminPageFramework_Widget_Controller extends AdminPageFramework_Widget_View {
21 21
 
22 22
     /**
23 23
      * Sets up hooks and properties.
@@ -33,7 +33,8 @@  discard block
 block discarded – undo
33 33
             
34 34
             // Other admin page framework factory classes uses wp_loaded hook but widget_init hook is called before that.
35 35
             // So we use widgets_init hook for this factory.
36
-            if ( did_action( 'widgets_init' ) ) {  // For the activation hook.
36
+            if ( did_action( 'widgets_init' ) ) {
37
+// For the activation hook.
37 38
                 $this->setup_pre();
38 39
             } {
39 40
                 add_action( 'widgets_init', array( $this, 'setup_pre' ) );     
@@ -150,7 +151,7 @@  discard block
 block discarded – undo
150 151
      * @since       3.2.0
151 152
      * @internal    Temporarily marked internal
152 153
      */
153
-    public function enqueueStyles( $aSRCs, $aCustomArgs=array() ) {     
154
+    public function enqueueStyles( $aSRCs, $aCustomArgs=array() ) {
154 155
         if ( method_exists( $this->oResource, '_enqueueStyles' ) ) {
155 156
             return $this->oResource->_enqueueStyles( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs );
156 157
         }
@@ -189,7 +190,7 @@  discard block
 block discarded – undo
189 190
      * @since           3.2.0
190 191
      * @internal    Temporarily marked internal
191 192
      */
192
-    public function enqueueScript( $sSRC, $aCustomArgs=array() ) {    
193
+    public function enqueueScript( $sSRC, $aCustomArgs=array() ) {
193 194
         if ( method_exists( $this->oResource, '_enqueueScript' ) ) {
194 195
             return $this->oResource->_enqueueScript( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs );
195 196
         }
Please login to merge, or discard this patch.
development/factory/widget/AdminPageFramework_Widget_Factory.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -23,6 +23,7 @@
 block discarded – undo
23 23
      * Sets up internal properties.
24 24
      * 
25 25
      * @since       3.2.0
26
+     * @param AdminPageFramework_Widget_Model $oCaller
26 27
      * @return      void
27 28
      */
28 29
 	public function __construct( $oCaller, $sWidgetTitle, array $aArguments=array() ) {
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,21 +25,21 @@  discard block
 block discarded – undo
25 25
      * @since       3.2.0
26 26
      * @return      void
27 27
      */
28
-	public function __construct( $oCaller, $sWidgetTitle, array $aArguments=array() ) {
28
+    public function __construct( $oCaller, $sWidgetTitle, array $aArguments=array() ) {
29 29
 		
30 30
         $aArguments = $aArguments 
31 31
             + array( 
32 32
                 'classname'     => 'admin_page_framework_widget',
33 33
                 'description'   => '',  
34 34
             );
35
-		parent::__construct( 
35
+        parent::__construct( 
36 36
             $oCaller->oProp->sClassName,  // base id 
37 37
             $sWidgetTitle,      // widget title
38 38
             $aArguments         // widget arguments
39 39
         );
40 40
         $this->oCaller = $oCaller;
41 41
         
42
-	}
42
+    }
43 43
     
44 44
     /**
45 45
      * Displays the widget contents in the front end.
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      * whether the title should be visible or not depending on the content.
50 50
      * @return      void
51 51
      */
52
-	public function widget( $aArguments, $aFormData ) {
52
+    public function widget( $aArguments, $aFormData ) {
53 53
            
54 54
         echo $aArguments[ 'before_widget' ];
55 55
         
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 
73 73
         echo $_sContent;
74 74
         
75
-		echo $aArguments[ 'after_widget' ];
75
+        echo $aArguments[ 'after_widget' ];
76 76
 		
77
-	}
77
+    }
78 78
         /**
79 79
          * Returns the widget title.
80 80
          * 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             if ( ! $_sTitle ) {
104 104
                 return '';
105 105
             }
106
-           return $aArguments['before_title'] 
106
+            return $aArguments['before_title'] 
107 107
                 . $_sTitle 
108 108
             . $aArguments['after_title'];           
109 109
             
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      * @since       3.2.0
116 116
      * @return      mixed       The validated form data. The type should be an array but it is dealt by the framework user it will be unknown.
117 117
      */
118
-	public function update( $aSubmittedFormData, $aSavedFormData ) {
118
+    public function update( $aSubmittedFormData, $aSavedFormData ) {
119 119
                 
120 120
         return $this->oCaller->oUtil->addAndApplyFilters(
121 121
             $this->oCaller, 
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
             $this->oCaller
129 129
         );
130 130
  
131
-	}
131
+    }
132 132
     
133 133
     /**
134 134
      * Constructs the widget form.
135 135
      * 
136 136
      * @return      void
137 137
      */
138
-	public function form( $aFormData ) {
138
+    public function form( $aFormData ) {
139 139
 
140 140
         // Trigger the load() method and load_{...} actions. The user sets up the form.
141 141
         $this->oCaller->load( $this->oCaller );
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             // $this->oCaller
194 194
         // );   
195 195
        
196
-	}
196
+    }
197 197
     
198 198
         /**
199 199
          * 
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      * @since       3.2.0
26 26
      * @return      void
27 27
      */
28
-	public function __construct( $oCaller, $sWidgetTitle, array $aArguments=array() ) {
28
+	public function __construct( $oCaller, $sWidgetTitle, array $aArguments = array() ) {
29 29
 		
30 30
         $aArguments = $aArguments 
31 31
             + array( 
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
                 'description'   => '',  
34 34
             );
35 35
 		parent::__construct( 
36
-            $oCaller->oProp->sClassName,  // base id 
37
-            $sWidgetTitle,      // widget title
36
+            $oCaller->oProp->sClassName, // base id 
37
+            $sWidgetTitle, // widget title
38 38
             $aArguments         // widget arguments
39 39
         );
40 40
         $this->oCaller = $oCaller;
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         
56 56
         $this->oCaller->oUtil->addAndDoActions( 
57 57
             $this->oCaller, 
58
-            'do_' . $this->oCaller->oProp->sClassName, 
58
+            'do_'.$this->oCaller->oProp->sClassName, 
59 59
             $this->oCaller
60 60
         );
61 61
        
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
          */
87 87
         private function _getTitle( array $aArguments, array $aFormData ) {
88 88
                 
89
-            if ( ! $this->oCaller->oProp->bShowWidgetTitle ) {
89
+            if ( !$this->oCaller->oProp->bShowWidgetTitle ) {
90 90
                 return '';
91 91
             }
92 92
             
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
                 $aFormData,
101 101
                 $this->id_base 
102 102
             );
103
-            if ( ! $_sTitle ) {
103
+            if ( !$_sTitle ) {
104 104
                 return '';
105 105
             }
106
-           return $aArguments['before_title'] 
106
+           return $aArguments[ 'before_title' ] 
107 107
                 . $_sTitle 
108
-            . $aArguments['after_title'];           
108
+            . $aArguments[ 'after_title' ];           
109 109
             
110 110
         }
111 111
             
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             $this->oCaller, 
122 122
             "validation_{$this->oCaller->oProp->sClassName}", 
123 123
             call_user_func_array( 
124
-                array( $this->oCaller, 'validate' ),    // triggers __call()
124
+                array( $this->oCaller, 'validate' ), // triggers __call()
125 125
                 array( $aSubmittedFormData, $aSavedFormData, $this->oCaller ) // parameters
126 126
             ), // 3.5.3+                        
127 127
             $aSavedFormData,
@@ -142,16 +142,16 @@  discard block
 block discarded – undo
142 142
         $this->oCaller->oUtil->addAndDoActions( 
143 143
             $this->oCaller, 
144 144
             array(
145
-                'load_' . $this->oCaller->oProp->sClassName, 
145
+                'load_'.$this->oCaller->oProp->sClassName, 
146 146
             ),
147 147
             $this->oCaller 
148 148
         );
149 149
 	              
150 150
         // Set up callbacks for field element outputs such as for name and it attributes.
151 151
         $this->oCaller->oProp->aFormCallbacks = array( 
152
-            'hfID'          => array( $this, 'get_field_id' ),    // defined in the WP_Widget class.  
153
-            'hfTagID'       => array( $this, 'get_field_id' ),    // defined in the WP_Widget class.  
154
-            'hfName'        => array( $this, '_replyToGetFieldName' ),  // defined in the WP_Widget class.  
152
+            'hfID'          => array( $this, 'get_field_id' ), // defined in the WP_Widget class.  
153
+            'hfTagID'       => array( $this, 'get_field_id' ), // defined in the WP_Widget class.  
154
+            'hfName'        => array( $this, '_replyToGetFieldName' ), // defined in the WP_Widget class.  
155 155
             'hfInputName'   => array( $this, '_replyToGetFieldInputName' ),
156 156
             // 'hfClass'       => array( $this, '_replyToAddClassSelector' ),
157 157
             // 'hfNameFlat'    => array( $this, '_replyToGetFlatFieldName' ), // @deprecated 3.6.0+ the same as the framework factory method.
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $this->oCaller->oUtil->addAndDoActions( 
167 167
             $this->oCaller, 
168 168
             array(
169
-                'load_after_' . $this->oCaller->oProp->sClassName, 
169
+                'load_after_'.$this->oCaller->oProp->sClassName, 
170 170
             ),
171 171
             $this->oCaller 
172 172
         );        
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
             $_aParams      = func_get_args() + array( null, null, null );
208 208
             $aField        = $_aParams[ 1 ];
209 209
             
210
-            $_sSectionIndex = isset( $aField['section_id'], $aField['_section_index'] ) 
211
-                ? "[{$aField['_section_index']}]" 
210
+            $_sSectionIndex = isset( $aField[ 'section_id' ], $aField[ '_section_index' ] ) 
211
+                ? "[{$aField[ '_section_index' ]}]" 
212 212
                 : "";             
213 213
             $_sID           = $this->oCaller->isSectionSet( $aField )
214
-                ? $aField['section_id'] . "]" . $_sSectionIndex . "[" . $aField[ 'field_id' ]
215
-                : $aField['field_id'];
214
+                ? $aField[ 'section_id' ]."]".$_sSectionIndex."[".$aField[ 'field_id' ]
215
+                : $aField[ 'field_id' ];
216 216
             return $this->get_field_name( $_sID );
217 217
         
218 218
         }    
@@ -231,15 +231,15 @@  discard block
 block discarded – undo
231 231
             $_sIndex = $this->oCaller->oUtil->getAOrB(
232 232
                 '0' !== $sIndex && empty( $sIndex ),
233 233
                 '',
234
-                "[" . $sIndex . "]"
234
+                "[".$sIndex."]"
235 235
             );                        
236
-            $_sSectionIndex = isset( $aField['section_id'], $aField['_section_index'] ) 
237
-                ? "[{$aField['_section_index']}]" 
236
+            $_sSectionIndex = isset( $aField[ 'section_id' ], $aField[ '_section_index' ] ) 
237
+                ? "[{$aField[ '_section_index' ]}]" 
238 238
                 : "";             
239 239
             $_sID           = $this->oCaller->isSectionSet( $aField )
240
-                ? $aField['section_id'] . "]" . $_sSectionIndex . "[" . $aField[ 'field_id' ]
240
+                ? $aField[ 'section_id' ]."]".$_sSectionIndex."[".$aField[ 'field_id' ]
241 241
                 : $aField[ 'field_id' ];
242
-            return $this->get_field_name( $_sID ) . $_sIndex;
242
+            return $this->get_field_name( $_sID ).$_sIndex;
243 243
             
244 244
         }
245 245
         
Please login to merge, or discard this patch.
development/utility/AdminPageFramework_PluginBootstrap.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
      * @param       string      $sPluginFilePath        The plugin file path.
39 39
      * @param       string      $sPluginHookPrefix      The plugin hook slug without underscore. This will be used to construct hook names.
40 40
      * @param       string      $sSetUpHook             The action hook name for the setUp callback. Default 'plugins_loaded'.
41
-     * @param       string      $iPriority              The priority. Set a lower number to get loader earlier. Default: `10`.
41
+     * @param       integer      $iPriority              The priority. Set a lower number to get loader earlier. Default: `10`.
42 42
      */
43 43
     public function __construct( $sPluginFilePath, $sPluginHookPrefix='', $sSetUpHook='plugins_loaded', $iPriority=10 ) {
44 44
         
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      * @param       string      $sSetUpHook             The action hook name for the setUp callback. Default 'plugins_loaded'.
41 41
      * @param       string      $iPriority              The priority. Set a lower number to get loader earlier. Default: `10`.
42 42
      */
43
-    public function __construct( $sPluginFilePath, $sPluginHookPrefix='', $sSetUpHook='plugins_loaded', $iPriority=10 ) {
43
+    public function __construct( $sPluginFilePath, $sPluginHookPrefix = '', $sSetUpHook = 'plugins_loaded', $iPriority = 10 ) {
44 44
         
45 45
         // Check if it has been loaded.
46 46
         if ( $this->_hasLoaded() ) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         register_deactivation_hook( $this->sFilePath, array( $this, 'replyToPluginDeactivation' ) );
77 77
                  
78 78
         // 8. Schedule to load plugin specific components.
79
-        if ( ! $this->sSetUpHook || did_action( $this->sSetUpHook ) )  {
79
+        if ( !$this->sSetUpHook || did_action( $this->sSetUpHook ) ) {
80 80
             $this->_replyToLoadPluginComponents();
81 81
         } else {
82 82
             add_action( $this->sSetUpHook, array( $this, '_replyToLoadPluginComponents' ), $this->iPriority );
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
          */
114 114
         protected function _registerClasses() {
115 115
             
116
-            if ( ! class_exists( 'AdminPageFramework_RegisterClasses' ) ) {
116
+            if ( !class_exists( 'AdminPageFramework_RegisterClasses' ) ) {
117 117
                 return;
118 118
             }                        
119 119
             // Register classes
120 120
             new AdminPageFramework_RegisterClasses( 
121
-                $this->getScanningDirs(),   // scanning directory paths
122
-                array(),                    // autoloader options
121
+                $this->getScanningDirs(), // scanning directory paths
122
+                array(), // autoloader options
123 123
                 $this->getClasses()         // pre-generated class list
124 124
             );
125 125
                     
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
         register_deactivation_hook( $this->sFilePath, array( $this, 'replyToPluginDeactivation' ) );
77 77
                  
78 78
         // 8. Schedule to load plugin specific components.
79
-        if ( ! $this->sSetUpHook || did_action( $this->sSetUpHook ) )  {
79
+        if ( ! $this->sSetUpHook || did_action( $this->sSetUpHook ) ) {
80 80
             $this->_replyToLoadPluginComponents();
81 81
         } else {
82 82
             add_action( $this->sSetUpHook, array( $this, '_replyToLoadPluginComponents' ), $this->iPriority );
Please login to merge, or discard this patch.
development/utility/AdminPageFramework_Requirement.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -134,6 +134,7 @@  discard block
 block discarded – undo
134 134
          * Returns a php warning if present.
135 135
          * @since       3.5.3
136 136
          * @internal
137
+         * @param string $sType
137 138
          * @return      string      The warning.
138 139
          */
139 140
         private function _getWarningByType( $sType ) {
@@ -226,6 +227,7 @@  discard block
 block discarded – undo
226 227
              * if it returns non true (false), it stores the subject warning and returns the array holding the warnings.
227 228
              * 
228 229
              * @since       3.4.6
230
+             * @param string $sFuncName
229 231
              * @return      array           The warning array.
230 232
              */
231 233
             private function _getWarningsByFunctionName( $sFuncName, $aSubjects ) {
@@ -285,6 +287,7 @@  discard block
 block discarded – undo
285 287
     /**
286 288
      * Deactivates the plugin.
287 289
      * @since       3.4.6
290
+     * @param string $sPluginFilePath
288 291
      */
289 292
     public function deactivatePlugin( $sPluginFilePath, $sMessage='', $bIsOnActivation=false ) {
290 293
         
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -278,7 +278,7 @@
 block discarded – undo
278 278
                     ?  "<strong>" . $this->_sScriptName . "</strong>:&nbsp;" 
279 279
                     : '';            
280 280
                 return $_sScripTitle
281
-                   . implode( '<br />', $_aWarnings );
281
+                    . implode( '<br />', $_aWarnings );
282 282
                 
283 283
             }
284 284
         
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
      * 
77 77
      * @since       3.4.6
78 78
      */ 
79
-    public function __construct( array $aRequirements=array(), $sScriptName='' ) {
79
+    public function __construct( array $aRequirements = array(), $sScriptName = '' ) {
80 80
         
81 81
         // Avoid undefined index warnings.
82 82
         $aRequirements          = $aRequirements + $this->_aDefaultRequirements;    
83 83
         $aRequirements          = array_filter( $aRequirements, 'is_array' );
84
-        foreach( array( 'php', 'mysql', 'wordpress' ) as $_iIndex => $_sName ) {
84
+        foreach ( array( 'php', 'mysql', 'wordpress' ) as $_iIndex => $_sName ) {
85 85
             if ( isset( $aRequirements[ $_sName ] ) ) {
86 86
                 $aRequirements[ $_sName ] = $aRequirements[ $_sName ] + $this->_aDefaultRequirements[ $_sName ];
87 87
             }
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
         $_aWarnings = array();
106 106
         
107 107
         // PHP, WordPress, MySQL
108
-        $_aWarnings[] = $this->_getWarningByType( 'php' );
109
-        $_aWarnings[] = $this->_getWarningByType( 'wordpress' );
110
-        $_aWarnings[] = $this->_getWarningByType( 'mysql' );
108
+        $_aWarnings[ ] = $this->_getWarningByType( 'php' );
109
+        $_aWarnings[ ] = $this->_getWarningByType( 'wordpress' );
110
+        $_aWarnings[ ] = $this->_getWarningByType( 'mysql' );
111 111
         
112 112
         // Ensure necessary array elements.
113 113
         $this->_aRequirements = $this->_aRequirements + array(
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
         // Check the rest.
121 121
         $_aWarnings = array_merge(
122 122
             $_aWarnings,
123
-            $this->_checkFunctions( $this->_aRequirements['functions'] ),
124
-            $this->_checkClasses( $this->_aRequirements['classes'] ),
125
-            $this->_checkConstants( $this->_aRequirements['constants'] ),
126
-            $this->_checkFiles( $this->_aRequirements['files'] )
123
+            $this->_checkFunctions( $this->_aRequirements[ 'functions' ] ),
124
+            $this->_checkClasses( $this->_aRequirements[ 'classes' ] ),
125
+            $this->_checkConstants( $this->_aRequirements[ 'constants' ] ),
126
+            $this->_checkFiles( $this->_aRequirements[ 'files' ] )
127 127
         );
128 128
         
129 129
         $this->aWarnings = array_filter( $_aWarnings ); // drop empty elements.
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
          * @return      string      The warning.
138 138
          */
139 139
         private function _getWarningByType( $sType ) {
140
-            if ( ! isset( $this->_aRequirements[ $sType ][ 'version' ] ) ) {
140
+            if ( !isset( $this->_aRequirements[ $sType ][ 'version' ] ) ) {
141 141
                 return '';
142 142
             }
143 143
             if ( $this->_checkPHPVersion( $this->_aRequirements[ $sType ][ 'version' ] ) ) {
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
          * @since       3.4.6
165 165
          */
166 166
         private function _checkWordPressVersion( $sWordPressVersion ) {
167
-            return version_compare( $GLOBALS['wp_version'], $sWordPressVersion, ">=" );
167
+            return version_compare( $GLOBALS[ 'wp_version' ], $sWordPressVersion, ">=" );
168 168
         }
169 169
         
170 170
         /**
@@ -230,9 +230,9 @@  discard block
 block discarded – undo
230 230
              */
231 231
             private function _getWarningsByFunctionName( $sFuncName, $aSubjects ) {
232 232
                 $_aWarnings = array();
233
-                foreach( $aSubjects as $_sSubject => $_sWarning ) {
234
-                    if ( ! call_user_func_array( $sFuncName, array( $_sSubject ) ) ) {
235
-                        $_aWarnings[] = sprintf( $_sWarning, $_sSubject );
233
+                foreach ( $aSubjects as $_sSubject => $_sWarning ) {
234
+                    if ( !call_user_func_array( $sFuncName, array( $_sSubject ) ) ) {
235
+                        $_aWarnings[ ] = sprintf( $_sWarning, $_sSubject );
236 236
                     }
237 237
                 }
238 238
                 return $_aWarnings;                
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
          */    
253 253
         public function _replyToPrintAdminNotices() {
254 254
             
255
-            $_aWarnings     = array_unique( $this->aWarnings );
255
+            $_aWarnings = array_unique( $this->aWarnings );
256 256
             if ( empty( $_aWarnings ) ) {
257 257
                 return;
258 258
             }
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
              */
271 271
             private function _getWarnings() {
272 272
 
273
-                $_aWarnings     = array_unique( $this->aWarnings );            
273
+                $_aWarnings = array_unique( $this->aWarnings );            
274 274
                 if ( empty( $_aWarnings ) ) {
275 275
                     return '';
276 276
                 }        
277
-                $_sScripTitle   = $this->_sScriptName 
278
-                    ?  "<strong>" . $this->_sScriptName . "</strong>:&nbsp;" 
277
+                $_sScripTitle = $this->_sScriptName 
278
+                    ? "<strong>".$this->_sScriptName."</strong>:&nbsp;" 
279 279
                     : '';            
280 280
                 return $_sScripTitle
281 281
                    . implode( '<br />', $_aWarnings );
@@ -286,12 +286,12 @@  discard block
 block discarded – undo
286 286
      * Deactivates the plugin.
287 287
      * @since       3.4.6
288 288
      */
289
-    public function deactivatePlugin( $sPluginFilePath, $sMessage='', $bIsOnActivation=false ) {
289
+    public function deactivatePlugin( $sPluginFilePath, $sMessage = '', $bIsOnActivation = false ) {
290 290
         
291 291
         add_action( 'admin_notices', array( $this, '_replyToPrintAdminNotices' ) );
292
-        $this->aWarnings[] = '<strong>' . $sMessage . '</strong>';
293
-        if ( ! function_exists( 'deactivate_plugins' ) ) {
294
-            if ( ! @include( ABSPATH . '/wp-admin/includes/plugin.php' ) ) {
292
+        $this->aWarnings[ ] = '<strong>'.$sMessage.'</strong>';
293
+        if ( !function_exists( 'deactivate_plugins' ) ) {
294
+            if ( !@include( ABSPATH.'/wp-admin/includes/plugin.php' ) ) {
295 295
                 return;
296 296
             }
297 297
         }
@@ -301,8 +301,8 @@  discard block
 block discarded – undo
301 301
         // Before that, we can display messages to the user.
302 302
         if ( $bIsOnActivation ) {
303 303
             
304
-            $_sPluginListingPage = add_query_arg( array(), $GLOBALS['pagenow'] );
305
-            wp_die( $this->_getWarnings() . "<p><a href='$_sPluginListingPage'>Go back</a>.</p>" );
304
+            $_sPluginListingPage = add_query_arg( array(), $GLOBALS[ 'pagenow' ] );
305
+            wp_die( $this->_getWarnings()."<p><a href='$_sPluginListingPage'>Go back</a>.</p>" );
306 306
             
307 307
         }
308 308
         
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
      * @since       3.4.6
101 101
      * @return      integer         The number of warnings.
102 102
      */
103
-    public function check() {      
103
+    public function check() {
104 104
         
105 105
         $_aWarnings = array();
106 106
         
Please login to merge, or discard this patch.
development/utility/readme_parser/AdminPageFramework_WPReadmeParser.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,6 @@  discard block
 block discarded – undo
81 81
      *      'code_block'        =>  ...,
82 82
      *      
83 83
      * )`
84
-     * @param       array       $aOptions           The options array which determines the behaviour of the class.
85 84
      * @since       3.5.0
86 85
      * @since       3.6.0       Made it accept string content to be passed to the first parameter.
87 86
      */
@@ -156,6 +155,7 @@  discard block
 block discarded – undo
156 155
          * Returns the parsed text.
157 156
          * @since       3.5.0
158 157
          * @internal
158
+         * @param string $sContent
159 159
          */
160 160
         private function _getParsedText( $sContent ) {
161 161
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      * @since       3.5.0
86 86
      * @since       3.6.0       Made it accept string content to be passed to the first parameter.
87 87
      */
88
-    public function __construct( $sFilePathOrContent='', array $aReplacements=array(), array $aCallbacks=array() ) {
88
+    public function __construct( $sFilePathOrContent = '', array $aReplacements = array(), array $aCallbacks = array() ) {
89 89
 
90 90
         $this->sText            = file_exists( $sFilePathOrContent )
91 91
             ? file_get_contents( $sFilePathOrContent )
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 '/^[\s]*==[\s]*(.+?)[\s]*==/m', 
122 122
                 $sText,
123 123
                 -1, 
124
-                PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY 
124
+                PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY 
125 125
             );         
126 126
             return $_aSections;
127 127
         }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      * @since       3.5.0
133 133
      * @return      string
134 134
      */
135
-    public function get( $sSectionName='' ) {
135
+    public function get( $sSectionName = '' ) {
136 136
         return $sSectionName
137 137
             ? $this->getSection( $sSectionName )
138 138
             : $this->_getParsedText( $this->sText );
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
          */
195 195
         public function _replyToReplaceCodeBlocks( $aMatches ) {
196 196
             
197
-            if ( ! isset( $aMatches[ 1 ] ) ) {
197
+            if ( !isset( $aMatches[ 1 ] ) ) {
198 198
                 return $aMatches[ 0 ];
199 199
             }
200 200
             
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      */
218 218
     public function getRawSection( $sSectionName ) {
219 219
 
220
-        $_iIndex   = array_search( $sSectionName, $this->_aSections );  
220
+        $_iIndex = array_search( $sSectionName, $this->_aSections );  
221 221
         return false === $_iIndex
222 222
             ? ''
223 223
             : trim( $this->_aSections[ $_iIndex + 1 ] );
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         // If <?php notation is missing, highlight_string() will not highlight the syntax so add it.
238 238
         $_bHasPHPTag = "<?php" === substr( $sCode, 0, 5 );
239 239
         
240
-        $sCode = $_bHasPHPTag ? $sCode : "<?php " . $sCode;
240
+        $sCode = $_bHasPHPTag ? $sCode : "<?php ".$sCode;
241 241
         
242 242
         $sCode = str_replace( '"', "'", $sCode ); // highlight_string() crashes if double quotes are contained in the code.
243 243
         $sCode = highlight_string( $sCode, true );
Please login to merge, or discard this patch.
class/admin/_abstract/AdminPageFrameworkLoader_AdminPage_Tab_ReadMeBase.php 4 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -20,6 +20,8 @@
 block discarded – undo
20 20
     /**
21 21
      * 
22 22
      * @since       3.5.3
23
+     * @param string $sFilePath
24
+     * @param string $sTOCTitle
23 25
      */
24 26
     protected function _getReadmeContents( $sFilePath, $sTOCTitle, $asSections=array() ) {
25 27
         
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
             return $_oTOC->get();        
47 47
         }
48 48
         return ''
49
-         . $_sContent;
49
+            . $_sContent;
50 50
         
51 51
     }
52 52
     
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      * 
22 22
      * @since       3.5.3
23 23
      */
24
-    protected function _getReadmeContents( $sFilePath, $sTOCTitle, $asSections=array() ) {
24
+    protected function _getReadmeContents( $sFilePath, $sTOCTitle, $asSections = array() ) {
25 25
         
26 26
         $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser( 
27 27
             $sFilePath, 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             )
35 35
         );    
36 36
         $_sContent = '';
37
-        foreach( ( array ) $asSections as $_sSection  ) {
37
+        foreach ( ( array ) $asSections as $_sSection ) {
38 38
             $_sContent .= $_oWPReadmeParser->getSection( $_sSection );  
39 39
         }        
40 40
         if ( $sTOCTitle ) {            
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
              * @since       3.6.1
67 67
              * @return      string      The generate HTML output.
68 68
              */
69
-            public function _replyToProcessShortcode_embed( $aAttributes, $sURL, $sShortcode='' ) {
69
+            public function _replyToProcessShortcode_embed( $aAttributes, $sURL, $sShortcode = '' ) {
70 70
 
71 71
                 $sURL   = isset( $aAttributes[ 'src' ] ) ? $aAttributes[ 'src' ] : $sURL;      
72 72
                 $_sHTML = wp_oembed_get( $sURL );
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         foreach( ( array ) $asSections as $_sSection  ) {
38 38
             $_sContent .= $_oWPReadmeParser->getSection( $_sSection );  
39 39
         }        
40
-        if ( $sTOCTitle ) {            
40
+        if ( $sTOCTitle ) {
41 41
             $_oTOC = new AdminPageFramework_TableOfContents(
42 42
                 $_sContent,
43 43
                 4,
Please login to merge, or discard this patch.
generator/AdminPageFrameworkLoader_AdminPage_Tool_Generator_Generator.php 3 patches
Doc Comments   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -257,6 +257,7 @@  discard block
 block discarded – undo
257 257
          * Generates the framework zip data.
258 258
          * 
259 259
          * @since       3.5.4
260
+         * @param string $sFrameworkDirPath
260 261
          * @return      string      The binary zip data.
261 262
          */
262 263
         private function _getDownloadFrameworkZipFile( $sFrameworkDirPath, $sDestinationPath ) {
@@ -308,11 +309,7 @@  discard block
 block discarded – undo
308 309
                  * 
309 310
                  * @since       3.5.4
310 311
                  * @remark      string      $sPath              The path to check. It can be a directory or a file.
311
-                 * @param       string      $sPathInArchive     The parsing directory path set to the archive. 
312
-                 * The passed path for the archive has a trailing slash. It starts with a directory name.
313
-                 * e.g.
314
-                 * `utility/AdminPageFramework_WPReadmeParser/`
315
-                 * `factory/widget/model/`
312
+                 * @param string $sPath
316 313
                  * @return      boolean
317 314
                  */
318 315
                 private function _isAllowedArchivePath( $sPath ) {
@@ -567,6 +564,7 @@  discard block
 block discarded – undo
567 564
                  * Modifies the text domain in the given file contents.
568 565
                  * 
569 566
                  * @since       3.5.4
567
+                 * @param string $sFileContents
570 568
                  * @return      string
571 569
                  */                
572 570
                 private function _modifyTextDomain( $sFileContents ) {
@@ -585,6 +583,7 @@  discard block
 block discarded – undo
585 583
                      * Retrieves the value from the $_POST array by the given field ID.
586 584
                      * 
587 585
                      * @since       3.5.4
586
+                     * @param string $sFieldID
588 587
                      * @return      string
589 588
                      */
590 589
                     private function _getFormSubmitValueByFieldIDAsString( $sFieldID ) {
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $this->oFactory = $oFactory;
31 31
         
32 32
         add_action( 
33
-            'export_name_' . $this->sPageSlug . '_' . $this->sTabSlug, 
33
+            'export_name_'.$this->sPageSlug.'_'.$this->sTabSlug, 
34 34
             array( $this, 'replyToFilterFileName' ), 
35 35
             10, 
36 36
             5 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                 'title'             => __( 'Class Prefix', 'admin-page-framework-loader' ),
77 77
                 'type'              => 'text',
78 78
                 'description'       => __( 'Set alphanumeric characters for the class names.', 'admin-page-framework-loader' )
79
-                    . ' ' .  __( 'For example, if you set here <code>MyPluginName_</code>, you will need to extend the class named <code>MyClassName_AdminPageFramework</code> instead of <code>AdminPageFramework</code>.', 'admin-page-framework-loader' )
79
+                    . ' '.__( 'For example, if you set here <code>MyPluginName_</code>, you will need to extend the class named <code>MyClassName_AdminPageFramework</code> instead of <code>AdminPageFramework</code>.', 'admin-page-framework-loader' )
80 80
                     . ' e.g.<code>MyPluginName_</code>',
81 81
                 'attributes'        => array(
82 82
                     'size'          => 30,
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
                 'label_min_width'   => 0,
127 127
                 'order'             => 100,
128 128
                 'value'             => __( 'Download', 'adimn-page-framework-demo' ),
129
-                'file_name'         => 'admin-page-framework.zip',  // the default file name. This will be modified by the filter.
130
-                'format'            => 'text',  // 'json', 'text', 'array'      
129
+                'file_name'         => 'admin-page-framework.zip', // the default file name. This will be modified by the filter.
130
+                'format'            => 'text', // 'json', 'text', 'array'      
131 131
                 'description'       => $oFactory->oUtil->getAOrB(
132 132
                     class_exists( 'ZipArchive' ),
133 133
                     __( 'Download the compiled framework files as a zip file.', 'admin-page-framework-loader' ),
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
         
182 182
         // the class prefix must not contain white spaces and some other characters not supported in PHP class names.
183 183
         preg_match( 
184
-            '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/',     // pattern - allowed characters for variables in PHP.
185
-            $aInput[ 'class_prefix' ],     // subject
184
+            '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', // pattern - allowed characters for variables in PHP.
185
+            $aInput[ 'class_prefix' ], // subject
186 186
             $_aMatches 
187 187
         );
188 188
         if ( $aInput[ 'class_prefix' ] && empty( $_aMatches ) ) {
@@ -190,13 +190,13 @@  discard block
 block discarded – undo
190 190
             $_bVerified = false;
191 191
         }
192 192
                         
193
-        if ( ! $aInput[ 'text_domain' ] ) {
193
+        if ( !$aInput[ 'text_domain' ] ) {
194 194
             $_aErrors[ 'text_domain' ] = __( 'The text domain cannot be empty.', 'admin-page-framework-loader' );
195 195
             $_bVerified = false;
196 196
         }
197 197
                 
198 198
         // An invalid value is found. Set a field error array and an admin notice and return the old values.
199
-        if ( ! $_bVerified ) {
199
+        if ( !$_bVerified ) {
200 200
             $oAdminPage->setFieldErrors( $_aErrors );     
201 201
             $oAdminPage->setSettingNotice( __( 'There was something wrong with your input.', 'admin-page-framework-loader' ) );
202 202
             return $aOldInput;
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
      */
239 239
     public function replyToDownloadFramework( $aSavedData, $sSubmittedFieldID, $sSubmittedInputID, $oAdminPage ) {
240 240
         
241
-        $_sFrameworkDirPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/library/admin-page-framework';
242
-        if ( ! file_exists( $_sFrameworkDirPath ) ) {
241
+        $_sFrameworkDirPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/library/admin-page-framework';
242
+        if ( !file_exists( $_sFrameworkDirPath ) ) {
243 243
             return $aSavedData;
244 244
         }
245 245
         
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             $_sFrameworkDirPath, 
249 249
             $_sTempFile
250 250
         );
251
-        header( "Content-Length: " . strlen( $_sData ) ); 
251
+        header( "Content-Length: ".strlen( $_sData ) ); 
252 252
         unlink( $_sTempFile );
253 253
         return $_sData;
254 254
         
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
                 $sFrameworkDirPath, 
266 266
                 $sDestinationPath, 
267 267
                 array(
268
-                    'include_directory'             => false,   // wrap contents in a sub-directory
268
+                    'include_directory'             => false, // wrap contents in a sub-directory
269 269
                     'additional_source_directories' => apply_filters(
270
-                        AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_additional_source_directories',
270
+                        AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_additional_source_directories',
271 271
                         array() // directory paths 
272 272
                     ),
273 273
                 ),                
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                 ) 
279 279
             );
280 280
             $_bSucceed = $_oZip->compress();
281
-            if ( ! $_bSucceed ) {
281
+            if ( !$_bSucceed ) {
282 282
                 return '';
283 283
             }
284 284
             return file_get_contents( $sDestinationPath );
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
                 
299 299
                 // Check if it belongs to selected components.
300 300
                 if ( false === $this->_isAllowedArchivePath( $sPathInArchive ) ) {
301
-                    return '';  // empty value will drop the entry
301
+                    return ''; // empty value will drop the entry
302 302
                 }                
303 303
                 return $sPathInArchive;
304 304
                            
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
                  */
318 318
                 private function _isAllowedArchivePath( $sPath ) {
319 319
                     
320
-                    foreach( $this->_getDisallowedArchiveDirectoryPaths() as $_sDisallowedPath ) {
320
+                    foreach ( $this->_getDisallowedArchiveDirectoryPaths() as $_sDisallowedPath ) {
321 321
                         $_bHasPrefix = $this->oFactory->oUtil->hasPrefix( 
322 322
                             ltrim( $_sDisallowedPath, '/' ), // needle
323 323
                             ltrim( $sPath, '/' ) // haystack
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
                     // List paths.
387 387
                     $_aAllComponentsPaths       = array();
388 388
                     $_aSelectedComponentsPaths  = array();
389
-                    foreach( $this->_aComponentPaths as $_sKey => $_aPaths ) {
389
+                    foreach ( $this->_aComponentPaths as $_sKey => $_aPaths ) {
390 390
                     
391 391
                         // Extract all component paths.
392 392
                         $_aAllComponentsPaths = array_merge(
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
             public function _replyToModifyFileContents( $sFileContents, $sPathInArchive ) {
441 441
 
442 442
                 $sFileContents = apply_filters(
443
-                    AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_file_contents',
443
+                    AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_file_contents',
444 444
                     $sFileContents, 
445 445
                     $sPathInArchive,
446 446
                     $this->oFactory->oUtil->getElement(
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
                 );
455 455
             
456 456
                 // Check the file extension.
457
-                if ( ! in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), array( 'php', 'css', 'js' ) ) ) {
457
+                if ( !in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), array( 'php', 'css', 'js' ) ) ) {
458 458
                     return $sFileContents;
459 459
                 }
460 460
                 
@@ -506,12 +506,12 @@  discard block
 block discarded – undo
506 506
                             $this->_getCheckedComponents()
507 507
                         );
508 508
                         $_aInsert = array(
509
-                            'Included Components: ' . implode( ', ', $_aCheckedComponents ),
510
-                            'Generated on ' . date( 'Y-m-d' ),  // today's date
509
+                            'Included Components: '.implode( ', ', $_aCheckedComponents ),
510
+                            'Generated on '.date( 'Y-m-d' ), // today's date
511 511
                         );
512 512
                         return preg_replace(
513 513
                             '#\*/#', // needle - matches '*/'
514
-                            implode( PHP_EOL . ' ', $_aInsert ) . ' \0', // replacement \0 is a back-reference to '*/'
514
+                            implode( PHP_EOL.' ', $_aInsert ).' \0', // replacement \0 is a back-reference to '*/'
515 515
                             $sFileContents, // subject
516 516
                             1 // replace only the first occurrence
517 517
                         );      
@@ -525,14 +525,14 @@  discard block
 block discarded – undo
525 525
                     private function _modifyClassNameOfInclusionList( $sFileContents ) {
526 526
                         // Replace the array key names.
527 527
                         $sFileContents = preg_replace_callback(
528
-                            '/(["\'])(.+)\1(?=\s?+=>)/',  // pattern '
529
-                            array( $this, '_replyToModifyPathName' ),   // callable
528
+                            '/(["\'])(.+)\1(?=\s?+=>)/', // pattern '
529
+                            array( $this, '_replyToModifyPathName' ), // callable
530 530
                             $sFileContents // subject
531 531
                         );     
532 532
                         // Replace the registry class names.
533 533
                         return preg_replace_callback(
534
-                            '/(=>\s?+)(.+)(?=::)/',  // pattern '
535
-                            array( $this, '_replyToModifyPathName' ),   // callable
534
+                            '/(=>\s?+)(.+)(?=::)/', // pattern '
535
+                            array( $this, '_replyToModifyPathName' ), // callable
536 536
                             $sFileContents // subject
537 537
                         );     
538 538
                     }
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
                     return strlen( $_sPrefix )
558 558
                         ? str_replace( 
559 559
                             'AdminPageFramework', // search 
560
-                            $_sPrefix . 'AdminPageFramework', // replace
560
+                            $_sPrefix.'AdminPageFramework', // replace
561 561
                             $sSubject // subject
562 562
                         )
563 563
                         : $sSubject;
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
                      */
590 590
                     private function _getFormSubmitValueByFieldIDAsString( $sFieldID ) {
591 591
                          
592
-                        static $_aCaches=array();
592
+                        static $_aCaches = array();
593 593
                         $_aCaches[ $sFieldID ] = isset( $_aCaches[ $sFieldID ] )
594 594
                             ? $_aCaches[ $sFieldID ]
595 595
                             : $this->oFactory->oUtil->getElement(
@@ -623,9 +623,9 @@  discard block
 block discarded – undo
623 623
                 'public',
624 624
             ),
625 625
             'Content-Description'       => 'File Transfer',
626
-            'Content-type'              => 'application/octet-stream',   // 'application/zip' may work as well
626
+            'Content-type'              => 'application/octet-stream', // 'application/zip' may work as well
627 627
             'Content-Transfer-Encoding' => 'binary',
628
-            'Content-Disposition'       => 'attachment; filename="' . $sFileName .'";',
628
+            'Content-Disposition'       => 'attachment; filename="'.$sFileName.'";',
629 629
             // 'Content-Length'            => strlen( $mData ),
630 630
         ) + $aHeader;
631 631
         
@@ -662,10 +662,10 @@  discard block
 block discarded – undo
662 662
         $_sFileNameWOExtension = trim( $_sFileNameWOExtension );
663 663
         return $this->oFactory->oUtil->getAOrB(
664 664
                 $_sFileNameWOExtension,
665
-                $_sFileNameWOExtension . '-admin-page-framework',
665
+                $_sFileNameWOExtension.'-admin-page-framework',
666 666
                 'admin-page-framework'
667 667
             )
668
-            . '.' . AdminPageFramework_Registry::VERSION
668
+            . '.'.AdminPageFramework_Registry::VERSION
669 669
             . '.zip';
670 670
         
671 671
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -637,7 +637,7 @@
 block discarded – undo
637 637
      * @callback    filter    "export_name_{page slug}_{tab slug}" filter.
638 638
      * @return      string
639 639
      */
640
-    public function replyToFilterFileName( $sFileName, $sFieldID, $sInputID, $vExportingData, $oAdminPage ) { 
640
+    public function replyToFilterFileName( $sFileName, $sFieldID, $sInputID, $vExportingData, $oAdminPage ) {
641 641
         return $this->_getDownloadFileName();
642 642
     }        
643 643
     
Please login to merge, or discard this patch.