Issues (36)

lib/Service/MiscService.php (1 issue)

Labels
Severity
1
<?php declare(strict_types=1);
2
3
4
/**
5
 * Files_FromMail - Recover your email attachments from your cloud.
6
 *
7
 * This file is licensed under the Affero General Public License version 3 or
8
 * later. See the COPYING file.
9
 *
10
 * @author Maxence Lange <[email protected]>
11
 * @copyright 2017
12
 * @license GNU AGPL version 3 or any later version
13
 *
14
 * This program is free software: you can redistribute it and/or modify
15
 * it under the terms of the GNU Affero General Public License as
16
 * published by the Free Software Foundation, either version 3 of the
17
 * License, or (at your option) any later version.
18
 *
19
 * This program is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 * GNU Affero General Public License for more details.
23
 *
24
 *  You should have received a copy of the GNU Affero General Public License
25
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
26
 *
27
 */
28
29
30
namespace OCA\Files_FromMail\Service;
31
32
use OCA\Files_FromMail\AppInfo\Application;
33
use OCP\ILogger;
0 ignored issues
show
The type OCP\ILogger was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
34
35
36
/**
37
 * Class MiscService
38
 *
39
 * @package OCA\Files_FromMail\Service
40
 */
41
class MiscService {
42
43
44
	/** @var ILogger */
45
	private $logger;
46
47
48
	public function __construct(ILogger $logger) {
49
		$this->logger = $logger;
50
	}
51
52
53
	/**
54
	 * @param string $message
55
	 * @param int $level
56
	 */
57
	public function log(string $message, int $level = 2): void {
58
		$data = array(
59
			'app'   => Application::APP_NAME,
60
			'level' => $level
61
		);
62
63
		$this->logger->log($level, $message, $data);
64
	}
65
66
}
67
68