This class 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...
7
{
8
/**
9
* Auth provider instance.
10
*
11
* @var \Cartalyst\Sentinel\Sentinel
12
*/
13
protected $provider;
14
15
/**
16
* Field from the user to be saved as author of the action.
17
*
18
* @var string
19
*/
20
protected $field;
21
22
/**
23
* Create adapter instance for Sentinel.
24
*
25
* @param SentinelProvider $provider
26
* @param string $field
27
*/
28
public function __construct(SentinelProvider $provider, $field = null)
29
{
30
$this->provider = $provider;
31
$this->field = $field;
32
}
33
34
/**
35
* Get identifier of the currently logged in user.
36
*
37
* @return string|null
38
*/
39
public function getUser()
40
{
41
return $this->getUserFieldValue();
42
}
43
44
/**
45
* Get value from the user to be saved as the author.
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.