Just return early instead:

```php
if (isset($this->options['object_repository'])) {
    /* @var \Doctrine\Common\Persistence\ObjectRepository $objectRepository */
    $roleRepository = $parentLocator->get($this->options['object_repository']);

    return new ObjectRepositoryRoleProvider($roleRepository);
}

if (isset($this->options['object_manager']) && isset($this->options['class_name'])) {
    /* @var \Doctrine\Common\Persistence\ObjectManager $objectManager */
    $objectManager    = $parentLocator->get($this->options['object_manager']);
    $roleRepository     = $objectManager->getRepository($this->options['class_name']);

    return new ObjectRepositoryRoleProvider($roleRepository);
}

throw new Exception\RuntimeException(
    'No object repository was found while creating the ZfcRbac object repository role provider. Are '
    . 'you sure you specified either the object_repository option or object_manager/class_name options?'
);
```