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

StoreRequest::getTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 1
eloc 1
c 1
b 1
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
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