Passed
Push — master ( 7ba2cb...1d30f9 )
by Peter
02:20
created

Profile   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUrl() 0 8 1
A profile() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Admin\Http\Controllers\Admin\Execute;
6
7
use AbterPhp\Admin\Constant\Routes;
8
use AbterPhp\Framework\Constant\Session;
9
10
class Profile extends User
11
{
12
    public function profile()
13
    {
14
        $userId = $this->session->get(Session::USER_ID);
15
16
        $this->update($userId);
0 ignored issues
show
Bug introduced by
It seems like $userId can also be of type null; however, parameter $entityId of AbterPhp\Framework\Http\...ecuteAbstract::update() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

16
        $this->update(/** @scrutinizer ignore-type */ $userId);
Loading history...
17
    }
18
19
    /**
20
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
21
     *
22
     * @param string      $next
23
     * @param string|null $entityId
24
     *
25
     * @return string
26
     * @throws URLException
27
     */
28
    protected function getUrl(string $next, string $entityId = null)
29
    {
30
        /** @var UrlGenerator $urlGenerator */
31
        $urlGenerator = $this->urlGenerator;
32
33
        $url = $urlGenerator->createFromName(Routes::ROUTE_PROFILE);
34
35
        return $url;
36
    }
37
}
38