| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class SettingsController extends Controller { |
||
| 12 | |||
| 13 | private $service; |
||
| 14 | private $userSession; |
||
| 15 | |||
| 16 | public function __construct( |
||
| 17 | $appName, |
||
| 18 | IRequest $request, |
||
| 19 | SettingsService $service, |
||
| 20 | IUserSession $userSession |
||
| 21 | ) { |
||
| 22 | parent::__construct($appName, $request); |
||
| 23 | $this->service = $service; |
||
| 24 | $this->userSession = $userSession; |
||
| 25 | } |
||
| 26 | |||
| 27 | private function getUID() { |
||
| 28 | return $this->userSession->getUser()->getUID(); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @NoAdminRequired |
||
| 33 | * @throws \OCP\PreConditionNotMetException |
||
| 34 | */ |
||
| 35 | public function set() { |
||
| 36 | $this->service->set( |
||
| 37 | $this->getUID(), |
||
| 38 | $this->request->getParams() |
||
| 39 | ); |
||
| 40 | return $this->get(); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @NoAdminRequired |
||
| 45 | */ |
||
| 46 | public function get() { |
||
| 48 | } |
||
| 49 | } |
||
| 50 |