Code cleanup and documentation improvements.

This commit is contained in:
James Cole
2018-07-06 07:15:42 +02:00
parent bdc6678341
commit a76241c7ba
49 changed files with 342 additions and 82 deletions

View File

@@ -1,5 +1,4 @@
<?php /** @noinspection PhpDynamicAsStaticMethodCallInspection */
<?php
/**
* ScanAttachments.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
@@ -20,6 +19,8 @@
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
declare(strict_types=1);
namespace FireflyIII\Console\Commands;
@@ -63,13 +64,13 @@ class ScanAttachments extends Command
try {
$content = $disk->get($fileName);
} catch (FileNotFoundException $e) {
$this->error(sprintf('Could not find data for attachment #%d', $attachment->id));
$this->error(sprintf('Could not find data for attachment #%d: %s', $attachment->id, $e->getMessage()));
continue;
}
try {
$decrypted = Crypt::decrypt($content);
} catch (DecryptException $e) {
$this->error(sprintf('Could not decrypt data of attachment #%d', $attachment->id));
$this->error(sprintf('Could not decrypt data of attachment #%d: %s', $attachment->id, $e->getMessage()));
continue;
}
$tmpfname = tempnam(sys_get_temp_dir(), 'FireflyIII');