Enabled PHPMD for src and tests
This commit is contained in:
@@ -159,12 +159,12 @@ class PageRulesActions implements Configurations
|
||||
]);
|
||||
}
|
||||
|
||||
public function setMinification(bool $html, bool $css, bool $js)
|
||||
public function setMinification(bool $html, bool $css, bool $javascript)
|
||||
{
|
||||
$this->addConfigurationOption("minification", [
|
||||
'html' => $this->getBoolAsOnOrOff($html),
|
||||
'css' => $this->getBoolAsOnOrOff($css),
|
||||
'js' => $this->getBoolAsOnOrOff($js),
|
||||
'js' => $this->getBoolAsOnOrOff($javascript),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -297,9 +297,9 @@ class PageRulesActions implements Configurations
|
||||
return $this->configs;
|
||||
}
|
||||
|
||||
private function addConfigurationOption($id, array $configuration)
|
||||
private function addConfigurationOption(string $setting, array $configuration)
|
||||
{
|
||||
$configuration['id'] = $id;
|
||||
$configuration['id'] = $setting;
|
||||
|
||||
array_push($this->configs, (object) $configuration);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,17 @@ class DNS implements API
|
||||
$this->adapter = $adapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
|
||||
*
|
||||
* @param string $zoneID
|
||||
* @param string $type
|
||||
* @param string $name
|
||||
* @param string $content
|
||||
* @param int $ttl
|
||||
* @param bool $proxied
|
||||
* @return bool
|
||||
*/
|
||||
public function addRecord(
|
||||
string $zoneID,
|
||||
string $type,
|
||||
|
||||
@@ -21,6 +21,16 @@ class PageRules implements API
|
||||
$this->adapter = $adapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
|
||||
*
|
||||
* @param string $zoneID
|
||||
* @param PageRulesTargets $target
|
||||
* @param PageRulesActions $actions
|
||||
* @param bool $active
|
||||
* @param int|null $priority
|
||||
* @return bool
|
||||
*/
|
||||
public function createPageRule(
|
||||
string $zoneID,
|
||||
PageRulesTargets $target,
|
||||
|
||||
@@ -43,7 +43,7 @@ class UARules implements API
|
||||
string $zoneID,
|
||||
string $mode,
|
||||
\Cloudflare\API\Configurations\Configurations $configuration,
|
||||
string $id = null,
|
||||
string $ruleID = null,
|
||||
string $description = null
|
||||
): bool {
|
||||
$options = [
|
||||
@@ -51,8 +51,8 @@ class UARules implements API
|
||||
'configurations' => $configuration->getArray()
|
||||
];
|
||||
|
||||
if ($id !== null) {
|
||||
$options['id'] = $id;
|
||||
if ($ruleID !== null) {
|
||||
$options['id'] = $ruleID;
|
||||
}
|
||||
|
||||
if ($description !== null) {
|
||||
|
||||
@@ -43,7 +43,7 @@ class ZoneLockdown implements API
|
||||
string $zoneID,
|
||||
array $urls,
|
||||
\Cloudflare\API\Configurations\ZoneLockdown $configuration,
|
||||
string $id = null,
|
||||
string $lockdownID = null,
|
||||
string $description = null
|
||||
): bool {
|
||||
$options = [
|
||||
@@ -51,8 +51,8 @@ class ZoneLockdown implements API
|
||||
'configurations' => $configuration->getArray()
|
||||
];
|
||||
|
||||
if ($id !== null) {
|
||||
$options['id'] = $id;
|
||||
if ($lockdownID !== null) {
|
||||
$options['id'] = $lockdownID;
|
||||
}
|
||||
|
||||
if ($description !== null) {
|
||||
|
||||
@@ -19,6 +19,14 @@ class Zones implements API
|
||||
$this->adapter = $adapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
|
||||
*
|
||||
* @param string $name
|
||||
* @param bool $jumpstart
|
||||
* @param string $organizationID
|
||||
* @return \stdClass
|
||||
*/
|
||||
public function addZone(string $name, bool $jumpstart = false, string $organizationID = ''): \stdClass
|
||||
{
|
||||
$options = [
|
||||
|
||||
Reference in New Issue
Block a user