Test Failed
Push — master ( 647c72...cd42b5 )
by
unknown
10:25
created

TaskListModule::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
	include_once(__DIR__ . '/../mapi/class.taskrecurrence.php');
3
4
	/**
5
	 * Task Module
6
	 */
7
	class TaskListModule extends ListModule
8
	{
9
		/**
10
		 * Constructor
11
		 * @param int $id unique id.
12
		 * @param array $data list of all actions.
13
		 */
14
		function __construct($id, $data)
15
		{
16
			parent::__construct($id, $data);
17
18
			$this->properties = $GLOBALS["properties"]->getTaskListProperties();
19
20
			$this->start = 0;
21
		}
22
23
		/**
24
		 * Creates the notifiers for this module,
25
		 * and register them to the Bus.
26
		 */
27
		function createNotifiers()
28
		{
29
			$entryid = $this->getEntryID();
30
			$GLOBALS["bus"]->registerNotifier('tasklistnotifier', $entryid);
31
			$GLOBALS["bus"]->registerNotifier('newtodotasknotifier', bin2hex(TodoList::getEntryId()));
32
		}
33
34
		/**
35
		 * Executes all the actions in the $data variable.
36
		 * @return boolean true on success of false on fialure.
37
		 */
38
		function execute()
39
		{
40
			foreach($this->data as $actionType => $action)
41
			{
42
				if(isset($actionType)) {
43
					try {
44
						$store = $this->getActionStore($action);
45
						$entryid = $this->getActionEntryID($action);
46
47
						switch($actionType)
48
						{
49
							case "list":
50
								$this->getDelegateFolderInfo($store);
51
								$this->messageList($store, $entryid, $action, $actionType);
0 ignored issues
show
Bug introduced by
$entryid of type object is incompatible with the type string expected by parameter $entryid of ListModule::messageList(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

51
								$this->messageList($store, /** @scrutinizer ignore-type */ $entryid, $action, $actionType);
Loading history...
52
								break;
53
							case "search":
54
								// @FIXME add handling of private items
55
								$this->search($store, $entryid, $action, $actionType);
56
								break;
57
							case "updatesearch":
58
								$this->updatesearch($store, $entryid, $action);
59
								break;
60
							case "stopsearch":
61
								$this->stopSearch($store, $entryid, $action);
62
								break;
63
							default:
64
								$this->handleUnknownActionType($actionType);
65
						}
66
					} catch (MAPIException $e) {
67
						$this->processException($e, $actionType);
68
					}
69
				}
70
			}
71
		}
72
	}
73
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
74