Documentation

RNEClient
in package
implements RNEClientInterface

Class RNEClient

Table of Contents

Interfaces

RNEClientInterface

Constants

BASE_URI  = 'https://registre-national-entreprises.inpi.fr/'
DEFAULT_PAGE_SIZE  = 20
VALID_ACTIVITY_SECTORS  = ['AGENT_COMMERCIAL', 'AGRICOLE_NON_ACTIF', 'ACTIF_AGRICOLE', 'ARTISANALE', 'ARTISANALE_REGLEMENTEE', 'COMMERCIALE', 'LIBERALE_REGLEMENTEE', 'LIBERALE_NON_REGLEMENTEE', 'GESTION_DE_BIENS', 'SANS_ACTIVITE']

Properties

$client  : Client
$token  : string|null

Methods

__construct()  : mixed
RNEClient constructor.
authenticate()  : void
Authentify the user and store the token in the client
getToken()  : string
Get the token
addPageSizeToUrl()  : string
Add the page size parameter to the url
addPageToUrl()  : string
Add the page parameter to the url
catchResponseErrors()  : void
Catch the response errors
decorateResponse()  : array<string|int, mixed>
add a decoration to the response resultsCount, hasMoreResults, nextPageUrl
getAuthorizationHeaderArray()  : array<string|int, mixed>
Get the authorization header array
requestApi()  : array<string|int, mixed>
Request the API

Constants

BASE_URI

public mixed BASE_URI = 'https://registre-national-entreprises.inpi.fr/'

DEFAULT_PAGE_SIZE

public mixed DEFAULT_PAGE_SIZE = 20

VALID_ACTIVITY_SECTORS

public mixed VALID_ACTIVITY_SECTORS = ['AGENT_COMMERCIAL', 'AGRICOLE_NON_ACTIF', 'ACTIF_AGRICOLE', 'ARTISANALE', 'ARTISANALE_REGLEMENTEE', 'COMMERCIALE', 'LIBERALE_REGLEMENTEE', 'LIBERALE_NON_REGLEMENTEE', 'GESTION_DE_BIENS', 'SANS_ACTIVITE']

Properties

Methods

__construct()

RNEClient constructor.

public __construct([string|null $token = null ][, Client|null $client = null ]) : mixed

If a token is provided, it will be used for the requests Otherwise, the user will have to authenticate first

Parameters
$token : string|null = null
$client : Client|null = null

authenticate()

Authentify the user and store the token in the client

public authenticate(string $username, string $password) : void
Parameters
$username : string
$password : string
Tags
throws
GuzzleException

getToken()

Get the token

public getToken() : string
Return values
string

addPageSizeToUrl()

Add the page size parameter to the url

protected addPageSizeToUrl(string $url, int $pageSize) : string
Parameters
$url : string
$pageSize : int
Tags
throws
Exception
Return values
string

addPageToUrl()

Add the page parameter to the url

protected addPageToUrl(string $url, int $page) : string
Parameters
$url : string
$page : int
Tags
throws
Exception
Return values
string

catchResponseErrors()

Catch the response errors

protected catchResponseErrors(GuzzleException $e) : void
Parameters
$e : GuzzleException
Tags
throws
Exception

decorateResponse()

add a decoration to the response resultsCount, hasMoreResults, nextPageUrl

protected decorateResponse(array<string|int, mixed> $data[, int $pageSize = self::DEFAULT_PAGE_SIZE ]) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
$pageSize : int = self::DEFAULT_PAGE_SIZE
Tags
throws
GuzzleException
Return values
array<string|int, mixed>

getAuthorizationHeaderArray()

Get the authorization header array

protected getAuthorizationHeaderArray() : array<string|int, mixed>
Tags
throws
Exception
Return values
array<string|int, mixed>

requestApi()

Request the API

protected requestApi(string $method, string $url[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
$method : string
$url : string
$options : array<string|int, mixed> = []
Tags
throws
GuzzleException
Return values
array<string|int, mixed>

        
On this page

Search results