Introduction
I'm using Laravel 4 and have two composer packages with the same namespace, autoloaded with PSR-0. The simplified schematics of the composer.json files are as follows.
Laravel app composer.json
{
"require": {
"laravel/framework": "4.2.*",
"xxxxx/packageA": "1.2.0"
}
}
xxxxx/packageA composer.json
{
"require": {
"xxxxx/packageB": "~2.1.0"
},
"autoload": {
"psr-0": {
"NS": "src/"
}
}
}
xxxxx/packageB composer.json
{
"autoload": {
"psr-0": {
"NS": "src/"
}
}
}
The Question
So, xxxxx/packageA
and xxxxx/packageB
both have a NS
namespace in the src
directory. Does this work? I'm getting an error saying that class NS\\X
was not found. Is this a Composer restriction with packages having the same namespace or this is fine and I have a error in my code?