mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 03:43:07 +00:00
Fix some nullable methods.
This commit is contained in:
@@ -61,7 +61,7 @@ abstract class Controller extends BaseController
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function buildParams(): string
|
final protected function buildParams(): string
|
||||||
{
|
{
|
||||||
$return = '?';
|
$return = '?';
|
||||||
$params = [];
|
$params = [];
|
||||||
@@ -83,7 +83,7 @@ abstract class Controller extends BaseController
|
|||||||
/**
|
/**
|
||||||
* @return Manager
|
* @return Manager
|
||||||
*/
|
*/
|
||||||
protected function getManager(): Manager
|
final protected function getManager(): Manager
|
||||||
{
|
{
|
||||||
// create some objects:
|
// create some objects:
|
||||||
$manager = new Manager;
|
$manager = new Manager;
|
||||||
|
@@ -238,7 +238,7 @@ class RecurrenceController extends Controller
|
|||||||
$result = $recurring->fire();
|
$result = $recurring->fire();
|
||||||
} catch (FireflyException $e) {
|
} catch (FireflyException $e) {
|
||||||
Log::error($e->getMessage());
|
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) {
|
if (false === $result) {
|
||||||
return response()->json([], 204);
|
return response()->json([], 204);
|
||||||
|
@@ -157,16 +157,16 @@ class RecurrenceUpdateRequest extends FormRequest
|
|||||||
/**
|
/**
|
||||||
* Returns the repetition data as it is found in the submitted data.
|
* 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 = [];
|
$return = [];
|
||||||
// repetition data:
|
// repetition data:
|
||||||
/** @var array $repetitions */
|
/** @var array $repetitions */
|
||||||
$repetitions = $this->get('repetitions');
|
$repetitions = $this->get('repetitions');
|
||||||
if (null === $repetitions) {
|
if (null === $repetitions) {
|
||||||
return null;
|
return [];
|
||||||
}
|
}
|
||||||
/** @var array $repetition */
|
/** @var array $repetition */
|
||||||
foreach ($repetitions as $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
|
* 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.
|
* 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 = [];
|
$return = [];
|
||||||
// transaction data:
|
// transaction data:
|
||||||
/** @var array $transactions */
|
/** @var array $transactions */
|
||||||
$transactions = $this->get('transactions');
|
$transactions = $this->get('transactions');
|
||||||
if (null === $transactions) {
|
if (null === $transactions) {
|
||||||
return null;
|
return [];
|
||||||
}
|
}
|
||||||
/** @var array $transaction */
|
/** @var array $transaction */
|
||||||
foreach ($transactions as $transaction) {
|
foreach ($transactions as $transaction) {
|
||||||
|
Reference in New Issue
Block a user