Changeset View
Changeset View
Standalone View
Standalone View
src/app/Domain.php
Show First 20 Lines • Show All 244 Lines • ▼ Show 20 Lines | public function setStatusAttribute($status) | ||||
$status ^= $value; | $status ^= $value; | ||||
} | } | ||||
} | } | ||||
if ($status > 0) { | if ($status > 0) { | ||||
throw new \Exception("Invalid domain status: {$status}"); | throw new \Exception("Invalid domain status: {$status}"); | ||||
} | } | ||||
if ($this->isPublic()) { | |||||
$this->attributes['status'] = $new_status; | |||||
return; | |||||
} | |||||
if ($new_status & self::STATUS_CONFIRMED) { | |||||
// if we have confirmed ownership of or management access to the domain, then we have | |||||
machniak: You don't really need this `if`, just use the `else` code. | |||||
// also confirmed the domain exists in DNS. | |||||
$new_status |= self::STATUS_VERIFIED; | |||||
$new_status |= self::STATUS_ACTIVE; | |||||
} | |||||
if ($new_status & self::STATUS_DELETED && $new_status & self::STATUS_ACTIVE) { | |||||
$new_status ^= self::STATUS_ACTIVE; | |||||
} | |||||
if ($new_status & self::STATUS_SUSPENDED && $new_status & self::STATUS_ACTIVE) { | |||||
$new_status ^= self::STATUS_ACTIVE; | |||||
} | |||||
// if the domain is now active, it is not new anymore. | |||||
if ($new_status & self::STATUS_ACTIVE && $new_status & self::STATUS_NEW) { | |||||
$new_status ^= self::STATUS_NEW; | |||||
} | |||||
$this->attributes['status'] = $new_status; | $this->attributes['status'] = $new_status; | ||||
} | } | ||||
/** | /** | ||||
* Ownership verification by checking for a TXT (or CNAME) record | * Ownership verification by checking for a TXT (or CNAME) record | ||||
* in the domain's DNS (that matches the verification hash). | * in the domain's DNS (that matches the verification hash). | ||||
* | * | ||||
* @return bool True if verification was successful, false otherwise | * @return bool True if verification was successful, false otherwise | ||||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |
You don't really need this if, just use the else code.