*/
public function closeDirectory () {
// Close the directory by unsetting it
- $this->setDirectoryIteratorInstance(NULL);
+ $this->unsetDirectoryIteratorInstance();
$this->setPathName('');
}
/**
* Setter for the directory pointer
*
- * @param $iteratorInstance An instanceof a DirectoryIterator class or NULL to unset ("close") it.
+ * @param $iteratorInstance An instanceof a DirectoryIterator class
* @return void
*/
- protected final function setDirectoryIteratorInstance (DirectoryIterator $iteratorInstance = NULL) {
- // Set instance (or NULL)
+ protected final function setDirectoryIteratorInstance (DirectoryIterator $iteratorInstance) {
+ // Set instance
$this->iteratorInstance = $iteratorInstance;
}
return $this->iteratorInstance;
}
+ /**
+ * Remove directory iterator instance (effectively closing it) by setting
+ * it to NULL. This will trigger a call on the destructor which will then
+ * "close" the iterator.
+ *
+ * @param $iteratorInstance An instanceof a DirectoryIterator class
+ * @return void
+ */
+ protected final function unsetDirectoryIteratorInstance (e) {
+ // "Unset" the instance
+ $this->iteratorInstance = NULL;
+ }
+
/**
* Setter for path name
*