This is not a solution but it worked for me...
You don't need to add manually the classmap. If you look inside vendor/composer/autoload_classmap.php you can see composer added:
'CS_REST_CLASSES' => $vendorDir .'/campaignmonitor/createsend-php/csrest_administrators.php',
Then I tried two things:
- Instantiate my class somewhere:
$cm = new \CS_REST_Lists;
- Inject the class in my services.yml:
my.service:
class: My\Namespace\MyService
arguments: [@campaign_monitor]
campaign_monitor:
class: CS_REST_Lists
arguments: ['', %campaignmonitor%]
The weird part is instantiating worked all the time but injecting triggered:
PHP Fatal error: Class 'CS_REST_List' not found in /my/code/path/var/cache/dev/appDevDebugProjectContainer.php on line 1779
So I tried to inject a different classmap in my services.yml (i.g File_Iterator from phpunit) I assumed that a library like phpunit wouldn't be an issue and it worked. Then I replaced in services.yml File_Iterator with CS_REST_List and magically it worked...
So... not sure what's going wrong but I think the problem comes from symfony's container not composer. I used symfony 2.5.1