Skip to content

Commit 9d49738

Browse files
committed
- support to PHP 8.2
- update README.md with the correct transition example
1 parent ca1d80e commit 9d49738

11 files changed

Lines changed: 113 additions & 30 deletions

File tree

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,11 +1391,26 @@ $issueKey = 'TEST-879';
13911391
try {
13921392
$transition = new Transition();
13931393
$transition->setTransitionName('In Progress');
1394-
$transition->setCommentBody('performing the transition via REST API.');
1394+
1395+
$doc = (new Document())
1396+
->paragraph() // paragraph, can have child blocks (needs to be closed with `->end()`)
1397+
->text('Issue ') // simple unstyled text
1398+
->strong(' status') // text node embedding a `strong` mark
1399+
->text(' ') // simple unstyled text
1400+
->text(' changed ') // text node embedding a `em` mark
1401+
->text('. ') // simple unstyled text
1402+
->underline('by') // text node embedding a `underline` mark
1403+
->em(' REST API.') // simple unstyled text
1404+
->end() // closes `paragraph` node
1405+
;
13951406

1396-
$issueService = new IssueService();
1407+
$comment = new AtlassianDocumentFormat($doc);
1408+
1409+
$transition->setCommentBody($comment);
13971410

1411+
$issueService = new IssueService();
13981412
$issueService->transition($issueKey, $transition);
1413+
13991414
} catch (JiraCloud\JiraException $e) {
14001415
$this->assertTrue(FALSE, 'add Comment Failed : ' . $e->getMessage());
14011416
}

src/ADF/AtlassianDocumentFormat.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
*/
1111
class AtlassianDocumentFormat implements \JsonSerializable
1212
{
13+
public array $type;
14+
15+
public array $content;
16+
17+
public string $version;
18+
1319
private Document $document;
1420

1521
public function __construct(Document|Node $document)

src/Issue/Comment.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class Comment implements \JsonSerializable
2828

2929
public bool $jsdPublic;
3030

31+
public string $renderedBody;
32+
3133
/**
3234
* mapping function for json_mapper.
3335
*

src/Issue/Comments.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
class Comments implements \JsonSerializable
66
{
7-
/** @var int */
8-
public $startAt;
7+
public string $self;
8+
9+
public int $startAt;
910

10-
/** @var int */
11-
public $maxResults;
11+
public int $maxResults;
1212

13-
/** @var int */
14-
public $total;
13+
public int $total;
1514

1615
/** @var \JiraCloud\Issue\Comment[] */
1716
public $comments;

src/Issue/History.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@
99
*/
1010
class History implements \JsonSerializable
1111
{
12-
/** @var int */
13-
public $id;
12+
public int $id;
1413

15-
/** @var \JiraCloud\Issue\Reporter */
16-
public $author;
14+
public Reporter $author;
1715

18-
/** @var string */
19-
public $created;
16+
public string $created;
2017

21-
/** @var array|null */
22-
public $items;
18+
public ?array $items;
2319

2420
#[\ReturnTypeWillChange]
2521
public function jsonSerialize()

src/Issue/IssueField.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
namespace JiraCloud\Issue;
44

5+
use AllowDynamicProperties;
56
use DateTimeInterface;
67
use JiraCloud\ADF\ADFMarkType;
78
use JiraCloud\ADF\AtlassianDocumentFormat;
89
use JiraCloud\ClassSerialize;
910
use JiraCloud\Project\Project;
1011

12+
13+
#[AllowDynamicProperties]
1114
class IssueField implements \JsonSerializable
1215
{
1316
use ClassSerialize;

src/Issue/IssueType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class IssueType implements \JsonSerializable
1616

1717
public bool $subtask;
1818

19+
public string $hierarchyLevel;
20+
1921
/** @var \JiraCloud\Issue\IssueStatus[] */
2022
public $statuses;
2123

src/Issue/Reporter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class Reporter implements \JsonSerializable
2020

2121
public string $active;
2222

23+
public string $timezone;
24+
25+
public string $accountType;
26+
2327
private bool $wantUnassigned = false;
2428

2529
public string $accountId;

src/Issue/Transition.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ class Transition implements \JsonSerializable
2323

2424
public ?array $update = null;
2525

26+
public bool $hasScreen;
27+
public bool $isGlobal;
28+
public bool $isInitial;
29+
public bool $isAvailable;
30+
public bool $isConditional;
31+
public bool $isLooped;
32+
2633
public function setTransitionName($name): void
2734
{
2835
if (is_null($this->transition)) {

src/Project/Project.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ class Project implements \JsonSerializable
103103

104104
public int $fieldConfigurationScheme;
105105

106+
public string $simplified;
107+
106108
#[\ReturnTypeWillChange]
107109
public function jsonSerialize()
108110
{

0 commit comments

Comments
 (0)