Completed
Push — master ( ca5656...60398b )
by Morris
32:43 queued 16:28
created

SimpleOutput::startProgress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author Thomas Müller <[email protected]>
4
 *
5
 * @copyright Copyright (c) 2017, ownCloud GmbH
6
 * @license AGPL-3.0
7
 *
8
 * This code is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License, version 3,
10
 * as published by the Free Software Foundation.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
 * GNU Affero General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Affero General Public License, version 3,
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
19
 *
20
 */
21
22
23
namespace OC\Migration;
24
25
26
use OCP\ILogger;
27
use OCP\Migration\IOutput;
28
29
/**
30
 * Class SimpleOutput
31
 *
32
 * Just a simple IOutput implementation with writes messages to the log file.
33
 * Alternative implementations will write to the console or to the web ui (web update case)
34
 *
35
 * @package OC\Migration
36
 */
37
class SimpleOutput implements IOutput {
38
39
	/** @var ILogger */
40
	private $logger;
41
	private $appName;
42
43
	public function __construct(ILogger $logger, $appName) {
44
		$this->logger = $logger;
45
		$this->appName = $appName;
46
	}
47
48
	/**
49
	 * @param string $message
50
	 * @since 9.1.0
51
	 */
52
	public function info($message) {
53
		$this->logger->info($message, ['app' => $this->appName]);
54
	}
55
56
	/**
57
	 * @param string $message
58
	 * @since 9.1.0
59
	 */
60
	public function warning($message) {
61
		$this->logger->warning($message, ['app' => $this->appName]);
62
	}
63
64
	/**
65
	 * @param int $max
66
	 * @since 9.1.0
67
	 */
68
	public function startProgress($max = 0) {
69
	}
70
71
	/**
72
	 * @param int $step
73
	 * @param string $description
74
	 * @since 9.1.0
75
	 */
76
	public function advance($step = 1, $description = '') {
77
	}
78
79
	/**
80
	 * @since 9.1.0
81
	 */
82
	public function finishProgress() {
83
	}
84
}
85