public function stream_metadata(string $path, int $option, $var): bool
    {
        $path = $this->resolvePath(vfsStream::path($path));

        /** @var vfsStreamAbstractContent|null $content */
        $content = $this->getContent($path);
        switch ($option) {
            case STREAM_META_TOUCH:
                if (null === $content) {
                    $content = $this->createFile($path, null, STREAM_REPORT_ERRORS);
                    // file creation may not be allowed at provided path
                    if (false === $content) {
                        return false;
                    }
                }

                $currentTime = time();
                $content->lastModified($var[0] ?? $currentTime);
                $content->lastAccessed($var[1] ?? $currentTime);
                return true;

            case STREAM_META_OWNER_NAME:
                return false;

            case STREAM_META_OWNER:
                if (null === $content) {
                    return false;
                }

                return $this->doPermChange(
                    $path,
                    $content,
                    function() use ($content, $var) { $content->chown($var); }
                );

            case STREAM_META_GROUP_NAME:
                return false;

            case STREAM_META_GROUP:
                if (null === $content) {
                    return false;
                }

                return $this->doPermChange(
                    $path,
                    $content,
                    function() use ($content, $var) { $content->chgrp($var); }
                );

            case STREAM_META_ACCESS:
                if (null === $content) {
                    return false;
                }

                return $this->doPermChange(
                    $path,
                    $content,
                    function() use ($content, $var) { $content->chmod($var); }
                );

            default:
                return false;
        }
    }
public function stream_metadata(string $path, int $option, $var): bool
    {
        $path = $this->resolvePath(vfsStream::path($path));

        /** @var vfsStreamAbstractContent|null $content */
        $content = $this->getContent($path);
        switch ($option) {
            case STREAM_META_TOUCH:
                if (null === $content) {
                    $content = $this->createFile($path, null, STREAM_REPORT_ERRORS);
                    // file creation may not be allowed at provided path
                    if (false === $content) {
                        return false;
                    }
                }

                $currentTime = time();
                $content->lastModified($var[0] ?? $currentTime);
                $content->lastAccessed($var[1] ?? $currentTime);
                return true;

            case STREAM_META_OWNER_NAME:
                return false;

            case STREAM_META_OWNER:
                if (null === $content) {
                    return false;
                }

                return $this->doPermChange(
                    $path,
                    $content,
                    function() use ($content, $var) { $content->chown($var); }
                );

            case STREAM_META_GROUP_NAME:
                return false;

            case STREAM_META_GROUP:
                if (null === $content) {
                    return false;
                }

                return $this->doPermChange(
                    $path,
                    $content,
                    function() use ($content, $var) { $content->chgrp($var); }
                );

            case STREAM_META_ACCESS:
                if (null === $content) {
                    return false;
                }

                return $this->doPermChange(
                    $path,
                    $content,
                    function() use ($content, $var) { $content->chmod($var); }
                );

            default:
                return false;
        }
    }
public function stream_metadata ( string $ path , int $ option , $ var ) : bool { $ path = $ this -> resolvePath ( vfsStream :: path ( $ path ) ) ; /** @var vfsStreamAbstractContent|null $content */ $ content = $ this -> getContent ( $ path ) ; switch ( $ option ) { case STREAM_META_TOUCH : if ( null === $ content ) { $ content = $ this -> createFile ( $ path , null , STREAM_REPORT_ERRORS ) ; // file creation may not be allowed at provided path if ( false === $ content ) { return false ; } } $ currentTime = time ( ) ; $ content -> lastModified ( $ var [ 0 ] ?? $ currentTime ) ; $ content -> lastAccessed ( $ var [ 1 ] ?? $ currentTime ) ; return true ; case STREAM_META_OWNER_NAME : return false ; case STREAM_META_OWNER : if ( null === $ content ) { return false ; } return $ this -> doPermChange ( $ path , $ content , function ( ) use ( $ content , $ var ) { $ content -> chown ( $ var ) ; } ) ; case STREAM_META_GROUP_NAME : return false ; case STREAM_META_GROUP : if ( null === $ content ) { return false ; } return $ this -> doPermChange ( $ path , $ content , function ( ) use ( $ content , $ var ) { $ content -> chgrp ( $ var ) ; } ) ; case STREAM_META_ACCESS : if ( null === $ content ) { return false ; } return $ this -> doPermChange ( $ path , $ content , function ( ) use ( $ content , $ var ) { $ content -> chmod ( $ var ) ; } ) ; default : return false ; } }
sets metadata like owner, user or permissions

@param   string  $path
@param   int     $option
@param   mixed   $var
@return  bool
@since   1.1.0
sets metadata like owner user or permissions