I think you can do something more efficient:

```php
$class = get_class($element);

if (isset($this->instanceMap[$class]) {
   // ... do something
}
```