Bolt\Controller\Async\FilesystemManager::isMatchingExtension PHP Method

isMatchingExtension() private method

Check that file extensions are not being changed.
private isMatchingExtension ( string $oldName, string $newName ) : boolean
$oldName string
$newName string
return boolean
    private function isMatchingExtension($oldName, $newName)
    {
        $user = $this->getUser();
        if ($this->users()->hasRole($user['id'], 'root')) {
            return true;
        }
        $oldFile = new \SplFileInfo($oldName);
        $newFile = new \SplFileInfo($newName);
        return $oldFile->getExtension() === $newFile->getExtension();
    }