mirror of
https://github.com/composer/composer
synced 2025-05-10 09:02:59 +00:00
Refactoring ClassLoader::add() to return early
This commit is contained in:
parent
e74223470a
commit
6510ee5c4c
1 changed files with 15 additions and 14 deletions
|
@ -90,21 +90,22 @@ class ClassLoader
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isset($this->prefixes[$prefix])) {
|
if (!isset($this->prefixes[$prefix])) {
|
||||||
if ($prepend) {
|
|
||||||
$this->prefixes[$prefix] = array_merge(
|
|
||||||
(array) $paths,
|
|
||||||
$this->prefixes[$prefix]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$this->prefixes[$prefix] = array_merge(
|
|
||||||
$this->prefixes[$prefix],
|
|
||||||
(array) $paths
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$this->prefixes[$prefix] = (array) $paths;
|
$this->prefixes[$prefix] = (array) $paths;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($prepend) {
|
||||||
|
$this->prefixes[$prefix] = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->prefixes[$prefix]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->prefixes[$prefix] = array_merge(
|
||||||
|
$this->prefixes[$prefix],
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue