diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 56d2b8289c..458b0fed01 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -371,10 +371,9 @@ class AccountRepository implements AccountRepositoryInterface * Returns the date of the very first transaction in this account. * * @param Account $account - * @deprecated - * @return TransactionJournal + * @return TransactionJournal|null */ - public function oldestJournal(Account $account): TransactionJournal + public function oldestJournal(Account $account): ?TransactionJournal { $first = $account->transactions() ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') @@ -387,7 +386,7 @@ class AccountRepository implements AccountRepositoryInterface return TransactionJournal::find((int)$first->id); } - return new TransactionJournal(); + return null; } /** @@ -402,7 +401,7 @@ class AccountRepository implements AccountRepositoryInterface { $result = new Carbon; $journal = $this->oldestJournal($account); - if (null !== $journal->id) { + if (null !== $journal) { $result = $journal->date; } diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 3ea3c1be42..59e67acfc8 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -164,10 +164,9 @@ interface AccountRepositoryInterface * Returns the date of the very first transaction in this account. * * @param Account $account - * @deprecated - * @return TransactionJournal + * @return TransactionJournal|null */ - public function oldestJournal(Account $account): TransactionJournal; + public function oldestJournal(Account $account): ?TransactionJournal; /** * Returns the date of the very first transaction in this account. diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php index e9e44b71c8..931b46747e 100644 --- a/app/Repositories/Account/AccountTasker.php +++ b/app/Repositories/Account/AccountTasker.php @@ -80,7 +80,7 @@ class AccountTasker implements AccountTaskerInterface $entry['end_balance'] = $endSet[$account->id] ?? '0'; // first journal exists, and is on start, then this is the actual opening balance: - if (null !== $first->id && $first->date->isSameDay($start)) { + if (null !== $first && $first->date->isSameDay($start)) { Log::debug(sprintf('Date of first journal for %s is %s', $account->name, $first->date->format('Y-m-d'))); $entry['start_balance'] = $first->transactions()->where('account_id', $account->id)->first()->amount; Log::debug(sprintf('Account %s was opened on %s, so opening balance is %f', $account->name, $start->format('Y-m-d'), $entry['start_balance'])); diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php index cf723f56bb..52b77fff68 100644 --- a/app/Repositories/Attachment/AttachmentRepository.php +++ b/app/Repositories/Attachment/AttachmentRepository.php @@ -127,7 +127,6 @@ class AttachmentRepository implements AttachmentRepositoryInterface * @return string * * @throws \Illuminate\Contracts\Encryption\DecryptException - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ public function getContent(Attachment $attachment): string { diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.php index cb377a383b..70bf949732 100644 --- a/app/Repositories/ExportJob/ExportJobRepository.php +++ b/app/Repositories/ExportJob/ExportJobRepository.php @@ -89,7 +89,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface while ($count < 30) { $key = Str::random(12); $existing = $this->findByKey($key); - if (null === $existing->id) { + if (null === $existing) { $exportJob = new ExportJob; $exportJob->user()->associate($this->user); $exportJob->key = Str::random(12); @@ -121,16 +121,14 @@ class ExportJobRepository implements ExportJobRepositoryInterface /** * @param string $key - * - * @deprecated - * @return ExportJob + * @return ExportJob|null */ - public function findByKey(string $key): ExportJob + public function findByKey(string $key): ?ExportJob { /** @var ExportJob $result */ $result = $this->user->exportJobs()->where('key', $key)->first(['export_jobs.*']); if (null === $result) { - return new ExportJob; + return null; } return $result; @@ -141,7 +139,6 @@ class ExportJobRepository implements ExportJobRepositoryInterface * * @return string * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ public function getContent(ExportJob $job): string { diff --git a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php index 3a9bd5c4fd..90473ca3ed 100644 --- a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php +++ b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php @@ -58,11 +58,9 @@ interface ExportJobRepositoryInterface /** * @param string $key - * - * @deprecated - * @return ExportJob + * @return ExportJob|null */ - public function findByKey(string $key): ExportJob; + public function findByKey(string $key): ?ExportJob; /** * @param ExportJob $job diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.php index 24b7703719..b439e7b518 100644 --- a/app/Repositories/ImportJob/ImportJobRepository.php +++ b/app/Repositories/ImportJob/ImportJobRepository.php @@ -86,7 +86,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface while ($count < 30) { $key = Str::random(12); $existing = $this->findByKey($key); - if (null === $existing->id) { + if (null === $existing) { $importJob = ImportJob::create( [ 'user_id' => $this->user->id, @@ -114,15 +114,14 @@ class ImportJobRepository implements ImportJobRepositoryInterface /** * @param string $key * - * @return ImportJob - * @deprecated + * @return ImportJob|null */ - public function findByKey(string $key): ImportJob + public function findByKey(string $key): ?ImportJob { /** @var ImportJob $result */ $result = $this->user->importJobs()->where('key', $key)->first(['import_jobs.*']); if (null === $result) { - return new ImportJob; + return null; } return $result; diff --git a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php index 0789741fc5..6d151a4588 100644 --- a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php +++ b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php @@ -54,11 +54,9 @@ interface ImportJobRepositoryInterface /** * @param string $key - * - * @return ImportJob - * @deprecated + * @return ImportJob|null */ - public function findByKey(string $key): ImportJob; + public function findByKey(string $key): ?ImportJob; /** * Return all attachments for job. diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.php index d147cbd676..c67f1cc36b 100644 --- a/app/Repositories/Recurring/RecurringRepository.php +++ b/app/Repositories/Recurring/RecurringRepository.php @@ -187,7 +187,6 @@ class RecurringRepository implements RecurringRepositoryInterface * @param Carbon $start * @param Carbon $end * - * @throws FireflyException * * @return array */ diff --git a/composer.lock b/composer.lock index 2a96a6e3a3..acd955e4ec 100644 --- a/composer.lock +++ b/composer.lock @@ -2416,21 +2416,22 @@ }, { "name": "ramsey/uuid", - "version": "3.7.3", + "version": "3.8.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76" + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/44abcdad877d9a46685a3a4d221e3b2c4b87cb76", - "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3", "shasum": "" }, "require": { - "paragonie/random_compat": "^1.0|^2.0", - "php": "^5.4 || ^7.0" + "paragonie/random_compat": "^1.0|^2.0|9.99.99", + "php": "^5.4 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "replace": { "rhumsaa/uuid": "self.version" @@ -2438,16 +2439,17 @@ "require-dev": { "codeception/aspect-mock": "^1.0 | ~2.0.0", "doctrine/annotations": "~1.2.0", - "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1", + "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ~2.1.0", "ircmaxell/random-lib": "^1.1", "jakub-onderka/php-parallel-lint": "^0.9.0", "mockery/mockery": "^0.9.9", "moontoast/math": "^1.1", "php-mock/php-mock-phpunit": "^0.3|^1.1", - "phpunit/phpunit": "^4.7|^5.0", + "phpunit/phpunit": "^4.7|^5.0|^6.5", "squizlabs/php_codesniffer": "^2.3" }, "suggest": { + "ext-ctype": "Provides support for PHP Ctype functions", "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", @@ -2492,7 +2494,7 @@ "identifier", "uuid" ], - "time": "2018-01-20T00:28:24+00:00" + "time": "2018-07-19T23:38:55+00:00" }, { "name": "rcrowe/twigbridge", @@ -2627,16 +2629,16 @@ }, { "name": "symfony/console", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f" + "reference": "5c31f6a97c1c240707f6d786e7e59bfacdbc0219" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/70591cda56b4b47c55776ac78e157c4bb6c8b43f", - "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f", + "url": "https://api.github.com/repos/symfony/console/zipball/5c31f6a97c1c240707f6d786e7e59bfacdbc0219", + "reference": "5c31f6a97c1c240707f6d786e7e59bfacdbc0219", "shasum": "" }, "require": { @@ -2691,11 +2693,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-31T10:17:53+00:00" + "time": "2018-07-16T14:05:40+00:00" }, { "name": "symfony/css-selector", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2748,16 +2750,16 @@ }, { "name": "symfony/debug", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "dbe0fad88046a755dcf9379f2964c61a02f5ae3d" + "reference": "a1f2118cedb8731c45e945cdd2b808ca82abc4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/dbe0fad88046a755dcf9379f2964c61a02f5ae3d", - "reference": "dbe0fad88046a755dcf9379f2964c61a02f5ae3d", + "url": "https://api.github.com/repos/symfony/debug/zipball/a1f2118cedb8731c45e945cdd2b808ca82abc4b5", + "reference": "a1f2118cedb8731c45e945cdd2b808ca82abc4b5", "shasum": "" }, "require": { @@ -2800,20 +2802,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-06-08T09:39:36+00:00" + "time": "2018-07-06T14:52:28+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5" + "reference": "00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2391ed210a239868e7256eb6921b1bd83f3087b5", - "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f", + "reference": "00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f", "shasum": "" }, "require": { @@ -2863,11 +2865,11 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:57+00:00" + "time": "2018-07-10T11:02:47+00:00" }, { "name": "symfony/finder", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2916,16 +2918,16 @@ }, { "name": "symfony/http-foundation", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "4f9c7cf962e635b0b26b14500ac046e07dbef7f3" + "reference": "8da9ea68ab2d80dfabd41e0d14b9606bb47a10c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/4f9c7cf962e635b0b26b14500ac046e07dbef7f3", - "reference": "4f9c7cf962e635b0b26b14500ac046e07dbef7f3", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/8da9ea68ab2d80dfabd41e0d14b9606bb47a10c0", + "reference": "8da9ea68ab2d80dfabd41e0d14b9606bb47a10c0", "shasum": "" }, "require": { @@ -2966,20 +2968,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-06-19T21:38:16+00:00" + "time": "2018-07-16T14:05:40+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "29c094a1c4f8209b7e033f612cbbd69029e38955" + "reference": "ebd28f4f88a2ca0a0488882ad73c4004f3afdbe3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/29c094a1c4f8209b7e033f612cbbd69029e38955", - "reference": "29c094a1c4f8209b7e033f612cbbd69029e38955", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/ebd28f4f88a2ca0a0488882ad73c4004f3afdbe3", + "reference": "ebd28f4f88a2ca0a0488882ad73c4004f3afdbe3", "shasum": "" }, "require": { @@ -3053,7 +3055,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2018-06-25T13:06:45+00:00" + "time": "2018-07-23T17:16:22+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3334,7 +3336,7 @@ }, { "name": "symfony/process", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -3443,16 +3445,16 @@ }, { "name": "symfony/routing", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "b38b9797327b26ea2e4146a40e6e2dc9820a6932" + "reference": "73770bf3682b4407b017c2bdcb2b11cdcbce5322" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/b38b9797327b26ea2e4146a40e6e2dc9820a6932", - "reference": "b38b9797327b26ea2e4146a40e6e2dc9820a6932", + "url": "https://api.github.com/repos/symfony/routing/zipball/73770bf3682b4407b017c2bdcb2b11cdcbce5322", + "reference": "73770bf3682b4407b017c2bdcb2b11cdcbce5322", "shasum": "" }, "require": { @@ -3516,20 +3518,20 @@ "uri", "url" ], - "time": "2018-06-19T21:38:16+00:00" + "time": "2018-06-28T06:30:33+00:00" }, { "name": "symfony/translation", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "b6d8164085ee0b6debcd1b7a131fd6f63bb04854" + "reference": "2dd74d6b2dcbd46a93971e6ce7d245cf3123e957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/b6d8164085ee0b6debcd1b7a131fd6f63bb04854", - "reference": "b6d8164085ee0b6debcd1b7a131fd6f63bb04854", + "url": "https://api.github.com/repos/symfony/translation/zipball/2dd74d6b2dcbd46a93971e6ce7d245cf3123e957", + "reference": "2dd74d6b2dcbd46a93971e6ce7d245cf3123e957", "shasum": "" }, "require": { @@ -3585,20 +3587,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-06-22T08:59:39+00:00" + "time": "2018-07-23T08:20:20+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "b2eebaec085d1f2cafbad7644733d494a3bbbc9b" + "reference": "9f882aed43f364de1d43038e8fb39703c577afc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/b2eebaec085d1f2cafbad7644733d494a3bbbc9b", - "reference": "b2eebaec085d1f2cafbad7644733d494a3bbbc9b", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9f882aed43f364de1d43038e8fb39703c577afc1", + "reference": "9f882aed43f364de1d43038e8fb39703c577afc1", "shasum": "" }, "require": { @@ -3660,7 +3662,7 @@ "debug", "dump" ], - "time": "2018-06-23T12:23:56+00:00" + "time": "2018-07-05T11:54:23+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -3827,16 +3829,16 @@ }, { "name": "zendframework/zend-diactoros", - "version": "1.8.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "63d920d1c9ebc009d860c3666593a66298727dd6" + "reference": "273c18bf6aaab20be9667a3aa4e7702e1e4e7ced" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/63d920d1c9ebc009d860c3666593a66298727dd6", - "reference": "63d920d1c9ebc009d860c3666593a66298727dd6", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/273c18bf6aaab20be9667a3aa4e7702e1e4e7ced", + "reference": "273c18bf6aaab20be9667a3aa4e7702e1e4e7ced", "shasum": "" }, "require": { @@ -3886,7 +3888,7 @@ "psr", "psr-7" ], - "time": "2018-07-09T21:17:27+00:00" + "time": "2018-07-19T18:38:31+00:00" } ], "packages-dev": [ @@ -5855,7 +5857,7 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", @@ -5911,7 +5913,7 @@ }, { "name": "symfony/config", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -5974,7 +5976,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -6024,7 +6026,7 @@ }, { "name": "symfony/stopwatch", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -6073,7 +6075,7 @@ }, { "name": "symfony/yaml", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git",