Skip to content

Commit

Permalink
added fio to PartyResponse (#16)
Browse files Browse the repository at this point in the history
* added fio to PartyResponse

* fix phones bug
  • Loading branch information
AlexandrErohin authored Jan 19, 2023
1 parent 00d2f85 commit ddf0d51
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
7 changes: 3 additions & 4 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
->in('tests')
;

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'declare_strict_types' => true,
])
->setRiskyAllowed(true)
->setFinder($finder)
;
->setFinder($finder);
13 changes: 9 additions & 4 deletions src/Model/Response/Suggest/PartyResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class PartyResponse extends SuggestResponse
*/
public $name;

/**
* @var array ФИО (для индивидуальных предпринимателей)
*/
public $fio;

/**
* @var string Код ОКАТО
*/
Expand Down Expand Up @@ -185,14 +190,14 @@ public function __construct(array $data)
}

if (isset($data['data']['emails']) && is_array($data['data']['emails'])) {
foreach ($data['data']['emails'] as $data) {
$this->emails[] = new EmailResponse($data);
foreach ($data['data']['emails'] as $email) {
$this->emails[] = new EmailResponse($email);
}
}

if (isset($data['data']['phones']) && is_array($data['data']['phones'])) {
foreach ($data['data']['phones'] as $data) {
$this->phones[] = new PhoneResponse($data);
foreach ($data['data']['phones'] as $phone) {
$this->phones[] = new PhoneResponse($phone);
}
}
}
Expand Down

0 comments on commit ddf0d51

Please sign in to comment.