silence possible notices
[pharext/pharext] / src / pharext / Task / Cleanup.php
index c2cfefa8b768019dcc1c55202812e89460b99c72..54e64e9ea318508472b7cbd469bbe824a3a48db8 100644 (file)
@@ -26,6 +26,9 @@ class Cleanup implements Task
         * @param bool $verbose
         */
        public function run($verbose = false) {
+               if ($verbose) {
+                       printf("Cleaning up %s ...\n", $this->rm);
+               }
                if ($this->rm instanceof Tempfile) {
                        unset($this->rm);
                } elseif (is_dir($this->rm)) {
@@ -37,12 +40,12 @@ class Cleanup implements Task
                                RecursiveIteratorIterator::CHILD_FIRST);
                        foreach ($rii as $path => $child) {
                                if ($child->isDir()) {
-                                       rmdir($path);
+                                       @rmdir($path);
                                } else {
-                                       unlink($path);
+                                       @unlink($path);
                                }
                        }
-                       rmdir($this->rm);
+                       @rmdir($this->rm);
                } else {
                        @unlink($this->rm);
                }