mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
PHP7 compatible function definitions.
This commit is contained in:
@@ -32,5 +32,5 @@ interface ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal);
|
||||
public function act(TransactionJournal $journal): bool;
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ class AddTag implements ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal)
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
// journal has this tag maybe?
|
||||
$tag = Tag::firstOrCreateEncrypted(['tag' => $this->action->action_value, 'user_id' => Auth::user()->id]);
|
||||
|
@@ -39,7 +39,7 @@ class AppendDescription implements ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal)
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$journal->description = $journal->description . $this->action->action_value;
|
||||
$journal->save();
|
||||
|
@@ -40,7 +40,7 @@ class ClearBudget implements ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal)
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$journal->budgets()->detach();
|
||||
|
||||
|
@@ -40,7 +40,7 @@ class ClearCategory implements ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal)
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$journal->categories()->detach();
|
||||
|
||||
|
@@ -39,7 +39,7 @@ class PrependDescription implements ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal)
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$journal->description = $this->action->action_value . $journal->description;
|
||||
$journal->save();
|
||||
|
@@ -39,7 +39,7 @@ class RemoveAllTags implements ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal)
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$journal->tags()->detach();
|
||||
|
||||
|
@@ -42,7 +42,7 @@ class RemoveTag implements ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal)
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
// if tag does not exist, no need to continue:
|
||||
$name = $this->action->action_value;
|
||||
|
@@ -43,7 +43,7 @@ class SetBudget implements ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal)
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
/** @var BudgetRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||
|
@@ -43,7 +43,7 @@ class SetCategory implements ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal)
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$name = $this->action->action_value;
|
||||
$category = Category::firstOrCreateEncrypted(['name' => $name, 'user_id' => Auth::user()->id]);
|
||||
|
@@ -39,7 +39,7 @@ class SetDescription implements ActionInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act(TransactionJournal $journal)
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$journal->description = $this->action->action_value;
|
||||
$journal->save();
|
||||
|
Reference in New Issue
Block a user