Why not using ternary form:

```php
return Intl\Intl::getCurrencyBundle()->getCurrencyName(
   $currency,
   $locale ?: $this->getCurrentLocale()
);
```