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

Profile::getUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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