Maybe this is better:
```php
if (!is_dir($this->cachepath) && !mkdir($this->cachePath, $this->dirPermissions, true)) {
    throw new InvalidArgumentException(sprintf('Failed to create cache path %s', $this->cachePath));
}
```