@@ -8,15 +8,15 @@ class FileManager
8
8
9
9
private string $ configFile = '.. ' ;
10
10
11
- private string $ extension = '.serial ' ;
12
-
13
- private string $ fileName = '' ;
14
-
15
11
/**
16
12
* @var array<string>
17
13
*/
18
14
private array $ excludedNamespaces = [];
19
15
16
+ private string $ extension = '.serial ' ;
17
+
18
+ private string $ fileName = '' ;
19
+
20
20
/**
21
21
* @var array<array<string>>
22
22
*/
@@ -36,21 +36,6 @@ public function __construct(string $composerJsonPath = '')
36
36
$ this ->fileName = \substr ($ class , \strrpos ($ class , '\\' ) + 1 );
37
37
}
38
38
39
- /**
40
- * You can add a Namespace directly. Specify the namespace (no
41
- * leading backslash) and the directory containing the class
42
- * files. This is realitive to the current script directory.
43
- * You can also pass an option localGit flag indicating this
44
- * directory is in the project git repo. This will allow you to
45
- * see the git history on the file.
46
- */
47
- public function addNamespace (string $ namespace , string $ directory , bool $ localGit = false ) : FileManager
48
- {
49
- $ this ->includedNamespaces [] = [$ namespace , $ directory , $ localGit ];
50
-
51
- return $ this ;
52
- }
53
-
54
39
/**
55
40
* The classes in the global namespace are handled slightly
56
41
* differently, as this should be the exception rather than the
@@ -67,21 +52,16 @@ public function addGlobalNameSpaceClass(string $filename, bool $localGit = false
67
52
}
68
53
69
54
/**
70
- * Set file extension for saving index file
71
- */
72
- public function setExtension (string $ extension = '.serial ' ) : self
73
- {
74
- $ this ->extension = $ extension ;
75
-
76
- return $ this ;
77
- }
78
-
79
- /**
80
- * Set base file name for saving index file
55
+ * You can add a Namespace directly. Specify the namespace (no
56
+ * leading backslash) and the directory containing the class
57
+ * files. This is realitive to the current script directory.
58
+ * You can also pass an option localGit flag indicating this
59
+ * directory is in the project git repo. This will allow you to
60
+ * see the git history on the file.
81
61
*/
82
- public function setBaseFile (string $ fileName ) : self
62
+ public function addNamespace (string $ namespace , string $ directory , bool $ localGit = false ) : FileManager
83
63
{
84
- $ this ->fileName = $ fileName ;
64
+ $ this ->includedNamespaces [] = [ $ namespace , $ directory , $ localGit ] ;
85
65
86
66
return $ this ;
87
67
}
@@ -177,6 +157,16 @@ public function save(string $fileName = '') : bool
177
157
return \PHPFUI \InstaDoc \NamespaceTree::save ($ this ->getSerializedName ($ fileName ));
178
158
}
179
159
160
+ /**
161
+ * Set base file name for saving index file
162
+ */
163
+ public function setBaseFile (string $ fileName ) : self
164
+ {
165
+ $ this ->fileName = $ fileName ;
166
+
167
+ return $ this ;
168
+ }
169
+
180
170
public function setComposerPath (string $ composerJsonPath ) : FileManager
181
171
{
182
172
$ this ->composerJsonPath = \str_replace ('\\' , '/ ' , $ composerJsonPath );
@@ -196,6 +186,16 @@ public function setConfigName(string $dirOrFilename) : FileManager
196
186
return $ this ;
197
187
}
198
188
189
+ /**
190
+ * Set file extension for saving index file
191
+ */
192
+ public function setExtension (string $ extension = '.serial ' ) : self
193
+ {
194
+ $ this ->extension = $ extension ;
195
+
196
+ return $ this ;
197
+ }
198
+
199
199
private function getSerializedName (string $ fileName = '' , string $ extension = '' ) : string
200
200
{
201
201
$ file = $ this ->configFile ;
0 commit comments