Passed
Push — master ( 0cee60...124be7 )
by Pauli
14:22
created

FileExistsException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getAltName() 0 2 1
A __construct() 0 3 1
A getPath() 0 2 1
1
<?php declare(strict_types=1);
2
3
/**
4
 * ownCloud - Music app
5
 *
6
 * This file is licensed under the Affero General Public License version 3 or
7
 * later. See the COPYING file.
8
 *
9
 * @author Pauli Järvinen <[email protected]>
10
 * @copyright Pauli Järvinen 2025
11
 */
12
13
namespace OCA\Music\AppFramework\Utility;
14
15
class FileExistsException extends \RuntimeException {
16
17
	private $path;
18
	private $altName;
19
20
	public function __construct(string $path, string $altName) {
21
		$this->path = $path;
22
		$this->altName = $altName;
23
	}
24
25
	/**
26
	 * Get conflicting file path
27
	 */
28
	public function getPath() {
29
		return $this->path;
30
	}
31
32
	/**
33
	 * Get suggested alternative file name to avoid the conflict
34
	 */
35
	public function getAltName() {
36
		return $this->altName;
37
	}
38
}
39