We do not use `else` in our codebase.
Ideally this should be split into 1 separate method to resolve the ObjectManager and use a ternary (which is allowed in our code) to resolve the type.
Another quick and dirty solution would be a switch true, something like this:

```php
switch (true) {
    case ($managerRegistry instanceof ManagerRegistry):
        $objectManager = $managerRegistry->getManager($managerName); 
        $type          = $managerRegistry->getName(); 
        break;

    default:
        $objectManager = $managerRegistry->getEntityManager(); 
        $type          = 'ORM';
}
```