<commit_before><?php

namespace NewUp\Support\Testing\FilesystemVirtualization;

use org\bovigo\vfs\vfsStream;

trait FilesystemVirtualization
{

    /**
     * The vfsStream instance.
     *
     * @var vfsStream
     */
    protected $vfs;

    /**
     * Sets up the vfs instance.
     */
    public function setUpVfs()
    {
        $this->vfs = vfsStream::setup($this->virtualPath);
    }

    /**
     * Frees the vfs variable and unsets it.
     */
    public function tearDownVfs()
    {
        $this->vfs = null;
        unset($this->vfs);
    }

    /**
     * Gets a vfsStream URL.
     *
     * @param $path
     *
     * @return string
     */
    public function getPath($path)
    {
        return vfsStream::url($this->virtualPath.'/'.$path);
    }

}<commit_msg>Updated comment, corrected tearDown<commit_after><?php

namespace NewUp\Support\Testing\FilesystemVirtualization;

use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;

trait FilesystemVirtualization
{

    /**
     * The vfsStream instance.
     *
     * @var vfsStreamDirectory
     */
    protected $vfs;

    /**
     * Sets up the vfs instance.
     */
    public function setUpVfs()
    {
        $this->vfs = vfsStream::setup($this->virtualPath);
    }

    /**
     * Gets the vfsStreamDirectory instance.
     *
     * @return \org\bovigo\vfs\vfsStreamDirectory
     */
    public function getVfs()
    {
        return $this->vfs;
    }

    /**
     * Frees the vfs variable and unsets it.
     */
    public function tearDownVfs()
    {
        unset($this->vfs);
        $this->vfs = null;
    }

    /**
     * Gets a vfsStream URL.
     *
     * @param $path
     *
     * @return string
     */
    public function getPath($path)
    {
        return vfsStream::url($this->virtualPath.'/'.$path);
    }

}
{'fraction_non_alphanumeric': 0.13043478260869565, 'fraction_numerical': 0.0, 'mean_word_length': 1.941747572815534, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6616665', 'n_tokens_mistral': 608, 'n_tokens_neox': 605, 'n_words': 116}