Closed LewisSmallwood closed 3 years ago
Does the API really not allow someone to pass an integer ID (or did DigitalOcean just document that you can't, even though it does actually work)? If this is the case, we should accept string|int
. Otherwise, this PR looks good.
Try and fix StyleCI for floating IP changes
You can download the raw diff from StyleCI and apply it to get the exact fixes. Alternatively, you can leave the build broken - that is also fine. StyleCI applies its fixes after the PR is merged, so contributors don't have to worry about code style. See https://github.com/DigitalOceanPHP/Client/blob/4.1/.github/CONTRIBUTING.md. :)
Does the API really not allow someone to pass an integer ID (or did DigitalOcean just document that you can't, even though it does actually work)? If this is the case, we should accept
string|int
. Otherwise, this PR looks good.
I just checked this @GrahamCampbell as I was a bit surprised https://developers.digitalocean.com/documentation/v2/#floating-ips
It seems they use the IP as the identication and do not return an INT based id for them. I am unsure if this has changed.
Actually looking into my older library it looks like it was a simple mistake when adding typehinting
https://github.com/DigitalOceanPHP/Client/commit/96d1f23b739ffd8e08de103c9c9686b4142b18c1
Does the API really not allow someone to pass an integer ID (or did DigitalOcean just document that you can't, even though it does actually work)? If this is the case, we should accept
string|int
. Otherwise, this PR looks good.
I can confirm that it is strings only, there doesn't actually appear to be an integer resource ID for floating IPs. Although, if you take an action like assign and look at the action entity it returns, there is a resource ID attached which I assume is the floating IP resource ID. But passing this to any of the methods doesn't work.
Excellent. Thank you, everyone. 🍻
Fixes #269