Online   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setRequestData() 0 3 1
A execute() 0 4 1
A __construct() 0 8 1
1
<?php
2
/**
3
 * Copyright (c) 2014, Tobia De Koninck hey--at--ledfan.be
4
 * This file is licensed under the AGPL version 3 or later.
5
 * See the COPYING file.
6
 */
7
8
namespace OCA\Chat\OCH\Commands;
9
10
use \OCA\CHat\App\Chat;
11
use \OCA\Chat\OCH\ChatAPI;
12
use \OCA\Chat\OCH\Db\UserOnlineMapper;
13
use \OCA\Chat\OCH\Commands\SyncOnline;
14
15
class Online extends ChatAPI {
16
17
	/**
18
	 * @var $userMapper \OCA\Chat\OCH\Db\UserOnlineMapper
19
	 */
20
	private $userOnlineMapper;
21
22
	/**
23
	 * @var $syncOnline \OCA\Chat\OCH\Commands\SyncOnline
24
	 */
25
	private $syncOnline;
26
27
	public function __construct(
28
		UserOnlineMapper $userOnlineMapper,
29
		SynConline $syncOnline
30
	){
31
		$this->userOnlineMapper = $userOnlineMapper;
32
		$this->syncOnline = $syncOnline;
33
34
	}
35
36
	public function setRequestData(array $requestData){
37
		$this->requestData = $requestData;
38
	}
39
40
	public function execute(){
41
		$this->userOnlineMapper->updateLastOnline($this->requestData['session_id'], $this->requestData['timestamp']);
42
		$this->syncOnline->execute();
43
	}
44
}
45