public function add(SplFileInfo $splFileInfo)
    {
        $fileSystem = new Filesystem();

        if (!$fileSystem->exists($splFileInfo->getRealPath())) {
            throw new Exception('Trying to add '.$splFileInfo->getRealPath().' missing file to the index');
        }

        // if the file is already present in the index, and its mtime has been modified, we add it to the change set
        if ($this->has($splFileInfo->getRealPath())
            && $splFileInfo->getMTime() !== $this->index[$splFileInfo->getRealPath()]) {
            $this->changes[$splFileInfo->getRealPath()] = $splFileInfo;
        }
        // add new or existing file to the index
        $this->index[$splFileInfo->getRealPath()] = $splFileInfo->getMTime();
    }