Test Setup Failed
Push — master ( bc077a...f9eb8c )
by he
05:47
created

StoreRequest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
eloc 9
c 1
b 1
f 1
dl 0
loc 28
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 6 1
A getBody() 0 3 1
A getProblemId() 0 3 1
A getContestId() 0 3 1
A getTitle() 0 3 1
1
<?php
2
3
namespace App\Http\Requests\Topic;
4
5
use App\Http\Requests\Request;
6
7
class StoreRequest extends Request
8
{
9
    public function getTitle()
10
    {
11
        return $this->input('title');
12
    }
13
14
    public function getBody()
15
    {
16
        return $this->input('content');
17
    }
18
19
    public function getContestId()
20
    {
21
        return $this->input('contest_id', 0);
22
    }
23
24
    public function getProblemId()
25
    {
26
        return $this->input('problem_id', 0);
27
    }
28
29
    public function rules()
30
    {
31
        return [
32
            'title' => 'required',
33
            'content' => 'required|min:10',
34
            'contest_id' => 'sometimes|numeric',
35
        ];
36
    }
37
38
}
39