Various code cleanup.

This commit is contained in:
James Cole
2019-02-16 08:05:48 +01:00
parent 59fdf5b77a
commit e0aa7f3ff5
15 changed files with 761 additions and 750 deletions

View File

@@ -103,6 +103,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
* @param Attachment $attachment
*
* @return bool
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
private function exportAttachment(Attachment $attachment): bool
{

View File

@@ -225,6 +225,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface
* @param string $note
*
* @return bool
* @throws Exception
*/
public function updateNote(Attachment $attachment, string $note): bool
{

View File

@@ -189,7 +189,7 @@ class CategoryRepository implements CategoryRepositoryInterface
if ($categories->count() > 0) {
$collector->setCategories($categories);
}
if ($categories->count() === 0) {
if (0 === $categories->count()) {
$collector->setCategories($this->getCategories());
}
@@ -653,7 +653,7 @@ class CategoryRepository implements CategoryRepositoryInterface
if ($categories->count() > 0) {
$collector->setCategories($categories);
}
if ($categories->count() === 0) {
if (0 === $categories->count()) {
$collector->setCategories($this->getCategories());
}

View File

@@ -437,7 +437,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface
$attachment->size = $file->getSize();
$attachment->uploaded = false;
$attachment->save();
$fileObject = $file->openFile('r');
$fileObject = $file->openFile();
$fileObject->rewind();

View File

@@ -348,6 +348,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
* @param string $text
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @throws \Exception
*/
private function setNoteText(TransactionJournalLink $link, string $text): void
{

View File

@@ -554,6 +554,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
* @param string $note
*
* @return bool
* @throws \Exception
*/
private function updateNote(PiggyBank $piggyBank, string $note): bool
{

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Services\Internal\Support;
use Exception;
use FireflyIII\Factory\AccountFactory;
use FireflyIII\Factory\AccountMetaFactory;
use FireflyIII\Factory\TransactionFactory;
@@ -340,7 +341,7 @@ trait AccountServiceTrait
if (null !== $dbNote) {
try {
$dbNote->delete();
} catch (\Exception $e) {
} catch (Exception $e) {
Log::debug($e->getMessage());
}
}

View File

@@ -66,6 +66,7 @@ trait BillServiceTrait
* @param string $note
*
* @return bool
* @throws \Exception
*/
public function updateNote(Bill $bill, string $note): bool
{

View File

@@ -165,7 +165,7 @@ trait RequestInformation
}
$baseHref = route('index');
$helpString = sprintf(
'<p><em><img src="%s/images/flags/%s.png" /> %s</em></p>', $baseHref, $originalLanguage, (string)trans('firefly.help_translating')
'<p><em><img alt="" src="%s/images/flags/%s.png" /> %s</em></p>', $baseHref, $originalLanguage, (string)trans('firefly.help_translating')
);
$content = $helpString . $help->getFromGitHub($route, $language);
}

View File

@@ -212,6 +212,7 @@ class User extends Authenticatable
* Generates access token.
*
* @return string
* @throws \Exception
*/
public function generateAccessToken(): string
{