mirror of
https://github.com/symfony/class-loader.git
synced 2026-03-24 09:12:18 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a5217edb6 | ||
|
|
77f69969b1 | ||
|
|
8478872572 | ||
|
|
827c54ee98 |
@@ -181,7 +181,7 @@ class ClassLoader
|
||||
$classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
|
||||
|
||||
foreach ($this->prefixes as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
if ($class === strstr($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
|
||||
return $dir . DIRECTORY_SEPARATOR . $classPath;
|
||||
|
||||
@@ -39,7 +39,7 @@ class ClassMapGenerator
|
||||
/**
|
||||
* Iterate over all files in the given directory searching for classes
|
||||
*
|
||||
* @param Iterator|string $dir The directory to search in or an iterator
|
||||
* @param \Iterator|string $dir The directory to search in or an iterator
|
||||
*
|
||||
* @return array A class map array
|
||||
*/
|
||||
|
||||
@@ -65,5 +65,5 @@ Resources
|
||||
You can run the unit tests with the following command:
|
||||
|
||||
$ cd path/to/Symfony/Component/ClassLoader/
|
||||
$ composer.phar install --dev
|
||||
$ composer.phar install
|
||||
$ phpunit
|
||||
|
||||
@@ -189,7 +189,7 @@ class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testUnableToLoadClassException()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user