mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	Various code cleanup
This commit is contained in:
		| @@ -18,6 +18,7 @@ use Illuminate\Queue\SerializesModels; | ||||
| /** | ||||
|  * Class BlockedBadLogin | ||||
|  * | ||||
|  * @deprecated | ||||
|  * @package FireflyIII\Events | ||||
|  */ | ||||
| class BlockedBadLogin extends Event | ||||
|   | ||||
| @@ -19,6 +19,7 @@ use Illuminate\Queue\SerializesModels; | ||||
| /** | ||||
|  * Class BlockedUseOfEmail | ||||
|  * | ||||
|  * @deprecated | ||||
|  * @package FireflyIII\Events | ||||
|  */ | ||||
| class BlockedUseOfEmail extends Event | ||||
|   | ||||
| @@ -19,6 +19,7 @@ use Illuminate\Queue\SerializesModels; | ||||
| /** | ||||
|  * Class BlockedUserLogin | ||||
|  * | ||||
|  * @deprecated | ||||
|  * @package FireflyIII\Events | ||||
|  */ | ||||
| class BlockedUserLogin extends Event | ||||
|   | ||||
| @@ -18,6 +18,7 @@ use Illuminate\Queue\SerializesModels; | ||||
| /** | ||||
|  * Class DeletedUser | ||||
|  * | ||||
|  * @deprecated | ||||
|  * @package FireflyIII\Events | ||||
|  */ | ||||
| class DeletedUser extends Event | ||||
|   | ||||
| @@ -18,6 +18,7 @@ use Illuminate\Queue\SerializesModels; | ||||
| /** | ||||
|  * Class LockedOutUser | ||||
|  * | ||||
|  * @deprecated | ||||
|  * @package FireflyIII\Events | ||||
|  */ | ||||
| class LockedOutUser extends Event | ||||
|   | ||||
| @@ -125,6 +125,7 @@ class StoredJournalEventHandler | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's 6 but I can live with it. | ||||
|      * @param TransactionJournal  $journal | ||||
|      * @param PiggyBank           $piggyBank | ||||
|      * @param PiggyBankRepetition $repetition | ||||
| @@ -153,7 +154,8 @@ class StoredJournalEventHandler | ||||
|             Log::debug(sprintf('Room in piggy bank for extra money is %f', $room)); | ||||
|             Log::debug(sprintf('There is NO room to add %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name)); | ||||
|             Log::debug(sprintf('New amount is %f', $room)); | ||||
|             $amount = $room; | ||||
|  | ||||
|             return $room; | ||||
|         } | ||||
|  | ||||
|         // amount is negative and $currentamount is smaller than $amount | ||||
| @@ -161,7 +163,8 @@ class StoredJournalEventHandler | ||||
|             Log::debug(sprintf('Max amount to remove is %f', $repetition->currentamount)); | ||||
|             Log::debug(sprintf('Cannot remove %f from piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name)); | ||||
|             Log::debug(sprintf('New amount is %f', $compare)); | ||||
|             $amount = $compare; | ||||
|  | ||||
|             return $compare; | ||||
|         } | ||||
|  | ||||
|         return $amount; | ||||
|   | ||||
| @@ -85,6 +85,7 @@ class UserEventHandler | ||||
|     /** | ||||
|      * @param BlockedBadLogin $event | ||||
|      * | ||||
|      * @deprecated | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function reportBadLogin(BlockedBadLogin $event) | ||||
| @@ -118,6 +119,7 @@ class UserEventHandler | ||||
|     /** | ||||
|      * @param BlockedUserLogin $event | ||||
|      * | ||||
|      * @deprecated | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function reportBlockedUser(BlockedUserLogin $event): bool | ||||
| @@ -157,6 +159,7 @@ class UserEventHandler | ||||
|     /** | ||||
|      * @param LockedOutUser $event | ||||
|      * | ||||
|      * @deprecated | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function reportLockout(LockedOutUser $event): bool | ||||
| @@ -189,6 +192,7 @@ class UserEventHandler | ||||
|     /** | ||||
|      * @param BlockedUseOfDomain $event | ||||
|      * | ||||
|      * @deprecated | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function reportUseBlockedDomain(BlockedUseOfDomain $event): bool | ||||
| @@ -227,6 +231,7 @@ class UserEventHandler | ||||
|     /** | ||||
|      * @param BlockedUseOfEmail $event | ||||
|      * | ||||
|      * @deprecated | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function reportUseOfBlockedEmail(BlockedUseOfEmail $event): bool | ||||
| @@ -263,6 +268,7 @@ class UserEventHandler | ||||
|     /** | ||||
|      * @param DeletedUser $event | ||||
|      * | ||||
|      * @deprecated | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function saveEmailAddress(DeletedUser $event): bool | ||||
| @@ -379,6 +385,7 @@ class UserEventHandler | ||||
|      * from the user yet stored conveniently. | ||||
|      * | ||||
|      * @param ConfirmedUser $event | ||||
|      * @deprecated | ||||
|      * | ||||
|      * @return bool | ||||
|      */ | ||||
| @@ -394,6 +401,7 @@ class UserEventHandler | ||||
|      * fashion as the previous method. | ||||
|      * | ||||
|      * @param RegisteredUser $event | ||||
|      * @deprecated | ||||
|      * | ||||
|      * @return bool | ||||
|      */ | ||||
|   | ||||
| @@ -139,6 +139,7 @@ class BalanceLine | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @SuppressWarnings(PHPMD.CyclomaticComplexity) | ||||
|      * @return string | ||||
|      */ | ||||
|     public function getTitle(): string | ||||
| @@ -147,13 +148,13 @@ class BalanceLine | ||||
|             return $this->getBudget()->name; | ||||
|         } | ||||
|         if ($this->getRole() == self::ROLE_DEFAULTROLE) { | ||||
|             return trans('firefly.no_budget'); | ||||
|             return strval(trans('firefly.no_budget')); | ||||
|         } | ||||
|         if ($this->getRole() == self::ROLE_TAGROLE) { | ||||
|             return trans('firefly.coveredWithTags'); | ||||
|             return strval(trans('firefly.coveredWithTags')); | ||||
|         } | ||||
|         if ($this->getRole() == self::ROLE_DIFFROLE) { | ||||
|             return trans('firefly.leftUnbalanced'); | ||||
|             return strval(trans('firefly.leftUnbalanced')); | ||||
|         } | ||||
|  | ||||
|         return ''; | ||||
|   | ||||
| @@ -74,12 +74,8 @@ class Help implements HelpInterface | ||||
|             $converter = new CommonMarkConverter(); | ||||
|             $content   = $converter->convertToHtml($content); | ||||
|         } | ||||
|         if (strlen($content) === 0) { | ||||
|             Log::warning('Raw content length is zero.'); | ||||
|         } | ||||
|  | ||||
|         return $content; | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user