org\bovigo\vfs\vfsStreamDirectory::getChild PHP Метод

getChild() публичный Метод

returns the child with the given name
public getChild ( string $name ) : org\bovigo\vfs\vfsStreamContent
$name string
Результат org\bovigo\vfs\vfsStreamContent
    public function getChild($name)
    {
        $childName = $this->getRealChildName($name);
        foreach ($this->children as $child) {
            if ($child->getName() === $childName) {
                return $child;
            }
            if ($child->appliesTo($childName) === true && $child->hasChild($childName) === true) {
                return $child->getChild($childName);
            }
        }
        return null;
    }

Usage Example

 /**
  * @expectedException RuntimeException
  */
 public function testShouldThrowExceptionWhenDeletionNotPermitted()
 {
     $this->root->chmod(0555);
     $this->root->getChild('testfile2')->chmod(0555);
     $localDelete = new DefaultDelete($this->root->url() . '/testfile2');
     $localDelete->execute();
 }
All Usage Examples Of org\bovigo\vfs\vfsStreamDirectory::getChild