Passed
Push — master ( 6b97f6...a6ae80 )
by Blizzz
13:11 queued 11s
created

ACreateEmpty   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 1 1
1
<?php
2
/**
3
 * @copyright Copyright (c) 2019 Julius Härtl <[email protected]>
4
 *
5
 * @author Julius Härtl <[email protected]>
6
 *
7
 * @license GNU AGPL version 3 or any later version
8
 *
9
 * This program is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU Affero General Public License as
11
 * published by the Free Software Foundation, either version 3 of the
12
 * License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
 * GNU Affero General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU Affero General Public License
20
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
 *
22
 */
23
24
namespace OCP\DirectEditing;
25
26
27
use OCP\Files\File;
28
29
/**
30
 * @since 18.0.0
31
 */
32
abstract class ACreateEmpty {
33
34
	/**
35
	 * Unique id for the creator to filter templates
36
	 *
37
	 * e.g. document/spreadsheet/presentation
38
	 *
39
	 * @since 18.0.0
40
	 * @return string
41
	 */
42
	abstract public function getId(): string;
43
44
	/**
45
	 * Descriptive name for the create action
46
	 *
47
	 * e.g Create a new document
48
	 *
49
	 * @since 18.0.0
50
	 * @return string
51
	 */
52
	abstract public function getName(): string;
53
54
	/**
55
	 * Default file extension for the new file
56
	 *
57
	 * @since 18.0.0
58
	 * @return string
59
	 */
60
	abstract public function getExtension(): string;
61
62
	/**
63
	 * Mimetype of the resulting created file
64
	 *
65
	 * @since 18.0.0
66
	 * @return string
67
	 */
68
	abstract public function getMimetype(): string;
69
70
	/**
71
	 * Add content when creating empty files
72
	 *
73
	 * @since 18.0.0
74
	 * @param File $file
75
	 */
76
	public function create(File $file, string $creatorId = null, string $templateId = null): void {
0 ignored issues
show
Unused Code introduced by
The parameter $templateId is not used and could be removed. ( Ignorable by Annotation )

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

76
	public function create(File $file, string $creatorId = null, /** @scrutinizer ignore-unused */ string $templateId = null): void {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $file is not used and could be removed. ( Ignorable by Annotation )

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

76
	public function create(/** @scrutinizer ignore-unused */ File $file, string $creatorId = null, string $templateId = null): void {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $creatorId is not used and could be removed. ( Ignorable by Annotation )

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

76
	public function create(File $file, /** @scrutinizer ignore-unused */ string $creatorId = null, string $templateId = null): void {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
77
78
	}
79
}
80