Skip to content

addressing inline control structures #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/MaxCDN/OAuth/OAuthUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class OAuthUtil {
public static function urlencode_rfc3986($input) {
if (is_array($input)) {
return array_map(array('\MaxCDN\OAuth\OAuthUtil', 'urlencode_rfc3986'), $input);
} else if (is_scalar($input)) {
} elseif (is_scalar($input)) {
return str_replace(
'+',
' ',
Expand Down Expand Up @@ -92,7 +92,9 @@ public static function get_headers() {
// parameters like this
// array('a' => array('b','c'), 'd' => 'e')
public static function parse_parameters( $input ) {
if (!isset($input) || !$input) return array();
if (!isset($input) || !$input) {
return array();
}

$pairs = explode('&', $input);

Expand Down Expand Up @@ -121,7 +123,9 @@ public static function parse_parameters( $input ) {
}

public static function build_http_query($params) {
if (!$params) return '';
if (!$params) {
return '';
}

// Urlencode both keys and values
$keys = OAuthUtil::urlencode_rfc3986(array_keys($params));
Expand Down