@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | unlink($tempfile); |
| 348 | 348 | $tempfile .= '.zip'; |
| 349 | 349 | stream_copy_to_stream(fopen($source, 'r'), fopen($tempfile, 'w')); |
| 350 | - register_shutdown_function(function () use ($tempfile) {unlink($tempfile); }); |
|
| 350 | + register_shutdown_function(function() use ($tempfile) {unlink($tempfile); }); |
|
| 351 | 351 | |
| 352 | 352 | return self::loadFileZipSource($tempfile); |
| 353 | 353 | } |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | $tempdir = tempnam(sys_get_temp_dir(), 'datapackage-php'); |
| 359 | 359 | unlink($tempdir); |
| 360 | 360 | mkdir($tempdir); |
| 361 | - register_shutdown_function(function () use ($tempdir) {Utils::removeDir($tempdir); }); |
|
| 361 | + register_shutdown_function(function() use ($tempdir) {Utils::removeDir($tempdir); }); |
|
| 362 | 362 | /* @noinspection PhpUnhandledExceptionInspection File existence is checked afterwards anyway */ |
| 363 | 363 | if (($zip->open($source) === TRUE) && ($zip->extractTo($tempdir) === TRUE)) { |
| 364 | 364 | $zip->close(); |
@@ -362,8 +362,7 @@ |
||
| 362 | 362 | /* @noinspection PhpUnhandledExceptionInspection File existence is checked afterwards anyway */ |
| 363 | 363 | if (($zip->open($source) === TRUE) && ($zip->extractTo($tempdir) === TRUE)) { |
| 364 | 364 | $zip->close(); |
| 365 | - } |
|
| 366 | - else { |
|
| 365 | + } else { |
|
| 367 | 366 | throw new Exceptions\DatapackageInvalidSourceException('zip file could not be opened from source.'); |
| 368 | 367 | } |
| 369 | 368 | |
@@ -189,7 +189,7 @@ |
||
| 189 | 189 | ++$ri; |
| 190 | 190 | } |
| 191 | 191 | $this->saveDescriptor($files['datapackage.json']); |
| 192 | - register_shutdown_function(function () use ($base) {Utils::removeDir($base); }); |
|
| 192 | + register_shutdown_function(function() use ($base) {Utils::removeDir($base); }); |
|
| 193 | 193 | if ($zip->open($zip_filename, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE) { |
| 194 | 194 | foreach ($files as $filename => $resource) { |
| 195 | 195 | $zip->addFile($resource, $filename); |
@@ -195,8 +195,7 @@ |
||
| 195 | 195 | $zip->addFile($resource, $filename); |
| 196 | 196 | } |
| 197 | 197 | $zip->close(); |
| 198 | - } |
|
| 199 | - else { |
|
| 198 | + } else { |
|
| 200 | 199 | throw new DatapackageInvalidSourceException('zip file could not be saved.'); |
| 201 | 200 | } |
| 202 | 201 | } |