You are here

function ClassFinder::addNamespacePsr0 in X Autoload 7.4

Same name and namespace in other branches
  1. 7.5 src/ClassFinder/ClassFinder.php \Drupal\xautoload\ClassFinder\ClassFinder::addNamespacePsr0()

Add PSR-0 style namespace. This will assume that we are really dealing with a namespace, even if it has no '\\' included.

Parameters

string $prefix:

string[]|string $paths:

Overrides CommonRegistrationInterface::addNamespacePsr0

File

lib/ClassFinder/ClassFinder.php, line 132

Class

ClassFinder

Namespace

Drupal\xautoload\ClassFinder

Code

function addNamespacePsr0($prefix, $paths) {
  $logical_base_path = Util::namespaceLogicalPath($prefix);
  foreach ((array) $paths as $root_path) {
    $deep_path = strlen($root_path) ? rtrim($root_path, '/') . '/' . $logical_base_path : $logical_base_path;
    $this->namespaceMap
      ->registerDeepPath($logical_base_path, $deep_path, $this->psr0Behavior);
  }
}