]> git.mxchange.org Git - core.git/commitdiff
setIteratorInstance() was already defined and way to generic.
authorRoland Haeder <roland@mxchange.org>
Sun, 7 Dec 2014 18:55:14 +0000 (19:55 +0100)
committerRoland Haeder <roland@mxchange.org>
Sun, 7 Dec 2014 18:55:14 +0000 (19:55 +0100)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/interfaces/io/directory/class_Directory.php
inc/classes/main/file_directories/directory/class_FrameworkDirectoryPointer.php

index 89e425edcd4ab9e88423c6d70cb4dc08da0c1267..993ced249cc8b7c28e9d3ffeb0f7838687be0593 100644 (file)
@@ -50,7 +50,7 @@ interface Directory extends FrameworkInterface {
         *
         * @return      $iteratorInstance       The directory pointer which shall be a valid directory resource
         */
-       function getIteratorInstance ();
+       function getDirectoryIteratorInstance ();
 
        /**
         * Getter for path name
index d2f47d3c93a8649fc0d5daa351afcabf0444d592..2d075cbdd8f4ec2747fceed5c23ad0c758763672 100644 (file)
@@ -45,7 +45,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Directory
         */
        public function __destruct() {
                // Is there a resource pointer? Then we have to close the directory here!
-               if ($this->getIteratorInstance() instanceof DirectoryIterator) {
+               if ($this->getDirectoryIteratorInstance() instanceof DirectoryIterator) {
                        // Try to close a directory
                        $this->closeDirectory();
                } // END - if
@@ -109,7 +109,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Directory
                $iteratorInstance->rewind();
 
                // Set directory pointer and path name
-               $pointerInstance->setIteratorInstance($iteratorInstance);
+               $pointerInstance->setDirectoryIteratorInstance($iteratorInstance);
                $pointerInstance->setPathName($pathName);
 
                // Return the instance
@@ -126,13 +126,13 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Directory
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . '] - CALLED!');
 
                // Can the next entry be read?
-               assert($this->getIteratorInstance()->valid());
+               assert($this->getDirectoryIteratorInstance()->valid());
 
                // Default is FALSE
                $currentEntry = FALSE;
 
                // Read data from the directory pointer and return it
-               $currentEntry = $this->getIteratorInstance()->current();
+               $currentEntry = $this->getDirectoryIteratorInstance()->current();
 
                // Return found entry
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: currentEntry[]=' . gettype($currentEntry) . ' - EXIT!');
@@ -151,7 +151,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Directory
                        // No exception given, so read all files and directories, but not recursive
                        self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: No exceptions given, please use readRawDirectory() instead!');
                        return $this->readRawDirectory();
-               } elseif (!$this->getIteratorInstance()->valid()) {
+               } elseif (!$this->getDirectoryIteratorInstance()->valid()) {
                        // No more left to read
                        return NULL;
                }
@@ -172,7 +172,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Directory
                        // Is it not excluded?
                        if (in_array($rawLine, $except)) {
                                // To next entry
-                               $this->getIteratorInstance()->next();
+                               $this->getDirectoryIteratorInstance()->next();
 
                                // Exclude this part
                                $rawLine = $this->readDirectoryExcept($except);
@@ -181,7 +181,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Directory
                } // END - if
 
                // To next entry
-               $this->getIteratorInstance()->next();
+               $this->getDirectoryIteratorInstance()->next();
 
                // Return read line
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine);
@@ -196,7 +196,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Directory
         */
        public function closeDirectory () {
                // Close the directory by unsetting it
-               $this->setIteratorInstance(NULL);
+               $this->setDirectoryIteratorInstance(NULL);
                $this->setPathName('');
        }
 
@@ -206,7 +206,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Directory
         * @param       $iteratorInstance       An instanceof a DirectoryIterator class or NULL to unset ("close") it.
         * @return      void
         */
-       protected final function setIteratorInstance (DirectoryIterator $iteratorInstance = NULL) {
+       protected final function setDirectoryIteratorInstance (DirectoryIterator $iteratorInstance = NULL) {
                // Set instance (or NULL)
                $this->iteratorInstance = $iteratorInstance;
        }
@@ -216,7 +216,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Directory
         *
         * @return      $iteratorInstance       The directory pointer which shall be a valid directory resource
         */
-       public final function getIteratorInstance () {
+       public final function getDirectoryIteratorInstance () {
                return $this->iteratorInstance;
        }