Completed
Push — master ( 985ed1...fcadec )
by Mahmoud
03:02
created

FindWhateverSettingsTask   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 31
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 8 1
1
<?php
2
3
namespace App\Containers\Settings\Tasks;
4
5
use App\Containers\Settings\Data\Repositories\SettingsRepository;
6
use App\Port\Task\Abstracts\Task;
7
8
/**
9
 * Class FindWhateverSettingsTask
10
 *
11
 * @author  Mahmoud Zalt  <[email protected]>
12
 */
13
class FindWhateverSettingsTask extends Task
14
{
15
16
    /**
17
     * @var  \App\Containers\Settings\Data\Repositories\SettingsRepository
18
     */
19
    private $settingsRepository;
20
21
    /**
22
     * FindSettingsTask constructor.
23
     *
24
     * @param \App\Containers\Settings\Data\Repositories\SettingsRepository $settingsRepository
25
     */
26
    public function __construct(SettingsRepository $settingsRepository)
27
    {
28
        $this->settingsRepository = $settingsRepository;
29
    }
30
31
    /**
32
     * @return  mixed
33
     */
34
    public function run()
35
    {
36
        $settingsName = 'whatever';
37
38
        $result = $this->settingsRepository->findWhere(['key' => $settingsName])->first();
39
40
        return $result->value;
41
    }
42
43
}
44