| @@ -123,7 +123,7 @@ | ||
| 123 | 123 |      { | 
| 124 | 124 |          if (function_exists('array_column') && false === I::ini('USE_CUSTOM')) { | 
| 125 | 125 | $result = array_column($array, $column, $index); | 
| 126 | -            if(null === $index){ | |
| 126 | +            if (null === $index) { | |
| 127 | 127 | $result = self::combine(array_keys($array), $result); | 
| 128 | 128 | } | 
| 129 | 129 | return $result; | 
| @@ -67,7 +67,7 @@ discard block | ||
| 67 | 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 | /** | 
| @@ -86,7 +86,7 @@ discard block | ||
| 86 | 86 | */ | 
| 87 | 87 | public function toArray() | 
| 88 | 88 |      { | 
| 89 | - return (array) I::call($this->_toArrayCall, [$this->getResult()]); | |
| 89 | + return (array)I::call($this->_toArrayCall, [$this->getResult()]); | |
| 90 | 90 | } | 
| 91 | 91 | |
| 92 | 92 | /** | 
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | public function generalBasic() | 
| 85 | 85 |      { | 
| 86 | 86 | $this->requestToken(); | 
| 87 | - $this->_result = (array) Json::decode(Http::post(self::URL_GENERAL_BASIC, parent::filterOptions([ | |
| 87 | + $this->_result = (array)Json::decode(Http::post(self::URL_GENERAL_BASIC, parent::filterOptions([ | |
| 88 | 88 | 'image', | 
| 89 | 89 | 'language_type', | 
| 90 | 90 | 'detect_direction', | 
| @@ -94,8 +94,8 @@ discard block | ||
| 94 | 94 | ]), [ | 
| 95 | 95 | 'access_token' => $this->_token, | 
| 96 | 96 | ])); | 
| 97 | -        $this->_toArrayCall = function ($result) { | |
| 98 | - return Arrays::column((array) I::get($result, 'words_result', []), 'words'); | |
| 97 | +        $this->_toArrayCall = function($result) { | |
| 98 | + return Arrays::column((array)I::get($result, 'words_result', []), 'words'); | |
| 99 | 99 | }; | 
| 100 | 100 | |
| 101 | 101 | return $this; | 
| @@ -117,7 +117,7 @@ discard block | ||
| 117 | 117 | public function accurateBasic() | 
| 118 | 118 |      { | 
| 119 | 119 | $this->requestToken(); | 
| 120 | - $this->_result = (array) Json::decode(Http::post(self::URL_ACCURATE_BASIC, parent::filterOptions([ | |
| 120 | + $this->_result = (array)Json::decode(Http::post(self::URL_ACCURATE_BASIC, parent::filterOptions([ | |
| 121 | 121 | 'image', | 
| 122 | 122 | 'language_type', | 
| 123 | 123 | 'detect_direction', | 
| @@ -126,8 +126,8 @@ discard block | ||
| 126 | 126 | ]), [ | 
| 127 | 127 | 'access_token' => $this->_token, | 
| 128 | 128 | ])); | 
| 129 | -        $this->_toArrayCall = function ($result) { | |
| 130 | - return Arrays::column((array) I::get($result, 'words_result', []), 'words'); | |
| 129 | +        $this->_toArrayCall = function($result) { | |
| 130 | + return Arrays::column((array)I::get($result, 'words_result', []), 'words'); | |
| 131 | 131 | }; | 
| 132 | 132 | |
| 133 | 133 | return $this; | 
| @@ -149,7 +149,7 @@ discard block | ||
| 149 | 149 | public function general() | 
| 150 | 150 |      { | 
| 151 | 151 | $this->requestToken(); | 
| 152 | - $this->_result = (array) Json::decode(Http::post(self::URL_GENERAL, parent::filterOptions([ | |
| 152 | + $this->_result = (array)Json::decode(Http::post(self::URL_GENERAL, parent::filterOptions([ | |
| 153 | 153 | 'image', | 
| 154 | 154 | 'recognize_granularity', | 
| 155 | 155 | 'language_type', | 
| @@ -161,7 +161,7 @@ discard block | ||
| 161 | 161 | ]), [ | 
| 162 | 162 | 'access_token' => $this->_token, | 
| 163 | 163 | ])); | 
| 164 | -        $this->_toArrayCall = function ($result) { | |
| 164 | +        $this->_toArrayCall = function($result) { | |
| 165 | 165 | return I::get($result, 'words_result'); | 
| 166 | 166 | }; | 
| 167 | 167 | |
| @@ -184,7 +184,7 @@ discard block | ||
| 184 | 184 | public function accurate() | 
| 185 | 185 |      { | 
| 186 | 186 | $this->requestToken(); | 
| 187 | - $this->_result = (array) Json::decode(Http::post(self::URL_ACCURATE, parent::filterOptions([ | |
| 187 | + $this->_result = (array)Json::decode(Http::post(self::URL_ACCURATE, parent::filterOptions([ | |
| 188 | 188 | 'image', | 
| 189 | 189 | 'language_type', | 
| 190 | 190 | 'recognize_granularity', | 
| @@ -195,7 +195,7 @@ discard block | ||
| 195 | 195 | ]), [ | 
| 196 | 196 | 'access_token' => $this->_token, | 
| 197 | 197 | ])); | 
| 198 | -        $this->_toArrayCall = function ($result) { | |
| 198 | +        $this->_toArrayCall = function($result) { | |
| 199 | 199 | return I::get($result, 'words_result'); | 
| 200 | 200 | }; | 
| 201 | 201 | |
| @@ -221,7 +221,7 @@ discard block | ||
| 221 | 221 |      { | 
| 222 | 222 |          parent::setOption('id_card_side', $side); | 
| 223 | 223 | $this->requestToken(); | 
| 224 | - $this->_result = (array) Json::decode(Http::post(self::URL_ID_CARD, parent::filterOptions([ | |
| 224 | + $this->_result = (array)Json::decode(Http::post(self::URL_ID_CARD, parent::filterOptions([ | |
| 225 | 225 | 'image', | 
| 226 | 226 | 'id_card_side', | 
| 227 | 227 | 'detect_direction', | 
| @@ -231,8 +231,8 @@ discard block | ||
| 231 | 231 | ]), [ | 
| 232 | 232 | 'access_token' => $this->_token, | 
| 233 | 233 | ])); | 
| 234 | -        $this->_toArrayCall = function ($result) { | |
| 235 | - return Arrays::column((array) I::get($result, 'words_result', []), 'words'); | |
| 234 | +        $this->_toArrayCall = function($result) { | |
| 235 | + return Arrays::column((array)I::get($result, 'words_result', []), 'words'); | |
| 236 | 236 | }; | 
| 237 | 237 | |
| 238 | 238 | return $this; | 
| @@ -254,12 +254,12 @@ discard block | ||
| 254 | 254 | public function bankcard() | 
| 255 | 255 |      { | 
| 256 | 256 | $this->requestToken(); | 
| 257 | - $this->_result = (array) Json::decode(Http::post(self::URL_BANK_CARD, parent::filterOptions([ | |
| 257 | + $this->_result = (array)Json::decode(Http::post(self::URL_BANK_CARD, parent::filterOptions([ | |
| 258 | 258 | 'image', | 
| 259 | 259 | ]), [ | 
| 260 | 260 | 'access_token' => $this->_token, | 
| 261 | 261 | ])); | 
| 262 | -        $this->_toArrayCall = function ($result) { | |
| 262 | +        $this->_toArrayCall = function($result) { | |
| 263 | 263 | return I::get($result, 'result'); | 
| 264 | 264 | }; | 
| 265 | 265 | return $this; | 
| @@ -281,15 +281,15 @@ discard block | ||
| 281 | 281 | public function businessLicense() | 
| 282 | 282 |      { | 
| 283 | 283 | $this->requestToken(); | 
| 284 | - $this->_result = (array) Json::decode(Http::post(self::URL_BUSINESS_LICENSE, parent::filterOptions([ | |
| 284 | + $this->_result = (array)Json::decode(Http::post(self::URL_BUSINESS_LICENSE, parent::filterOptions([ | |
| 285 | 285 | 'image', | 
| 286 | 286 | 'detect_direction', | 
| 287 | 287 | 'accuracy', | 
| 288 | 288 | ]), [ | 
| 289 | 289 | 'access_token' => $this->_token, | 
| 290 | 290 | ])); | 
| 291 | -        $this->_toArrayCall = function ($result) { | |
| 292 | - return Arrays::column((array) I::get($result, 'words_result', []), 'words'); | |
| 291 | +        $this->_toArrayCall = function($result) { | |
| 292 | + return Arrays::column((array)I::get($result, 'words_result', []), 'words'); | |
| 293 | 293 | }; | 
| 294 | 294 | |
| 295 | 295 | return $this; | 
| @@ -311,12 +311,12 @@ discard block | ||
| 311 | 311 | public function businessCard() | 
| 312 | 312 |      { | 
| 313 | 313 | $this->requestToken(); | 
| 314 | - $this->_result = (array) Json::decode(Http::post(self::URL_BUSINESS_CARD, parent::filterOptions([ | |
| 314 | + $this->_result = (array)Json::decode(Http::post(self::URL_BUSINESS_CARD, parent::filterOptions([ | |
| 315 | 315 | 'image', | 
| 316 | 316 | ]), [ | 
| 317 | 317 | 'access_token' => $this->_token, | 
| 318 | 318 | ])); | 
| 319 | -        $this->_toArrayCall = function ($result) { | |
| 319 | +        $this->_toArrayCall = function($result) { | |
| 320 | 320 | return I::get($result, 'words_result'); | 
| 321 | 321 | }; | 
| 322 | 322 | |
| @@ -339,13 +339,13 @@ discard block | ||
| 339 | 339 | public function passport() | 
| 340 | 340 |      { | 
| 341 | 341 | $this->requestToken(); | 
| 342 | - $this->_result = (array) Json::decode(Http::post(self::URL_PASSPORT, parent::filterOptions([ | |
| 342 | + $this->_result = (array)Json::decode(Http::post(self::URL_PASSPORT, parent::filterOptions([ | |
| 343 | 343 | 'image', | 
| 344 | 344 | ]), [ | 
| 345 | 345 | 'access_token' => $this->_token, | 
| 346 | 346 | ])); | 
| 347 | -        $this->_toArrayCall = function ($result) { | |
| 348 | - return Arrays::column((array) I::get($result, 'words_result', []), 'words'); | |
| 347 | +        $this->_toArrayCall = function($result) { | |
| 348 | + return Arrays::column((array)I::get($result, 'words_result', []), 'words'); | |
| 349 | 349 | }; | 
| 350 | 350 | |
| 351 | 351 | return $this; | 
| @@ -367,13 +367,13 @@ discard block | ||
| 367 | 367 | public function hkMacauExitentrypermit() | 
| 368 | 368 |      { | 
| 369 | 369 | $this->requestToken(); | 
| 370 | - $this->_result = (array) Json::decode(Http::post(self::URL_HK_MACAU_EXITENTRYPERMIT, parent::filterOptions([ | |
| 370 | + $this->_result = (array)Json::decode(Http::post(self::URL_HK_MACAU_EXITENTRYPERMIT, parent::filterOptions([ | |
| 371 | 371 | 'image', | 
| 372 | 372 | ]), [ | 
| 373 | 373 | 'access_token' => $this->_token, | 
| 374 | 374 | ])); | 
| 375 | -        $this->_toArrayCall = function ($result) { | |
| 376 | - return Arrays::column((array) I::get($result, 'words_result', []), 'words'); | |
| 375 | +        $this->_toArrayCall = function($result) { | |
| 376 | + return Arrays::column((array)I::get($result, 'words_result', []), 'words'); | |
| 377 | 377 | }; | 
| 378 | 378 | |
| 379 | 379 | return $this; | 
| @@ -395,13 +395,13 @@ discard block | ||
| 395 | 395 | public function taiwanExitentrypermit() | 
| 396 | 396 |      { | 
| 397 | 397 | $this->requestToken(); | 
| 398 | - $this->_result = (array) Json::decode(Http::post(self::URL_TAIWAN_EXITENTRYPERMIT, parent::filterOptions([ | |
| 398 | + $this->_result = (array)Json::decode(Http::post(self::URL_TAIWAN_EXITENTRYPERMIT, parent::filterOptions([ | |
| 399 | 399 | 'image', | 
| 400 | 400 | ]), [ | 
| 401 | 401 | 'access_token' => $this->_token, | 
| 402 | 402 | ])); | 
| 403 | -        $this->_toArrayCall = function ($result) { | |
| 404 | - return Arrays::column((array) I::get($result, 'words_result', []), 'words'); | |
| 403 | +        $this->_toArrayCall = function($result) { | |
| 404 | + return Arrays::column((array)I::get($result, 'words_result', []), 'words'); | |
| 405 | 405 | }; | 
| 406 | 406 | |
| 407 | 407 | return $this; | 
| @@ -423,13 +423,13 @@ discard block | ||
| 423 | 423 | public function householdRegister() | 
| 424 | 424 |      { | 
| 425 | 425 | $this->requestToken(); | 
| 426 | - $this->_result = (array) Json::decode(Http::post(self::URL_HOUSEHOLD_REGISTER, parent::filterOptions([ | |
| 426 | + $this->_result = (array)Json::decode(Http::post(self::URL_HOUSEHOLD_REGISTER, parent::filterOptions([ | |
| 427 | 427 | 'image', | 
| 428 | 428 | ]), [ | 
| 429 | 429 | 'access_token' => $this->_token, | 
| 430 | 430 | ])); | 
| 431 | -        $this->_toArrayCall = function ($result) { | |
| 432 | - return Arrays::column((array) I::get($result, 'words_result', []), 'words'); | |
| 431 | +        $this->_toArrayCall = function($result) { | |
| 432 | + return Arrays::column((array)I::get($result, 'words_result', []), 'words'); | |
| 433 | 433 | }; | 
| 434 | 434 | |
| 435 | 435 | return $this; | 
| @@ -451,13 +451,13 @@ discard block | ||
| 451 | 451 | public function birthCertificate() | 
| 452 | 452 |      { | 
| 453 | 453 | $this->requestToken(); | 
| 454 | - $this->_result = (array) Json::decode(Http::post(self::URL_BIRTH_CERTIFICATE, parent::filterOptions([ | |
| 454 | + $this->_result = (array)Json::decode(Http::post(self::URL_BIRTH_CERTIFICATE, parent::filterOptions([ | |
| 455 | 455 | 'image', | 
| 456 | 456 | ]), [ | 
| 457 | 457 | 'access_token' => $this->_token, | 
| 458 | 458 | ])); | 
| 459 | -        $this->_toArrayCall = function ($result) { | |
| 460 | - return Arrays::column((array) I::get($result, 'words_result', []), 'words'); | |
| 459 | +        $this->_toArrayCall = function($result) { | |
| 460 | + return Arrays::column((array)I::get($result, 'words_result', []), 'words'); | |
| 461 | 461 | }; | 
| 462 | 462 | |
| 463 | 463 | return $this; | 
| @@ -481,14 +481,14 @@ discard block | ||
| 481 | 481 | public function vatInvoice() | 
| 482 | 482 |      { | 
| 483 | 483 | $this->requestToken(); | 
| 484 | - $this->_result = (array) Json::decode(Http::post(self::URL_VAT_INVOICE, parent::filterOptions([ | |
| 484 | + $this->_result = (array)Json::decode(Http::post(self::URL_VAT_INVOICE, parent::filterOptions([ | |
| 485 | 485 | 'image', | 
| 486 | 486 | 'accuracy', | 
| 487 | 487 | 'type', | 
| 488 | 488 | ]), [ | 
| 489 | 489 | 'access_token' => $this->_token, | 
| 490 | 490 | ])); | 
| 491 | -        $this->_toArrayCall = function ($result) { | |
| 491 | +        $this->_toArrayCall = function($result) { | |
| 492 | 492 | return I::get($result, 'words_result', []); | 
| 493 | 493 | }; | 
| 494 | 494 | |
| @@ -511,12 +511,12 @@ discard block | ||
| 511 | 511 | public function quotaInvoice() | 
| 512 | 512 |      { | 
| 513 | 513 | $this->requestToken(); | 
| 514 | - $this->_result = (array) Json::decode(Http::post(self::URL_QUOTA_INVOICE, parent::filterOptions([ | |
| 514 | + $this->_result = (array)Json::decode(Http::post(self::URL_QUOTA_INVOICE, parent::filterOptions([ | |
| 515 | 515 | 'image', | 
| 516 | 516 | ]), [ | 
| 517 | 517 | 'access_token' => $this->_token, | 
| 518 | 518 | ])); | 
| 519 | -        $this->_toArrayCall = function ($result) { | |
| 519 | +        $this->_toArrayCall = function($result) { | |
| 520 | 520 | return I::get($result, 'words_result', []); | 
| 521 | 521 | }; | 
| 522 | 522 | |
| @@ -539,12 +539,12 @@ discard block | ||
| 539 | 539 | public function trainTicket() | 
| 540 | 540 |      { | 
| 541 | 541 | $this->requestToken(); | 
| 542 | - $this->_result = (array) Json::decode(Http::post(self::URL_TRAIN_TICKET, parent::filterOptions([ | |
| 542 | + $this->_result = (array)Json::decode(Http::post(self::URL_TRAIN_TICKET, parent::filterOptions([ | |
| 543 | 543 | 'image', | 
| 544 | 544 | ]), [ | 
| 545 | 545 | 'access_token' => $this->_token, | 
| 546 | 546 | ])); | 
| 547 | -        $this->_toArrayCall = function ($result) { | |
| 547 | +        $this->_toArrayCall = function($result) { | |
| 548 | 548 | return I::get($result, '0', []); | 
| 549 | 549 | }; | 
| 550 | 550 | |
| @@ -567,12 +567,12 @@ discard block | ||
| 567 | 567 | public function taxiReceipt() | 
| 568 | 568 |      { | 
| 569 | 569 | $this->requestToken(); | 
| 570 | - $this->_result = (array) Json::decode(Http::post(self::URL_TAXI_RECEIPT, parent::filterOptions([ | |
| 570 | + $this->_result = (array)Json::decode(Http::post(self::URL_TAXI_RECEIPT, parent::filterOptions([ | |
| 571 | 571 | 'image', | 
| 572 | 572 | ]), [ | 
| 573 | 573 | 'access_token' => $this->_token, | 
| 574 | 574 | ])); | 
| 575 | -        $this->_toArrayCall = function ($result) { | |
| 575 | +        $this->_toArrayCall = function($result) { | |
| 576 | 576 | return I::get($result, 'words_result', []); | 
| 577 | 577 | }; | 
| 578 | 578 | |
| @@ -595,7 +595,7 @@ discard block | ||
| 595 | 595 | public function receipt() | 
| 596 | 596 |      { | 
| 597 | 597 | $this->requestToken(); | 
| 598 | - $this->_result = (array) Json::decode(Http::post(self::URL_RECEIPT, parent::filterOptions([ | |
| 598 | + $this->_result = (array)Json::decode(Http::post(self::URL_RECEIPT, parent::filterOptions([ | |
| 599 | 599 | 'image', | 
| 600 | 600 | 'recognize_granularity', | 
| 601 | 601 | 'probability', | 
| @@ -604,7 +604,7 @@ discard block | ||
| 604 | 604 | ]), [ | 
| 605 | 605 | 'access_token' => $this->_token, | 
| 606 | 606 | ])); | 
| 607 | -        $this->_toArrayCall = function ($result) { | |
| 607 | +        $this->_toArrayCall = function($result) { | |
| 608 | 608 | return I::get($result, 'words_result', []); | 
| 609 | 609 | }; | 
| 610 | 610 | |
| @@ -627,13 +627,13 @@ discard block | ||
| 627 | 627 | public function insuranceDocuments() | 
| 628 | 628 |      { | 
| 629 | 629 | $this->requestToken(); | 
| 630 | - $this->_result = (array) Json::decode(Http::post(self::URL_INSURANCE_DOCUMENTS, parent::filterOptions([ | |
| 630 | + $this->_result = (array)Json::decode(Http::post(self::URL_INSURANCE_DOCUMENTS, parent::filterOptions([ | |
| 631 | 631 | 'image', | 
| 632 | 632 | 'kv_business', | 
| 633 | 633 | ]), [ | 
| 634 | 634 | 'access_token' => $this->_token, | 
| 635 | 635 | ])); | 
| 636 | -        $this->_toArrayCall = function ($result) { | |
| 636 | +        $this->_toArrayCall = function($result) { | |
| 637 | 637 | return I::get($result, 'words_result', []); | 
| 638 | 638 | }; | 
| 639 | 639 | |
| @@ -656,7 +656,7 @@ discard block | ||
| 656 | 656 | public function vehicleLicense() | 
| 657 | 657 |      { | 
| 658 | 658 | $this->requestToken(); | 
| 659 | - $this->_result = (array) Json::decode(Http::post(self::URL_VEHICLE_LICENSE, parent::filterOptions([ | |
| 659 | + $this->_result = (array)Json::decode(Http::post(self::URL_VEHICLE_LICENSE, parent::filterOptions([ | |
| 660 | 660 | 'image', | 
| 661 | 661 | 'detect_direction', | 
| 662 | 662 | 'accuracy', | 
| @@ -664,8 +664,8 @@ discard block | ||
| 664 | 664 | ]), [ | 
| 665 | 665 | 'access_token' => $this->_token, | 
| 666 | 666 | ])); | 
| 667 | -        $this->_toArrayCall = function ($result) { | |
| 668 | - return Arrays::column((array) I::get($result, 'data.words_result', []), 'words'); | |
| 667 | +        $this->_toArrayCall = function($result) { | |
| 668 | + return Arrays::column((array)I::get($result, 'data.words_result', []), 'words'); | |
| 669 | 669 | }; | 
| 670 | 670 | |
| 671 | 671 | return $this; | 
| @@ -687,15 +687,15 @@ discard block | ||
| 687 | 687 | public function drivingLicense() | 
| 688 | 688 |      { | 
| 689 | 689 | $this->requestToken(); | 
| 690 | - $this->_result = (array) Json::decode(Http::post(self::URL_DRIVING_LICENSE, parent::filterOptions([ | |
| 690 | + $this->_result = (array)Json::decode(Http::post(self::URL_DRIVING_LICENSE, parent::filterOptions([ | |
| 691 | 691 | 'image', | 
| 692 | 692 | 'detect_direction', | 
| 693 | 693 | 'unified_valid_period', | 
| 694 | 694 | ]), [ | 
| 695 | 695 | 'access_token' => $this->_token, | 
| 696 | 696 | ])); | 
| 697 | -        $this->_toArrayCall = function ($result) { | |
| 698 | - return Arrays::column((array) I::get($result, 'data.words_result', []), 'words'); | |
| 697 | +        $this->_toArrayCall = function($result) { | |
| 698 | + return Arrays::column((array)I::get($result, 'data.words_result', []), 'words'); | |
| 699 | 699 | }; | 
| 700 | 700 | |
| 701 | 701 | return $this; | 
| @@ -717,13 +717,13 @@ discard block | ||
| 717 | 717 | public function licensePlate() | 
| 718 | 718 |      { | 
| 719 | 719 | $this->requestToken(); | 
| 720 | - $this->_result = (array) Json::decode(Http::post(self::URL_LICENSE_PLATE, parent::filterOptions([ | |
| 720 | + $this->_result = (array)Json::decode(Http::post(self::URL_LICENSE_PLATE, parent::filterOptions([ | |
| 721 | 721 | 'image', | 
| 722 | 722 | 'multi_detect', | 
| 723 | 723 | ]), [ | 
| 724 | 724 | 'access_token' => $this->_token, | 
| 725 | 725 | ])); | 
| 726 | -        $this->_toArrayCall = function ($result) { | |
| 726 | +        $this->_toArrayCall = function($result) { | |
| 727 | 727 | return I::get($result, 'data.words_result', []); | 
| 728 | 728 | }; | 
| 729 | 729 | |
| @@ -746,12 +746,12 @@ discard block | ||
| 746 | 746 | public function vinCode() | 
| 747 | 747 |      { | 
| 748 | 748 | $this->requestToken(); | 
| 749 | - $this->_result = (array) Json::decode(Http::post(self::URL_VIN_CODE, parent::filterOptions([ | |
| 749 | + $this->_result = (array)Json::decode(Http::post(self::URL_VIN_CODE, parent::filterOptions([ | |
| 750 | 750 | 'image', | 
| 751 | 751 | ]), [ | 
| 752 | 752 | 'access_token' => $this->_token, | 
| 753 | 753 | ])); | 
| 754 | -        $this->_toArrayCall = function ($result) { | |
| 754 | +        $this->_toArrayCall = function($result) { | |
| 755 | 755 | return I::get($result, 'words_result.0.words'); | 
| 756 | 756 | }; | 
| 757 | 757 | |
| @@ -774,12 +774,12 @@ discard block | ||
| 774 | 774 | public function vehicleCertificate() | 
| 775 | 775 |      { | 
| 776 | 776 | $this->requestToken(); | 
| 777 | - $this->_result = (array) Json::decode(Http::post(self::URL_VEHICLE_CERTIFICATE, parent::filterOptions([ | |
| 777 | + $this->_result = (array)Json::decode(Http::post(self::URL_VEHICLE_CERTIFICATE, parent::filterOptions([ | |
| 778 | 778 | 'image', | 
| 779 | 779 | ]), [ | 
| 780 | 780 | 'access_token' => $this->_token, | 
| 781 | 781 | ])); | 
| 782 | -        $this->_toArrayCall = function ($result) { | |
| 782 | +        $this->_toArrayCall = function($result) { | |
| 783 | 783 | return I::get($result, 'words_result'); | 
| 784 | 784 | }; | 
| 785 | 785 | |
| @@ -802,14 +802,14 @@ discard block | ||
| 802 | 802 | public function handwriting() | 
| 803 | 803 |      { | 
| 804 | 804 | $this->requestToken(); | 
| 805 | - $this->_result = (array) Json::decode(Http::post(self::URL_HANDWRITING, parent::filterOptions([ | |
| 805 | + $this->_result = (array)Json::decode(Http::post(self::URL_HANDWRITING, parent::filterOptions([ | |
| 806 | 806 | 'image', | 
| 807 | 807 | 'recognize_granularity', | 
| 808 | 808 | 'words_type', | 
| 809 | 809 | ]), [ | 
| 810 | 810 | 'access_token' => $this->_token, | 
| 811 | 811 | ])); | 
| 812 | -        $this->_toArrayCall = function ($result) { | |
| 812 | +        $this->_toArrayCall = function($result) { | |
| 813 | 813 | return I::get($result, 'words_result'); | 
| 814 | 814 | }; | 
| 815 | 815 | |
| @@ -832,14 +832,14 @@ discard block | ||
| 832 | 832 | public function webImage() | 
| 833 | 833 |      { | 
| 834 | 834 | $this->requestToken(); | 
| 835 | - $this->_result = (array) Json::decode(Http::post(self::URL_WEB_IMAGE, parent::filterOptions([ | |
| 835 | + $this->_result = (array)Json::decode(Http::post(self::URL_WEB_IMAGE, parent::filterOptions([ | |
| 836 | 836 | 'image', | 
| 837 | 837 | 'detect_direction', | 
| 838 | 838 | 'detect_language', | 
| 839 | 839 | ]), [ | 
| 840 | 840 | 'access_token' => $this->_token, | 
| 841 | 841 | ])); | 
| 842 | -        $this->_toArrayCall = function ($result) { | |
| 842 | +        $this->_toArrayCall = function($result) { | |
| 843 | 843 | return I::get($result, 'words_result'); | 
| 844 | 844 | }; | 
| 845 | 845 | |
| @@ -862,14 +862,14 @@ discard block | ||
| 862 | 862 | public function formRequest() | 
| 863 | 863 |      { | 
| 864 | 864 | $this->requestToken(); | 
| 865 | - $this->_result = (array) Json::decode(Http::post(self::URL_FORM_REQUEST, parent::filterOptions([ | |
| 865 | + $this->_result = (array)Json::decode(Http::post(self::URL_FORM_REQUEST, parent::filterOptions([ | |
| 866 | 866 | 'image', | 
| 867 | 867 | 'is_sync', | 
| 868 | 868 | 'request_type', | 
| 869 | 869 | ]), [ | 
| 870 | 870 | 'access_token' => $this->_token, | 
| 871 | 871 | ])); | 
| 872 | -        $this->_toArrayCall = function ($result) { | |
| 872 | +        $this->_toArrayCall = function($result) { | |
| 873 | 873 | return I::get($result, 'result.0'); | 
| 874 | 874 | }; | 
| 875 | 875 | |
| @@ -892,13 +892,13 @@ discard block | ||
| 892 | 892 | public function formResult() | 
| 893 | 893 |      { | 
| 894 | 894 | $this->requestToken(); | 
| 895 | - $this->_result = (array) Json::decode(Http::post(self::URL_FORM_RESULT, parent::filterOptions([ | |
| 895 | + $this->_result = (array)Json::decode(Http::post(self::URL_FORM_RESULT, parent::filterOptions([ | |
| 896 | 896 | 'request_id', | 
| 897 | 897 | 'request_type', | 
| 898 | 898 | ]), [ | 
| 899 | 899 | 'access_token' => $this->_token, | 
| 900 | 900 | ])); | 
| 901 | -        $this->_toArrayCall = function ($result) { | |
| 901 | +        $this->_toArrayCall = function($result) { | |
| 902 | 902 | return I::get($result, 'result', []); | 
| 903 | 903 | }; | 
| 904 | 904 | |
| @@ -921,14 +921,14 @@ discard block | ||
| 921 | 921 | public function numbers() | 
| 922 | 922 |      { | 
| 923 | 923 | $this->requestToken(); | 
| 924 | - $this->_result = (array) Json::decode(Http::post(self::URL_NUMBERS, parent::filterOptions([ | |
| 924 | + $this->_result = (array)Json::decode(Http::post(self::URL_NUMBERS, parent::filterOptions([ | |
| 925 | 925 | 'image', | 
| 926 | 926 | 'recognize_granularity', | 
| 927 | 927 | 'detect_direction' | 
| 928 | 928 | ]), [ | 
| 929 | 929 | 'access_token' => $this->_token, | 
| 930 | 930 | ])); | 
| 931 | -        $this->_toArrayCall = function ($result) { | |
| 931 | +        $this->_toArrayCall = function($result) { | |
| 932 | 932 | return I::get($result, 'words_result.0.words', []); | 
| 933 | 933 | }; | 
| 934 | 934 | |
| @@ -951,12 +951,12 @@ discard block | ||
| 951 | 951 | public function qrcode() | 
| 952 | 952 |      { | 
| 953 | 953 | $this->requestToken(); | 
| 954 | - $this->_result = (array) Json::decode(Http::post(self::URL_NUMBERS, parent::filterOptions([ | |
| 954 | + $this->_result = (array)Json::decode(Http::post(self::URL_NUMBERS, parent::filterOptions([ | |
| 955 | 955 | 'image' | 
| 956 | 956 | ]), [ | 
| 957 | 957 | 'access_token' => $this->_token, | 
| 958 | 958 | ])); | 
| 959 | -        $this->_toArrayCall = function ($result) { | |
| 959 | +        $this->_toArrayCall = function($result) { | |
| 960 | 960 | return I::get($result, 'codes_result', []); | 
| 961 | 961 | }; | 
| 962 | 962 | |
| @@ -150,7 +150,7 @@ discard block | ||
| 150 | 150 | */ | 
| 151 | 151 | public static function stdin() | 
| 152 | 152 |      { | 
| 153 | - return rtrim((string) fgets(\STDIN), PHP_EOL); | |
| 153 | + return rtrim((string)fgets(\STDIN), PHP_EOL); | |
| 154 | 154 | } | 
| 155 | 155 | |
| 156 | 156 | /** | 
| @@ -181,7 +181,7 @@ discard block | ||
| 181 | 181 | |
| 182 | 182 | $input = self::stdin(); | 
| 183 | 183 |          if ('' === $input) { | 
| 184 | - return (string) $defaultValue; | |
| 184 | + return (string)$defaultValue; | |
| 185 | 185 | } | 
| 186 | 186 | return $input; | 
| 187 | 187 | } | 
| @@ -242,7 +242,7 @@ discard block | ||
| 242 | 242 | */ | 
| 243 | 243 | public static function moveCursorUp($rows = 1) | 
| 244 | 244 |      { | 
| 245 | - echo '\033[' . (int) $rows . 'A'; | |
| 245 | + echo '\033[' . (int)$rows . 'A'; | |
| 246 | 246 | } | 
| 247 | 247 | |
| 248 | 248 | /** | 
| @@ -256,7 +256,7 @@ discard block | ||
| 256 | 256 | */ | 
| 257 | 257 | public static function moveCursorDown($rows = 1) | 
| 258 | 258 |      { | 
| 259 | - echo '\033[' . (int) $rows . 'B'; | |
| 259 | + echo '\033[' . (int)$rows . 'B'; | |
| 260 | 260 | } | 
| 261 | 261 | |
| 262 | 262 | /** | 
| @@ -270,7 +270,7 @@ discard block | ||
| 270 | 270 | */ | 
| 271 | 271 | public static function moveCursorForward($steps = 1) | 
| 272 | 272 |      { | 
| 273 | - echo '\033[' . (int) $steps . 'C'; | |
| 273 | + echo '\033[' . (int)$steps . 'C'; | |
| 274 | 274 | } | 
| 275 | 275 | |
| 276 | 276 | /** | 
| @@ -284,7 +284,7 @@ discard block | ||
| 284 | 284 | */ | 
| 285 | 285 | public static function moveCursorBackward($steps = 1) | 
| 286 | 286 |      { | 
| 287 | - echo '\033[' . (int) $steps . 'D'; | |
| 287 | + echo '\033[' . (int)$steps . 'D'; | |
| 288 | 288 | } | 
| 289 | 289 | |
| 290 | 290 | /** | 
| @@ -296,7 +296,7 @@ discard block | ||
| 296 | 296 | */ | 
| 297 | 297 | public static function moveCursorNextLine($lines = 1) | 
| 298 | 298 |      { | 
| 299 | - echo '\033[' . (int) $lines . 'E'; | |
| 299 | + echo '\033[' . (int)$lines . 'E'; | |
| 300 | 300 | } | 
| 301 | 301 | |
| 302 | 302 | /** | 
| @@ -308,7 +308,7 @@ discard block | ||
| 308 | 308 | */ | 
| 309 | 309 | public static function moveCursorPrevLine($lines = 1) | 
| 310 | 310 |      { | 
| 311 | - echo '\033[' . (int) $lines . 'F'; | |
| 311 | + echo '\033[' . (int)$lines . 'F'; | |
| 312 | 312 | } | 
| 313 | 313 | |
| 314 | 314 | /** | 
| @@ -322,9 +322,9 @@ discard block | ||
| 322 | 322 | public static function moveCursorTo($column, $row = null) | 
| 323 | 323 |      { | 
| 324 | 324 |          if ($row === null) { | 
| 325 | - echo '\033[' . (int) $column . 'G'; | |
| 325 | + echo '\033[' . (int)$column . 'G'; | |
| 326 | 326 |          } else { | 
| 327 | - echo '\033[' . (int) $row . ';' . (int) $column . 'H'; | |
| 327 | + echo '\033[' . (int)$row . ';' . (int)$column . 'H'; | |
| 328 | 328 | } | 
| 329 | 329 | } | 
| 330 | 330 | |
| @@ -339,7 +339,7 @@ discard block | ||
| 339 | 339 | */ | 
| 340 | 340 | public static function scrollUp($lines = 1) | 
| 341 | 341 |      { | 
| 342 | - echo '\033[' . (int) $lines . 'S'; | |
| 342 | + echo '\033[' . (int)$lines . 'S'; | |
| 343 | 343 | } | 
| 344 | 344 | |
| 345 | 345 | /** | 
| @@ -353,7 +353,7 @@ discard block | ||
| 353 | 353 | */ | 
| 354 | 354 | public static function scrollDown($lines = 1) | 
| 355 | 355 |      { | 
| 356 | - echo '\033[' . (int) $lines . 'T'; | |
| 356 | + echo '\033[' . (int)$lines . 'T'; | |
| 357 | 357 | } | 
| 358 | 358 | |
| 359 | 359 | /** | 
| @@ -521,9 +521,9 @@ discard block | ||
| 521 | 521 | public static function exec($command) | 
| 522 | 522 |      { | 
| 523 | 523 |          if (class_exists('\Symfony\Component\Process\Process')) { | 
| 524 | -            try{ | |
| 524 | +            try { | |
| 525 | 525 | $process = new \Symfony\Component\Process\Process($command); | 
| 526 | -            }catch(Exception $e){ | |
| 526 | +            } catch (Exception $e) { | |
| 527 | 527 | $process = new \Symfony\Component\Process\Process(Strings::toArray($command, ' ')); | 
| 528 | 528 | } | 
| 529 | 529 | |
| @@ -532,7 +532,7 @@ discard block | ||
| 532 | 532 | return false; | 
| 533 | 533 | } | 
| 534 | 534 | return $process->getOutput(); | 
| 535 | -        }else{ | |
| 535 | +        } else { | |
| 536 | 536 | return exec($command); | 
| 537 | 537 | } | 
| 538 | 538 | } | 
| @@ -523,7 +523,7 @@ discard block | ||
| 523 | 523 |          if (class_exists('\Symfony\Component\Process\Process')) { | 
| 524 | 524 |              try{ | 
| 525 | 525 | $process = new \Symfony\Component\Process\Process($command); | 
| 526 | -            }catch(Exception $e){ | |
| 526 | +            } catch(Exception $e){ | |
| 527 | 527 | $process = new \Symfony\Component\Process\Process(Strings::toArray($command, ' ')); | 
| 528 | 528 | } | 
| 529 | 529 | |
| @@ -532,7 +532,7 @@ discard block | ||
| 532 | 532 | return false; | 
| 533 | 533 | } | 
| 534 | 534 | return $process->getOutput(); | 
| 535 | -        }else{ | |
| 535 | +        } else{ | |
| 536 | 536 | return exec($command); | 
| 537 | 537 | } | 
| 538 | 538 | } |