mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Code cleanup.
This commit is contained in:
@@ -29,8 +29,6 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* Class CronRequest
|
||||
*
|
||||
|
||||
*/
|
||||
class CronRequest extends FormRequest
|
||||
{
|
||||
@@ -38,8 +36,6 @@ class CronRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Verify the request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
@@ -48,8 +44,6 @@ class CronRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Get all data from the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAll(): array
|
||||
{
|
||||
@@ -69,8 +63,6 @@ class CronRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* The rules that the incoming request must be matched against.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
@@ -31,8 +31,6 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* Class UpdateRequest
|
||||
*
|
||||
|
||||
*/
|
||||
class UpdateRequest extends FormRequest
|
||||
{
|
||||
@@ -41,17 +39,15 @@ class UpdateRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Get all data from the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAll(): array
|
||||
{
|
||||
$name = $this->route()->parameter('dynamicConfigKey');
|
||||
|
||||
if ($name === 'configuration.is_demo_site' || $name === 'configuration.single_user_mode') {
|
||||
if ('configuration.is_demo_site' === $name || 'configuration.single_user_mode' === $name) {
|
||||
return ['value' => $this->boolean('value')];
|
||||
}
|
||||
if ($name === 'configuration.permission_update_check' || $name === 'configuration.last_update_check') {
|
||||
if ('configuration.permission_update_check' === $name || 'configuration.last_update_check' === $name) {
|
||||
return ['value' => $this->convertInteger('value')];
|
||||
}
|
||||
|
||||
@@ -60,20 +56,18 @@ class UpdateRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* The rules that the incoming request must be matched against.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$name = $this->route()->parameter('configName');
|
||||
|
||||
if ($name === 'configuration.is_demo_site' || $name === 'configuration.single_user_mode') {
|
||||
if ('configuration.is_demo_site' === $name || 'configuration.single_user_mode' === $name) {
|
||||
return ['value' => ['required', new IsBoolean()]];
|
||||
}
|
||||
if ($name === 'configuration.permission_update_check') {
|
||||
if ('configuration.permission_update_check' === $name) {
|
||||
return ['value' => 'required|numeric|between:-1,1'];
|
||||
}
|
||||
if ($name === 'configuration.last_update_check') {
|
||||
if ('configuration.last_update_check' === $name) {
|
||||
return ['value' => 'required|numeric|min:464272080'];
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,6 @@ class UserStoreRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Logged in + owner
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
@@ -49,8 +47,6 @@ class UserStoreRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Get all data from the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAll(): array
|
||||
{
|
||||
@@ -69,8 +65,6 @@ class UserStoreRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* The rules that the incoming request must be matched against.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
@@ -41,8 +41,6 @@ class UserUpdateRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Logged in + owner
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
@@ -51,8 +49,6 @@ class UserUpdateRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Get all data from the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAll(): array
|
||||
{
|
||||
@@ -71,8 +67,6 @@ class UserUpdateRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* The rules that the incoming request must be matched against.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
@@ -89,14 +83,10 @@ class UserUpdateRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*
|
||||
* @param Validator $validator
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
/** @var User|null $current */
|
||||
/** @var null|User $current */
|
||||
$current = $this->route()->parameter('user');
|
||||
$validator->after(
|
||||
static function (Validator $validator) use ($current) {
|
||||
|
||||
Reference in New Issue
Block a user