Skip to content

Commit

Permalink
Added return type ?array to UserDataProviderInterface::data() method
Browse files Browse the repository at this point in the history
The change should make cached data smaller since a lot of data providers
don't need to provide any user data, but they were still cached as an
empty array into the user data cache (Redis).

remp/crm#2460
  • Loading branch information
rootpd committed May 26, 2022
1 parent 20a1880 commit 23414f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Models/User/PaymentsUserDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public static function identifier(): string
return 'payments';
}

public function data($userId)
public function data($userId): ?array
{
return [];
return null;
}

public function download($userId)
Expand Down
4 changes: 2 additions & 2 deletions src/Models/User/RecurrentPaymentsUserDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public static function identifier(): string
return 'recurrent_payments';
}

public function data($userId)
public function data($userId): ?array
{
return [];
return null;
}

public function download($userId)
Expand Down

0 comments on commit 23414f4

Please sign in to comment.