PHP Class JiraRestApi\JiraClient

Datei anzeigen Open project: lesstif/php-jira-rest-client Class Usage Examples

Protected Properties

Property Type Description
$configuration JiraRestApi\Configuration\ConfigurationInterface Jira Rest API Configuration.
$curl resource CURL instance.
$http_response string HTTP response code.
$json_mapper JsonMapper Json Mapper.
$log Monolog\Logger Monolog instance.

Public Methods

Method Description
__construct ( JiraRestApi\Configuration\ConfigurationInterface $configuration = null, Logger $logger = null ) Constructor.
exec ( string $context, string $post_data = null, string $custom_request = null ) : string Execute REST request.
getConfiguration ( ) : JiraRestApi\Configuration\ConfigurationInterface Jira Rest API Configuration.
upload ( string $context, array $filePathArray ) : array File upload.

Protected Methods

Method Description
authorization ( resource $ch ) Add authorize to curl request.
createUrlByContext ( string $context ) : string Get URL by context.
filterNullVariable ( array $haystack ) : array Serilize only not null field.

Private Methods

Method Description
convertLogLevel ( $log_level ) : integer Convert log level.
createUploadHandle ( string $url, string $upload_file ) : resource Create upload handle.

Method Details

__construct() public method

Constructor.
public __construct ( JiraRestApi\Configuration\ConfigurationInterface $configuration = null, Logger $logger = null )
$configuration JiraRestApi\Configuration\ConfigurationInterface
$logger Monolog\Logger

authorization() protected method

Add authorize to curl request.
protected authorization ( resource $ch )
$ch resource

createUrlByContext() protected method

Get URL by context.
protected createUrlByContext ( string $context ) : string
$context string
return string

exec() public method

Execute REST request.
public exec ( string $context, string $post_data = null, string $custom_request = null ) : string
$context string Rest API context (ex.:issue, search, etc..)
$post_data string
$custom_request string [PUT|DELETE]
return string

filterNullVariable() protected method

Serilize only not null field.
protected filterNullVariable ( array $haystack ) : array
$haystack array
return array

getConfiguration() public method

Jira Rest API Configuration.
public getConfiguration ( ) : JiraRestApi\Configuration\ConfigurationInterface
return JiraRestApi\Configuration\ConfigurationInterface

upload() public method

File upload.
public upload ( string $context, array $filePathArray ) : array
$context string url context
$filePathArray array upload file path.
return array

Property Details

$configuration protected_oe property

Jira Rest API Configuration.
protected ConfigurationInterface,JiraRestApi\Configuration $configuration
return JiraRestApi\Configuration\ConfigurationInterface

$curl protected_oe property

CURL instance.
protected resource $curl
return resource

$http_response protected_oe property

HTTP response code.
protected string $http_response
return string

$json_mapper protected_oe property

Json Mapper.
protected JsonMapper $json_mapper
return JsonMapper

$log protected_oe property

Monolog instance.
protected Logger,Monolog $log
return Monolog\Logger