1 | <?php |
||
12 | class FileBag |
||
13 | { |
||
14 | /** |
||
15 | * @var array An array of SplFileInfo objects |
||
16 | */ |
||
17 | protected $fileObjects = []; |
||
18 | |||
19 | /** |
||
20 | * Constructs a new FileBag |
||
21 | * @param $arrayOfSplFileInfoObjects |
||
22 | */ |
||
23 | public function __construct(array $arrayOfSplFileInfoObjects = []) |
||
27 | |||
28 | /** |
||
29 | * Return an array of SplFileInfo objects |
||
30 | * @return array |
||
31 | */ |
||
32 | public function getAllFileInfoObjects() |
||
36 | |||
37 | /** |
||
38 | * Reset the FileBag back to an empty array. |
||
39 | * @return array - an empty array |
||
40 | */ |
||
41 | public function emptyBag() |
||
46 | |||
47 | /** |
||
48 | * Set up the bag with a proper array of SplFileInfo objects |
||
49 | * @param array $splFileInfoObjects |
||
50 | * @internal param $arrayOfSplFileInfoObjects |
||
51 | */ |
||
52 | protected function initialize(array $splFileInfoObjects = []) |
||
60 | |||
61 | /** |
||
62 | * Check for an \SplFileInfo object or a custom namespaces object |
||
63 | * @param $entity |
||
64 | * @return \SplFileInfo|\SplFileInfo[]|string |
||
65 | */ |
||
66 | protected function createSplFileInfoObject($entity) |
||
92 | } |
||
93 |