-
Notifications
You must be signed in to change notification settings - Fork 1
/
Example.php
34 lines (27 loc) · 1.29 KB
/
Example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
declare(strict_types=1);
namespace Example;
use RikuKukkaniemi\FinnishCompanyInfo\Exception\CompanyInfoException;
use RikuKukkaniemi\FinnishCompanyInfo\Service\CompanyInfoService;
class Example
{
public function example(CompanyInfoService $companyInfoService): void
{
try {
$companyInfo = $companyInfoService->getCompanyInformation('1234567-8');
} catch (CompanyInfoException) {
// Handle exception
return;
}
$companyInfo->getName(); // String
$companyInfo->getWebsite(); // String or null
$currentAddress = $companyInfo->getCurrentAddress(); // Address object
$currentAddress->getStreet(); // String
$currentAddress->getCity(); // String
$currentAddress->getPostalCode(); // String
$businessLines = $companyInfo->getBusinessLines(); // Array of BusinessLine objects (can be empty)
$businessLines[0]->getCode(); // String
$businessLines[0]->getDescription(); // String
$businessLines[0]->getLanguage(); // String (language of description)
}
}