Completed
Branch master (bd1f84)
by
unknown
01:13 queued 37s
created
admin-page-framework-loader.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class AdminPageFrameworkLoader_Registry_Base {
18 18
 
19
-    const VERSION        = '3.8.33';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
19
+    const VERSION        = '3.8.33'; // <--- 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
 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
      * The text domain slug and its path.
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
factory/_common/utility/base_utility/AdminPageFramework_Utility_Array.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
      * @since  3.8.9
29 29
      * @since  3.8.32   Moved from `AdminPageFramework_Debug_Base` and renamed from `___getArrayMappedRecursive()` and made public as a part of the utility class.
30 30
      */
31
-    static public function getArrayMappedRecursive( $cCallback, $aArray, array $aArguments=array() ) {
31
+    static public function getArrayMappedRecursive( $cCallback, $aArray, array $aArguments = array() ) {
32 32
         $_aOutput = array();
33
-        foreach( $aArray as $_isKey => $_vValue ) {
33
+        foreach ( $aArray as $_isKey => $_vValue ) {
34 34
             if ( is_array( $_vValue ) ) {
35 35
                 $_aOutput[ $_isKey ] = self::getArrayMappedRecursive( $cCallback, $_vValue, $aArguments );
36 36
                 continue;
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
      * @return      numeric
48 48
      * @since       3.7.4
49 49
      */
50
-    static public function getUnusedNumericIndex( $aArray, $nIndex, $iOffset=1 ) {
50
+    static public function getUnusedNumericIndex( $aArray, $nIndex, $iOffset = 1 ) {
51 51
 
52 52
         // Check if the order value is not used.
53
-        if ( ! isset( $aArray[ $nIndex ] ) ) {
53
+        if ( !isset( $aArray[ $nIndex ] ) ) {
54 54
             return $nIndex;
55 55
         }
56 56
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @return      boolean
66 66
      */
67 67
     static public function isAssociative( array $aArray ) {
68
-        return array_keys ( $aArray ) !== range( 0, count( $aArray ) - 1 );
68
+        return array_keys( $aArray ) !== range( 0, count( $aArray ) - 1 );
69 69
     }
70 70
 
71 71
     /**
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
      */
99 99
     static public function getReadableListOfArray( array $aArray ) {
100 100
 
101
-        $_aOutput   = array();
102
-        foreach( $aArray as $_sKey => $_vValue ) {
103
-            $_aOutput[] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ) . PHP_EOL;
101
+        $_aOutput = array();
102
+        foreach ( $aArray as $_sKey => $_vValue ) {
103
+            $_aOutput[ ] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ).PHP_EOL;
104 104
         }
105 105
         return implode( PHP_EOL, $_aOutput );
106 106
 
@@ -111,37 +111,37 @@  discard block
 block discarded – undo
111 111
      * @since       3.3.0
112 112
      * @return      string      The generated human readable array contents.
113 113
      */
114
-    static public function getReadableArrayContents( $sKey, $vValue, $sLabelCharLengths=16, $iOffset=0 ) {
114
+    static public function getReadableArrayContents( $sKey, $vValue, $sLabelCharLengths = 16, $iOffset = 0 ) {
115 115
 
116 116
         $_aOutput   = array();
117
-        $_aOutput[] = ( $iOffset
118
-                ? str_pad( ' ', $iOffset  )
117
+        $_aOutput[ ] = ( $iOffset
118
+                ? str_pad( ' ', $iOffset )
119 119
                 : ''
120 120
             )
121 121
             . ( $sKey
122
-                ? '[' . $sKey . ']'
122
+                ? '['.$sKey.']'
123 123
                 : ''
124 124
             );
125 125
 
126
-        if ( ! in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) {
127
-            $_aOutput[] = $vValue;
126
+        if ( !in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) {
127
+            $_aOutput[ ] = $vValue;
128 128
             return implode( PHP_EOL, $_aOutput );
129 129
         }
130 130
 
131 131
         foreach ( $vValue as $_sTitle => $_asDescription ) {
132
-            if ( ! in_array( gettype( $_asDescription ), array( 'array', 'object' ) ) ) {
133
-                $_aOutput[] = str_pad( ' ', $iOffset )
132
+            if ( !in_array( gettype( $_asDescription ), array( 'array', 'object' ) ) ) {
133
+                $_aOutput[ ] = str_pad( ' ', $iOffset )
134 134
                     . $_sTitle
135 135
                     . str_pad( ':', $sLabelCharLengths - self::getStringLength( $_sTitle ) )
136 136
                     . $_asDescription;
137 137
                 continue;
138 138
             }
139
-            $_aOutput[] = str_pad( ' ', $iOffset )
139
+            $_aOutput[ ] = str_pad( ' ', $iOffset )
140 140
                 . $_sTitle
141 141
                 . ": {"
142 142
                 . self::getReadableArrayContents( '', $_asDescription, 16, $iOffset + 4 )
143 143
                 . PHP_EOL
144
-                . str_pad( ' ', $iOffset ) . "}";
144
+                . str_pad( ' ', $iOffset )."}";
145 145
         }
146 146
         return implode( PHP_EOL, $_aOutput );
147 147
 
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
      */
155 155
     static public function getReadableListOfArrayAsHTML( array $aArray ) {
156 156
 
157
-        $_aOutput   = array();
158
-        foreach( $aArray as $_sKey => $_vValue ) {
159
-            $_aOutput[] = "<ul class='array-contents'>"
157
+        $_aOutput = array();
158
+        foreach ( $aArray as $_sKey => $_vValue ) {
159
+            $_aOutput[ ] = "<ul class='array-contents'>"
160 160
                     .  self::getReadableArrayContentsHTML( $_sKey, $_vValue )
161
-                . "</ul>" . PHP_EOL;
161
+                . "</ul>".PHP_EOL;
162 162
         }
163 163
         return implode( PHP_EOL, $_aOutput );
164 164
 
@@ -175,25 +175,25 @@  discard block
 block discarded – undo
175 175
             $_aOutput   = array();
176 176
 
177 177
             // Title - array key
178
-            $_aOutput[] = $sKey
179
-                ? "<h3 class='array-key'>" . $sKey . "</h3>"
178
+            $_aOutput[ ] = $sKey
179
+                ? "<h3 class='array-key'>".$sKey."</h3>"
180 180
                 : "";
181 181
 
182 182
             // If it does not have a nested array or object,
183
-            if ( ! in_array( gettype( $vValue ), array( 'array', 'object' ), true ) ) {
184
-                $_aOutput[] = "<div class='array-value'>"
183
+            if ( !in_array( gettype( $vValue ), array( 'array', 'object' ), true ) ) {
184
+                $_aOutput[ ] = "<div class='array-value'>"
185 185
                         . html_entity_decode( nl2br( $vValue ), ENT_QUOTES )
186 186
                     . "</div>";
187
-                return "<li>" . implode( PHP_EOL, $_aOutput ) . "</li>";
187
+                return "<li>".implode( PHP_EOL, $_aOutput )."</li>";
188 188
             }
189 189
 
190 190
             // Now it is a nested item.
191 191
             foreach ( $vValue as $_sKey => $_vValue ) {
192
-                $_aOutput[] =  "<ul class='array-contents'>"
192
+                $_aOutput[ ] = "<ul class='array-contents'>"
193 193
                         . self::getReadableArrayContentsHTML( $_sKey, $_vValue )
194 194
                     . "</ul>";
195 195
             }
196
-            return implode( PHP_EOL, $_aOutput ) ;
196
+            return implode( PHP_EOL, $_aOutput );
197 197
 
198 198
         }
199 199
 
Please login to merge, or discard this patch.
AdminPageFramework_Model__FormSubmission__Validator__ContactForm.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class AdminPageFramework_Model__FormSubmission__Validator__ContactForm extends AdminPageFramework_Model__FormSubmission__Validator_Base {
18 18
 
19
-    public $sActionHookPrefix = 'try_validation_after_';    // 3.7.6 Changed it from `try_validation_before_`
19
+    public $sActionHookPrefix = 'try_validation_after_'; // 3.7.6 Changed it from `try_validation_before_`
20 20
     public $iHookPriority = 10;
21 21
     public $iCallbackParameters = 5;
22 22
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) {
34 34
 
35 35
         // Check whether sending an email has been confirmed by the user or not.
36
-        if ( ! $this->_shouldProceed( $oFactory, $aSubmits ) ) {
36
+        if ( !$this->_shouldProceed( $oFactory, $aSubmits ) ) {
37 37
             return;
38 38
         }
39 39
 
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
             $this->getElement( $aSubmitInformation, 'section_id' )
45 45
         );
46 46
         $this->oFactory->oProp->_bDisableSavingOptions = true;
47
-        $this->deleteTransient( 'apf_tfd' . md5( 'temporary_form_data_' . $this->oFactory->oProp->sClassName . get_current_user_id() ) );
47
+        $this->deleteTransient( 'apf_tfd'.md5( 'temporary_form_data_'.$this->oFactory->oProp->sClassName.get_current_user_id() ) );
48 48
 
49 49
         // Schedule to remove the confirmation url query key.
50 50
         add_action( "setting_update_url_{$this->oFactory->oProp->sClassName}", array( $this, '_replyToRemoveConfirmationQueryKey' ) );
51 51
 
52 52
         // Go to the catch clause.
53
-        $_oException = new Exception( 'aReturn' );  // the property name to return from the catch clause.
53
+        $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clause.
54 54
         $_oException->aReturn = $aInputs;
55 55
         throw $_oException;
56 56
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
          */
86 86
         private function ___sendEmail( $aInputs, $sPressedInputNameFlat, $sSubmitSectionID ) {
87 87
 
88
-            $_sTransientKey = 'apf_em_' . md5( $sPressedInputNameFlat . get_current_user_id() );
88
+            $_sTransientKey = 'apf_em_'.md5( $sPressedInputNameFlat.get_current_user_id() );
89 89
             $_aEmailOptions = $this->getTransient( $_sTransientKey );
90 90
             $this->deleteTransient( $_sTransientKey );
91 91
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                 'name'          => '',
102 102
             );
103 103
 
104
-            if ( false === wp_verify_nonce( $_aEmailOptions[ 'nonce' ], 'apf_email_nonce_' . md5( ( string ) site_url() ) ) ) {
104
+            if ( false === wp_verify_nonce( $_aEmailOptions[ 'nonce' ], 'apf_email_nonce_'.md5( ( string ) site_url() ) ) ) {
105 105
                 $this->oFactory->setSettingNotice(
106 106
                     $this->oFactory->oMsg->get( 'nonce_verification_failed' ),
107 107
                     'error'
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
          * @return      string
137 137
          */
138 138
         public function _replyToRemoveConfirmationQueryKey( $sSettingUpdateURL ) {
139
-            return remove_query_arg( array( 'confirmation', ), $sSettingUpdateURL );
139
+            return remove_query_arg( array( 'confirmation',), $sSettingUpdateURL );
140 140
         }
141 141
 
142 142
 }
Please login to merge, or discard this patch.