Passed
Branch dev (18e500)
by Michael
23:10
created
development/factory/admin_page/AdminPageFramework.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
      * @param       string                  $sCapability    (optional) sets the overall access level to the admin pages created by the framework. The used capabilities are listed <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. The capability can be set per page, tab, setting section, setting field. Default: `manage_options`
57 57
      * @param       string                  $sTextDomain    (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: admin-page-framework.
58 58
      */
59
-    public function __construct( $isOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ){
59
+    public function __construct( $isOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) {
60 60
                         
61 61
         if ( ! $this->_isInstantiatable() ) {
62 62
             return;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
      * @param       string                  $sCapability    (optional) sets the overall access level to the admin pages created by the framework. The used capabilities are listed <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. The capability can be set per page, tab, setting section, setting field. Default: `manage_options`
68 68
      * @param       string                  $sTextDomain    (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: admin-page-framework.
69 69
      */
70
-    public function __construct( $isOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ){
70
+    public function __construct( $isOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) {
71 71
 
72
-        if ( ! $this->_isInstantiatable() ) {
72
+        if ( !$this->_isInstantiatable() ) {
73 73
             return;
74 74
         }
75 75
 
@@ -89,15 +89,15 @@  discard block
 block discarded – undo
89 89
          */
90 90
         private function _getCallerPath( $sCallerPath ) {
91 91
 
92
-            if ( $sCallerPath  ) {
92
+            if ( $sCallerPath ) {
93 93
                 return trim( $sCallerPath );
94 94
             }
95 95
 
96
-            if ( ! is_admin() ) {
96
+            if ( !is_admin() ) {
97 97
                 return null;
98 98
             }
99 99
 
100
-            if ( ! isset( $GLOBALS[ 'pagenow' ] ) ) {
100
+            if ( !isset( $GLOBALS[ 'pagenow' ] ) ) {
101 101
                 return null;
102 102
             }
103 103
 
Please login to merge, or discard this patch.
_model/delegate/AdminPageFramework_Model__FormSubmission_Base.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@
 block discarded – undo
46 46
      * @return      null|string     Returns `null` if no value is found and the associated link url if found. 
47 47
      * Otherwise, the found value.
48 48
      */ 
49
-    protected function _getPressedSubmitButtonData( array $aPostElements, $sTargetKey='field_id' ) {    
49
+    protected function _getPressedSubmitButtonData( array $aPostElements, $sTargetKey = 'field_id' ) {    
50 50
 
51
-        foreach( $aPostElements as $_sInputID => $_aSubElements ) {
51
+        foreach ( $aPostElements as $_sInputID => $_aSubElements ) {
52 52
             
53 53
             // The 'name' key must be set.
54
-            if ( ! isset( $_aSubElements[ 'name' ] ) ) {
54
+            if ( !isset( $_aSubElements[ 'name' ] ) ) {
55 55
                 continue;
56 56
             }
57 57
             $_aNameKeys = explode( '|', $_aSubElements[ 'name' ] ); 
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * @return      null|string     Returns `null` if no value is found and the associated link url if found. 
48 48
      * Otherwise, the found value.
49 49
      */ 
50
-    protected function _getPressedSubmitButtonData( array $aPostElements, $sTargetKey='field_id' ) {    
50
+    protected function _getPressedSubmitButtonData( array $aPostElements, $sTargetKey='field_id' ) {
51 51
 
52 52
         foreach( $aPostElements as $_sInputID => $_aSubElements ) {
53 53
             
@@ -58,7 +58,8 @@  discard block
 block discarded – undo
58 58
             $_aNameKeys = explode( '|', $_aSubElements[ 'name' ] ); 
59 59
             
60 60
             // If the element is not found, skip.
61
-            if ( null === $this->getElement( $_POST, $_aNameKeys, null ) ) {    // sanitization unnecessary
61
+            if ( null === $this->getElement( $_POST, $_aNameKeys, null ) ) {
62
+// sanitization unnecessary
62 63
                 continue;
63 64
             }
64 65
             
@@ -85,7 +86,7 @@  discard block
 block discarded – undo
85 86
      */
86 87
     protected function _setSettingNoticeAfterValidation( $bIsInputEmtpy ) {
87 88
      
88
-        if ( $this->oFactory->hasSettingNotice() ) {     
89
+        if ( $this->oFactory->hasSettingNotice() ) {
89 90
             return;
90 91
         }
91 92
         $this->oFactory->setSettingNotice(  
Please login to merge, or discard this patch.
factory/admin_page/_model/format/AdminPageFramework_Format_InPageTabs.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      */
52 52
     public function get() {
53 53
 
54
-         // Apply filters to modify the in-page tab array.
54
+            // Apply filters to modify the in-page tab array.
55 55
         $_aInPageTabs = $this->addAndApplyFilter(
56 56
             $this->oFactory,  // caller object
57 57
             "tabs_{$this->oFactory->oProp->sClassName}_{$this->sPageSlug}", // filter name
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,14 +53,14 @@
 block discarded – undo
53 53
 
54 54
          // Apply filters to modify the in-page tab array.
55 55
         $_aInPageTabs = $this->addAndApplyFilter(
56
-            $this->oFactory,  // caller object
56
+            $this->oFactory, // caller object
57 57
             "tabs_{$this->oFactory->oProp->sClassName}_{$this->sPageSlug}", // filter name
58 58
             $this->aInPageTabs     // filtering value
59 59
         );    
60 60
 
61 61
         // Added items may be missing necessary keys so format them
62
-        foreach( ( array ) $_aInPageTabs as $_sTabSlug => $_aInPageTab ) {
63
-            if ( ! is_array( $_aInPageTab ) ) {
62
+        foreach ( ( array ) $_aInPageTabs as $_sTabSlug => $_aInPageTab ) {
63
+            if ( !is_array( $_aInPageTab ) ) {
64 64
                 continue;
65 65
             }
66 66
             $_oFormatter = new AdminPageFramework_Format_InPageTab( 
Please login to merge, or discard this patch.
factory/admin_page/_view/AdminPageFramework_View__PageMataBoxRenderer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     public function render( $sContext ) {
30 30
                
31 31
         // If nothing is registered do not render even the container.
32
-        if ( ! $this->doesMetaBoxExist() ) {
32
+        if ( !$this->doesMetaBoxExist() ) {
33 33
             return;
34 34
         }
35 35
         
Please login to merge, or discard this patch.
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 
21 21
     /**
22 22
      * Renders a registered meta box.
23
-
24 23
      * @return      void
25 24
      * @param       string $sContext `side`, `normal`, or `advanced`.
26 25
      * @since       3.0.0
Please login to merge, or discard this patch.
development/factory/network_admin_page/AdminPageFramework_NetworkAdmin.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
      * @param       string      $sTextDomain        (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: `admin-page-framework`.
56 56
      * @return      void        returns nothing.
57 57
      */
58
-    public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ){
58
+    public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ) {
59 59
             
60 60
         if ( ! $this->_isInstantiatable() ) {
61 61
             return;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
     protected $_aBuiltInRootMenuSlugs = array(
40 40
         // All keys must be lower case to support case insensitive look-ups.
41 41
         'dashboard'     => 'index.php',
42
-        'sites'         => 'sites.php',         // not work
43
-        'themes'        => 'themes.php',        // not work
42
+        'sites'         => 'sites.php', // not work
43
+        'themes'        => 'themes.php', // not work
44 44
         'plugins'       => 'plugins.php',
45 45
         'users'         => 'users.php',
46 46
         'settings'      => 'settings.php',
47
-        'updates'       => 'update-core.php',   // does not work
47
+        'updates'       => 'update-core.php', // does not work
48 48
     );
49 49
 
50 50
     /**
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
      * @param       string      $sTextDomain        (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: `admin-page-framework`.
66 66
      * @return      void        returns nothing.
67 67
      */
68
-    public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ){
68
+    public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_network', $sTextDomain = 'admin-page-framework' ) {
69 69
 
70
-        if ( ! $this->_isInstantiatable() ) {
70
+        if ( !$this->_isInstantiatable() ) {
71 71
             return;
72 72
         }
73 73
 
74 74
         $sCallerPath = $sCallerPath
75 75
             ? $sCallerPath
76
-            : AdminPageFramework_Utility::getCallerScriptPath( __FILE__ );     // this is important to attempt to find the caller script path here when separating the library into multiple files.
76
+            : AdminPageFramework_Utility::getCallerScriptPath( __FILE__ ); // this is important to attempt to find the caller script path here when separating the library into multiple files.
77 77
 
78 78
         parent::__construct( $sOptionKey, $sCallerPath, $sCapability, $sTextDomain );
79 79
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @param       mixed       $vDefault     the default value that will be returned if nothing is stored.
158 158
      * @return      mixed       If the field ID is not specified.
159 159
      */
160
-    static public function getOption( $sOptionKey, $asKey=null , $vDefault=null ) {
160
+    static public function getOption( $sOptionKey, $asKey = null, $vDefault = null ) {
161 161
         return AdminPageFramework_WPUtility::getSiteOption( $sOptionKey, $asKey, $vDefault );
162 162
     }
163 163
 
Please login to merge, or discard this patch.
class/admin/_abstract/AdminPageFrameworkLoader_AdminPage_RootBase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         }       
42 42
         
43 43
         trigger_error( 
44
-            'Admin Page Framework - Loader: ' . ' : ' . sprintf( 
44
+            'Admin Page Framework - Loader: '.' : '.sprintf( 
45 45
                 __( 'The method is not defined: %1$s', 'admin-page-framework-loader' ),
46 46
                 $sMethodName 
47 47
             ), 
Please login to merge, or discard this patch.
AdminPageFrameworkLoader_AdminPageMetaBox_ExternalLinks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@
 block discarded – undo
24 24
      */
25 25
     public function content( $sContent ) {
26 26
         
27
-        $_aReplacements   = array(
27
+        $_aReplacements = array(
28 28
             '%PLUGIN_DIR_URL%'  => AdminPageFrameworkLoader_Registry::getPluginURL(),
29 29
             '%WP_ADMIN_URL%'    => admin_url(),
30 30
         );
31 31
         $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser( 
32
-            AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt',
32
+            AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt',
33 33
             $_aReplacements
34 34
         );
35 35
         return ''
Please login to merge, or discard this patch.
admin-page-framework/help/AdminPageFrameworkLoader_AdminPage_Help_Debug.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     
35 35
     public function replyToDoTab( $oFactory ) {
36 36
         
37
-        echo "<h3>" . __( 'Saved Options', 'admin-page-framework-loader' ) . "</h3>";
37
+        echo "<h3>".__( 'Saved Options', 'admin-page-framework-loader' )."</h3>";
38 38
         $oFactory->oDebug->dump( $oFactory->oProp->aOptions );
39 39
         
40 40
     }
Please login to merge, or discard this patch.
dashboard/welcome/AdminPageFrameworkLoader_AdminPageWelcome_Welcome.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -226,8 +226,9 @@
 block discarded – undo
226 226
 
227 227
             $_aContributors = json_decode( wp_remote_retrieve_body( $_mResponse ) );
228 228
 
229
-            if ( ! is_array( $_aContributors ) )
230
-                return array();
229
+            if ( ! is_array( $_aContributors ) ) {
230
+                            return array();
231
+            }
231 232
 
232 233
             set_transient( 'apfl_contributors', $_aContributors, 3600 );
233 234
 
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
                 'tab_slug'          => $this->sTabSlug,
29 29
                 'section_id'        => $this->sTabSlug,
30 30
                 'section_tab_slug'  => 'welcome',
31
-                'title'             => __( "What's New", 'admin-page-framework-loader' ),   // '
31
+                'title'             => __( "What's New", 'admin-page-framework-loader' ), // '
32 32
                 'content'           => $this->_getReadmeContents(
33
-                    AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt',
33
+                    AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt',
34 34
                     '', // TOC title
35 35
                     array( 'New Features' ) // section
36 36
                 )
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
                 'tab_slug'          => $this->sTabSlug,
40 40
                 'section_tab_slug'  => $this->sTabSlug,
41 41
                 'section_id'        => 'getting_started',
42
-                'title'             => __( "Getting Started", 'admin-page-framework-loader' ),   // '
42
+                'title'             => __( "Getting Started", 'admin-page-framework-loader' ), // '
43 43
                 'content'           => $this->_getReadmeContents(
44
-                    AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt',
45
-                    "<h3>" . __( 'Contents', 'admin-page-framework-loader' ) . "</h3>",
44
+                    AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt',
45
+                    "<h3>".__( 'Contents', 'admin-page-framework-loader' )."</h3>",
46 46
                     array( 'Getting Started', 'Tutorials' )
47 47
                 ),
48 48
             ),
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 'tab_slug'          => $this->sTabSlug,
51 51
                 'section_tab_slug'  => $this->sTabSlug,
52 52
                 'section_id'        => 'change_log',
53
-                'title'             => __( "Change Log", 'admin-page-framework-loader' ),   // '
53
+                'title'             => __( "Change Log", 'admin-page-framework-loader' ), // '
54 54
                 'content'           => $this->_getChangeLog(),
55 55
             )
56 56
         );
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
             array(
87 87
                 'field_id'      => 'github_star',
88 88
                 'type'          => 'github',
89
-                'user_name'     => 'michaeluno',    // the GitHub account ID
90
-                'button_type'   => 'star',          // either of the followings: follow, star, watch, fork, issue
89
+                'user_name'     => 'michaeluno', // the GitHub account ID
90
+                'button_type'   => 'star', // either of the followings: follow, star, watch, fork, issue
91 91
                 'count'         => false,
92 92
                 'repository'    => 'admin-page-framework',
93 93
                 'size'          => 'mega',
94 94
                 'attributes'    => array(
95
-                    'data-text' => ' ' . AdminPageFramework_Registry::NAME . ' ' . AdminPageFramework_Registry::getVersion() . ' ',
95
+                    'data-text' => ' '.AdminPageFramework_Registry::NAME.' '.AdminPageFramework_Registry::getVersion().' ',
96 96
                     // 'data-icon' => 'octicon-mark-github',
97 97
                 ),
98 98
                 'description'   => __( 'Star the repository and get Involved!', 'admin-page-framework-loader' ),
@@ -132,26 +132,26 @@  discard block
 block discarded – undo
132 132
          * @since       3.6.1
133 133
          * @return      void
134 134
          */
135
-        private function _getChangeLog( $sSection='Changelog' ) {
135
+        private function _getChangeLog( $sSection = 'Changelog' ) {
136 136
 
137
-            $_aReplacements   = array(
137
+            $_aReplacements = array(
138 138
                 '%PLUGIN_DIR_URL%'  => AdminPageFrameworkLoader_Registry::getPluginURL(),
139 139
                 '%WP_ADMIN_URL%'    => admin_url(),
140 140
             );
141 141
             $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser(
142
-                AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt',
142
+                AdminPageFrameworkLoader_Registry::$sDirPath.'/readme.txt',
143 143
                 $_aReplacements
144 144
             );
145 145
             $_sChangeLog = $_oWPReadmeParser->getSection( $sSection );
146 146
             $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser(
147
-                AdminPageFrameworkLoader_Registry::$sDirPath . '/changelog.md',
147
+                AdminPageFrameworkLoader_Registry::$sDirPath.'/changelog.md',
148 148
                 $_aReplacements
149 149
             );
150 150
             $_sChangeLog .= $_oWPReadmeParser->getSection( $sSection );
151 151
 
152 152
             $_sChangeLog = $_sChangeLog
153 153
                 ? $_sChangeLog
154
-                : '<p>' . __( 'No valid changlog was found.', 'admin-page-framework-loader' ) . '</p>';
154
+                : '<p>'.__( 'No valid changlog was found.', 'admin-page-framework-loader' ).'</p>';
155 155
             return "<div class='changelog'>"
156 156
                 . $_sChangeLog
157 157
                 . "</div>";
@@ -182,18 +182,18 @@  discard block
 block discarded – undo
182 182
                 return '';
183 183
             }
184 184
 
185
-            $_aOutput   = array();
185
+            $_aOutput = array();
186 186
             foreach ( $_aContributors as $_oContributor ) {
187
-                $_aOutput[] = '<li class="wp-person">';
188
-                $_aOutput[] .= sprintf( '<a href="%s" title="%s">',
189
-                    esc_url( 'https://github.com/' . $_oContributor->login ),
187
+                $_aOutput[ ] = '<li class="wp-person">';
188
+                $_aOutput[ ] .= sprintf( '<a href="%s" title="%s">',
189
+                    esc_url( 'https://github.com/'.$_oContributor->login ),
190 190
                     esc_html( sprintf( __( 'View %s', 'admin-page-framework-loader' ), $_oContributor->login ) )
191 191
                 );
192
-                $_aOutput[] .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $_oContributor->avatar_url ), esc_html( $_oContributor->login ) );
193
-                $_aOutput[] .= '</a>';
194
-                $_aOutput[] .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $_oContributor->login ), esc_html( $_oContributor->login ) );
195
-                $_aOutput[] .= '</a>';
196
-                $_aOutput[] .= '</li>';
192
+                $_aOutput[ ] .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $_oContributor->avatar_url ), esc_html( $_oContributor->login ) );
193
+                $_aOutput[ ] .= '</a>';
194
+                $_aOutput[ ] .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/'.$_oContributor->login ), esc_html( $_oContributor->login ) );
195
+                $_aOutput[ ] .= '</a>';
196
+                $_aOutput[ ] .= '</li>';
197 197
             }
198 198
 
199 199
             return '<ul class="wp-people-group">'
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                 return $_aContributors;
218 218
             }
219 219
 
220
-            $_mResponse = wp_remote_get( $sRepositoryURL . '/contributors', array( 'sslverify' => false ) );
220
+            $_mResponse = wp_remote_get( $sRepositoryURL.'/contributors', array( 'sslverify' => false ) );
221 221
 
222 222
             if ( is_wp_error( $_mResponse ) || 200 != wp_remote_retrieve_response_code( $_mResponse ) ) {
223 223
                 return array();
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
             $_aContributors = json_decode( wp_remote_retrieve_body( $_mResponse ) );
227 227
 
228
-            if ( ! is_array( $_aContributors ) )
228
+            if ( !is_array( $_aContributors ) )
229 229
                 return array();
230 230
 
231 231
             set_transient( 'apfl_contributors', $_aContributors, 3600 );
Please login to merge, or discard this patch.