Fix some nullable methods.

This commit is contained in:
James Cole 2020-08-02 12:19:10 +02:00
parent d0a01d73c4
commit 0219069766
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
3 changed files with 9 additions and 9 deletions

View File

@ -61,7 +61,7 @@ abstract class Controller extends BaseController
*
* @return string
*/
protected function buildParams(): string
final protected function buildParams(): string
{
$return = '?';
$params = [];
@ -83,7 +83,7 @@ abstract class Controller extends BaseController
/**
* @return Manager
*/
protected function getManager(): Manager
final protected function getManager(): Manager
{
// create some objects:
$manager = new Manager;

View File

@ -238,7 +238,7 @@ class RecurrenceController extends Controller
$result = $recurring->fire();
} catch (FireflyException $e) {
Log::error($e->getMessage());
throw new FireflyException('200022: Error in cron job.');
throw new FireflyException('200022: Error in cron job.',0, $e);
}
if (false === $result) {
return response()->json([], 204);

View File

@ -157,16 +157,16 @@ class RecurrenceUpdateRequest extends FormRequest
/**
* Returns the repetition data as it is found in the submitted data.
*
* @return array|null
* @return array
*/
private function getRepetitionData(): ?array
private function getRepetitionData(): array
{
$return = [];
// repetition data:
/** @var array $repetitions */
$repetitions = $this->get('repetitions');
if (null === $repetitions) {
return null;
return [];
}
/** @var array $repetition */
foreach ($repetitions as $repetition) {
@ -185,16 +185,16 @@ class RecurrenceUpdateRequest extends FormRequest
* Returns the transaction data as it is found in the submitted data. It's a complex method according to code
* standards but it just has a lot of ??-statements because of the fields that may or may not exist.
*
* @return array|null
* @return array
*/
private function getTransactionData(): ?array
private function getTransactionData(): array
{
$return = [];
// transaction data:
/** @var array $transactions */
$transactions = $this->get('transactions');
if (null === $transactions) {
return null;
return [];
}
/** @var array $transaction */
foreach ($transactions as $transaction) {