I would rather do something like this, to preserve the original behaviour and still ensure phar compatibility:

```php
$filePath = realpath($fileName);

// Phar compatibility.
if (false === $filePath) {
    $filePath = $fileName;
}

if ( ! file_exists($filePath)) {
    throw new \InvalidArgumentException(
        sprintf("SQL file '<info>%s</info>' does not exist.", $filePath)
    );
} elseif ( ! is_readable($filePath)) {
    throw new \InvalidArgumentException(
        sprintf("SQL file '<info>%s</info>' does not have read permissions.", $filePath)
    );
}

$output->write(sprintf("Processing file '<info>%s</info>'... ", $filePath));
$sql = file_get_contents($filePath);
```

Please also note that we surround `!` with spaces. You removed those spaces, which has to be reverted.