From 2ae76a7d822ddd8711038ff68b8685f11f2c0fa5 Mon Sep 17 00:00:00 2001 From: KwangSeob Jeong Date: Thu, 29 Dec 2022 16:00:00 +0900 Subject: [PATCH] fixed #486, #487 --- README.md | 7 ++++++- src/Issue/IssueField.php | 2 ++ src/Issue/Reporter.php | 29 +++++++++++++---------------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0aee5cd..835011e 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,13 @@ you can choose loads environment variables either 'dotenv' or 'array'. ## use dotenv +If you want to use Dotenv based configuration,first of all, you have to install dependency. -copy .env.example file to .env on your project root. +```sh +composer require vlucas/phpdotenv +``` + +then copy .env.example file to .env on your project root. ```sh JIRA_HOST='https://your-jira.host.com' diff --git a/src/Issue/IssueField.php b/src/Issue/IssueField.php index 86bf7e3..114e1b6 100644 --- a/src/Issue/IssueField.php +++ b/src/Issue/IssueField.php @@ -2,10 +2,12 @@ namespace JiraRestApi\Issue; +use AllowDynamicProperties; use DateTimeInterface; use JiraRestApi\ClassSerialize; use JiraRestApi\Project\Project; +#[AllowDynamicProperties] class IssueField implements \JsonSerializable { use ClassSerialize; diff --git a/src/Issue/Reporter.php b/src/Issue/Reporter.php index a6c5590..c921911 100644 --- a/src/Issue/Reporter.php +++ b/src/Issue/Reporter.php @@ -8,29 +8,26 @@ class Reporter implements \JsonSerializable { use ClassSerialize; - /** @var string */ - public $self; + public string $key; - /** @var string|null */ - public $name; + public string $timezone; - /** @var string */ - public $emailAddress; + public string $self; - /** @var array|null */ - public $avatarUrls; + public ?string $name; - /** @var string */ - public $displayName; + public ?string $emailAddress; - /** @var string */ - public $active; + public array $avatarUrls; - /** @var bool want assignee to unassigned */ - private $wantUnassigned = false; + public string $displayName; - /** @var string */ - public $accountId; + public string $active; + + // want assignee to unassigned + private bool $wantUnassigned = false; + + public string $accountId; #[\ReturnTypeWillChange] public function jsonSerialize()