for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Fousky\Component\iDoklad;
use Fousky\Component\iDoklad\Storage\AccessTokenStorageInterface;
/**
* @author Lukáš Brzák <[email protected]>
*/
class iDokladFactory
{
* @param array $config
* @param AccessTokenStorageInterface|null $storage
*
* @throws \Symfony\Component\OptionsResolver\Exception\ExceptionInterface
* @return iDoklad
public static function create(array $config, AccessTokenStorageInterface $storage = null): iDoklad
return new iDoklad(
$config,
new iDokladTokenFactory($storage)
);
}
* Get all required options for $config.
* @return array
public static function getRequiredOptions(): array
return [
'client_id' => [
'info' => 'Client ID from iDoklad admin.',
'types' => ['string'],
],
'client_secret' => [
'info' => 'Client secret from iDoklad admin.',
];
* Get all available options for $config.
public static function getAvailableOptions(): array
'debug' => [
'info' => 'If true, then GuzzleHttp will be in verbose mode.',
'types' => ['boolean'],
'url' => [
'info' => 'iDoklad API base URL',
'token_endpoint' => [
'info' => 'iDoklad Access Token URL',
'scope' => [
'info' => 'iDoklad scope configuration.',