cloudflare / cloudflare/cloudflare-php
Strict PHP Return types not correct for DNS getRecordID()
Open
- Dominant language
- PHP
- Stars
- 674
- Forks
- 268
- PR merge metrics
- No merged PRs in 30d
Description
In `DNS.php`, the function `getRecordID` is declared with return type `string`, but returns false.
Can we change this to either empty string, or throw and exception instead of having conflicting return types?
```php
public function getRecordID(string $zoneID, string $type = '', string $name = ''): string
{
$records = $this->listRecords($zoneID, $type, $name);
if (isset($records->result[0]->id)) {
return $records->result[0]->id;
}
return false;
}
```
could change final lines to:
```php
return $records->result[0]->id ?? : '';
```
Contributor guide
Assessment
This issue has not been assessed yet.