forked from PHP-CS-Fixer/PHP-CS-Fixer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigInterface.php
140 lines (113 loc) · 3.37 KB
/
ConfigInterface.php
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
declare(strict_types=1);
/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier <[email protected]>
* Dariusz Rumiński <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace PhpCsFixer;
use PhpCsFixer\Fixer\FixerInterface;
/**
* @author Fabien Potencier <[email protected]>
* @author Dariusz Rumiński <[email protected]>
*/
interface ConfigInterface
{
/**
* Returns the path to the cache file.
*
* @return null|string Returns null if not using cache
*/
public function getCacheFile(): ?string;
/**
* Returns the custom fixers to use.
*
* @return FixerInterface[]
*/
public function getCustomFixers(): array;
/**
* Returns files to scan.
*
* @return iterable<\SplFileInfo>
*/
public function getFinder(): iterable;
public function getFormat(): string;
/**
* Returns true if progress should be hidden.
*/
public function getHideProgress(): bool;
public function getIndent(): string;
public function getLineEnding(): string;
/**
* Returns the name of the configuration.
*
* The name must be all lowercase and without any spaces.
*
* @return string The name of the configuration
*/
public function getName(): string;
/**
* Get configured PHP executable, if any.
*/
public function getPhpExecutable(): ?string;
/**
* Check if it is allowed to run risky fixers.
*/
public function getRiskyAllowed(): bool;
/**
* Get rules.
*
* Keys of array are names of fixers/sets, values are true/false.
*
* @return array<string, array<string, mixed>|bool>
*/
public function getRules(): array;
/**
* Returns true if caching should be enabled.
*/
public function getUsingCache(): bool;
/**
* Adds a suite of custom fixers.
*
* Name of custom fixer should follow `VendorName/rule_name` convention.
*
* @param FixerInterface[]|iterable|\Traversable $fixers
*/
public function registerCustomFixers(iterable $fixers): self;
/**
* Sets the path to the cache file.
*/
public function setCacheFile(string $cacheFile): self;
/**
* @param iterable<\SplFileInfo> $finder
*/
public function setFinder(iterable $finder): self;
public function setFormat(string $format): self;
public function setHideProgress(bool $hideProgress): self;
public function setIndent(string $indent): self;
public function setLineEnding(string $lineEnding): self;
/**
* Set PHP executable.
*/
public function setPhpExecutable(?string $phpExecutable): self;
/**
* Set if it is allowed to run risky fixers.
*/
public function setRiskyAllowed(bool $isRiskyAllowed): self;
/**
* Set rules.
*
* Keys of array are names of fixers or sets.
* Value for set must be bool (turn it on or off).
* Value for fixer may be bool (turn it on or off) or array of configuration
* (turn it on and contains configuration for FixerInterface::configure method).
*
* @param array<string, array<string, mixed>|bool> $rules
*/
public function setRules(array $rules): self;
public function setUsingCache(bool $usingCache): self;
}