Skip to content

Commit 9364bf4

Browse files
committed
Merge branch 'feature/applied_style_ci' into develop
2 parents cdccc18 + 5e9b73f commit 9364bf4

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ $iss = new IssueService(new ArrayConfiguration(
109109
- [Add comment](#add-comment)
110110
- [Perform a transition on an issue](#perform-a-transition-on-an-issue)
111111
- [Perform an advanced search, using the JQL](#perform-an-advanced-search)
112+
- [Simple JQL](#simple-query)
113+
- [JQL With pagination](#jql-with-pagination)
112114
- [Issue time tracking](#issue-time-tracking)
113115
- [Add worklog in Issue](#add-worklog-in-issue)
114116
- [Edit worklog in Issue](#edit-worklog-in-issue)
@@ -629,7 +631,7 @@ try {
629631

630632
#### Perform an advanced search
631633

632-
**Simple Query**
634+
##### Simple Query
633635

634636
```php
635637
<?php
@@ -650,9 +652,7 @@ try {
650652
}
651653
```
652654

653-
654-
655-
**JQL with pagination**
655+
##### JQL with pagination
656656

657657
```php
658658
<?php

src/JiraClient.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use JiraRestApi\Configuration\ConfigurationInterface;
66
use JiraRestApi\Configuration\DotEnvConfiguration;
7-
use Monolog\Logger as Logger;
87
use Monolog\Handler\StreamHandler;
8+
use Monolog\Logger as Logger;
99

1010
/**
1111
* Interact jira server with REST API.
@@ -58,13 +58,13 @@ class JiraClient
5858
* Constructor.
5959
*
6060
* @param ConfigurationInterface $configuration
61-
* @param Logger $logger
62-
* @param string $path
61+
* @param Logger $logger
62+
* @param string $path
6363
*/
6464
public function __construct(ConfigurationInterface $configuration = null, Logger $logger = null, $path = './')
6565
{
6666
if ($configuration === null) {
67-
if (!file_exists($path . '.env')) {
67+
if (!file_exists($path.'.env')) {
6868
// If calling the getcwd() on laravel it will returning the 'public' directory.
6969
$path = '../';
7070
}
@@ -155,9 +155,9 @@ protected function filterNullVariable($haystack)
155155
* @param string $post_data
156156
* @param string $custom_request [PUT|DELETE]
157157
*
158-
* @return string
159-
*
160158
* @throws JiraException
159+
*
160+
* @return string
161161
*/
162162
public function exec($context, $post_data = null, $custom_request = null)
163163
{
@@ -190,12 +190,12 @@ public function exec($context, $post_data = null, $custom_request = null)
190190
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->getConfiguration()->isCurlOptSslVerifyPeer());
191191

192192
// curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set
193-
if (!function_exists('ini_get') || !ini_get('open_basedir')){
193+
if (!function_exists('ini_get') || !ini_get('open_basedir')) {
194194
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
195195
}
196-
196+
197197
curl_setopt($ch, CURLOPT_HTTPHEADER,
198-
array('Accept: */*', 'Content-Type: application/json'));
198+
['Accept: */*', 'Content-Type: application/json']);
199199

200200
curl_setopt($ch, CURLOPT_VERBOSE, $this->getConfiguration()->isCurlOptVerbose());
201201

@@ -217,7 +217,7 @@ public function exec($context, $post_data = null, $custom_request = null)
217217
}
218218

219219
// HostNotFound, No route to Host, etc Network error
220-
$msg = sprintf("CURL Error: http response=%d, %s", $this->http_response, $body);
220+
$msg = sprintf('CURL Error: http response=%d, %s', $this->http_response, $body);
221221

222222
$this->log->addError($msg);
223223
throw new JiraException($msg);
@@ -255,12 +255,12 @@ private function createUploadHandle($url, $upload_file)
255255
// send file
256256
curl_setopt($ch, CURLOPT_POST, true);
257257

258-
if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 5) {
258+
if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 5) {
259259
$attachments = realpath($upload_file);
260260
$filename = basename($upload_file);
261261

262262
curl_setopt($ch, CURLOPT_POSTFIELDS,
263-
array('file' => '@'.$attachments.';filename='.$filename));
263+
['file' => '@'.$attachments.';filename='.$filename]);
264264

265265
$this->log->addDebug('using legacy file upload');
266266
} else {
@@ -269,7 +269,7 @@ private function createUploadHandle($url, $upload_file)
269269
$attachments->setPostFilename(basename($upload_file));
270270

271271
curl_setopt($ch, CURLOPT_POSTFIELDS,
272-
array('file' => $attachments));
272+
['file' => $attachments]);
273273

274274
$this->log->addDebug('using CURLFile='.var_export($attachments, true));
275275
}
@@ -280,15 +280,15 @@ private function createUploadHandle($url, $upload_file)
280280
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->getConfiguration()->isCurlOptSslVerifyPeer());
281281

282282
// curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); cannot be activated when an open_basedir is set
283-
if (!function_exists('ini_get') || !ini_get('open_basedir')){
283+
if (!function_exists('ini_get') || !ini_get('open_basedir')) {
284284
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
285285
}
286286
curl_setopt($ch, CURLOPT_HTTPHEADER,
287-
array(
287+
[
288288
'Accept: */*',
289289
'Content-Type: multipart/form-data',
290290
'X-Atlassian-Token: nocheck',
291-
));
291+
]);
292292

293293
curl_setopt($ch, CURLOPT_VERBOSE, $this->getConfiguration()->isCurlOptVerbose());
294294

@@ -303,9 +303,9 @@ private function createUploadHandle($url, $upload_file)
303303
* @param string $context url context
304304
* @param array $filePathArray upload file path.
305305
*
306-
* @return array
307-
*
308306
* @throws JiraException
307+
*
308+
* @return array
309309
*/
310310
public function upload($context, $filePathArray)
311311
{
@@ -314,8 +314,8 @@ public function upload($context, $filePathArray)
314314
// return value
315315
$result_code = 200;
316316

317-
$chArr = array();
318-
$results = array();
317+
$chArr = [];
318+
$results = [];
319319
$mh = curl_multi_init();
320320

321321
for ($idx = 0; $idx < count($filePathArray); ++$idx) {
@@ -363,7 +363,7 @@ public function upload($context, $filePathArray)
363363
if ($this->http_response != 200 && $this->http_response != 201) {
364364
$body = 'CURL HTTP Request Failed: Status Code : '
365365
.$this->http_response.', URL:'.$url;
366-
366+
367367
$this->log->addError($body);
368368
}
369369
}

0 commit comments

Comments
 (0)