Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
OptionStore: Add return type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
tangrufus committed Apr 19, 2017
1 parent 1199154 commit dcec27e
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions src/OptionStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,25 @@ final class OptionStore extends WPBSOptionStore
/**
* Cloudflare api key getter.
*
* @return mixed
* @return string
*/
public function getApiKey()
public function getApiKey(): string
{
return $this->get('wpcfg_cloudflare_api_key');
$value = $this->get('wpcfg_cloudflare_api_key');

return is_string($value) ? $value : '';
}

/**
* Bad usernames getter.
*
* @return string[]
*/
public function getBadUsernames()
public function getBadUsernames(): array
{
$value = $this->get('wpcfg_bad_login_bad_usernames');
if (empty($value)) {

if (! is_string($value)) {
return [];
}

Expand All @@ -59,20 +62,24 @@ public function getBadUsernames()
/**
* Cloudflare email getter.
*
* @return mixed
* @return string
*/
public function getEmail()
public function getEmail(): string
{
return $this->get('wpcfg_cloudflare_email');
$value = $this->get('wpcfg_cloudflare_email');

return is_string($value) ? $value : '';
}

/**
* Cloudflare zone id getter.
*
* @return mixed
* @return string
*/
public function getZoneId()
public function getZoneId(): string
{
return $this->get('wpcfg_cloudflare_zone_id');
$value = $this->get('wpcfg_cloudflare_zone_id');

return is_string($value) ? $value : '';
}
}

0 comments on commit dcec27e

Please sign in to comment.