You are here

public function vfsStreamDirectory::removeChild in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php \org\bovigo\vfs\vfsStreamDirectory::removeChild()

removes child from the directory

Parameters

string $name:

Return value

bool

Overrides vfsStreamContainer::removeChild

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php, line 134

Class

vfsStreamDirectory
Directory container.

Namespace

org\bovigo\vfs

Code

public function removeChild($name) {
  foreach ($this->children as $key => $child) {
    if ($child
      ->appliesTo($name)) {
      $child
        ->setParentPath(null);
      unset($this->children[$key]);
      $this
        ->updateModifications();
      return true;
    }
  }
  return false;
}