Migrate error: Call to a member function count() on a non-object I am trying to implement a user migration with the migration module but am getting this error:


  Fatal error: Call to a member function count() on a non-object in
  E:\wamp\www\website\sites\all\modules\migrate\includes\migration.inc
  on line 946


here is my migrate class:

abstract class CakeBaseMigration extends Migration {
  public function __construct($arguments) {
    parent::__construct($arguments);

    $this-&gt;team = array(
      new MigrateTeamMember('Chris', 'chris@somewhere.com',
          t('developer')),
    );

    Database::addConnectionInfo('for_migration', 'default', array(
      'driver' =&gt; 'mysql',
      'database' =&gt; 'databasename',
      'username' =&gt; 'username',
      'password' =&gt; 'password',
      'host' =&gt; 'localhost',
      'prefix' =&gt; '',
    ));

  }
}

class CakeUserMigration extends CakeBaseMigration {
  public function __construct($arguments) {

    parent::__construct($arguments);
    $this-&gt;description = t('Lagacy cakePHP system customers');


    $query = Database::getConnection('default', 'for_migration')
    -&gt;select('customers', 'c')
    -&gt;fields('c');

    $this-&gt;source = new MigrateSourceSQL($query);
    $this-&gt;destination = new MigrateDestinationUser();

    $this-&gt;map = new MigrateSQLMap($this-&gt;machineName,
        array('id' =&gt; array(
          'type' =&gt; 'int',
          'not null' =&gt; TRUE,
          'description' =&gt; 'Account ID.'
        )
        ),
        MigrateDestinationUser::getKeySchema()
    );

    $this-&gt;addFieldMapping('username', 'name');
    $this-&gt;addFieldMapping('pass', 'password');
    $this-&gt;addFieldMapping('mail', 'email');
    $this-&gt;addFieldMapping('created', 'modified');
    $this-&gt;addFieldMapping('roles')
    -&gt;separator(',')
    -&gt;defaultValue(DRUPAL_AUTHENTICATED_RID.',4');

  }
}


running the drush command drush migrate-audit --allsays that that cakeUser is missing a source and destination. 

I don't get it, Setting the database and running the query at devel/php returns the expected rows from the database.  

Any help on this would be fantastic :)
It seems the problem was the files not saving properly after I updated them, The code I posed above seems to be working ok now.