mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Specify return types.
This commit is contained in:
@@ -31,7 +31,7 @@ class AttachmentFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -51,7 +51,7 @@ class AttachmentFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
return [
|
||||
|
||||
@@ -30,7 +30,7 @@ class BillFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -39,7 +39,7 @@ class BillFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getBillData()
|
||||
public function getBillData(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->string('name'),
|
||||
|
||||
@@ -33,7 +33,7 @@ class BudgetFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
@@ -52,7 +52,7 @@ class BudgetFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
/** @var BudgetRepositoryInterface $repository */
|
||||
|
||||
@@ -31,7 +31,7 @@ class BudgetIncomeRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -40,7 +40,7 @@ class BudgetIncomeRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
return [
|
||||
|
||||
@@ -30,7 +30,7 @@ class BulkEditJournalRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -39,7 +39,7 @@ class BulkEditJournalRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
// fixed
|
||||
|
||||
@@ -32,7 +32,7 @@ class CategoryFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -51,7 +51,7 @@ class CategoryFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
/** @var CategoryRepositoryInterface $repository */
|
||||
$repository = app(CategoryRepositoryInterface::class);
|
||||
|
||||
@@ -31,7 +31,7 @@ class ConfigurationRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users and admins
|
||||
return auth()->check() && auth()->user()->hasRole('owner');
|
||||
@@ -51,7 +51,7 @@ class ConfigurationRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
$rules = [
|
||||
|
||||
@@ -30,7 +30,7 @@ class CurrencyFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -39,7 +39,7 @@ class CurrencyFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getCurrencyData()
|
||||
public function getCurrencyData(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->string('name'),
|
||||
@@ -52,7 +52,7 @@ class CurrencyFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
$rules = [
|
||||
|
||||
@@ -31,7 +31,7 @@ class DeleteAccountFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -40,7 +40,7 @@ class DeleteAccountFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
return [
|
||||
|
||||
@@ -31,7 +31,7 @@ class EmailFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -40,7 +40,7 @@ class EmailFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
return [
|
||||
|
||||
@@ -32,7 +32,7 @@ class ExportFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -41,7 +41,7 @@ class ExportFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
$sessionFirst = clone session('first');
|
||||
$first = $sessionFirst->subDay()->format('Y-m-d');
|
||||
|
||||
@@ -35,7 +35,7 @@ class JournalFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -46,7 +46,7 @@ class JournalFormRequest extends Request
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getJournalData()
|
||||
public function getJournalData(): array
|
||||
{
|
||||
$currencyId = $this->integer('amount_currency_id_amount');
|
||||
$data = [
|
||||
@@ -142,7 +142,7 @@ class JournalFormRequest extends Request
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
$what = $this->get('what');
|
||||
$rules = [
|
||||
|
||||
@@ -33,7 +33,7 @@ class JournalLinkRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -61,7 +61,7 @@ class JournalLinkRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// all possible combinations of link types and inward / outward:
|
||||
$combinations = [];
|
||||
|
||||
@@ -30,7 +30,7 @@ class LinkTypeFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged and admins
|
||||
return auth()->check() && auth()->user()->hasRole('owner');
|
||||
@@ -39,7 +39,7 @@ class LinkTypeFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
$nameRule = 'required|min:1|unique:link_types,name';
|
||||
|
||||
@@ -31,7 +31,7 @@ class MassDeleteJournalRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -40,7 +40,7 @@ class MassDeleteJournalRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
return [
|
||||
|
||||
@@ -31,7 +31,7 @@ class MassEditJournalRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -40,7 +40,7 @@ class MassEditJournalRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class NewUserFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -40,7 +40,7 @@ class NewUserFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
return [
|
||||
|
||||
@@ -30,7 +30,7 @@ class PiggyBankFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -54,7 +54,7 @@ class PiggyBankFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
$nameRule = 'required|between:1,255|uniquePiggyBankForUser';
|
||||
if ($this->integer('id')) {
|
||||
|
||||
@@ -31,7 +31,7 @@ class ProfileFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -40,7 +40,7 @@ class ProfileFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
return [
|
||||
|
||||
@@ -30,7 +30,7 @@ class ReconciliationUpdateRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -41,7 +41,7 @@ class ReconciliationUpdateRequest extends Request
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getJournalData()
|
||||
public function getJournalData(): array
|
||||
{
|
||||
$data = [
|
||||
'tags' => explode(',', $this->string('tags')),
|
||||
@@ -55,7 +55,7 @@ class ReconciliationUpdateRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'amount' => 'numeric|required',
|
||||
|
||||
@@ -40,7 +40,7 @@ class ReportFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
|
||||
@@ -133,7 +133,7 @@ class Request extends FormRequest
|
||||
*
|
||||
* @return Carbon|null
|
||||
*/
|
||||
protected function date(string $field)
|
||||
protected function date(string $field): ?Carbon
|
||||
{
|
||||
return $this->get($field) ? new Carbon($this->get($field)) : null;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class RuleGroupFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -52,7 +52,7 @@ class RuleGroupFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
/** @var RuleGroupRepositoryInterface $repository */
|
||||
|
||||
@@ -33,7 +33,7 @@ class SelectTransactionsRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -42,7 +42,7 @@ class SelectTransactionsRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
$sessionFirst = clone session('first');
|
||||
|
||||
@@ -32,7 +32,7 @@ class TagFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
|
||||
@@ -31,7 +31,7 @@ class TestRuleFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -40,7 +40,7 @@ class TestRuleFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
$validTriggers = array_keys(config('firefly.rule-triggers'));
|
||||
|
||||
@@ -31,7 +31,7 @@ class TokenFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -40,7 +40,7 @@ class TokenFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
return [
|
||||
|
||||
@@ -31,7 +31,7 @@ class UserFormRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow logged in users
|
||||
return auth()->check();
|
||||
@@ -53,7 +53,7 @@ class UserFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'required|exists:users,id',
|
||||
|
||||
@@ -31,7 +31,7 @@ class UserRegistrationRequest extends Request
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only everybody
|
||||
return true;
|
||||
@@ -40,7 +40,7 @@ class UserRegistrationRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(): array
|
||||
{
|
||||
// fixed
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user