You are here

function DummyFilesystem::addKnownFile in X Autoload 7.3

Parameters

string $file:

Throws

\Exception

2 calls to DummyFilesystem::addKnownFile()
DummyFilesystem::addClass in tests/Drupal/xautoload/Tests/DummyFilesystem.php
DummyFilesystem::addKnownFiles in tests/Drupal/xautoload/Tests/DummyFilesystem.php

File

tests/Drupal/xautoload/Tests/DummyFilesystem.php, line 45

Class

DummyFilesystem

Namespace

Drupal\xautoload\Tests

Code

function addKnownFile($file) {
  if (!isset($this->knownPaths[$file])) {
    $this->knownPaths[$file] = self::FILE;
    $this
      ->addKnownDir(dirname($file));
  }
  elseif (self::DIR === $this->knownPaths[$file]) {
    throw new \Exception("A directory already exists at '{$file}', cannot overwrite with a file.");
  }
}