Hoa central
FileSystem.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Iterator;
38 
47 class FileSystem extends \FilesystemIterator
48 {
54  protected $_splFileInfoClass = null;
55 
56 
57 
67  public function __construct($path, $flags = null, $splFileInfoClass = null)
68  {
69  $this->_splFileInfoClass = $splFileInfoClass;
70 
71  if (null === $flags) {
72  parent::__construct($path);
73  } else {
74  parent::__construct($path, $flags);
75  }
76 
77  return;
78  }
79 
86  public function current()
87  {
88  $out = parent::current();
89 
90  if (null !== $this->_splFileInfoClass &&
91  $out instanceof \SplFileInfo) {
92  $out->setInfoClass($this->_splFileInfoClass);
93  $out = $out->getFileInfo();
94  }
95 
96  return $out;
97  }
98 }
__construct($path, $flags=null, $splFileInfoClass=null)
Definition: FileSystem.php:67