PHP code example of marcingladkowski / gus-regon-bundle

1. Go to this page and download the library: Download marcingladkowski/gus-regon-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

marcingladkowski / gus-regon-bundle example snippets


return [
    // ...
    GusBundle\GusBundle::class => ['all' => true],
];

use GusBundle\Client\RegonClientInterface;
use GusApi\SearchReport;

class YourController
{
    public function __construct(
        private RegonClientInterface $gusClient
    ) {}

    public function lookup(string $nip): Response
    {
        $reports = $this->gusClient->getByNip($nip);
        
        foreach ($reports as $report) {
            /** @var SearchReport $report */
            $name = $report->getName();
            $regon = $report->getRegon();
            
            // ...
        }
    }
}