I would simplify the conditions by throwing the exception first in case the package is not found:

```php
if (!$package instanceof CompletePackageInterface) {
    throw new InvalidArgumentException('package not found');
}

if (filter_var($package->getSourceUrl(), FILTER_VALIDATE_URL)) {
    $this->openBrowser($package->getSourceUrl());
}

$this->getIO()->write('no valid source-url given for ' . $package->getName());
```