JiraRestApi\JiraClient::__construct PHP Метод

__construct() публичный Метод

Constructor.
public __construct ( JiraRestApi\Configuration\ConfigurationInterface $configuration = null, Logger $logger = null )
$configuration JiraRestApi\Configuration\ConfigurationInterface
$logger Monolog\Logger
    public function __construct(ConfigurationInterface $configuration = null, Logger $logger = null)
    {
        if ($configuration === null) {
            $path = './';
            if (!file_exists('.env')) {
                // If calling the getcwd() on laravel it will returning the 'public' directory.
                $path = '../';
            }
            $configuration = new DotEnvConfiguration($path);
        }
        $this->configuration = $configuration;
        $this->json_mapper = new \JsonMapper();
        $this->json_mapper->undefinedPropertyHandler = [\JiraRestApi\JsonMapperHelper::class, 'setUndefinedProperty'];
        // create logger
        if ($logger) {
            $this->log = $logger;
        } else {
            $this->log = new Logger('JiraClient');
            $this->log->pushHandler(new StreamHandler($configuration->getJiraLogFile(), $this->convertLogLevel($configuration->getJiraLogLevel())));
        }
        $this->http_response = 200;
    }

Usage Example

 public function __construct(array $config)
 {
     parent::__construct($config);
 }
All Usage Examples Of JiraRestApi\JiraClient::__construct