Skip to content

Commit dd7fd47

Browse files
harm-lessharm-less
harm-less
authored and
harm-less
committed
Made both collection public
- Made the rootCollection and childCollection methods public
1 parent dbefeef commit dd7fd47

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/FQ/Files.php

+26-26
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function __construct() {
4343
/**
4444
* @return RootDirCollection
4545
*/
46-
protected function _rootCollection() {
46+
public function rootCollection() {
4747
return $this->_rootDirCollection;
4848
}
4949

@@ -53,7 +53,7 @@ protected function _rootCollection() {
5353
* @return RootDir|false
5454
*/
5555
public function addRootDir(RootDir $rootDir, $index = null) {
56-
$rootDir = $this->_rootCollection()->addRootDir($rootDir, $index);
56+
$rootDir = $this->rootCollection()->addRootDir($rootDir, $index);
5757
return $this->isValid() === true ? $rootDir : false;
5858
}
5959

@@ -62,85 +62,85 @@ public function addRootDir(RootDir $rootDir, $index = null) {
6262
* @return bool
6363
*/
6464
public function removeRootDir(RootDir $rootDir) {
65-
return $this->_rootCollection()->removeDir($rootDir);
65+
return $this->rootCollection()->removeDir($rootDir);
6666
}
6767
/**
6868
* @param string $id
6969
* @return bool
7070
*/
7171
public function removeRootDirById($id) {
72-
return $this->_rootCollection()->removeDirById($id);
72+
return $this->rootCollection()->removeDirById($id);
7373
}
7474
/**
7575
* @param int $index
7676
* @return bool
7777
*/
7878
public function removeRootDirAtIndex($index) {
79-
return $this->_rootCollection()->removeDirAtIndex($index);
79+
return $this->rootCollection()->removeDirAtIndex($index);
8080
}
8181
public function removeAllRootDirs() {
82-
$this->_rootCollection()->removeAllDirs();
82+
$this->rootCollection()->removeAllDirs();
8383
}
8484

8585
/**
8686
* @return RootDir[]
8787
*/
8888
public function rootDirs() {
89-
return $this->_rootCollection()->dirs();
89+
return $this->rootCollection()->dirs();
9090
}
9191

9292
/**
9393
* @param RootDir $rootDir RootDir that will be checked
9494
* @return bool Returns true if RootDir is part of this files instance
9595
*/
9696
public function containsRootDir(RootDir $rootDir) {
97-
return $this->_rootCollection()->isInCollection($rootDir);
97+
return $this->rootCollection()->isInCollection($rootDir);
9898
}
9999

100100
/**
101101
* @return int Total root directories
102102
*/
103103
public function totalRootDirs() {
104-
return $this->_rootCollection()->totalDirs();
104+
return $this->rootCollection()->totalDirs();
105105
}
106106

107107
/**
108108
* @param string|RootDir $rootDir
109109
* @return RootDir|null
110110
*/
111111
public function getRootDir($rootDir) {
112-
return $this->_rootCollection()->getDir($rootDir);
112+
return $this->rootCollection()->getDir($rootDir);
113113
}
114114

115115
/**
116116
* @param string $id
117117
* @return null|RootDir
118118
*/
119119
public function getRootDirById($id) {
120-
return $this->_rootCollection()->getDirById($id);
120+
return $this->rootCollection()->getDirById($id);
121121
}
122122

123123
/**
124124
* @param int $index
125125
* @return RootDir|false
126126
*/
127127
public function getRootDirByIndex($index) {
128-
return $this->_rootCollection()->getDirByIndex($index);
128+
return $this->rootCollection()->getDirByIndex($index);
129129
}
130130

131131
/**
132132
* @return string[]
133133
*/
134134
public function getRootPaths() {
135-
return $this->_rootCollection()->getPaths();
135+
return $this->rootCollection()->getPaths();
136136
}
137137

138138

139139

140140
/**
141141
* @return ChildDirCollection
142142
*/
143-
protected function _childCollection() {
143+
public function childCollection() {
144144
return $this->_childDirCollection;
145145
}
146146

@@ -150,7 +150,7 @@ protected function _childCollection() {
150150
* @return ChildDir|false
151151
*/
152152
public function addChildDir(ChildDir $childDir, $index = null) {
153-
$childDir = $this->_childCollection()->addChildDir($childDir, $index);
153+
$childDir = $this->childCollection()->addChildDir($childDir, $index);
154154
return $this->isValid() === true ? $childDir : false;
155155
}
156156

@@ -159,77 +159,77 @@ public function addChildDir(ChildDir $childDir, $index = null) {
159159
* @return bool
160160
*/
161161
public function removeChildDir(ChildDir $childDir) {
162-
return $this->_childCollection()->removeDir($childDir);
162+
return $this->childCollection()->removeDir($childDir);
163163
}
164164
/**
165165
* @param string $id
166166
* @return bool
167167
*/
168168
public function removeChildDirById($id) {
169-
return $this->_childCollection()->removeDirById($id);
169+
return $this->childCollection()->removeDirById($id);
170170
}
171171
/**
172172
* @param int $index
173173
* @return bool
174174
*/
175175
public function removeChildDirAtIndex($index) {
176-
return $this->_childCollection()->removeDirAtIndex($index);
176+
return $this->childCollection()->removeDirAtIndex($index);
177177
}
178178
public function removeAllChildDirs() {
179-
$this->_childCollection()->removeAllDirs();
179+
$this->childCollection()->removeAllDirs();
180180
}
181181

182182
/**
183183
* @return ChildDir[]
184184
*/
185185
public function childDirs() {
186-
return $this->_childCollection()->dirs();
186+
return $this->childCollection()->dirs();
187187
}
188188

189189
/**
190190
* @param ChildDir $childDir Dir that will be checked
191191
* @return bool Returns true if dir is part of this files instance
192192
*/
193193
public function containsChildDir(ChildDir $childDir) {
194-
return $this->_childCollection()->isInCollection($childDir);
194+
return $this->childCollection()->isInCollection($childDir);
195195
}
196196

197197
/**
198198
* @return int Total child directories
199199
*/
200200
public function totalChildDirs() {
201-
return $this->_childCollection()->totalDirs();
201+
return $this->childCollection()->totalDirs();
202202
}
203203

204204
/**
205205
* @param string|ChildDir $childDir
206206
* @return null|ChildDir
207207
*/
208208
public function getChildDir($childDir) {
209-
return $this->_childCollection()->getDir($childDir);
209+
return $this->childCollection()->getDir($childDir);
210210
}
211211

212212
/**
213213
* @param string $id
214214
* @return null|ChildDir
215215
*/
216216
public function getChildDirById($id) {
217-
return $this->_childCollection()->getDirById($id);
217+
return $this->childCollection()->getDirById($id);
218218
}
219219

220220
/**
221221
* @param int $index
222222
* @return ChildDir|false
223223
*/
224224
public function getChildDirByIndex($index) {
225-
return $this->_childCollection()->getDirByIndex($index);
225+
return $this->childCollection()->getDirByIndex($index);
226226
}
227227

228228
/**
229229
* @return string[]
230230
*/
231231
public function getChildPaths() {
232-
return $this->_childCollection()->getPaths();
232+
return $this->childCollection()->getPaths();
233233
}
234234

235235
/**

0 commit comments

Comments
 (0)