Passed
Push — activity-logs ( 8cf388...c7846d )
by Fèvre
06:02
created

SessionRepository::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php
2
namespace Xetaravel\Models\Repositories;
3
4
use Xetaravel\Models\Session;
5
6
class SessionRepository
7
{
8
    /**
9
     * Update the session and save it.
10
     *
11
     * @param array $data The data used to update the session.
12
     * @param \Xetaravel\Models\Session $session The session to update.
13
     *
14
     * @return \Xetaravel\Models\Session
15
     */
16
    public static function update(array $data, Session $session): Session
17
    {
18
        $session->method =  $data['method'];
0 ignored issues
show
Bug Best Practice introduced by
The property method does not exist on Xetaravel\Models\Session. Since you implemented __set, consider adding a @property annotation.
Loading history...
19
        $session->url =  $data['url'];
0 ignored issues
show
Bug Best Practice introduced by
The property url does not exist on Xetaravel\Models\Session. Since you implemented __set, consider adding a @property annotation.
Loading history...
20
        $session->save();
21
22
        return $session;
23
    }
24
}
25