-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathCodeFileInterface.php
More file actions
47 lines (40 loc) · 1.07 KB
/
CodeFileInterface.php
File metadata and controls
47 lines (40 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace DrupalCodeBuilder\File;
/**
* Represents a generated code file.
*
* This may include the code of file on disk if this exists and the file is of
* a type that we are able to merge.
*/
interface CodeFileInterface extends \Stringable {
/**
* Gets the code for the file.
*
* @return string
* The code.
*/
public function getCode(): string;
/**
* Gets the relative filepath for the file.
*
* @return string
* The filepath, relative to the extension root.
*/
public function getFilePath(): string;
/**
* Determines whether the file this code is for already exists.
*
* @return bool
* TRUE if the file exists, FALSE if not.
*/
public function fileExists(): bool;
/**
* Determines whether the generated code has been merged with existing code.
*
* @return bool
* TRUE if the existing code has been merged; FALSE if not. Merged code may
* overwrite sections of existing code, for example, if both versions have
* the same function or method.
*/
public function fileIsMerged(): bool;
}