PHP code example of halloverden / symfony-brreg-http-client

1. Go to this page and download the library: Download halloverden/symfony-brreg-http-client 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/ */

    

halloverden / symfony-brreg-http-client example snippets

injectablephp
class TestService {

  /**
   * @var BrregServiceInterface
   */
  private $service;

  public function __construct(BrregServiceInterface $service) {
    $this->service = $service;
  }

  /**
   * @param int $organizationNumber
   * @param $fetchParentsIfPresent
   * 
   * @return Organization
   */
  public function test(int $organizationNumber, $fetchParentsIfPresent): Organization {
    return $this->service->findOrganizationByOrganizationNumber($organizationNumber, $fetchParentsIfPresent);
  }
}