@@ -60,15 +60,15 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | return $result; |
| 62 | 62 | } elseif (is_array($mixed) || is_object($mixed)) { // 数组和对象 |
| 63 | - if(false === is_string($keyString) && is_callable($keyString)){ |
|
| 63 | + if (false === is_string($keyString) && is_callable($keyString)) { |
|
| 64 | 64 | $mixed = self::call($keyString, [$mixed]); |
| 65 | - }else{ |
|
| 65 | + } else { |
|
| 66 | 66 | $keyArray = explode('.', $keyString); |
| 67 | 67 | foreach ($keyArray as $key) { |
| 68 | 68 | if (is_array($mixed)) { |
| 69 | 69 | if (array_key_exists($key, $mixed) && null !== $mixed[$key]) { |
| 70 | 70 | $mixed = $mixed[$key]; |
| 71 | - }else { |
|
| 71 | + } else { |
|
| 72 | 72 | return $defaultValue; |
| 73 | 73 | } |
| 74 | 74 | } elseif (is_object($mixed)) { |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | return $mixed; |
| 94 | 94 | } elseif (is_string($mixed) || is_numeric($mixed)) { // 字符串或数字 |
| 95 | - $pos = (int) $keyString; |
|
| 96 | - $length = null === $defaultValue ? 1 : (int) $defaultValue; |
|
| 95 | + $pos = (int)$keyString; |
|
| 96 | + $length = null === $defaultValue ? 1 : (int)$defaultValue; |
|
| 97 | 97 | return Strings::sub($mixed, $pos, $length); |
| 98 | 98 | } elseif (null === $mixed) { // null |
| 99 | 99 | return $defaultValue; |
@@ -62,13 +62,13 @@ |
||
| 62 | 62 | } elseif (is_array($mixed) || is_object($mixed)) { // 数组和对象 |
| 63 | 63 | if(false === is_string($keyString) && is_callable($keyString)){ |
| 64 | 64 | $mixed = self::call($keyString, [$mixed]); |
| 65 | - }else{ |
|
| 65 | + } else{ |
|
| 66 | 66 | $keyArray = explode('.', $keyString); |
| 67 | 67 | foreach ($keyArray as $key) { |
| 68 | 68 | if (is_array($mixed)) { |
| 69 | 69 | if (array_key_exists($key, $mixed) && null !== $mixed[$key]) { |
| 70 | 70 | $mixed = $mixed[$key]; |
| 71 | - }else { |
|
| 71 | + } else { |
|
| 72 | 72 | return $defaultValue; |
| 73 | 73 | } |
| 74 | 74 | } elseif (is_object($mixed)) { |
@@ -64,10 +64,10 @@ |
||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | $error = $this->getError(); |
| 67 | - if(is_array($error)){ |
|
| 67 | + if (is_array($error)) { |
|
| 68 | 68 | return $error; |
| 69 | 69 | } |
| 70 | - throw new Exception((string) $error); |
|
| 70 | + throw new Exception((string)$error); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |