Completed
Push — master ( 3f30e7...37b632 )
by Dmitry
08:21
created

Increment::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Job;
4
5
use Basis\Job;
6
7
class Increment extends Job
8
{
9
    public $note;
10
11
    public function run()
12
    {
13
        $this->require('note');
14
15
        $note = $this->findOrFail('note', $this->note);
16
        $note->message = ($note->message ?: 0) + 1;
17
        $note->save();
18
19
        return compact('note');
20
    }
21
}
22