1
0
Fork 0

Consistently use arrays as paths for a given namespace prefix

pull/1871/head
Jordi Boggiano 2013-05-05 10:56:46 +02:00
parent b00081f4f4
commit dc71ba557b
6 changed files with 15 additions and 19 deletions

View File

@ -76,11 +76,7 @@ EOF;
}
$exportedPrefix = var_export($namespace, true);
$namespacesFile .= " $exportedPrefix => ";
if (count($exportedPaths) > 1) {
$namespacesFile .= "array(".implode(', ', $exportedPaths)."),\n";
} else {
$namespacesFile .= $exportedPaths[0].",\n";
}
}
$namespacesFile .= ");\n";

View File

@ -478,9 +478,9 @@ class AutoloadGeneratorTest extends TestCase
\$baseDir = dirname(\$vendorDir);
return array(
'B\\\\Sub\\\\Name' => \$vendorDir . '/b/b/src',
'B\\\\Sub\\\\Name' => array(\$vendorDir . '/b/b/src'),
'A\\\\B' => array(\$baseDir . '/lib', \$vendorDir . '/a/a/lib'),
'A' => \$vendorDir . '/a/a/src',
'A' => array(\$vendorDir . '/a/a/src'),
);
EOF;
@ -721,8 +721,8 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir).'/working-dir';
return array(
'Foo' => $baseDir . '/src',
'Bar' => $vendorDir . '/b/b/lib',
'Foo' => array($baseDir . '/src'),
'Bar' => array($vendorDir . '/b/b/lib'),
);
EOF;
@ -784,7 +784,7 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir).'/working-dir';
return array(
'Foo' => $baseDir . '/../src',
'Foo' => array($baseDir . '/../src'),
);
EOF;
@ -836,7 +836,7 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Foo' => $baseDir . '/',
'Foo' => array($baseDir . '/'),
);
EOF;

View File

@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Main' => $baseDir . '/src',
'Main' => array($baseDir . '/src'),
'Lala' => array($baseDir . '/src', $baseDir . '/lib'),
);

View File

@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'Main' => $baseDir . '/src',
'Lala' => $baseDir . '/src',
'Main' => array($baseDir . '/src'),
'Lala' => array($baseDir . '/src'),
);

View File

@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = $vendorDir;
return array(
'Main' => $vendorDir . '/src',
'Lala' => $vendorDir . '/src',
'Main' => array($vendorDir . '/src'),
'Lala' => array($vendorDir . '/src'),
);

View File

@ -6,7 +6,7 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'B\\Sub\\Name' => $vendorDir . '/b/b/src',
'A\\B' => $vendorDir . '/a/a/lib',
'A' => $vendorDir . '/a/a/src',
'B\\Sub\\Name' => array($vendorDir . '/b/b/src'),
'A\\B' => array($vendorDir . '/a/a/lib'),
'A' => array($vendorDir . '/a/a/src'),
);