@@ -8,15 +8,15 @@ class FileManager
88
99 private string $ configFile = '.. ' ;
1010
11- private string $ extension = '.serial ' ;
12- 13- private string $ fileName = '' ;
14- 1511 /**
1612 * @var array<string>
1713 */
1814 private array $ excludedNamespaces = [];
1915
16+ private string $ extension = '.serial ' ;
17+ 18+ private string $ fileName = '' ;
19+ 2020 /**
2121 * @var array<array<string>>
2222 */
@@ -36,21 +36,6 @@ public function __construct(string $composerJsonPath = '')
3636 $ this ->fileName = \substr ($ class , \strrpos ($ class , '\\' ) + 1 );
3737 }
3838
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- 5439 /**
5540 * The classes in the global namespace are handled slightly
5641 * differently, as this should be the exception rather than the
@@ -67,21 +52,16 @@ public function addGlobalNameSpaceClass(string $filename, bool $localGit = false
6752 }
6853
6954 /**
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.
8161 */
82- public function setBaseFile (string $ fileName ) : self
62+ public function addNamespace (string $ namespace , string $ directory , bool $ localGit = false ) : FileManager
8363 {
84- $ this ->fileName = $ fileName ;
64+ $ this ->includedNamespaces [] = [ $ namespace , $ directory , $ localGit ] ;
8565
8666 return $ this ;
8767 }
@@ -177,6 +157,16 @@ public function save(string $fileName = '') : bool
177157 return \PHPFUI \InstaDoc \NamespaceTree::save ($ this ->getSerializedName ($ fileName ));
178158 }
179159
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+ 180170 public function setComposerPath (string $ composerJsonPath ) : FileManager
181171 {
182172 $ this ->composerJsonPath = \str_replace ('\\' , '/ ' , $ composerJsonPath );
@@ -196,6 +186,16 @@ public function setConfigName(string $dirOrFilename) : FileManager
196186 return $ this ;
197187 }
198188
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+ 199199 private function getSerializedName (string $ fileName = '' , string $ extension = '' ) : string
200200 {
201201 $ file = $ this ->configFile ;
0 commit comments