Completed
Branch master (fd853c)
by
unknown
04:08 queued 02:12
created
factory/_common/utility/wp_utility/AdminPageFramework_WPUtility.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         if ( is_string( $_sCustomMenuSlug ) ) {
30 30
             return $_sCustomMenuSlug;
31 31
         }
32
-        return 'edit.php?post_type=' . $sPostTypeSlug;
32
+        return 'edit.php?post_type='.$sPostTypeSlug;
33 33
     }
34 34
 
35 35
     /**
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
     static public function getWPAdminDirPath() {
64 64
 
65 65
         $_sWPAdminPath = str_replace(
66
-            get_bloginfo( 'url' ) . '/', // search
67
-            ABSPATH,    // replace
66
+            get_bloginfo( 'url' ).'/', // search
67
+            ABSPATH, // replace
68 68
             get_admin_url() // subject - works even in the network admin
69 69
         );
70 70
         return rtrim( $_sWPAdminPath, '/' );
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * @since       3.7.0
83 83
      * @return      void
84 84
      */
85
-    static public function goToLocalURL( $sURL, $oCallbackOnError=null ) {
85
+    static public function goToLocalURL( $sURL, $oCallbackOnError = null ) {
86 86
         self::redirectByType( $sURL, 1, $oCallbackOnError );
87 87
     }
88 88
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @since       3.6.3
96 96
      * @since       3.7.0      Added the second callback parameter.
97 97
      */
98
-    static public function goToURL( $sURL, $oCallbackOnError=null ) {
98
+    static public function goToURL( $sURL, $oCallbackOnError = null ) {
99 99
         self::redirectByType( $sURL, 0, $oCallbackOnError );
100 100
     }
101 101
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      * @param       integer     $iType              0: external site, 1: local site (within the same domain).
106 106
      * @param       callable    $oCallbackOnError
107 107
      */
108
-    static public function redirectByType( $sURL, $iType=0, $oCallbackOnError=null ) {
108
+    static public function redirectByType( $sURL, $iType = 0, $oCallbackOnError = null ) {
109 109
 
110 110
         $_iRedirectError = self::getRedirectPreError( $sURL, $iType );
111 111
         if ( $_iRedirectError && is_callable( $oCallbackOnError ) ) {
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     static public function getRedirectPreError( $sURL, $iType ) {
137 137
 
138 138
         // check only external urls as local ones can be a relative url and always fails the below check.
139
-        if ( ! $iType && filter_var( $sURL, FILTER_VALIDATE_URL) === false ) {
139
+        if ( !$iType && filter_var( $sURL, FILTER_VALIDATE_URL ) === false ) {
140 140
             return 1;
141 141
         }
142 142
         // If HTTP headers are already sent, redirect cannot be done.
Please login to merge, or discard this patch.
factory/_common/utility/wp_utility/AdminPageFramework_WPUtility_URL.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
         $sPageURL       = 'on' == @$_SERVER[ "HTTPS" ] ? "https://" : "http://";
30 30
 
31 31
         if ( "80" != $_SERVER[ "SERVER_PORT" ] ) {
32
-            $sPageURL .= $_SERVER[ "SERVER_NAME" ] . ":" . $_SERVER[ "SERVER_PORT" ] . $sRequestURI;
32
+            $sPageURL .= $_SERVER[ "SERVER_NAME" ].":".$_SERVER[ "SERVER_PORT" ].$sRequestURI;
33 33
         } else {
34
-            $sPageURL .= $_SERVER[ "SERVER_NAME" ] . $sRequestURI;
34
+            $sPageURL .= $_SERVER[ "SERVER_NAME" ].$sRequestURI;
35 35
         }
36 36
         return $sPageURL;
37 37
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      * @param string $sSubjectURL ( optional ) The subject url to modify
49 49
      * @return string The modified url.
50 50
      */
51
-    static public function getQueryAdminURL( $aAddingQueries=array(), $aRemovingQueryKeys=array(), $sSubjectURL='' ) {
51
+    static public function getQueryAdminURL( $aAddingQueries = array(), $aRemovingQueryKeys = array(), $sSubjectURL = '' ) {
52 52
 
53 53
         $_sAdminURL = is_network_admin()
54 54
             ? network_admin_url( AdminPageFramework_WPUtility_Page::getPageNow() )
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $_oWPStyles      = new WP_Styles(); // It doesn't matter whether the file is a style or not. Just use the built-in WordPress class to calculate the SRC URL.
100 100
         $_sRelativePath  = AdminPageFramework_Utility::getRelativePath( preg_replace( '/[\/\\\\]wp-content$/', '', rtrim( WP_CONTENT_DIR, '/\\' ) ), $sFilePath );
101 101
         $_sRelativePath  = preg_replace( "/^\.[\/\\\]/", '', $_sRelativePath, 1 ); // removes the heading ./ or .\
102
-        $_sHref          = trailingslashit( $_oWPStyles->base_url ) . $_sRelativePath;
102
+        $_sHref          = trailingslashit( $_oWPStyles->base_url ).$_sRelativePath;
103 103
         unset( $_oWPStyles ); // for PHP 5.2.x or below
104 104
         return $_sHref;
105 105
 
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
      * @param       string      $sSRC
119 119
      * @param       boolean     $bReturnNullIfNotExist
120 120
      */
121
-    static public function getResolvedSRC( $sSRC, $bReturnNullIfNotExist=false ) {
121
+    static public function getResolvedSRC( $sSRC, $bReturnNullIfNotExist = false ) {
122 122
 
123
-        if ( ! self::isResourcePath( $sSRC ) ) {
123
+        if ( !self::isResourcePath( $sSRC ) ) {
124 124
             return $bReturnNullIfNotExist
125 125
                 ? null
126 126
                 : $sSRC;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
         // If the file exists, it means it is an absolute path. If so, calculate the URL from the path.
135 135
         if ( file_exists( realpath( $sSRC ) ) ) {
136
-            return self::getSRCFromPath( $sSRC );   // url escaping is done in the method
136
+            return self::getSRCFromPath( $sSRC ); // url escaping is done in the method
137 137
         }
138 138
 
139 139
         if ( $bReturnNullIfNotExist ) {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
          * @param boolean $bReturnNullIfNotExist
151 151
          * @return string
152 152
          */
153
-        static public function resolveSRC( $sSRC, $bReturnNullIfNotExist=false ) {
153
+        static public function resolveSRC( $sSRC, $bReturnNullIfNotExist = false ) {
154 154
             return self::getResolvedSRC( $sSRC, $bReturnNullIfNotExist );
155 155
         }
156 156
 
Please login to merge, or discard this patch.
development/factory/_common/utility/debug/AdminPageFramework_Debug_Log.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @since       3.8.9
29 29
      * @return      void
30 30
      **/
31
-    static protected function _log( $mValue, $sFilePath=null, $bStackTrace=false, $iTrace=0, $iStringLengthLimit=99999, $iArrayDepthLimit=50 ) {
31
+    static protected function _log( $mValue, $sFilePath = null, $bStackTrace = false, $iTrace = 0, $iStringLengthLimit = 99999, $iArrayDepthLimit = 50 ) {
32 32
 
33 33
         static $_fPreviousTimeStamp = 0;
34 34
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $_sCallerClass      = self::___getCallerClassName( $_oCallerInfo, $iTrace );
38 38
         $_fCurrentTimeStamp = microtime( true );
39 39
         $_sLogContent       = self::___getLogContents( $mValue, $_fCurrentTimeStamp, $_fPreviousTimeStamp, $_sCallerClass, $_sCallerFunction, $iStringLengthLimit, $iArrayDepthLimit )
40
-            . ( $bStackTrace ? self::getStackTrace($iTrace + 1 ) : '' )
40
+            . ( $bStackTrace ? self::getStackTrace( $iTrace + 1 ) : '' )
41 41
             . PHP_EOL;
42 42
 
43 43
         file_put_contents( self::___getLogFilePath( $sFilePath, $_sCallerClass ), $_sLogContent, FILE_APPEND );
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
                     round( $_fCurrentTimeStamp - $_fPreviousTimeStamp, 3 ), // elapsed time
55 55
                     $_sCallerClass,
56 56
                     $_sCallerFunction
57
-                ) . PHP_EOL
58
-                . self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) . PHP_EOL;
57
+                ).PHP_EOL
58
+                . self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit ).PHP_EOL;
59 59
         }
60 60
         /**
61 61
          * @since       3.8.9
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
          */
64 64
         static private function ___getCallerFunctionName( $oCallerInfo, $iTrace ) {
65 65
             return self::getElement(
66
-                $oCallerInfo,  // subject array
66
+                $oCallerInfo, // subject array
67 67
                 array( 2 + $iTrace, 'function' ), // key
68 68
                 ''      // default
69 69
             );
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
          */
75 75
         static private function ___getCallerClassName( $oCallerInfo, $iTrace ) {
76 76
             return self::getElement(
77
-                $oCallerInfo,  // subject array
77
+                $oCallerInfo, // subject array
78 78
                 array( 2 + $iTrace, 'class' ), // key
79 79
                 ''      // default
80 80
             );
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
          */
90 90
         static private function ___getLogFilePath( $bsFilePathOrName, $sCallerClass ) {
91 91
 
92
-            $_sWPContentDir  = WP_CONTENT_DIR . DIRECTORY_SEPARATOR;
92
+            $_sWPContentDir = WP_CONTENT_DIR.DIRECTORY_SEPARATOR;
93 93
 
94 94
             // It is a partial file name
95
-            if ( is_string( $bsFilePathOrName ) && ! self::hasSlash( $bsFilePathOrName ) ) {
96
-                return $_sWPContentDir . $bsFilePathOrName . '_' . date( "Ymd" ) . '.log';
95
+            if ( is_string( $bsFilePathOrName ) && !self::hasSlash( $bsFilePathOrName ) ) {
96
+                return $_sWPContentDir.$bsFilePathOrName.'_'.date( "Ymd" ).'.log';
97 97
             }
98 98
 
99 99
             // Try creating a file.
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
             // Return a generated default log path.
108 108
             $_sClassBaseName = $sCallerClass ? basename( $sCallerClass ) : basename( get_class() );
109
-            return $_sWPContentDir . $_sClassBaseName . '_' . date( "Ymd" ) . '.log';
109
+            return $_sWPContentDir.$_sClassBaseName.'_'.date( "Ymd" ).'.log';
110 110
 
111 111
         }
112 112
             /**
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
              * @internal
116 116
              */
117 117
             static private function ___createFile( $sFilePath ) {
118
-                if ( ! $sFilePath || true === $sFilePath ) {
118
+                if ( !$sFilePath || true === $sFilePath ) {
119 119
                     return false;
120 120
                 }
121 121
                 if ( file_exists( $sFilePath ) ) {
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
             $_nNow              = $fCurrentTimeStamp + ( self::___getSiteGMTOffset() * 60 * 60 );
138 138
             $_nMicroseconds     = str_pad( round( ( $_nNow - floor( $_nNow ) ) * 10000 ), 4, '0' );
139 139
             $_aOutput           = array(
140
-                date( "Y/m/d H:i:s", $_nNow ) . '.' . $_nMicroseconds,
140
+                date( "Y/m/d H:i:s", $_nNow ).'.'.$_nMicroseconds,
141 141
                 self::___getFormattedElapsedTime( $nElapsed ),
142 142
                 self::___getPageLoadID(),
143 143
                 self::getFrameworkVersion(),
144
-                $sCallerClass . '::' . $sCallerFunction,
144
+                $sCallerClass.'::'.$sCallerFunction,
145 145
                 current_filter(),
146 146
                 self::getCurrentURL(),
147 147
             );
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
              */
157 157
             static private function ___getSiteGMTOffset() {
158 158
                 static $_nGMTOffset;
159
-                $_nGMTOffset        = isset( $_nGMTOffset )
159
+                $_nGMTOffset = isset( $_nGMTOffset )
160 160
                     ? $_nGMTOffset
161 161
                     : get_option( 'gmt_offset' );
162 162
                 return $_nGMTOffset;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
              */
168 168
             static private function ___getPageLoadID() {
169 169
                 static $_sPageLoadID;
170
-                $_sPageLoadID       = $_sPageLoadID
170
+                $_sPageLoadID = $_sPageLoadID
171 171
                     ? $_sPageLoadID
172 172
                     : uniqid();
173 173
                 return $_sPageLoadID;
@@ -191,15 +191,15 @@  discard block
 block discarded – undo
191 191
                     3,
192 192
                     '0'
193 193
                 );
194
-                $_sElapsed          = self::getElement(
195
-                    $_aElapsedParts,  // subject array
196
-                    0,  // key
194
+                $_sElapsed = self::getElement(
195
+                    $_aElapsedParts, // subject array
196
+                    0, // key
197 197
                     0   // default
198 198
                 );
199
-                $_sElapsed          = strlen( $_sElapsed ) > 1
200
-                    ? '+' . substr( $_sElapsed, -1, 2 )
201
-                    : ' ' . $_sElapsed;
202
-                return $_sElapsed . '.' . $_sElapsedFloat;
199
+                $_sElapsed = strlen( $_sElapsed ) > 1
200
+                    ? '+'.substr( $_sElapsed, -1, 2 )
201
+                    : ' '.$_sElapsed;
202
+                return $_sElapsed.'.'.$_sElapsedFloat;
203 203
 
204 204
             }
205 205
 
Please login to merge, or discard this patch.
development/factory/_common/utility/debug/AdminPageFramework_Debug.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      * @param       integer         $iArrayDepthLimit
36 36
      * @return      void
37 37
      */
38
-    static public function dump( $asArray, $sFilePath=null, $bStackTrace=false, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) {
38
+    static public function dump( $asArray, $sFilePath = null, $bStackTrace = false, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) {
39 39
         echo self::get( $asArray, $sFilePath, true, $bStackTrace, $iStringLengthLimit, $iArrayDepthLimit );
40 40
     }
41 41
 
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
      * @since       3.8.9
45 45
      * @return      string
46 46
      */
47
-    static public function getDetails( $mValue, $bEscape=true, $bStackTrace=false, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) {
47
+    static public function getDetails( $mValue, $bEscape = true, $bStackTrace = false, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) {
48 48
         $_sValueWithDetails = self::_getArrayRepresentationSanitized(
49 49
             self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit )
50 50
         );
51 51
         $_sValueWithDetails = $bStackTrace
52
-            ? $_sValueWithDetails . PHP_EOL . self::getStackTrace()
52
+            ? $_sValueWithDetails.PHP_EOL.self::getStackTrace()
53 53
             : $_sValueWithDetails;
54 54
         return $bEscape
55 55
             ? "<pre class='dump-array'>"
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * @param       integer         $iArrayDepthLimit
76 76
      * @return      string
77 77
      */
78
-    static public function get( $asArray, $sFilePath=null, $bEscape=true, $bStackTrace=false, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) {
78
+    static public function get( $asArray, $sFilePath = null, $bEscape = true, $bStackTrace = false, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) {
79 79
 
80 80
         if ( $sFilePath ) {
81 81
             self::log( $asArray, $sFilePath );
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      * @param       integer     $iArrayDepthLimit   The depth limit for arrays.*
118 118
      * @return      void
119 119
      **/
120
-    static public function log( $mValue, $sFilePath=null, $bStackTrace=false, $iTrace=0, $iStringLengthLimit=99999, $iArrayDepthLimit=50 ) {
120
+    static public function log( $mValue, $sFilePath = null, $bStackTrace = false, $iTrace = 0, $iStringLengthLimit = 99999, $iArrayDepthLimit = 50 ) {
121 121
         self::_log( $mValue, $sFilePath, $bStackTrace, $iTrace, $iStringLengthLimit, $iArrayDepthLimit );
122 122
     }
123 123
 
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
      * @since unknown
132 132
      * @deprecated      3.2.0
133 133
      */
134
-    static public function dumpArray( $asArray, $sFilePath=null ) {
135
-        self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::dump()' );
134
+    static public function dumpArray( $asArray, $sFilePath = null ) {
135
+        self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::dump()' );
136 136
         AdminPageFramework_Debug::dump( $asArray, $sFilePath );
137 137
     }
138 138
 
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
      * @since       3.0.0 Changed the $bEncloseInTag parameter to bEscape.
146 146
      * @deprecated  3.2.0
147 147
      */
148
-    static public function getArray( $asArray, $sFilePath=null, $bEscape=true ) {
149
-        self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::get()' );
148
+    static public function getArray( $asArray, $sFilePath = null, $bEscape = true ) {
149
+        self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::get()' );
150 150
         return AdminPageFramework_Debug::get( $asArray, $sFilePath, $bEscape );
151 151
     }
152 152
 
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
      * @since       3.0.3   Changed the default log location and file name.
158 158
      * @deprecated  3.1.0   Use the `log()` method instead.
159 159
      */
160
-    static public function logArray( $asArray, $sFilePath=null ) {
161
-        self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::log()' );
160
+    static public function logArray( $asArray, $sFilePath = null ) {
161
+        self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::log()' );
162 162
         AdminPageFramework_Debug::log( $asArray, $sFilePath );
163 163
     }
164 164
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      * @deprecated  3.8.9
172 172
      */
173 173
     static public function getAsString( $mValue ) {
174
-        self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__ );
174
+        self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__ );
175 175
         return self::_getLegible( $mValue );
176 176
     }
177 177
 
Please login to merge, or discard this patch.
development/factory/_common/utility/debug/AdminPageFramework_Debug_Base.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
      * @return  string
38 38
      * @since   3.8.9
39 39
      */
40
-    static protected function _getLegibleDetails( $mValue, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) {
40
+    static protected function _getLegibleDetails( $mValue, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) {
41 41
         if ( is_array( $mValue ) ) {
42
-            return '(array, length: ' . count( $mValue ).') '
43
-                . print_r( self::___getLegibleDetailedArray( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) , true );
42
+            return '(array, length: '.count( $mValue ).') '
43
+                . print_r( self::___getLegibleDetailedArray( $mValue, $iStringLengthLimit, $iArrayDepthLimit ), true );
44 44
         }
45 45
         return print_r( self::___getLegibleDetailedValue( $mValue, $iStringLengthLimit ), true );
46 46
     }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @since  3.8.9
56 56
      * @since  3.8.22  Added the `$sStringLengthLimit` and `$iArrayDepthLimit` parameters.
57 57
      */
58
-    static protected function _getLegible( $mValue, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) {
58
+    static protected function _getLegible( $mValue, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) {
59 59
 
60 60
         $iArrayDepthLimit = $iArrayDepthLimit ? $iArrayDepthLimit : self::$iLegibleArrayDepthLimit;
61 61
         $mValue           = is_object( $mValue )
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             )
73 73
             : $mValue;
74 74
         $mValue = is_string( $mValue )
75
-            ? self::___getLegibleString( $mValue,  $iStringLengthLimit, false )
75
+            ? self::___getLegibleString( $mValue, $iStringLengthLimit, false )
76 76
             : $mValue;
77 77
         return self::_getArrayRepresentationSanitized( print_r( $mValue, true ) );
78 78
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
          */
89 89
         static private function ___getObjectName( $mItem ) {
90 90
             if ( is_object( $mItem ) ) {
91
-                return '(object) ' . get_class( $mItem );
91
+                return '(object) '.get_class( $mItem );
92 92
             }
93 93
             return $mItem;
94 94
         }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
          * @return      string
100 100
          */
101 101
         static private function ___getLegibleDetailedCallable( $asoCallable ) {
102
-            return '(callable) ' . self::___getCallableName( $asoCallable );
102
+            return '(callable) '.self::___getCallableName( $asoCallable );
103 103
         }
104 104
             /**
105 105
              * @since       3.8.9
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                 $_sSubject = is_object( $asoCallable[ 0 ] )
118 118
                     ? get_class( $asoCallable[ 0 ] )
119 119
                     : ( string ) $asoCallable[ 0 ];
120
-                return $_sSubject . '::' . ( string ) $asoCallable[ 1 ];
120
+                return $_sSubject.'::'.( string ) $asoCallable[ 1 ];
121 121
 
122 122
             }
123 123
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             if ( method_exists( $oObject, '__toString' ) ) {
132 132
                 return ( string ) $oObject;
133 133
             }
134
-            return '(object) ' . get_class( $oObject ) . ' ' . count( get_object_vars( $oObject ) ) . ' properties.';
134
+            return '(object) '.get_class( $oObject ).' '.count( get_object_vars( $oObject ) ).' properties.';
135 135
 
136 136
         }
137 137
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
          * @since  3.8.22  Changed the scope to private from public.
148 148
          * @since  3.8.22  Renamed from `_getLegibleArray()`.
149 149
          */
150
-        static private function ___getLegibleDetailedArray( array $aArray, $iStringLengthLimit=0, $iDepthLimit=0 ) {
150
+        static private function ___getLegibleDetailedArray( array $aArray, $iStringLengthLimit = 0, $iDepthLimit = 0 ) {
151 151
             $_iDepthLimit = $iDepthLimit ? $iDepthLimit : self::$iLegibleArrayDepthLimit;
152 152
             return self::___getArrayMappedRecursive(
153 153
                 self::_getSlicedByDepth( $aArray, $_iDepthLimit ),
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
                         return self::___getLegibleDetailedObject( $mNonScalar );
188 188
                     }
189 189
                     if ( is_array( $mNonScalar ) ) {
190
-                        return '(' . $_sType . ') ' . count( $mNonScalar ) . ' elements';
190
+                        return '('.$_sType.') '.count( $mNonScalar ).' elements';
191 191
                     }
192
-                    return '(' . $_sType . ') ' . ( string ) $mNonScalar;
192
+                    return '('.$_sType.') '.( string ) $mNonScalar;
193 193
 
194 194
                 }
195 195
                 /**
@@ -201,11 +201,11 @@  discard block
 block discarded – undo
201 201
                  */
202 202
                 static private function ___getLegibleDetailedScalar( $sScalar, $iStringLengthLimit ) {
203 203
                     if ( is_bool( $sScalar ) ) {
204
-                        return '(boolean) ' . ( $sScalar ? 'true' : 'false' );
204
+                        return '(boolean) '.( $sScalar ? 'true' : 'false' );
205 205
                     }
206 206
                     return is_string( $sScalar )
207 207
                         ? self::___getLegibleString( $sScalar, $iStringLengthLimit, true )
208
-                        : '(' . gettype( $sScalar ) . ', length: ' . self::___getValueLength( $sScalar ) .  ') ' . $sScalar;
208
+                        : '('.gettype( $sScalar ).', length: '.self::___getValueLength( $sScalar ).') '.$sScalar;
209 209
                 }
210 210
                     /**
211 211
                      * Returns a length of a value.
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                      * @param       boolean     $bShowDetails
231 231
                      * @return      string
232 232
                      */
233
-                    static private function ___getLegibleString( $sString, $iLengthLimit, $bShowDetails=true ) {
233
+                    static private function ___getLegibleString( $sString, $iLengthLimit, $bShowDetails = true ) {
234 234
 
235 235
                         static $_iMBSupport;
236 236
                         $_iMBSupport    = isset( $_iMBSupport ) ? $_iMBSupport : ( integer ) function_exists( 'mb_strlen' );
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 
242 242
                         if ( $bShowDetails ) {
243 243
                             return $_iCharLength <= $iCharLimit
244
-                                ? '(string, length: ' . $_iCharLength . ') ' . $sString
245
-                                : '(string, length: ' . $_iCharLength . ') ' . call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) )
244
+                                ? '(string, length: '.$_iCharLength.') '.$sString
245
+                                : '(string, length: '.$_iCharLength.') '.call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) )
246 246
                                     . '...';
247 247
                         }
248 248
                         return $_iCharLength <= $iCharLimit
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
      * @return array
284 284
      * @since  3.8.22
285 285
      */
286
-    static public function getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) {
286
+    static public function getSlicedByDepth( array $aSubject, $iDepth = 0, $sMore = '(array truncated) ...' ) {
287 287
        return self::_getSlicedByDepth( $aSubject, $iDepth, $sMore );
288 288
     }
289 289
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
      * @since       3.8.22      Added the `$sMore` parameter.
304 304
      * @internal
305 305
      */
306
-    static private function _getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) {
306
+    static private function _getSlicedByDepth( array $aSubject, $iDepth = 0, $sMore = '(array truncated) ...' ) {
307 307
 
308 308
         foreach ( $aSubject as $_sKey => $_vValue ) {
309 309
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
      * @return array
339 339
      * @since  3.8.9
340 340
      */
341
-    static private function ___getArrayMappedRecursive( array $aArray, $oCallable, array $aArguments=array() ) {
341
+    static private function ___getArrayMappedRecursive( array $aArray, $oCallable, array $aArguments = array() ) {
342 342
 
343 343
         self::$___oCurrentCallableForArrayMapRecursive = $oCallable;
344 344
         self::$___aArgumentsForArrayMapRecursive       = $aArguments;
@@ -372,9 +372,9 @@  discard block
 block discarded – undo
372 372
      * @since   3.8.22
373 373
      * @since   3.8.23 Deprecated the `$oException` parameter.
374 374
      */
375
-    static public function getStackTrace( $iSkip=0, $_deprecated=null ) {
375
+    static public function getStackTrace( $iSkip = 0, $_deprecated = null ) {
376 376
 
377
-        $_iSkip      = 1;   // need to skip this method trace itself
377
+        $_iSkip      = 1; // need to skip this method trace itself
378 378
         $_oException = new Exception();
379 379
 
380 380
         // Backward compatibility.
@@ -390,22 +390,22 @@  discard block
 block discarded – undo
390 390
         $_aFrames    = array_slice( $_aFrames, $_iSkip );
391 391
         foreach ( array_reverse( $_aFrames ) as $_iIndex => $_aFrame ) {
392 392
 
393
-            $_aFrame     = $_aFrame + array(
393
+            $_aFrame = $_aFrame + array(
394 394
                 'file'  => null, 'line' => null, 'function' => null,
395 395
                 'class' => null, 'args' => array(),
396 396
             );
397 397
             $_sArguments = self::___getArgumentsOfEachStackTrace( $_aFrame[ 'args' ] );
398
-            $_aTraces[]  = sprintf(
398
+            $_aTraces[ ]  = sprintf(
399 399
                 "#%s %s(%s): %s(%s)",
400 400
                 $_iIndex + 1,
401 401
                 $_aFrame[ 'file' ],
402 402
                 $_aFrame[ 'line' ],
403
-                isset( $_aFrame[ 'class' ] ) ? $_aFrame[ 'class' ] . '->' . $_aFrame[ 'function' ] : $_aFrame[ 'function' ],
403
+                isset( $_aFrame[ 'class' ] ) ? $_aFrame[ 'class' ].'->'.$_aFrame[ 'function' ] : $_aFrame[ 'function' ],
404 404
                 $_sArguments
405 405
             );
406 406
 
407 407
         }
408
-        return implode( PHP_EOL, $_aTraces ) . PHP_EOL;
408
+        return implode( PHP_EOL, $_aTraces ).PHP_EOL;
409 409
 
410 410
     }
411 411
         /**
@@ -420,16 +420,16 @@  discard block
 block discarded – undo
420 420
             foreach ( $aTraceArguments as $_mArgument ) {
421 421
                 $_sType        = gettype( $_mArgument );
422 422
                 $_sType        = str_replace(
423
-                    array( 'resource (closed)', 'unknown type', 'integer', 'double', ),
424
-                    array( 'resource', 'unknown', 'scalar', 'scalar', ),
423
+                    array( 'resource (closed)', 'unknown type', 'integer', 'double',),
424
+                    array( 'resource', 'unknown', 'scalar', 'scalar',),
425 425
                     $_sType
426 426
                 );
427 427
                 $_sMethodName  = "___getStackTraceArgument_{$_sType}";
428
-                $_aArguments[] = method_exists( __CLASS__, $_sMethodName )
428
+                $_aArguments[ ] = method_exists( __CLASS__, $_sMethodName )
429 429
                     ? self::{$_sMethodName}( $_mArgument )
430 430
                     : $_sType;
431 431
             }
432
-            return join(", ",  $_aArguments );
432
+            return join( ", ", $_aArguments );
433 433
         }
434 434
             /**
435 435
              * @since 3.8.22
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
              * @return string
439 439
              */
440 440
             static private function ___getStackTraceArgument_string( $mArgument ) {
441
-                return "'" . $mArgument . "'";
441
+                return "'".$mArgument."'";
442 442
             }
443 443
             static private function ___getStackTraceArgument_scalar( $mArgument ) {
444 444
                 return $mArgument;
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
                 return 'NULL';
451 451
             }
452 452
             static private function ___getStackTraceArgument_object( $mArgument ) {
453
-                return 'Object(' . get_class( $mArgument ) . ')';
453
+                return 'Object('.get_class( $mArgument ).')';
454 454
             }
455 455
             static private function ___getStackTraceArgument_resource( $mArgument ) {
456 456
                 return get_resource_type( $mArgument );
@@ -463,18 +463,18 @@  discard block
 block discarded – undo
463 463
                 $_iMax    = 10;
464 464
                 $_iTotal  = count( $mArgument );
465 465
                 $_iIndex  = 0;
466
-                foreach( $mArgument as $_sKey => $_mValue ) {
466
+                foreach ( $mArgument as $_sKey => $_mValue ) {
467 467
                     $_iIndex++;
468
-                    $_mValue   = is_scalar( $_mValue )
468
+                    $_mValue = is_scalar( $_mValue )
469 469
                         ? $_mValue
470
-                        : ucfirst( gettype( $_mValue ) ) . (
470
+                        : ucfirst( gettype( $_mValue ) ).(
471 471
                             is_object( $_mValue )
472
-                                ? ' (' . get_class( $_mValue ) . ')'
472
+                                ? ' ('.get_class( $_mValue ).')'
473 473
                                 : ''
474 474
                         );
475
-                    $_sOutput .= $_sKey . ': ' . $_mValue . ',';
475
+                    $_sOutput .= $_sKey.': '.$_mValue.',';
476 476
                     if ( $_iIndex > $_iMax && $_iTotal > $_iMax ) {
477
-                        $_sOutput  = rtrim( $_sOutput, ','  ) . '...';
477
+                        $_sOutput = rtrim( $_sOutput, ',' ).'...';
478 478
                         break;
479 479
                     }
480 480
                 }
Please login to merge, or discard this patch.
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.23';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
19
+    const VERSION        = '3.8.23'; // <--- 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.