In the static method getKeySchema, the pseudo-variable $this is used.

  static public function getKeySchema($entity_type = NULL) {
    // Migrate UI invokes $destination->getKeySchema() without any parameters.
    if (!$entity_type) {
      if (isset($this)) {
        if ($this instanceof MigrateDestination) {
          $entity_type = $this->entityType;
        }
        elseif ($this instanceof Migration) {
          $entity_type = $this->destination->entityType;
        }
      }
      else {
        return array();
      }
    }
...
}

According to PHP documentation

Because static methods are callable without an instance of the object created, the pseudo-variable $this is not available inside the method declared as static.

That could throw errors depending on the error report level you use.

Comments

mikeryan’s picture