Completed
Push — master ( f06f41...6c4f3d )
by Ryan
02:40
created

UserRouter::activate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 7
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
1
<?php namespace Anomaly\UsersModule\User;
2
3
use Anomaly\Streams\Platform\Entry\EntryRouter;
4
use Illuminate\Encryption\Encrypter;
5
6
class UserRouter extends EntryRouter
7
{
8
    /**
9
     * Return the activate route.
10
     *
11
     * @param Encrypter $encrypter
12
     * @param array     $parameters
13
     *
14
     * @return string
15
     */
16 View Code Duplication
    public function activate(Encrypter $encrypter, array $parameters = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
    {
18
        $parameters['email'] = $encrypter->encrypt($this->entry->getEmail());
19
        $parameters['code']  = $encrypter->encrypt($this->entry->getActivationCode());
20
21
        return $this->url->route('anomaly.module.users::users.activate', $parameters);
22
    }
23
24
    /**
25
     * Return the password reset route.
26
     *
27
     * @param Encrypter $encrypter
28
     * @param array     $parameters
29
     */
30 View Code Duplication
    public function reset(Encrypter $encrypter, array $parameters = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
31
    {
32
        $parameters['email'] = $encrypter->encrypt($this->entry->getEmail());
33
        $parameters['code']  = $encrypter->encrypt($this->entry->getResetCode());
34
35
        return $this->url->route('anomaly.module.users::users.reset', $parameters);
36
    }
37
}
38