Enabled PHPMD for src and tests

This commit is contained in:
Junade Ali
2017-10-13 15:18:08 +01:00
parent f0213ecf92
commit ca9e5bbc28
11 changed files with 64 additions and 35 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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 = [