Completed
Pull Request — master (#48)
by
unknown
02:50
created
src/Package.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -8,41 +8,41 @@  discard block
 block discarded – undo
8 8
 class Package
9 9
 {
10 10
 
11
-  /**
12
-   * @param $source
13
-   * @param null $basePath
14
-   *
15
-   * @return \frictionlessdata\datapackage\Datapackages\BaseDatapackage
16
-   * @throws \Exception
17
-   * @throws \frictionlessdata\datapackage\Exceptions\DatapackageInvalidSourceException
18
-   */
19
-  public static function load($source, $basePath = null)
11
+    /**
12
+     * @param $source
13
+     * @param null $basePath
14
+     *
15
+     * @return \frictionlessdata\datapackage\Datapackages\BaseDatapackage
16
+     * @throws \Exception
17
+     * @throws \frictionlessdata\datapackage\Exceptions\DatapackageInvalidSourceException
18
+     */
19
+    public static function load($source, $basePath = null)
20 20
     {
21 21
         static::isZipPresent();
22 22
         return Factory::datapackage($source, $basePath);
23 23
     }
24 24
 
25
-  /**
26
-   * @param $source
27
-   * @param null $basePath
28
-   *
29
-   * @return \frictionlessdata\datapackage\Validators\DatapackageValidationError[]
30
-   * @throws \Exception
31
-   */
32
-  public static function validate($source, $basePath = null)
25
+    /**
26
+     * @param $source
27
+     * @param null $basePath
28
+     *
29
+     * @return \frictionlessdata\datapackage\Validators\DatapackageValidationError[]
30
+     * @throws \Exception
31
+     */
32
+    public static function validate($source, $basePath = null)
33 33
     {
34 34
         static::isZipPresent();
35 35
         return Factory::validate($source, $basePath);
36 36
     }
37 37
 
38
-  /**
39
-   * @param null $descriptor
40
-   * @param null $basePath
41
-   *
42
-   * @return mixed
43
-   * @throws \Exception
44
-   */
45
-  public static function create($descriptor = null, $basePath = null)
38
+    /**
39
+     * @param null $descriptor
40
+     * @param null $basePath
41
+     *
42
+     * @return mixed
43
+     * @throws \Exception
44
+     */
45
+    public static function create($descriptor = null, $basePath = null)
46 46
     {
47 47
         static::isZipPresent();
48 48
         $descriptor = Utils::objectify($descriptor);
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
         return new $packageClass($descriptor, $basePath, true);
55 55
     }
56 56
 
57
-  /**
58
-   * @throws \Exception
59
-   */
60
-  private static function isZipPresent() {
57
+    /**
58
+     * @throws \Exception
59
+     */
60
+    private static function isZipPresent() {
61 61
         //If ZipArchive is not available throw Exception.
62 62
         if (!class_exists('ZipArchive')) {
63
-          throw new Exception('Error: Your PHP version is not compiled with zip support');
63
+            throw new Exception('Error: Your PHP version is not compiled with zip support');
64 64
         }
65 65
     }
66 66
 }
Please login to merge, or discard this patch.
src/Datapackages/BaseDatapackage.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,16 +13,16 @@  discard block
 block discarded – undo
13 13
 abstract class BaseDatapackage implements \Iterator
14 14
 {
15 15
 
16
-  /**
17
-   * BaseDatapackage constructor.
18
-   *
19
-   * @param object $descriptor
20
-   * @param null|string $basePath
21
-   *
22
-   * @param bool $skipValidations
23
-   *
24
-   * @throws \frictionlessdata\datapackage\Exceptions\DatapackageValidationFailedException
25
-   */
16
+    /**
17
+     * BaseDatapackage constructor.
18
+     *
19
+     * @param object $descriptor
20
+     * @param null|string $basePath
21
+     *
22
+     * @param bool $skipValidations
23
+     *
24
+     * @throws \frictionlessdata\datapackage\Exceptions\DatapackageValidationFailedException
25
+     */
26 26
     public function __construct($descriptor, $basePath = null, $skipValidations = false)
27 27
     {
28 28
         $this->descriptor = $descriptor;
@@ -191,13 +191,13 @@  discard block
 block discarded – undo
191 191
         $this->saveDescriptor($files['datapackage.json']);
192 192
         register_shutdown_function(function () use ($base) {Utils::removeDir($base); });
193 193
         if ($zip->open($zip_filename, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE) {
194
-          foreach ($files as $filename => $resource) {
194
+            foreach ($files as $filename => $resource) {
195 195
             $zip->addFile($resource, $filename);
196
-          }
197
-          $zip->close();
196
+            }
197
+            $zip->close();
198 198
         }
199 199
         else {
200
-          throw new DatapackageInvalidSourceException('zip file could not be saved.');
200
+            throw new DatapackageInvalidSourceException('zip file could not be saved.');
201 201
         }
202 202
     }
203 203
 
@@ -206,14 +206,14 @@  discard block
 block discarded – undo
206 206
     protected $basePath;
207 207
     protected $skipValidations = false;
208 208
 
209
-  /**
210
-   * called by the resources iterator for each iteration.
211
-   *
212
-   * @param object $descriptor
213
-   *
214
-   * @return \frictionlessdata\datapackage\Resources\BaseResource
215
-   * @throws \frictionlessdata\datapackage\Exceptions\ResourceValidationFailedException
216
-   */
209
+    /**
210
+     * called by the resources iterator for each iteration.
211
+     *
212
+     * @param object $descriptor
213
+     *
214
+     * @return \frictionlessdata\datapackage\Resources\BaseResource
215
+     * @throws \frictionlessdata\datapackage\Exceptions\ResourceValidationFailedException
216
+     */
217 217
     protected function initResource($descriptor)
218 218
     {
219 219
         return Factory::resource($descriptor, $this->basePath, $this->skipValidations);
Please login to merge, or discard this patch.