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

SessionRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A update() 0 7 1
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