Completed
Branch master (0a34ef)
by
unknown
13:11
created
development/utility/zip/AdminPageFramework_Zip.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@
 block discarded – undo
248 248
                         in_array( 
249 249
                             substr( $_sIterationItem, strrpos( $_sIterationItem, '/' ) + 1 ), 
250 250
                             array( '.', '..' ) 
251
-                       )
251
+                        )
252 252
                     ) {
253 253
                         return;
254 254
                     }
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
      * 
51 51
      * @since       3.6.0
52 52
      */
53
-    public $aOptions   = array(
54
-        'include_directory'             => false,   // (boolean) whether the contents should be put inside a root directory.
53
+    public $aOptions = array(
54
+        'include_directory'             => false, // (boolean) whether the contents should be put inside a root directory.
55 55
         'additional_source_directories' => array(),
56 56
         // 'ignoring_file_extensions'      => array(), // not implemented yet.
57 57
     );
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @param       array|boolean       $abOptions
65 65
      * @param       callable            $aCallbacks
66 66
      */
67
-    public function __construct( $sSource, $sDestination, $abOptions=false, array $aCallbacks=array() ) {
67
+    public function __construct( $sSource, $sDestination, $abOptions = false, array $aCallbacks = array() ) {
68 68
         
69 69
         $this->sSource      = $sSource;
70 70
         $this->sDestination = $sDestination;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     public function compress() {
97 97
 
98 98
         // Check whether it is possible to perform the task.
99
-        if ( ! $this->isFeasible( $this->sSource ) ) {
99
+        if ( !$this->isFeasible( $this->sSource ) ) {
100 100
             return false;
101 101
         }
102 102
         
@@ -106,19 +106,19 @@  discard block
 block discarded – undo
106 106
         }
107 107
 
108 108
         $_oZip = new ZipArchive();
109
-        if ( ! $_oZip->open( $this->sDestination, ZIPARCHIVE::CREATE ) ) {
109
+        if ( !$_oZip->open( $this->sDestination, ZIPARCHIVE::CREATE ) ) {
110 110
             return false;
111 111
         }
112 112
         
113 113
         $this->sSource = $this->_getSanitizedSourcePath( $this->sSource );
114 114
         // $this->sSource = str_replace( '\\', '/', realpath( $this->sSource ) );
115 115
 
116
-        $_aMethods      = array(
116
+        $_aMethods = array(
117 117
             'unknown'   => '_replyToReturnFalse',
118 118
             'directory' => '_replyToCompressDirectory',
119 119
             'file'      => '_replyToCompressFile',
120 120
         );
121
-        $_sMethodName   = $_aMethods[ $this->_getSourceType( $this->sSource ) ];
121
+        $_sMethodName = $_aMethods[ $this->_getSourceType( $this->sSource ) ];
122 122
         return call_user_func_array(
123 123
             array( $this, $_sMethodName ),
124 124
             array(
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
          * @since       3.6.0       Changed the name from `_compressDirectory`. Changed the scope to public to allow overriding the method in an extended class.
145 145
          * @return      boolean     True on success, false otherwise.
146 146
          */
147
-        public function _replyToCompressDirectory( ZipArchive $oZip, $sSourceDirPath, array $aCallbacks=array(), $bIncludeDir=false, array $aAdditionalSourceDirs=array() ) {
147
+        public function _replyToCompressDirectory( ZipArchive $oZip, $sSourceDirPath, array $aCallbacks = array(), $bIncludeDir = false, array $aAdditionalSourceDirs = array() ) {
148 148
             
149 149
             $_sArchiveRootDirName = '';
150 150
            
@@ -174,11 +174,11 @@  discard block
 block discarded – undo
174 174
              * @since       3.6.0
175 175
              * @return      void
176 176
              */
177
-            private function _addArchiveItems( $oZip, $aSourceDirPaths, $aCallbacks, $sRootDirName='' ) {
177
+            private function _addArchiveItems( $oZip, $aSourceDirPaths, $aCallbacks, $sRootDirName = '' ) {
178 178
                 
179
-                $sRootDirName = $sRootDirName ? rtrim( $sRootDirName, '/' ) . '/' : '';
179
+                $sRootDirName = $sRootDirName ? rtrim( $sRootDirName, '/' ).'/' : '';
180 180
                 
181
-                foreach( $aSourceDirPaths as $_isIndexOrRelativeDirPath => $_sSourceDirPath ) {
181
+                foreach ( $aSourceDirPaths as $_isIndexOrRelativeDirPath => $_sSourceDirPath ) {
182 182
                     
183 183
                     $_sSourceDirPath   = $this->_getSanitizedSourcePath( $_sSourceDirPath );
184 184
                     $_sInsideDirPrefix = is_integer( $_isIndexOrRelativeDirPath )
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
                         : $_isIndexOrRelativeDirPath;
187 187
                         
188 188
                     // Add a directory inside the compressing directory.
189
-                    if( $_sInsideDirPrefix ) {
189
+                    if ( $_sInsideDirPrefix ) {
190 190
                         $this->_addRelativeDir(
191 191
                             $oZip,
192 192
                             $_sInsideDirPrefix,
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                             $_sSourceDirPath,
205 205
                             $_sIterationItem, 
206 206
                             $aCallbacks,
207
-                            $sRootDirName . $_sInsideDirPrefix
207
+                            $sRootDirName.$_sInsideDirPrefix
208 208
                         );
209 209
                     }                                
210 210
                 }
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
                     $sRelativeDirPath = str_replace( '\\', '/', $sRelativeDirPath );
219 219
                     $_aPathPartsParse = array_filter( explode( '/', $sRelativeDirPath ) );
220 220
                     $_aDirPath        = array();
221
-                    foreach( $_aPathPartsParse as $_sDirName ) {
222
-                        $_aDirPath[] = $_sDirName;
221
+                    foreach ( $_aPathPartsParse as $_sDirName ) {
222
+                        $_aDirPath[ ] = $_sDirName;
223 223
                         $this->_addEmptyDir( 
224 224
                             $oZip, 
225 225
                             implode( '/', $_aDirPath ),
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
                  * @param       string          $sInsidePathPrefix      The prefix to add to the inside archive directory structure. 
239 239
                  * @return      void
240 240
                  */
241
-                private function _addArchiveItem( ZipArchive $oZip, $sSource, $_sIterationItem, array $aCallbacks, $sInsidePathPrefix='' ) {
241
+                private function _addArchiveItem( ZipArchive $oZip, $sSource, $_sIterationItem, array $aCallbacks, $sInsidePathPrefix = '' ) {
242 242
                     
243 243
                     $_sIterationItem   = str_replace( '\\', '/', $_sIterationItem );
244
-                    $sInsidePathPrefix = rtrim( $sInsidePathPrefix, '/' ) . '/'; // add a trailing slash
244
+                    $sInsidePathPrefix = rtrim( $sInsidePathPrefix, '/' ).'/'; // add a trailing slash
245 245
                     
246 246
                     // Ignore "." and ".." folders
247 247
                     if ( 
@@ -259,18 +259,18 @@  discard block
 block discarded – undo
259 259
                     if ( true === is_dir( $_sIterationItem ) ) {
260 260
                         $this->_addEmptyDir( 
261 261
                             $oZip, 
262
-                            $sInsidePathPrefix . str_replace( 
263
-                                $sSource . '/', 
262
+                            $sInsidePathPrefix.str_replace( 
263
+                                $sSource.'/', 
264 264
                                 '', 
265
-                                $_sIterationItem . '/'
265
+                                $_sIterationItem.'/'
266 266
                             ), 
267 267
                             $aCallbacks[ 'directory_name' ]
268 268
                         );                    
269 269
                     } else if ( true === is_file( $_sIterationItem ) ) {
270 270
                         $this->_addFromString( 
271 271
                             $oZip, 
272
-                            $sInsidePathPrefix . str_replace(
273
-                                $sSource . '/', 
272
+                            $sInsidePathPrefix.str_replace(
273
+                                $sSource.'/', 
274 274
                                 '', 
275 275
                                 $_sIterationItem
276 276
                             ),
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
          * @since       3.6.0       Changed the name from `_compressFile`. Changed the scope from `private` to allow overriding in an extended class.
299 299
          * @return      boolean     True on success, false otherwise.
300 300
          */
301
-        public function _replyToCompressFile( ZipArchive $oZip, $sSourceFilePath, $aCallbacks=null ) {
301
+        public function _replyToCompressFile( ZipArchive $oZip, $sSourceFilePath, $aCallbacks = null ) {
302 302
             $this->_addFromString( 
303 303
                 $oZip, 
304 304
                 basename( $sSourceFilePath ), 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
      * @return      boolean
330 330
      */
331 331
     private function isFeasible( $sSource ) {
332
-        if ( ! extension_loaded( 'zip' ) ) {
332
+        if ( !extension_loaded( 'zip' ) ) {
333 333
             return false;
334 334
         }
335 335
         return file_exists( $sSource );
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
      */
354 354
     private function _addEmptyDir( ZipArchive $oZip, $sInsidePath, $oCallable ) {
355 355
         $sInsidePath = $this->_getFilteredArchivePath( $sInsidePath, $oCallable );
356
-        if ( ! strlen( $sInsidePath ) ) {
356
+        if ( !strlen( $sInsidePath ) ) {
357 357
             return;
358 358
         }
359 359
         $oZip->addEmptyDir( $sInsidePath );        
@@ -365,10 +365,10 @@  discard block
 block discarded – undo
365 365
      * @remark      If the path is empty, it will not process.
366 366
      * @return      void
367 367
      */
368
-    private function _addFromString( ZipArchive $oZip, $sInsidePath, $sSourceContents='', array $aCallbacks=array() ) {
368
+    private function _addFromString( ZipArchive $oZip, $sInsidePath, $sSourceContents = '', array $aCallbacks = array() ) {
369 369
         
370 370
         $sInsidePath = $this->_getFilteredArchivePath( $sInsidePath, $aCallbacks[ 'file_name' ] );
371
-        if ( ! strlen( $sInsidePath ) ) {
371
+        if ( !strlen( $sInsidePath ) ) {
372 372
             return;
373 373
         }
374 374
         $oZip->addFromString(
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
             
149 149
             $_sArchiveRootDirName = '';
150 150
            
151
-            if ( $bIncludeDir ) {                
151
+            if ( $bIncludeDir ) {
152 152
                 $_sArchiveRootDirName = $this->_getMainDirectoryName( $sSourceDirPath );
153 153
                 $this->_addEmptyDir( 
154 154
                     $oZip, 
Please login to merge, or discard this patch.
development/utility/class_tester/AdminPageFramework_ClassTester.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     /**
43 43
      * Creates an object instance with dynamic parameters.
44 44
      */
45
-    static public function getInstance( $sClassName, array $aParameters=array() ) {
45
+    static public function getInstance( $sClassName, array $aParameters = array() ) {
46 46
         
47 47
         $_oReflection = new ReflectionClass( $sClassName );
48 48
         return $_oReflection->newInstanceArgs( $aParameters );               
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         // For PHP 5.2.x or below
59 59
         if ( version_compare( phpversion(), '<', '5.3.0' ) ) {
60 60
             trigger_error(
61
-                'Program Name' . ': ' 
61
+                'Program Name'.': ' 
62 62
                     . sprintf( 
63 63
                         'The method cannot run with your PHP version: %1$s',
64 64
                         phpversion()
Please login to merge, or discard this patch.
development/admin-page-framework.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @package     AdminPageFramework
11 11
  */
12 12
 
13
-if ( ! class_exists( 'AdminPageFramework_Registry', false ) ) :
13
+if ( !class_exists( 'AdminPageFramework_Registry', false ) ) :
14 14
 /**
15 15
  * Facilitates WordPress plugin and theme development.
16 16
  *
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 final class AdminPageFramework_Registry extends AdminPageFramework_Registry_Base {
57 57
 
58 58
     const TEXT_DOMAIN        = 'admin-page-framework';
59
-    const TEXT_DOMAIN_PATH   = '/language';  // not used at the moment
59
+    const TEXT_DOMAIN_PATH   = '/language'; // not used at the moment
60 60
 
61 61
     /**
62 62
      * Indicates whether the framework is loaded from the minified version or not.
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
      * Sets up static properties.
99 99
      * @return      void
100 100
      */
101
-    static public function setUp( $sFilePath=__FILE__ ) {
101
+    static public function setUp( $sFilePath = __FILE__ ) {
102 102
 
103 103
         self::$sFilePath                = $sFilePath;
104 104
         self::$sDirPath                 = dirname( self::$sFilePath );
105
-        self::$sIncludeClassListPath    = self::$sDirPath . '/admin-page-framework-include-class-list.php';
105
+        self::$sIncludeClassListPath    = self::$sDirPath.'/admin-page-framework-include-class-list.php';
106 106
         self::$aClassFiles              = self::_getClassFilePathList( self::$sIncludeClassListPath );
107 107
         self::$sAutoLoaderPath          = isset( self::$aClassFiles[ 'AdminPageFramework_RegisterClasses' ] )
108 108
             ? self::$aClassFiles[ 'AdminPageFramework_RegisterClasses' ]
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
          * @return      array
118 118
          */
119 119
         static private function _getClassFilePathList( $sInclusionClassListPath ) {
120
-            $aClassFiles = array();    // this will be updated if the inclusion below is successful.
120
+            $aClassFiles = array(); // this will be updated if the inclusion below is successful.
121 121
             include( $sInclusionClassListPath );
122 122
             return $aClassFiles;
123 123
         }
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
      */
131 131
     static public function getVersion() {
132 132
 
133
-        if ( ! isset( self::$sAutoLoaderPath ) ) {
134
-            trigger_error( 'Admin Page Framework: ' . ' : ' . sprintf( __( 'The method is called too early. Perform <code>%2$s</code> earlier.', 'admin-page-framework' ), __METHOD__, 'setUp()' ), E_USER_WARNING );
133
+        if ( !isset( self::$sAutoLoaderPath ) ) {
134
+            trigger_error( 'Admin Page Framework: '.' : '.sprintf( __( 'The method is called too early. Perform <code>%2$s</code> earlier.', 'admin-page-framework' ), __METHOD__, 'setUp()' ), E_USER_WARNING );
135 135
             return self::VERSION;
136 136
         }
137
-        $_aMinifiedVesionSuffix     = array(
137
+        $_aMinifiedVesionSuffix = array(
138 138
             0 => '',
139 139
             1 => '.min',
140 140
         );
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 }
164 164
 endif;
165 165
 
166
-if ( ! class_exists( 'AdminPageFramework_Bootstrap', false ) ) :
166
+if ( !class_exists( 'AdminPageFramework_Bootstrap', false ) ) :
167 167
 /**
168 168
  * Loads the Admin Page Framework library.
169 169
  *
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function __construct( $sLibraryPath ) {
186 186
 
187
-        if ( ! $this->_isLoadable() ) {
187
+        if ( !$this->_isLoadable() ) {
188 188
             return;
189 189
         }
190 190
 
Please login to merge, or discard this patch.