Open a904guy opened 3 years ago
Let me know if the method name doesn't fit any guidelines and I'll adjust the request.
I've tested this locally, and made sure the config property was correct and inline with the documentation about cloudflare Access Rules.
There was no way to modify the configuration from a user standpoint because it was a private property.
I don't believe the Travis-CI test failures are related to my code...
In ToolInfo.php line 50:
Undefined index: name
Please advise.
please rebase off the latest master branch, the CI provider has been fixed
@jacobbednarz Done.
I've pulled the upstream changes down.
looks like you've got some lint issues to address and we can merge this.
I don't have this pulled down to a local machine, been working inside github.
Can you tell me what the lint issue is?
I don't see it being declared in the output.
Loaded config default from ".php_cs".
1) cloudflare-php/src/Configurations/AccessRules.php
Checked all files in 0.589 seconds, 12.000 MB memory used
make: *** [Makefile:9: lint] Error 8
Error: Process completed with exit code 2.```
Locally, you would run make fix
and it would handle the fix for you. In this case, it's the braces and spacing.
@@ -9,9 +9,9 @@ class AccessRules implements Configurations
public function setIP(string $value)
{
if (strpos($value, ':') !== false) {
- $this->config = ['target' => 'ip6', 'value' => $value];
+ $this->config = ['target' => 'ip6', 'value' => $value];
} else {
- $this->config = ['target' => 'ip', 'value' => $value];
+ $this->config = ['target' => 'ip', 'value' => $value];
}
}
PHPMD also wants this to not use else
(which I don't agree with) so we can just suppress that by prepending the method with
/**
* @SuppressWarnings(PHPMD.ElseExpression)
*/
For best results, I'd recommend pulling this locally and using the tools provided or use something like GitHub codespaces.
Currently it is impossible to set an IPv6 address to an AccessRule from the API.
This pull will add a new method
setIPv6
to matchsetIP
which only supports IPv4.Thanks, Andy