@@ -52,17 +52,19 @@ |
||
| 52 | 52 | $newWords = array(); |
| 53 | 53 | foreach ($words as $word) |
| 54 | 54 | { |
| 55 | - if (in_array(strtoupper($word), $uppercase_exceptions)) |
|
| 56 | - $word = strtoupper($word); |
|
| 57 | - else |
|
| 58 | - if (!in_array($word, $lowercase_exceptions)) |
|
| 59 | - $word = ucfirst($word); |
|
| 55 | + if (in_array(strtoupper($word), $uppercase_exceptions)) {
|
|
| 56 | + $word = strtoupper($word); |
|
| 57 | + } else |
|
| 58 | + if (!in_array($word, $lowercase_exceptions)) {
|
|
| 59 | + $word = ucfirst($word); |
|
| 60 | + } |
|
| 60 | 61 | |
| 61 | 62 | $newWords[] = $word; |
| 62 | 63 | } |
| 63 | 64 | |
| 64 | - if (in_array(strtolower($delimiter), $lowercase_exceptions)) |
|
| 65 | - $delimiter = strtolower($delimiter); |
|
| 65 | + if (in_array(strtolower($delimiter), $lowercase_exceptions)) {
|
|
| 66 | + $delimiter = strtolower($delimiter); |
|
| 67 | + } |
|
| 66 | 68 | |
| 67 | 69 | $attributeValue = join($delimiter, $newWords); |
| 68 | 70 | } |
@@ -100,10 +100,12 @@ |
||
| 100 | 100 | foreach($attributes as $attributeKey => $value) |
| 101 | 101 | {
|
| 102 | 102 | $value = $this->castAttribute($attributeKey, $value); |
| 103 | - if($value !== null) // Will occur for customCasts, since we don't want the attribute to exist in this class but in the child resource |
|
| 103 | + if($value !== null) {
|
|
| 104 | + // Will occur for customCasts, since we don't want the attribute to exist in this class but in the child resource |
|
| 104 | 105 | {
|
| 105 | 106 | $this->attributes[$attributeKey] = $value; |
| 106 | 107 | } |
| 108 | + } |
|
| 107 | 109 | } |
| 108 | 110 | } |
| 109 | 111 | |
@@ -373,8 +373,7 @@ discard block |
||
| 373 | 373 | */ |
| 374 | 374 | protected function setContentType($contentType) |
| 375 | 375 | {
|
| 376 | - if ($contentType === 'json') { $contentType = 'application/json'; }
|
|
| 377 | - elseif ($contentType === 'form') { $contentType = 'application/x-www-form-urlencoded'; }
|
|
| 376 | + if ($contentType === 'json') { $contentType = 'application/json'; } elseif ($contentType === 'form') { $contentType = 'application/x-www-form-urlencoded'; }
|
|
| 378 | 377 | $this->contentType = $contentType; |
| 379 | 378 | } |
| 380 | 379 | |
@@ -551,8 +550,7 @@ discard block |
||
| 551 | 550 | {
|
| 552 | 551 | if (!$this->contentType) |
| 553 | 552 | {
|
| 554 | - if ($this->getMethod() === 'POST') { return 'application/x-www-form-urlencoded'; }
|
|
| 555 | - else { return 'application/json'; }
|
|
| 553 | + if ($this->getMethod() === 'POST') { return 'application/x-www-form-urlencoded'; } else { return 'application/json'; }
|
|
| 556 | 554 | } |
| 557 | 555 | return $this->contentType; |
| 558 | 556 | } |