INotifyHandler::getChanges()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016 Robin Appelman <[email protected]>
4
 * This file is licensed under the Licensed under the MIT license:
5
 * http://opensource.org/licenses/MIT
6
 *
7
 */
8
9
namespace Icewind\SMB;
10
11
interface INotifyHandler {
12
	// https://msdn.microsoft.com/en-us/library/dn392331.aspx
13
	const NOTIFY_ADDED = 1;
14
	const NOTIFY_REMOVED = 2;
15
	const NOTIFY_MODIFIED = 3;
16
	const NOTIFY_RENAMED_OLD = 4;
17
	const NOTIFY_RENAMED_NEW = 5;
18
	const NOTIFY_ADDED_STREAM = 6;
19
	const NOTIFY_REMOVED_STREAM = 7;
20
	const NOTIFY_MODIFIED_STREAM = 8;
21
	const NOTIFY_REMOVED_BY_DELETE = 9;
22
23
	/**
24
	 * Get all changes detected since the start of the notify process or the last call to getChanges
25
	 *
26
	 * @return Change[]
27
	 */
28
	public function getChanges(): array;
29
30
	/**
31
	 * Listen actively to all incoming changes
32
	 *
33
	 * Note that this is a blocking process and will cause the process to block forever if not explicitly terminated
34
	 *
35
	 * @param callable(Change):?bool $callback
0 ignored issues
show
Documentation introduced by
The doc-type callable(Change):?bool could not be parsed: Expected "|" or "end of type", but got "(" at position 8. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
36
	 */
37
	public function listen(callable $callback): void;
38
39
	/**
40
	 * Stop listening for changes
41
	 *
42
	 * Note that any pending changes will be discarded
43
	 */
44
	public function stop(): void;
45
}
46